diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrusher.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrusher.java index dd8af8111..ff62c517a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrusher.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrusher.java @@ -35,19 +35,20 @@ import net.minecraft.world.IBlockReader; import net.minecraft.world.World; import net.minecraft.world.server.ServerWorld; +import javax.annotation.Nullable; import java.util.Random; public class BlockCrusher extends BlockContainerBase { private final boolean isDouble; public BlockCrusher(boolean isDouble) { - super(ActuallyBlocks.defaultPickProps(0).tickRandomly()); + super(ActuallyBlocks.defaultPickProps(0).randomTicks()); this.isDouble = isDouble; - this.setDefaultState(this.stateContainer.getBaseState().with(HORIZONTAL_FACING, Direction.NORTH).with(LIT, false)); + this.registerDefaultState(getStateDefinition().any().setValue(HORIZONTAL_FACING, Direction.NORTH).setValue(LIT, false)); } @Override - public TileEntity createNewTileEntity(IBlockReader worldIn) { + public TileEntity newBlockEntity(IBlockReader worldIn) { return this.isDouble ? new TileEntityCrusherDouble() : new TileEntityCrusher(); @@ -55,7 +56,7 @@ public class BlockCrusher extends BlockContainerBase { @Override public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random rand) { - if (state.get(BlockStateProperties.LIT)) { + if (state.getValue(BlockStateProperties.LIT)) { for (int i = 0; i < 5; i++) { double xRand = rand.nextDouble() / 0.75D - 0.5D; double zRand = rand.nextDouble() / 0.75D - 0.5D; @@ -66,7 +67,7 @@ public class BlockCrusher extends BlockContainerBase { } @Override - public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { + public ActionResultType use(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { if (this.isDouble) { return this.openGui(world, player, pos, TileEntityCrusherDouble.class); } @@ -76,24 +77,24 @@ public class BlockCrusher extends BlockContainerBase { @Override public BlockState getStateForPlacement(BlockItemUseContext context) { - return this.getDefaultState().with(HORIZONTAL_FACING, context.getNearestLookingDirection().getOpposite()).with(LIT, false); + return defaultBlockState().setValue(HORIZONTAL_FACING, context.getNearestLookingDirection().getOpposite()).setValue(LIT, false); } @Override - protected void fillStateContainer(StateContainer.Builder builder) { + protected void createBlockStateDefinition(StateContainer.Builder builder) { builder.add(LIT).add(HORIZONTAL_FACING); } @Override public int getLightValue(BlockState state, IBlockReader world, BlockPos pos) { - return state.get(LIT) + return state.getValue(LIT) ? 12 : 0; } @Override public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { - switch (state.get(HORIZONTAL_FACING)) { + switch (state.getValue(HORIZONTAL_FACING)) { case EAST: return Shapes.GrinderShapes.SHAPE_E; case SOUTH: diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockFluidFlowing.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockFluidFlowing.java index c981790cd..898492fdb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockFluidFlowing.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockFluidFlowing.java @@ -13,7 +13,7 @@ package de.ellpeck.actuallyadditions.mod.blocks.base; import net.minecraft.block.material.Material; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; - +/* public class BlockFluidFlowing extends BlockFluidClassic implements ItemBlockBase.ICustomRarity { public BlockFluidFlowing(Fluid fluid, Material material) { @@ -31,3 +31,5 @@ public class BlockFluidFlowing extends BlockFluidClassic implements ItemBlockBas return !world.getBlockState(pos).getMaterial().isLiquid() && super.displaceIfPossible(world, pos); } } + + */ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java index 1da52515b..7cc64df66 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java @@ -123,6 +123,7 @@ public final class InitBooklet { } private static void initChapters() { + /* //Getting Started chaptersIntroduction[0] = new BookletChapter("bookTutorial", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(ActuallyItems.ITEM_BOOKLET.get()), new PageTextOnly(1), new PageTextOnly(2), new PageTextOnly(3), new PageCrafting(4, ItemCrafting.recipeBook).setNoText()); // chaptersIntroduction[1] = new BookletChapter("videoGuide", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemMisc.get(), 1, TheMiscItems.YOUTUBE_ICON.ordinal()), new PageLinkButton(1, "https://www.youtube.com/watch?v=fhjz0Ew56pM"), new PageLinkButton(2, "https://www.youtube.com/playlist?list=PLJeFZ64pT89MrTRZYzD_rtHFajPVlt6cF")).setImportant(); @@ -294,5 +295,7 @@ public final class InitBooklet { new BookletChapterTrials("empoweredOil", FluidUtil.getFilledBucket(new FluidStack(InitFluids.fluidEmpoweredOil, FluidAttributes.BUCKET_VOLUME)), false); new BookletChapterTrials("mobFarm", new ItemStack(Items.ROTTEN_FLESH), false); new BookletChapterTrials("empowererAutomation", new ItemStack(ActuallyBlocks.EMPOWERER.get()), false); + + */ } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrafting.java index bdbfcaa76..7ab661dc6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrafting.java @@ -17,7 +17,6 @@ import de.ellpeck.actuallyadditions.mod.util.RefHelp; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.Util; -import de.ellpeck.actuallyadditions.mod.util.crafting.BlankRecipe; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.item.crafting.Ingredient; @@ -62,7 +61,7 @@ public class PageCrafting extends BookletPage { public void drawScreenPre(GuiBookletBase gui, int startX, int startY, int mouseX, int mouseY, float partialTicks) { super.drawScreenPre(gui, startX, startY, mouseX, mouseY, partialTicks); - gui.mc.getTextureManager().bindTexture(GuiBooklet.RES_LOC_GADGETS); + gui.getMinecraft().getTextureManager().bind(GuiBooklet.RES_LOC_GADGETS); GuiUtils.drawTexturedModalRect(startX + 5, startY + 6, 20, 0, 116, 54, 0); if (this.recipeTypeLocKey != null) { @@ -112,9 +111,12 @@ public class PageCrafting extends BookletPage { ItemStack output = recipe.getResultItem(); if (StackUtil.isValid(output)) { ItemStack copy = output.copy(); + /* if (this.isWildcard) { copy.setItemDamage(Util.WILDCARD); } + + */ list.add(copy); } } @@ -126,7 +128,7 @@ public class PageCrafting extends BookletPage { Ingredient[] ings = new Ingredient[9]; int width = 3; int height = 3; - +/* if (recipe instanceof BlankRecipe) { this.recipeTypeLocKey = "tooltip." + ActuallyAdditions.MODID + ".disabled"; gui.addOrModifyItemRenderer(recipe.getResultItem(), startX + 100, startY + 25, 1F, false); @@ -163,6 +165,8 @@ public class PageCrafting extends BookletPage { this.recipeTypeLocKey = "booklet." + ActuallyAdditions.MODID + ".shapelessOreRecipe"; } + + */ for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { Ingredient ing = ings[y * width + x]; @@ -173,10 +177,11 @@ public class PageCrafting extends BookletPage { if (StackUtil.isValid(stack)) { ItemStack copy = stack.copy(); copy.setCount(1); + /* if (copy.getItemDamage() == Util.WILDCARD) { copy.setItemDamage(0); } - + */ gui.addOrModifyItemRenderer(copy, startX + 6 + x * 18, startY + 7 + y * 18, 1F, true); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/ConfigurationHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/ConfigurationHandler.java index b850f6704..594791a19 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/config/ConfigurationHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/ConfigurationHandler.java @@ -14,9 +14,7 @@ import java.io.File; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.fml.client.event.ConfigChangedEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; public class ConfigurationHandler {