Compare commits

..

No commits in common. "b6e4b5a8b302a2aef90549a0874265519f101510" and "56ec90df997851f23314e10539dcd8aa87d86ee5" have entirely different histories.

19 changed files with 64 additions and 84 deletions

View file

@ -76,7 +76,7 @@ public class BlockRecipeGenerator extends RecipeProvider {
.save(consumer); .save(consumer);
//Vertical Digger //Vertical Digger
Recipe.shaped(ActuallyBlocks.VERTICAL_DIGGER.get()) Recipe.shaped(ActuallyBlocks.Vertical_DIGGER.get())
.pattern("IRI", "RCR", "IDI") .pattern("IRI", "RCR", "IDI")
.define('R', Tags.Items.STORAGE_BLOCKS_REDSTONE) .define('R', Tags.Items.STORAGE_BLOCKS_REDSTONE)
.define('I', ActuallyBlocks.IRON_CASING.get()) .define('I', ActuallyBlocks.IRON_CASING.get())

View file

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

View file

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

View file

@ -91,7 +91,7 @@ public final class ActuallyBlocks {
public static final AABlockReg<BlockBioReactor, AABlockItem, TileEntityBioReactor> BIOREACTOR = new AABlockReg<>("bio_reactor", BlockBioReactor::new, public static final AABlockReg<BlockBioReactor, AABlockItem, TileEntityBioReactor> BIOREACTOR = new AABlockReg<>("bio_reactor", BlockBioReactor::new,
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityBioReactor::new); (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityBioReactor::new);
public static final AABlockReg<BlockVerticalDigger, AABlockItem, TileEntityVerticalDigger> VERTICAL_DIGGER = new AABlockReg<>("vertical_digger", BlockVerticalDigger::new, public static final AABlockReg<BlockVerticalDigger, AABlockItem, TileEntityVerticalDigger> Vertical_DIGGER = new AABlockReg<>("vertical_digger", BlockVerticalDigger::new,
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityVerticalDigger::new); (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityVerticalDigger::new);
public static final AABlockReg<BlockAtomicReconstructor, AABlockItem, TileEntityAtomicReconstructor> ATOMIC_RECONSTRUCTOR = new AABlockReg<>("atomic_reconstructor", BlockAtomicReconstructor::new, public static final AABlockReg<BlockAtomicReconstructor, AABlockItem, TileEntityAtomicReconstructor> ATOMIC_RECONSTRUCTOR = new AABlockReg<>("atomic_reconstructor", BlockAtomicReconstructor::new,

View file

@ -215,7 +215,7 @@ public final class InitBooklet {
new BookletChapter("fireworkBox", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.FIREWORK_BOX.get()), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityFireworkBox.USE_PER_SHOT), new PageCrafting(2, BlockCrafting.recipeFireworkBox)).setSpecial(); new BookletChapter("fireworkBox", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.FIREWORK_BOX.get()), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityFireworkBox.USE_PER_SHOT), new PageCrafting(2, BlockCrafting.recipeFireworkBox)).setSpecial();
new BookletChapter("batteryBox", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.BATTERY_BOX.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeBatteryBox).setNoText()).setSpecial(); new BookletChapter("batteryBox", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.BATTERY_BOX.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeBatteryBox).setNoText()).setSpecial();
new BookletChapter("farmer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.FARMER.get()), new PageTextOnly(1), new PagePicture(2, "page_farmer_crops", 95).addItemsToPage(new ItemStack(Items.WHEAT_SEEDS)).addItemsToPage(new ItemStack(ActuallyItems.CANOLA_SEED.get())), new PagePicture(3, "page_farmer_cactus", 105).addItemsToPage(new ItemStack(Blocks.CACTUS)), new PagePicture(4, "page_farmer_wart", 95).addItemsToPage(new ItemStack(Items.NETHER_WART)), new PagePicture(5, "page_farmer_reeds", 105).addItemsToPage(new ItemStack(Items.REEDS)), new PagePicture(6, "page_farmer_melons", 105).addItemsToPage(new ItemStack(Items.MELON), new ItemStack(Blocks.PUMPKIN), new ItemStack(Blocks.MELON_BLOCK)), new PagePicture(7, "page_farmer_enderlilly", 105), new PagePicture(8, "page_farmer_redorchid", 105), new PageCrafting(4, BlockCrafting.recipeFarmer).setWildcard().setNoText()).setImportant(); new BookletChapter("farmer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.FARMER.get()), new PageTextOnly(1), new PagePicture(2, "page_farmer_crops", 95).addItemsToPage(new ItemStack(Items.WHEAT_SEEDS)).addItemsToPage(new ItemStack(ActuallyItems.CANOLA_SEED.get())), new PagePicture(3, "page_farmer_cactus", 105).addItemsToPage(new ItemStack(Blocks.CACTUS)), new PagePicture(4, "page_farmer_wart", 95).addItemsToPage(new ItemStack(Items.NETHER_WART)), new PagePicture(5, "page_farmer_reeds", 105).addItemsToPage(new ItemStack(Items.REEDS)), new PagePicture(6, "page_farmer_melons", 105).addItemsToPage(new ItemStack(Items.MELON), new ItemStack(Blocks.PUMPKIN), new ItemStack(Blocks.MELON_BLOCK)), new PagePicture(7, "page_farmer_enderlilly", 105), new PagePicture(8, "page_farmer_redorchid", 105), new PageCrafting(4, BlockCrafting.recipeFarmer).setWildcard().setNoText()).setImportant();
new BookletChapter("miner", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.VERTICAL_DIGGER.get()), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityVerticalDigger.ENERGY_USE_PER_BLOCK).addTextReplacement("<range>", TileEntityVerticalDigger.DEFAULT_RANGE), new PageCrafting(2, BlockCrafting.recipeMiner)).setSpecial(); new BookletChapter("miner", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.Vertical_DIGGER.get()), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityVerticalDigger.ENERGY_USE_PER_BLOCK).addTextReplacement("<range>", TileEntityVerticalDigger.DEFAULT_RANGE), new PageCrafting(2, BlockCrafting.recipeMiner)).setSpecial();
new BookletChapterCoffee("coffeeMachine", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.COFFEE_MACHINE.get()), new PageTextOnly(1).addItemsToPage(new ItemStack(ActuallyItems.COFFEE_BEANS.get())).addTextReplacement("<rf>", TileEntityCoffeeMachine.ENERGY_USED).addTextReplacement("<coffee>", TileEntityCoffeeMachine.CACHE_USE).addTextReplacement("<water>", TileEntityCoffeeMachine.WATER_USE), new PageTextOnly(2).addItemsToPage(new ItemStack(ActuallyItems.COFFEE.get())), new PagePicture(3, "page_coffee_machine", 115), new PageCrafting(4, BlockCrafting.recipeCoffeeMachine).setWildcard().setNoText(), new PageCrafting(5, ItemCrafting.recipeCup).setNoText()).setImportant(); new BookletChapterCoffee("coffeeMachine", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.COFFEE_MACHINE.get()), new PageTextOnly(1).addItemsToPage(new ItemStack(ActuallyItems.COFFEE_BEANS.get())).addTextReplacement("<rf>", TileEntityCoffeeMachine.ENERGY_USED).addTextReplacement("<coffee>", TileEntityCoffeeMachine.CACHE_USE).addTextReplacement("<water>", TileEntityCoffeeMachine.WATER_USE), new PageTextOnly(2).addItemsToPage(new ItemStack(ActuallyItems.COFFEE.get())), new PagePicture(3, "page_coffee_machine", 115), new PageCrafting(4, BlockCrafting.recipeCoffeeMachine).setWildcard().setNoText(), new PageCrafting(5, ItemCrafting.recipeCup).setNoText()).setImportant();
List<IBookletPage> list = new ArrayList<>(); List<IBookletPage> list = new ArrayList<>();

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -10,7 +10,6 @@
package de.ellpeck.actuallyadditions.mod.tile; 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.config.values.ConfigIntValues;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
@ -37,7 +36,7 @@ public class TileEntityLeafGenerator extends TileEntityBase implements ISharingE
private int oldEnergy; private int oldEnergy;
public TileEntityLeafGenerator() { public TileEntityLeafGenerator() {
super(ActuallyBlocks.LEAF_GENERATOR.getTileEntityType()); super(ActuallyTiles.LEAFGENERATOR_TILE.get());
} }
@Override @Override

