Moreeeee fixes... time for bed...

This commit is contained in:
Flanks255 2021-08-30 17:44:39 -05:00
parent 218df0c857
commit b6e4b5a8b3
12 changed files with 47 additions and 31 deletions

View file

@ -31,7 +31,6 @@ import de.ellpeck.actuallyadditions.mod.misc.apiimpl.MethodHandler;
import de.ellpeck.actuallyadditions.mod.network.PacketHandler;
import de.ellpeck.actuallyadditions.mod.recipe.EmpowererHandler;
import de.ellpeck.actuallyadditions.mod.recipe.HairyBallHandler;
import de.ellpeck.actuallyadditions.mod.tile.ActuallyTiles;
import de.ellpeck.actuallyadditions.mod.update.UpdateChecker;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
@ -107,7 +106,7 @@ public class ActuallyAdditions {
new UpdateChecker();
BannerHelper.init();
InitEntities.init(); // todo: [port] replace
AAWorldGen gen = new AAWorldGen();
//AAWorldGen gen = new AAWorldGen();
ItemCoffee.initIngredients();
CrusherCrafting.init();
HairyBallHandler.init();

View file

@ -10,6 +10,7 @@
package de.ellpeck.actuallyadditions.mod;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import de.ellpeck.actuallyadditions.mod.blocks.render.*;
import de.ellpeck.actuallyadditions.mod.entity.InitEntities;
import de.ellpeck.actuallyadditions.mod.entity.RenderWorm;
@ -17,7 +18,6 @@ import de.ellpeck.actuallyadditions.mod.event.ClientEvents;
import de.ellpeck.actuallyadditions.mod.inventory.ActuallyContainers;
import de.ellpeck.actuallyadditions.mod.inventory.gui.*;
import de.ellpeck.actuallyadditions.mod.misc.special.SpecialRenderInit;
import de.ellpeck.actuallyadditions.mod.tile.ActuallyTiles;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScreenManager;
import net.minecraft.client.network.play.ClientPlayNetHandler;
@ -68,17 +68,17 @@ public class ActuallyAdditionsClient {
}
private static void setupSpecialRenders() {
ClientRegistry.bindTileEntityRenderer(ActuallyTiles.ATOMICRECONSTRUCTOR_TILE.get(), RenderReconstructorLens::new);
ClientRegistry.bindTileEntityRenderer(ActuallyTiles.DISPLAYSTAND_TILE.get(), RenderDisplayStand::new);
ClientRegistry.bindTileEntityRenderer(ActuallyTiles.EMPOWERER_TILE.get(), RenderEmpowerer::new);
ClientRegistry.bindTileEntityRenderer(ActuallyTiles.BATTERYBOX_TILE.get(), RenderBatteryBox::new);
ClientRegistry.bindTileEntityRenderer(ActuallyBlocks.ATOMIC_RECONSTRUCTOR.getTileEntityType(), RenderReconstructorLens::new);
ClientRegistry.bindTileEntityRenderer(ActuallyBlocks.DISPLAY_STAND.getTileEntityType(), RenderDisplayStand::new);
ClientRegistry.bindTileEntityRenderer(ActuallyBlocks.EMPOWERER.getTileEntityType(), RenderEmpowerer::new);
ClientRegistry.bindTileEntityRenderer(ActuallyBlocks.BATTERY_BOX.getTileEntityType(), RenderBatteryBox::new);
ClientRegistry.bindTileEntityRenderer(ActuallyTiles.LASERRELAYENERGY_TILE.get(), RenderLaserRelay::new);
ClientRegistry.bindTileEntityRenderer(ActuallyTiles.LASERRELAYENERGYADVANCED_TILE.get(), RenderLaserRelay::new);
ClientRegistry.bindTileEntityRenderer(ActuallyTiles.LASERRELAYENERGYEXTREME_TILE.get(), RenderLaserRelay::new);
ClientRegistry.bindTileEntityRenderer(ActuallyTiles.LASERRELAYITEM_TILE.get(), RenderLaserRelay::new);
ClientRegistry.bindTileEntityRenderer(ActuallyTiles.LASERRELAYITEMWHITELIST_TILE.get(), RenderLaserRelay::new);
ClientRegistry.bindTileEntityRenderer(ActuallyTiles.LASERRELAYFLUIDS_TILE.get(), RenderLaserRelay::new);
ClientRegistry.bindTileEntityRenderer(ActuallyBlocks.LASER_RELAY.getTileEntityType(), RenderLaserRelay::new);
ClientRegistry.bindTileEntityRenderer(ActuallyBlocks.LASER_RELAY_ADVANCED.getTileEntityType(), RenderLaserRelay::new);
ClientRegistry.bindTileEntityRenderer(ActuallyBlocks.LASER_RELAY_EXTREME.getTileEntityType(), RenderLaserRelay::new);
ClientRegistry.bindTileEntityRenderer(ActuallyBlocks.LASER_RELAY_ITEM.getTileEntityType(), RenderLaserRelay::new);
ClientRegistry.bindTileEntityRenderer(ActuallyBlocks.LASER_RELAY_ITEM_ADVANCED.getTileEntityType(), RenderLaserRelay::new);
ClientRegistry.bindTileEntityRenderer(ActuallyBlocks.LASER_RELAY_FLUIDS.getTileEntityType(), RenderLaserRelay::new);
}
// TODO: [port] validate that this works

View file

@ -44,7 +44,7 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple
private int oldEnergy;
public TileEntityAtomicReconstructor() {
super(ActuallyTiles.ATOMICRECONSTRUCTOR_TILE.get(), 1);
super(ActuallyBlocks.ATOMIC_RECONSTRUCTOR.getTileEntityType(), 1);
int power = ConfigIntValues.RECONSTRUCTOR_POWER.getValue();
int recieve = MathHelper.ceil(power * 0.016666F);
this.storage = new CustomEnergyStorage(power, recieve, 0);

View file

@ -10,6 +10,7 @@
package de.ellpeck.actuallyadditions.mod.tile;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import de.ellpeck.actuallyadditions.mod.items.ItemBattery;
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor;
import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
@ -30,7 +31,7 @@ public class TileEntityBatteryBox extends TileEntityInventoryBase implements ISh
private int lastCompare;
public TileEntityBatteryBox() {
super(ActuallyTiles.BATTERYBOX_TILE.get(), 1);
super(ActuallyBlocks.BATTERY_BOX.getTileEntityType(), 1);
}
@Override

View file

@ -10,6 +10,7 @@
package de.ellpeck.actuallyadditions.mod.tile;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import de.ellpeck.actuallyadditions.mod.inventory.ContainerBioReactor;
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor;
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IRemover;
@ -51,7 +52,7 @@ public class TileEntityBioReactor extends TileEntityInventoryBase implements INa
private int lastProducePerTick;
public TileEntityBioReactor() {
super(ActuallyTiles.BIOREACTOR_TILE.get(), 8);
super(ActuallyBlocks.BIOREACTOR.getTileEntityType(), 8);
}
public static boolean isValidItem(ItemStack stack) {

View file

@ -10,6 +10,7 @@
package de.ellpeck.actuallyadditions.mod.tile;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import de.ellpeck.actuallyadditions.mod.fluids.InitFluids;
import de.ellpeck.actuallyadditions.mod.inventory.ContainerCanolaPress;
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
@ -61,7 +62,7 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IN
private int lastProcessTime;
public TileEntityCanolaPress() {
super(ActuallyTiles.CANOLAPRESS_TILE.get(), 1);
super(ActuallyBlocks.CANOLA_PRESS.getTileEntityType(), 1);
}
@OnlyIn(Dist.CLIENT)

View file

@ -10,6 +10,7 @@
package de.ellpeck.actuallyadditions.mod.tile;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
import de.ellpeck.actuallyadditions.mod.inventory.ContainerCoalGenerator;
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor;
@ -49,7 +50,7 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements
private int curBurn = -1;
public TileEntityCoalGenerator() {
super(ActuallyTiles.COALGENERATOR_TILE.get(), 1);
super(ActuallyBlocks.COAL_GENERATOR.getTileEntityType(), 1);
}
@OnlyIn(Dist.CLIENT)

View file

@ -12,6 +12,7 @@ package de.ellpeck.actuallyadditions.mod.tile;
import de.ellpeck.actuallyadditions.api.ActuallyTags;
import de.ellpeck.actuallyadditions.api.recipe.CoffeeIngredient;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import de.ellpeck.actuallyadditions.mod.inventory.ContainerCoffeeMachine;
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
import de.ellpeck.actuallyadditions.mod.items.ItemCoffee;
@ -88,7 +89,7 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements
private int lastBrewTime;
public TileEntityCoffeeMachine() {
super(ActuallyTiles.COFFEEMACHINE_TILE.get(), 11);
super(ActuallyBlocks.COFFEE_MACHINE.getTileEntityType(), 11);
}
@OnlyIn(Dist.CLIENT)

View file

@ -11,6 +11,7 @@
package de.ellpeck.actuallyadditions.mod.tile;
import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import de.ellpeck.actuallyadditions.mod.blocks.BlockPoweredFurnace;
import de.ellpeck.actuallyadditions.mod.inventory.ContainerGrinder;
import de.ellpeck.actuallyadditions.mod.misc.SoundHandler;
@ -27,6 +28,7 @@ import net.minecraft.inventory.container.Container;
import net.minecraft.inventory.container.INamedContainerProvider;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.Direction;
import net.minecraft.util.SoundCategory;
@ -63,7 +65,7 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto
}
public TileEntityCrusher() {
super(ActuallyTiles.GRINDER_TILE.get(), 3);
super(ActuallyBlocks.CRUSHER.getTileEntityType(), 3);
this.isDouble = false;
}
@ -92,7 +94,7 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto
@Override
public void updateEntity() {
super.updateEntity();
if (!this.world.isRemote) {
if (!this.level.isClientSide) {
if (this.isDouble && this.isAutoSplit) {
TileEntityPoweredFurnace.autoSplit(this.inv, SLOT_INPUT_1, SLOT_INPUT_2);
}
@ -143,8 +145,8 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto
}
}
BlockState currState = this.world.getBlockState(this.pos);
boolean current = currState.get(BlockPoweredFurnace.IS_ON);
BlockState currState = this.level.getBlockState(this.worldPosition);
boolean current = currState.getValue(BlockStateProperties.LIT);
boolean changeTo = current;
if (this.lastCrushed != crushed) {
changeTo = crushed;
@ -157,7 +159,7 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto
}
if (changeTo != current) {
this.world.setBlockState(this.pos, currState.with(BlockPoweredFurnace.IS_ON, changeTo));
this.level.setBlockAndUpdate(this.worldPosition, currState.setValue(BlockStateProperties.LIT, changeTo));
}
this.lastCrushed = crushed;
@ -170,7 +172,7 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto
}
if (shouldPlaySound) {
this.world.playSound(null, this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), SoundHandler.crusher, SoundCategory.BLOCKS, 0.025F, 1.0F);
this.level.playSound(null, this.worldPosition.getX(), this.worldPosition.getY(), this.worldPosition.getZ(), SoundHandler.crusher, SoundCategory.BLOCKS, 0.025F, 1.0F);
}
}
}
@ -194,13 +196,15 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto
ItemStack outputOne = recipe.getOutputOne();
ItemStack outputTwo = recipe.getOutputTwo();
if (StackUtil.isValid(outputOne)) {
/* //TODO
if (outputOne.getDamage() == Util.WILDCARD) {
outputOne.setDamage(0);
}
if (StackUtil.isValid(outputTwo) && outputTwo.getDamage() == Util.WILDCARD) {
outputTwo.setDamage(0);
}
if ((!StackUtil.isValid(this.inv.getStackInSlot(theFirstOutput)) || this.inv.getStackInSlot(theFirstOutput).isItemEqual(outputOne) && this.inv.getStackInSlot(theFirstOutput).getCount() <= this.inv.getStackInSlot(theFirstOutput).getMaxStackSize() - outputOne.getCount()) && (!StackUtil.isValid(outputTwo) || !StackUtil.isValid(this.inv.getStackInSlot(theSecondOutput)) || this.inv.getStackInSlot(theSecondOutput).isItemEqual(outputTwo) && this.inv.getStackInSlot(theSecondOutput).getCount() <= this.inv.getStackInSlot(theSecondOutput).getMaxStackSize() - outputTwo.getCount())) {
*/
if ((!StackUtil.isValid(this.inv.getStackInSlot(theFirstOutput)) || this.inv.getStackInSlot(theFirstOutput).sameItem(outputOne) && this.inv.getStackInSlot(theFirstOutput).getCount() <= this.inv.getStackInSlot(theFirstOutput).getMaxStackSize() - outputOne.getCount()) && (!StackUtil.isValid(outputTwo) || !StackUtil.isValid(this.inv.getStackInSlot(theSecondOutput)) || this.inv.getStackInSlot(theSecondOutput).isItemEqual(outputTwo) && this.inv.getStackInSlot(theSecondOutput).getCount() <= this.inv.getStackInSlot(theSecondOutput).getMaxStackSize() - outputTwo.getCount())) {
return true;
}
}
@ -221,9 +225,11 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto
}
ItemStack outputOne = recipe.getOutputOne();
if (StackUtil.isValid(outputOne)) {
/* //TODO
if (outputOne.getDamage() == Util.WILDCARD) {
outputOne.setDamage(0);
}
*/
if (!StackUtil.isValid(this.inv.getStackInSlot(theFirstOutput))) {
this.inv.setStackInSlot(theFirstOutput, outputOne.copy());
} else if (this.inv.getStackInSlot(theFirstOutput).getItem() == outputOne.getItem()) {
@ -233,10 +239,12 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto
ItemStack outputTwo = recipe.getOutputTwo();
if (StackUtil.isValid(outputTwo)) {
/* //TODO
if (outputTwo.getDamage() == Util.WILDCARD) {
outputTwo.setDamage(0);
}
int rand = this.world.rand.nextInt(100) + 1;
*/
int rand = this.level.random.nextInt(100) + 1;
if (rand <= recipe.getSecondChance()) {
if (!StackUtil.isValid(this.inv.getStackInSlot(theSecondOutput))) {
this.inv.setStackInSlot(theSecondOutput, outputTwo.copy());
@ -265,7 +273,7 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto
public void onButtonPressed(int buttonID, PlayerEntity player) {
if (buttonID == 0) {
this.isAutoSplit = !this.isAutoSplit;
this.markDirty();
this.setChanged();
}
}

View file

@ -10,10 +10,12 @@
package de.ellpeck.actuallyadditions.mod.tile;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
public class TileEntityCrusherDouble extends TileEntityCrusher {
public TileEntityCrusherDouble() {
super(ActuallyTiles.GRINDER_DOUBLE_TILE.get(), 6);
super(ActuallyBlocks.CRUSHER_DOUBLE.getTileEntityType(), 6);
this.isDouble = true;
}

View file

@ -11,6 +11,7 @@
package de.ellpeck.actuallyadditions.mod.tile;
import de.ellpeck.actuallyadditions.api.misc.IDisplayStandItem;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import net.minecraft.block.Block;
import net.minecraft.item.BlockItem;
@ -30,7 +31,7 @@ public class TileEntityDisplayStand extends TileEntityInventoryBase implements I
private int oldEnergy;
public TileEntityDisplayStand() {
super(ActuallyTiles.DISPLAYSTAND_TILE.get(), 1);
super(ActuallyBlocks.DISPLAY_STAND.getTileEntityType(), 1);
}
@Override

View file

@ -10,6 +10,7 @@
package de.ellpeck.actuallyadditions.mod.tile;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import de.ellpeck.actuallyadditions.mod.inventory.ContainerDropper;
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
@ -32,7 +33,7 @@ public class TileEntityDropper extends TileEntityInventoryBase implements INamed
private int currentTime;
public TileEntityDropper() {
super(ActuallyTiles.DROPPER_TILE.get(), 9);
super(ActuallyBlocks.DROPPER.getTileEntityType(), 9);
}
@Override