View file

@ -10,7 +10,6 @@
package de.ellpeck.actuallyadditions.mod.tile; package de.ellpeck.actuallyadditions.mod.tile;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import de.ellpeck.actuallyadditions.mod.inventory.ContainerDirectionalBreaker; import de.ellpeck.actuallyadditions.mod.inventory.ContainerDirectionalBreaker;
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor; import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor;
import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil;
@ -45,7 +44,7 @@ public class TileEntityLongRangeBreaker extends TileEntityInventoryBase implemen
private int currentTime; private int currentTime;
public TileEntityLongRangeBreaker() { public TileEntityLongRangeBreaker() {
super(ActuallyBlocks.LONG_RANGE_BREAKER.getTileEntityType(), 9); super(ActuallyTiles.DIRECTIONALBREAKER_TILE.get(), 9);
} }
@Override @Override
@ -69,7 +68,7 @@ public class TileEntityLongRangeBreaker extends TileEntityInventoryBase implemen
@Override @Override
public void updateEntity() { public void updateEntity() {
super.updateEntity(); super.updateEntity();
if (!this.level.isClientSide) { if (!this.world.isRemote) {
if (!this.isRedstonePowered && !this.isPulseMode) { if (!this.isRedstonePowered && !this.isPulseMode) {
if (this.currentTime > 0) { if (this.currentTime > 0) {
this.currentTime--; this.currentTime--;
@ -89,24 +88,24 @@ public class TileEntityLongRangeBreaker extends TileEntityInventoryBase implemen
private void doWork() { private void doWork() {
if (this.storage.getEnergyStored() >= ENERGY_USE * RANGE) { if (this.storage.getEnergyStored() >= ENERGY_USE * RANGE) {
BlockState state = this.level.getBlockState(this.worldPosition); BlockState state = this.world.getBlockState(this.pos);
Direction sideToManipulate = WorldUtil.getDirectionByPistonRotation(state); Direction sideToManipulate = WorldUtil.getDirectionByPistonRotation(state);
for (int i = 0; i < RANGE; i++) { for (int i = 0; i < RANGE; i++) {
BlockPos coordsBlock = this.worldPosition.relative(sideToManipulate, i + 1); BlockPos coordsBlock = this.pos.offset(sideToManipulate, i + 1);
BlockState breakState = this.level.getBlockState(coordsBlock); BlockState breakState = this.world.getBlockState(coordsBlock);
Block blockToBreak = breakState.getBlock(); Block blockToBreak = breakState.getBlock();
if (blockToBreak != null && !this.level.isEmptyBlock(coordsBlock) && this.level.getBlockState(coordsBlock).getDestroySpeed(this.level, coordsBlock) > -1.0F) { if (blockToBreak != null && !this.world.isAirBlock(coordsBlock) && this.world.getBlockState(coordsBlock).getBlockHardness(this.world, coordsBlock) > -1.0F) {
List<ItemStack> drops = Block.getDrops(breakState, (ServerWorld) this.level, coordsBlock, this.level.getBlockEntity(coordsBlock)); List<ItemStack> drops = Block.getDrops(breakState, (ServerWorld) this.world, coordsBlock, this.world.getTileEntity(coordsBlock));
float chance = WorldUtil.fireFakeHarvestEventsForDropChance(this, drops, this.level, coordsBlock); float chance = WorldUtil.fireFakeHarvestEventsForDropChance(this, drops, this.world, coordsBlock);
if (chance > 0 && this.level.random.nextFloat() <= chance) { if (chance > 0 && this.world.rand.nextFloat() <= chance) {
if (StackUtil.canAddAll(this.inv, drops, false)) { if (StackUtil.canAddAll(this.inv, drops, false)) {
this.level.levelEvent(2001, coordsBlock, Block.getId(this.level.getBlockState(coordsBlock))); this.world.playEvent(2001, coordsBlock, Block.getStateId(this.world.getBlockState(coordsBlock)));
this.level.setBlockAndUpdate(coordsBlock, Blocks.AIR.defaultBlockState()); this.world.setBlockState(coordsBlock, Blocks.AIR.getDefaultState());
StackUtil.addAll(this.inv, drops, false); StackUtil.addAll(this.inv, drops, false);
this.storage.extractEnergyInternal(ENERGY_USE, false); this.storage.extractEnergyInternal(ENERGY_USE, false);
this.setChanged(); this.markDirty();
} }
} }
} }

View file

@ -10,7 +10,6 @@
package de.ellpeck.actuallyadditions.mod.tile; package de.ellpeck.actuallyadditions.mod.tile;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigStringListValues; import de.ellpeck.actuallyadditions.mod.config.values.ConfigStringListValues;
import de.ellpeck.actuallyadditions.mod.inventory.ContainerMiner; import de.ellpeck.actuallyadditions.mod.inventory.ContainerMiner;
import de.ellpeck.actuallyadditions.mod.items.ItemDrill; import de.ellpeck.actuallyadditions.mod.items.ItemDrill;
@ -59,7 +58,7 @@ public class TileEntityVerticalDigger extends TileEntityInventoryBase implements
private int oldCheckZ; private int oldCheckZ;
public TileEntityVerticalDigger() { public TileEntityVerticalDigger() {
super(ActuallyBlocks.VERTICAL_DIGGER.getTileEntityType(), 9); super(ActuallyTiles.MINER_TILE.get(), 9);
} }
@Override @Override
@ -91,13 +90,13 @@ public class TileEntityVerticalDigger extends TileEntityInventoryBase implements
@Override @Override
public void updateEntity() { public void updateEntity() {
super.updateEntity(); super.updateEntity();
if (!this.level.isClientSide) { if (!this.world.isRemote) {
if (!this.isRedstonePowered && this.ticksElapsed % 5 == 0) { if (!this.isRedstonePowered && this.ticksElapsed % 5 == 0) {
if (this.checkY != 0) { if (this.checkY != 0) {
int range = TileEntityPhantomface.upgradeRange(DEFAULT_RANGE, this.level, this.worldPosition); int range = TileEntityPhantomFace.upgradeRange(DEFAULT_RANGE, this.world, this.pos);
if (this.checkY < 0) { if (this.checkY < 0) {
this.checkY = this.worldPosition.getY() - 1; this.checkY = this.pos.getY() - 1;
this.checkX = -range; this.checkX = -range;
this.checkZ = -range; this.checkZ = -range;
} }
@ -132,23 +131,23 @@ public class TileEntityVerticalDigger extends TileEntityInventoryBase implements
? 3 ? 3
: 1); : 1);
if (this.storage.getEnergyStored() >= actualUse) { if (this.storage.getEnergyStored() >= actualUse) {
BlockPos pos = new BlockPos(this.worldPosition.getX() + this.checkX, this.checkY, this.worldPosition.getZ() + this.checkZ); BlockPos pos = new BlockPos(this.pos.getX() + this.checkX, this.checkY, this.pos.getZ() + this.checkZ);
BlockState state = this.level.getBlockState(pos); BlockState state = this.world.getBlockState(pos);
Block block = state.getBlock(); Block block = state.getBlock();
ItemStack stack = block.getPickBlock(state, new BlockRayTraceResult(new Vector3d(0, 0, 0), Direction.DOWN, pos, false), this.level, pos, FakePlayerFactory.getMinecraft((ServerWorld) this.level)); ItemStack stack = block.getPickBlock(state, new BlockRayTraceResult(new Vector3d(0, 0, 0), Direction.DOWN, pos, false), this.world, pos, FakePlayerFactory.getMinecraft((ServerWorld) this.world));
if (!block.isAir(this.level.getBlockState(pos), this.level, pos)) { if (!block.isAir(this.world.getBlockState(pos), this.world, pos)) {
if (block.getHarvestLevel(this.level.getBlockState(pos)) <= ItemDrill.HARVEST_LEVEL && state.getDestroySpeed(this.level, pos) >= 0F && !(block instanceof IFluidBlock) && this.isMinable(block, stack)) { if (block.getHarvestLevel(this.world.getBlockState(pos)) <= ItemDrill.HARVEST_LEVEL && state.getBlockHardness(this.world, pos) >= 0F && !(block instanceof IFluidBlock) && this.isMinable(block, stack)) {
List<ItemStack> drops = Block.getDrops(state, (ServerWorld) this.level, pos, this.level.getBlockEntity(pos)); List<ItemStack> drops = Block.getDrops(state, (ServerWorld) this.world, pos, this.world.getTileEntity(pos));
float chance = WorldUtil.fireFakeHarvestEventsForDropChance(this, drops, this.level, pos); float chance = WorldUtil.fireFakeHarvestEventsForDropChance(this, drops, this.world, pos);
if (chance > 0 && this.level.random.nextFloat() <= chance) { if (chance > 0 && this.world.rand.nextFloat() <= chance) {
if (StackUtil.canAddAll(this.inv, drops, false)) { if (StackUtil.canAddAll(this.inv, drops, false)) {
this.level.levelEvent(2001, pos, Block.getId(this.level.getBlockState(pos))); this.world.playEvent(2001, pos, Block.getStateId(this.world.getBlockState(pos)));
this.level.setBlockAndUpdate(pos, Blocks.AIR.defaultBlockState()); this.world.setBlockState(pos, Blocks.AIR.getDefaultState());
StackUtil.addAll(this.inv, drops, false); StackUtil.addAll(this.inv, drops, false);
this.setChanged(); this.markDirty();
this.storage.extractEnergyInternal(actualUse, false); this.storage.extractEnergyInternal(actualUse, false);
this.shootParticles(pos.getX(), pos.getY(), pos.getZ()); this.shootParticles(pos.getX(), pos.getY(), pos.getZ());
@ -197,7 +196,7 @@ public class TileEntityVerticalDigger extends TileEntityInventoryBase implements
} }
private void shootParticles(int endX, int endY, int endZ) { private void shootParticles(int endX, int endY, int endZ) {
AssetUtil.spawnLaserWithTimeServer(this.level, this.worldPosition.getX(), this.worldPosition.getY(), this.worldPosition.getZ(), endX, endY, endZ, new float[]{65F / 255F, 150F / 255F, 2F / 255F}, 10, 120, 0.1F, 0.8F); AssetUtil.spawnLaserWithTimeServer(this.world, this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), endX, endY, endZ, new float[]{65F / 255F, 150F / 255F, 2F / 255F}, 10, 120, 0.1F, 0.8F);
} }
private boolean isBlacklisted(Block block) { private boolean isBlacklisted(Block block) {

View file

@ -11,7 +11,6 @@
package de.ellpeck.actuallyadditions.mod.tile; package de.ellpeck.actuallyadditions.mod.tile;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import de.ellpeck.actuallyadditions.mod.inventory.ContainerXPSolidifier; import de.ellpeck.actuallyadditions.mod.inventory.ContainerXPSolidifier;
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems; import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
import de.ellpeck.actuallyadditions.mod.items.ItemSolidifiedExperience; import de.ellpeck.actuallyadditions.mod.items.ItemSolidifiedExperience;
@ -51,7 +50,7 @@ public class TileEntityXPSolidifier extends TileEntityInventoryBase implements I
private int singlePointAmount; private int singlePointAmount;
public TileEntityXPSolidifier() { public TileEntityXPSolidifier() {
super(ActuallyBlocks.XP_SOLIDIFIER.getTileEntityType(), 2); super(ActuallyTiles.XPSOLIDIFIER_TILE.get(), 2);
} }
/* /*