diff --git a/gradle.properties b/gradle.properties index 5b60007ec..817be8199 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ mod_version=1.1.52 # Forge game_version=1.16.5 -forge_version=36.2.2 +forge_version=36.2.8 # Parchment (Mappings) parchment_version=2021.10.17 diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index fd64c3473..f3fa0fbb2 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -251,9 +251,9 @@ ea2f5b2bf99670f4df05889ab67c73686a26a58b assets/actuallyadditions/models/item/bl be227e074a54982e1e9f9f304e63df3095006955 assets/actuallyadditions/models/item/black_quartz_wall.json 3679056a9aee03821a997a2616b8808af7bfe4b7 assets/actuallyadditions/models/item/breaker.json f3282e55e71d26a32cee1287881ac2d5e91c30a8 assets/actuallyadditions/models/item/canola.json +e4b8fbed9602c0cf96eff84111586799412982fc assets/actuallyadditions/models/item/canola_oil_bucket.json 08c70d561c219bb4c6d21b5f56192df81f054e0a assets/actuallyadditions/models/item/canola_press.json 0507025fadef30e363cbc825265576c782880f7b assets/actuallyadditions/models/item/canola_seeds.json -b0f7c3915b646ccd27ca6ff40517e19e2a0fb7ef assets/actuallyadditions/models/item/canolaoil.json 83b47876ba2c85d3ba83e36ee9b02a8d458f7230 assets/actuallyadditions/models/item/charcoal_block.json 36179c5cc77dc38364a1931f2fabbf846ef9c39d assets/actuallyadditions/models/item/chiseled_black_quartz_block.json 27c8ed9e39b600161a6a327db0ac53e10acc13bb assets/actuallyadditions/models/item/chiseled_black_quartz_slab.json @@ -269,7 +269,6 @@ bbf723238f6536295339f0b0b5b052cf89b92d5b assets/actuallyadditions/models/item/co 1e7e61701473dbf3dfc18bb5b9fa7be91b443dd8 assets/actuallyadditions/models/item/crusher.json aeacd7ca465c19d6cbcef25e61023397c4472ab3 assets/actuallyadditions/models/item/crusher_double.json 3a9cfcb0a3bec43f6556b3bdab09731758a36cc2 assets/actuallyadditions/models/item/crystallized_canola_seed.json -da3b2fa50416d61d8b3683ee74f9572b36f4fea3 assets/actuallyadditions/models/item/crystaloil.json ec0cdeb022c4e0bc43c0fd5d3e3e758361f7ebe2 assets/actuallyadditions/models/item/diamatine_aiot.json 9e7e70f1efd1fdc83d78d0526657c229acf7293d assets/actuallyadditions/models/item/diamatine_axe.json 04cc1e040d286dbf4e8b828b52a76829ed51e14a assets/actuallyadditions/models/item/diamatine_boots.json @@ -342,7 +341,6 @@ d019c764e87de9f1856dc8d12b880d874e215fac assets/actuallyadditions/models/item/em f7c65e8d77b723f4fd5b7349c7f8ec23f2e6440b assets/actuallyadditions/models/item/empowered_restonia_crystal_block.json 9b80be9493b12d8a5c05469055204128df718901 assets/actuallyadditions/models/item/empowered_void_crystal.json c70272562c084ce2a04933ca04e270f9b3493cf4 assets/actuallyadditions/models/item/empowered_void_crystal_block.json -485a85b7176f60fce7286293767107c51649e488 assets/actuallyadditions/models/item/empoweredoil.json 88457aa73c273fb512b5c4103a1183e93dcec412 assets/actuallyadditions/models/item/empowerer.json 8c5fb751f1795df8cec1100368b153ab02d003d4 assets/actuallyadditions/models/item/empty_cup.json 0d0fd6b7df3a378a58cd35168fb0e1c3d54c6b03 assets/actuallyadditions/models/item/ender_casing.json @@ -433,7 +431,6 @@ a1da5a212c8f8454a1e632e083986fc86cbe8de7 assets/actuallyadditions/models/item/le 3247178d5c1350c2a93e544687c12a88cf28a363 assets/actuallyadditions/models/item/lens_of_the_miner.json 55ce74cb71c0db54712382cd61f2c27214201c94 assets/actuallyadditions/models/item/long_range_breaker.json abf136ca89e5d896fd9ae6f89d0113d5793b3b1c assets/actuallyadditions/models/item/netherite_aiot.json -cec09548b75f7f3e2079e75e1aaf5253e2f318ba assets/actuallyadditions/models/item/oil_generator.json 0dc90f8c2d8cc17f4859d196c4ab22caf52e7bd1 assets/actuallyadditions/models/item/palis_aiot.json 8a77539480881e4fa9ea005fc3aedf2d1cb96591 assets/actuallyadditions/models/item/palis_axe.json 29f970ca565c5c644753d5620e7067d4be4dbfaf assets/actuallyadditions/models/item/palis_boots.json @@ -474,7 +471,6 @@ af0512cfb813e6fb43bb920db3eb1f1c2976ace6 assets/actuallyadditions/models/item/qu bb0fbcacce026c672b8d98db22694fd2b6eefb20 assets/actuallyadditions/models/item/quartz_sword.json 7f7a44a1afcbfbe63bc55be016a81dc265515b24 assets/actuallyadditions/models/item/quintuple_battery.json d8cf56e92afa1ea98eead8af208cc6281c815ede assets/actuallyadditions/models/item/ranged_collector.json -12b62d8ed574812fb48d32e416b3c9f4ebf70ec8 assets/actuallyadditions/models/item/refinedcanolaoil.json a607d6e415c04d4aa4128446c3dbb40b9aafc5d5 assets/actuallyadditions/models/item/resonant_rice.json 68d8873d46bfbe65112f29bc4b1159e586d6705f assets/actuallyadditions/models/item/restonia_aiot.json 5300d3a0ece8b26a0bc0631df9151bebaef8a1b9 assets/actuallyadditions/models/item/restonia_axe.json @@ -710,9 +706,13 @@ a63b57c27d8548ddd13d64d18b098d4f5c127a30 data/actuallyadditions/recipes/restonia 85d2537a973d520c9eaaf2f15109c265faa2df3a data/actuallyadditions/recipes/rice_slime_potion.json d4ca5d77d16ff6fdfc60e665694fdd97bce25463 data/actuallyadditions/recipes/shock_suppressor.json 655fab699bb97ec252deb61d91fbef6f4738fe1c data/actuallyadditions/recipes/single_battery.json +cc4cd7379a8de3372d2a8310ea576bf5ca08c20e data/actuallyadditions/recipes/solid_fuel/charcoal-block.json 8cb9b0e94a5de6e0bb74d808207ddf041d444280 data/actuallyadditions/recipes/solid_fuel/charcoal.json +1207208a8393f613e537cb4542e1766a837282e4 data/actuallyadditions/recipes/solid_fuel/coal-block.json 3a4c2b0ca2e150ef24edb2defe018f6574cb4827 data/actuallyadditions/recipes/solid_fuel/coal.json -9d2105a32a4781f3fd10a70f97ba243b1c0ceb34 data/actuallyadditions/recipes/solid_fuel/stick.json +a7488a05a2fbc4e4017a4b7769f65ff8ce48613a data/actuallyadditions/recipes/solid_fuel/lava.json +5bf07f52f8a4b7734a800dc64e5759caf48257b9 data/actuallyadditions/recipes/solid_fuel/stick.json +1234e59cf88f96ae64032ce6bb0c734dc8870471 data/actuallyadditions/recipes/solid_fuel/tiny-coal.json 8ebd738f3968564e22ba6841eb821e5064c78588 data/actuallyadditions/recipes/stone_aiot.json bc7a41d9f36cc43e146e0b727b6f439cc0d29343 data/actuallyadditions/recipes/teleport_staff.json bdf7dbf563485903e444400d341e56d0bf308481 data/actuallyadditions/recipes/tiny_torch.json diff --git a/src/generated/resources/assets/actuallyadditions/models/item/canolaoil.json b/src/generated/resources/assets/actuallyadditions/models/item/canolaoil.json deleted file mode 100644 index 1c2d7ff43..000000000 --- a/src/generated/resources/assets/actuallyadditions/models/item/canolaoil.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "actuallyadditions:block/canolaoil" -} \ No newline at end of file diff --git a/src/generated/resources/assets/actuallyadditions/models/item/crystaloil.json b/src/generated/resources/assets/actuallyadditions/models/item/crystaloil.json deleted file mode 100644 index e18623031..000000000 --- a/src/generated/resources/assets/actuallyadditions/models/item/crystaloil.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "actuallyadditions:block/crystaloil" -} \ No newline at end of file diff --git a/src/generated/resources/assets/actuallyadditions/models/item/empoweredoil.json b/src/generated/resources/assets/actuallyadditions/models/item/empoweredoil.json deleted file mode 100644 index 66f5b8dca..000000000 --- a/src/generated/resources/assets/actuallyadditions/models/item/empoweredoil.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "actuallyadditions:block/empoweredoil" -} \ No newline at end of file diff --git a/src/generated/resources/assets/actuallyadditions/models/item/oil_generator.json b/src/generated/resources/assets/actuallyadditions/models/item/oil_generator.json deleted file mode 100644 index 24323e038..000000000 --- a/src/generated/resources/assets/actuallyadditions/models/item/oil_generator.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "actuallyadditions:block/oil_generator" -} \ No newline at end of file diff --git a/src/generated/resources/assets/actuallyadditions/models/item/refinedcanolaoil.json b/src/generated/resources/assets/actuallyadditions/models/item/refinedcanolaoil.json deleted file mode 100644 index 3d975aec4..000000000 --- a/src/generated/resources/assets/actuallyadditions/models/item/refinedcanolaoil.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "actuallyadditions:block/refinedcanolaoil" -} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/BlockStateGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/BlockStateGenerator.java index 266f5b996..a442c7259 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/BlockStateGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/BlockStateGenerator.java @@ -2,6 +2,7 @@ package de.ellpeck.actuallyadditions.data; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks; +import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import net.minecraft.block.Block; import net.minecraft.block.SlabBlock; import net.minecraft.block.StairsBlock; @@ -164,7 +165,6 @@ public class BlockStateGenerator extends BlockStateProvider { slabBlock((SlabBlock) ActuallyBlocks.BLACK_QUARTZ_BRICK_SLAB.get(), modLoc("block/black_quartz_brick_block"), modLoc("block/black_quartz_brick_block")); slabBlock((SlabBlock) ActuallyBlocks.ETHETIC_GREEN_SLAB.get(), modLoc("block/ethetic_green_block"), modLoc("block/ethetic_green_block")); slabBlock((SlabBlock) ActuallyBlocks.ETHETIC_WHITE_SLAB.get(), modLoc("block/ethetic_white_block"), modLoc("block/ethetic_white_block")); - } diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/ItemModelGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/ItemModelGenerator.java index 11f2223d0..52c5c044d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/ItemModelGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/ItemModelGenerator.java @@ -2,6 +2,7 @@ package de.ellpeck.actuallyadditions.data; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks; +import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.items.ActuallyItems; import net.minecraft.block.Block; import net.minecraft.block.WallBlock; @@ -10,6 +11,7 @@ import net.minecraft.item.Item; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.model.generators.ItemModelProvider; import net.minecraftforge.client.model.generators.ModelFile; +import net.minecraftforge.client.model.generators.loaders.DynamicBucketModelBuilder; import net.minecraftforge.common.data.ExistingFileHelper; import net.minecraftforge.fml.RegistryObject; @@ -36,7 +38,10 @@ public class ItemModelGenerator extends ItemModelProvider { // Blocks - ActuallyBlocks.BLOCKS.getEntries().forEach(this::registerBlockModel); + ActuallyBlocks.BLOCKS.getEntries().stream().filter(b -> !b.get().getRegistryName().getPath().contains("oil")).forEach(this::registerBlockModel); + + withExistingParent(InitFluids.CANOLA_OIL.getBucket().getRegistryName().getPath(), "forge:item/bucket") + .customLoader((builder, template) -> DynamicBucketModelBuilder.begin(builder, template).fluid(InitFluids.CANOLA_OIL.get())); } private void registerBlockModel(RegistryObject block) { diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/SolidFuelGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/SolidFuelGenerator.java index 467cdec3d..108ec151f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/SolidFuelGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/SolidFuelGenerator.java @@ -1,8 +1,12 @@ package de.ellpeck.actuallyadditions.data; import com.google.gson.JsonObject; +import de.ellpeck.actuallyadditions.api.ActuallyTags; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; +import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks; import de.ellpeck.actuallyadditions.mod.crafting.SolidFuelRecipe; +import de.ellpeck.actuallyadditions.mod.items.ActuallyItems; +import de.ellpeck.actuallyadditions.mod.items.base.ActuallyItem; import net.minecraft.data.DataGenerator; import net.minecraft.data.DirectoryCache; import net.minecraft.data.IFinishedRecipe; @@ -13,6 +17,7 @@ import net.minecraft.item.crafting.Ingredient; import net.minecraft.tags.ITag; import net.minecraft.util.ResourceLocation; +import javax.annotation.Nonnull; import java.nio.file.Path; import java.util.function.Consumer; @@ -22,15 +27,19 @@ public class SolidFuelGenerator extends RecipeProvider { } @Override - protected void saveAdvancement(DirectoryCache pCache, JsonObject pAdvancementJson, Path pPath) { + protected void saveAdvancement(@Nonnull DirectoryCache pCache, @Nonnull JsonObject pAdvancementJson, @Nonnull Path pPath) { //Nah } @Override - protected void buildShapelessRecipes(Consumer consumer) { + protected void buildShapelessRecipes(@Nonnull Consumer consumer) { addFuel(consumer, "coal", Items.COAL, 48000, 1600); - addFuel(consumer, "stick", Items.STICK, 1000, 200); //TEST + addFuel(consumer, "stick", Items.STICK, 3000, 100); + addFuel(consumer, "tiny-coal", ActuallyTags.Items.TINY_COALS, 6000, 200); addFuel(consumer, "charcoal", Items.CHARCOAL, 48000, 1600); + addFuel(consumer, "coal-block", Items.COAL_BLOCK, 480000, 16000); + addFuel(consumer, "charcoal-block", ActuallyBlocks.CHARCOAL_BLOCK.getItem(), 480000, 16000); + addFuel(consumer, "lava", Items.LAVA_BUCKET, 600000, 20000); } private void addFuel(Consumer consumer, String name, Item item, int energy, int burnTime) { @@ -39,7 +48,7 @@ public class SolidFuelGenerator extends RecipeProvider { private void addFuel(Consumer consumer, String name, Ingredient item, int energy, int burnTime) { consumer.accept(new SolidFuelRecipe.FinishedRecipe(new ResourceLocation(ActuallyAdditions.MODID, "solid_fuel/"+name), item, energy, burnTime)); } - private void addFuel(Consumer consumer, String name, ITag tag, int energy, int burnTime) { + private void addFuel(Consumer consumer, String name, ITag tag, int energy, int burnTime) { consumer.accept(new SolidFuelRecipe.FinishedRecipe(new ResourceLocation(ActuallyAdditions.MODID, "solid_fuel/"+name), Ingredient.of(tag), energy, burnTime)); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java index 314c94af2..36107410a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java @@ -42,6 +42,8 @@ import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.util.ResourceLocation; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.crafting.CraftingHelper; import net.minecraftforge.event.AddReloadListenerEvent; @@ -76,6 +78,7 @@ public class ActuallyAdditions { // public static final boolean DEOBF = (boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment"); public static final ItemGroup GROUP = new ItemGroup(MODID) { + @OnlyIn(Dist.CLIENT) @Override public ItemStack makeIcon() { return new ItemStack(ActuallyItems.ITEM_BOOKLET.get()); 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 b876c5112..a68f9fb69 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrusher.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrusher.java @@ -47,13 +47,19 @@ public class BlockCrusher extends BlockContainerBase { this.registerDefaultState(getStateDefinition().any().setValue(HORIZONTAL_FACING, Direction.NORTH).setValue(LIT, false)); } - //@Override - public TileEntity newBlockEntity(IBlockReader worldIn) { + @Nullable + @Override + public TileEntity createTileEntity(BlockState state, IBlockReader world) { return this.isDouble ? new TileEntityCrusherDouble() : new TileEntityCrusher(); } + @Override + public boolean hasTileEntity(BlockState state) { + return true; + } + @Override public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random rand) { if (state.getValue(BlockStateProperties.LIT)) { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/CommonConfig.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/CommonConfig.java index 089a2e65c..8e0a3388c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/config/CommonConfig.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/CommonConfig.java @@ -90,8 +90,8 @@ public class CommonConfig { ELEVEN = BUILDER.comment("11?").defineInRange("whatIs11", 11, 0, 12); - REDSTONECONFIGURATOR = BUILDER.comment("define the item used to configure Redstone Mode").define("redstoneConfigurator", Items.REDSTONE_TORCH.getRegistryName().toString(), obj -> obj instanceof String && ResourceLocation.isValidResourceLocation((String) obj)); - RELAYCONFIGURATOR = BUILDER.comment("define the item used to configure Direction in laser relays").define("relayConfigurator", Items.COMPASS.getRegistryName().toString(), obj -> obj instanceof String && ResourceLocation.isValidResourceLocation((String) obj)); + REDSTONECONFIGURATOR = BUILDER.comment("define the item used to configure Redstone Mode").define("redstoneConfigurator", Items.REDSTONE_TORCH.getRegistryName().toString(), obj -> obj instanceof String); + RELAYCONFIGURATOR = BUILDER.comment("define the item used to configure Direction in laser relays").define("relayConfigurator", Items.COMPASS.getRegistryName().toString(), obj -> obj instanceof String); BUILDER.pop(); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/CrushingRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/CrushingRecipe.java index 1b14edeb3..962245408 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/CrushingRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/CrushingRecipe.java @@ -48,10 +48,14 @@ public class CrushingRecipe implements IRecipe { } @Override - public boolean matches(IInventory pInv, @Nonnull World pLevel) { + public boolean matches(IInventory pInv, World pLevel) { return input.test(pInv.getItem(0)); } + public boolean matches (ItemStack stack) { + return input.test(stack); + } + @Override @Nonnull public ItemStack assemble(@Nonnull IInventory pInv) { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/SolidFuelRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/SolidFuelRecipe.java index 7f5e0f1b9..677205f6c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/SolidFuelRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/SolidFuelRecipe.java @@ -37,10 +37,14 @@ public class SolidFuelRecipe implements IRecipe { } @Override - public boolean matches(SingleItem pInv, @Nullable World pLevel) { + public boolean matches(SingleItem pInv, World pLevel) { return itemIngredient.test(pInv.getItem()); } + public boolean matches(ItemStack stack) { + return this.itemIngredient.test(stack); + } + @Override public ItemStack assemble(SingleItem pInv) { return ItemStack.EMPTY; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/InitFluids.java b/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/InitFluids.java index 155525fd8..5baa12abe 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/InitFluids.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/InitFluids.java @@ -21,10 +21,10 @@ public final class InitFluids { public static final DeferredRegister FLUIDS = DeferredRegister.create(ForgeRegistries.FLUIDS, ActuallyAdditions.MODID); public static final DeferredRegister FLUID_BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, ActuallyAdditions.MODID); - public static final FluidAA CANOLA_OIL = new FluidAA("canolaoil", "canolaoil"); - public static final FluidAA REFINED_CANOLA_OIL = new FluidAA("refinedcanolaoil", "refinedcanolaoil"); - public static final FluidAA CRYSTALIZED_OIL = new FluidAA("crystaloil", "crystaloil"); - public static final FluidAA EMPOWERED_OIL = new FluidAA("empoweredoil", "empoweredoil"); + public static final FluidAA CANOLA_OIL = new FluidAA("canola_oil", "canola_oil"); + public static final FluidAA REFINED_CANOLA_OIL = new FluidAA("refined_canola_oil", "refined_canola_oil"); + public static final FluidAA CRYSTALIZED_OIL = new FluidAA("crystal_oil", "crystal_oil"); + public static final FluidAA EMPOWERED_OIL = new FluidAA("empowered_oil", "empowered_oil"); public static void init(IEventBus bus) { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/CrusherScreen.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/CrusherScreen.java index 03e061618..24e83a490 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/CrusherScreen.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/CrusherScreen.java @@ -58,6 +58,9 @@ public class CrusherScreen extends AAScreen { this.buttonAutoSplit = new Buttons.SmallerButton( this.leftPos - 10, this.topPos, new StringTextComponent("S"), (button) -> actionPerformed(0)); this.addButton(this.buttonAutoSplit); } + + titleLabelX = (int) (imageWidth / 2.0f - font.width(title) / 2.0f); + titleLabelY = -10; } protected void actionPerformed(int id) { @@ -88,11 +91,6 @@ public class CrusherScreen extends AAScreen { } } - @Override - public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) { - AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.tileGrinder); - } - @Override public void renderBg(MatrixStack matrices, float f, int x, int y) { RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ActuallyItems.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ActuallyItems.java index 2480aea1e..5d39da1a7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ActuallyItems.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ActuallyItems.java @@ -24,6 +24,7 @@ import net.minecraft.inventory.EquipmentSlotType; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemTier; +import net.minecraft.item.Items; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fml.RegistryObject; import net.minecraftforge.registries.DeferredRegister; @@ -95,7 +96,7 @@ public final class ActuallyItems { public static final RegistryObject ENGINEERS_GOGGLES = ITEMS.register("engineers_goggles", () -> new ItemEngineerGoggles(false)); public static final RegistryObject LASER_UPGRADE_RANGE = ITEMS.register("laser_upgrade_range", ItemBase::new); public static final RegistryObject LASER_UPGRADE_INVISIBILITY = ITEMS.register("laser_upgrade_invisibility", ItemBase::new); - public static final RegistryObject HANDHELD_FILLER = ITEMS.register("handheld_filler", ItemFillingWand::new); + public static final Supplier HANDHELD_FILLER = ITEMS.register("handheld_filler", ItemFillingWand::new); public static final RegistryObject TRAVELERS_SACK = ITEMS.register("travelers_sack", () -> new ItemBag(false)); public static final RegistryObject VOID_SACK = ITEMS.register("void_sack", () -> new ItemBag(true)); public static final RegistryObject WORM = ITEMS.register("worm", ItemWorm::new); @@ -278,7 +279,7 @@ public final class ActuallyItems { public static final RegistryObject ENORI_BOOTS = ITEMS.register("enori_boots", () -> new ItemArmorAA(ArmorMaterials.ENORI, EquipmentSlotType.FEET)); public static final RegistryObject ENORI_AIOT = ITEMS.register("enori_aiot", () -> new AllInOneTool(ToolMaterials.ENORI)); - public static final Set> SIMPLE_ITEMS = ImmutableSet.of( + public static final Set> SIMPLE_ITEMS = ImmutableSet.of( // Crystals BLACK_QUARTZ, RESTONIA_CRYSTAL, PALIS_CRYSTAL, DIAMATINE_CRYSTAL, VOID_CRYSTAL, EMERADIC_CRYSTAL, ENORI_CRYSTAL, EMPOWERED_RESTONIA_CRYSTAL, diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBattery.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBattery.java index 62c682e16..af29d4810 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBattery.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBattery.java @@ -23,6 +23,9 @@ import net.minecraft.util.Hand; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TranslationTextComponent; import net.minecraft.world.World; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.OnlyIns; import net.minecraftforge.energy.CapabilityEnergy; import javax.annotation.Nullable; @@ -66,6 +69,7 @@ public class ItemBattery extends ItemEnergy { return super.use(worldIn, player, hand); } + @OnlyIn(Dist.CLIENT) @Override public void appendHoverText(ItemStack stack, @Nullable World playerIn, List list, ITooltipFlag advanced) { super.appendHoverText(stack, playerIn, list, advanced); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBooklet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBooklet.java index c870b9a94..93f17c90b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBooklet.java @@ -73,6 +73,7 @@ public class ItemBooklet extends ItemBase implements IHudDisplay { return ActionResult.success(player.getItemInHand(hand)); } + @OnlyIn(Dist.CLIENT) @Override public void appendHoverText(ItemStack stack, @Nullable World playerIn, List tooltip, ITooltipFlag advanced) { tooltip.add(new TranslationTextComponent("tooltip." + ActuallyAdditions.MODID + "." + this.getDescription().getString() + ".desc")); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCoffee.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCoffee.java index 4a5c2303e..2e62bfada 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCoffee.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCoffee.java @@ -26,6 +26,8 @@ import net.minecraft.item.crafting.Ingredient; import net.minecraft.nbt.CompoundNBT; import net.minecraft.util.text.ITextComponent; import net.minecraft.world.World; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.fml.ModList; import javax.annotation.Nullable; @@ -104,6 +106,8 @@ public class ItemCoffee extends ItemFoodBase { public CompoundNBT getShareTag(ItemStack stack) { return super.getShareTag(stack); } + + @OnlyIn(Dist.CLIENT) @Override public void appendHoverText(ItemStack stack, @Nullable World playerIn, List tooltip, ITooltipFlag advanced) { //PotionEffect[] effects = ActuallyAdditionsAPI.methodHandler.getEffectsFromStack(stack); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemEngineerGoggles.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemEngineerGoggles.java index e5b27b7c9..8a6805166 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemEngineerGoggles.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemEngineerGoggles.java @@ -40,7 +40,7 @@ public class ItemEngineerGoggles extends ItemArmorAA implements IGoggles { super(ArmorMaterials.GOGGLES, EquipmentSlotType.HEAD, ActuallyItems.defaultProps().setNoRepair().durability(0)); this.displayMobs = displayMobs; - MinecraftForge.EVENT_BUS.register(this); + //MinecraftForge.EVENT_BUS.register(this); } public static boolean isWearing(PlayerEntity player) { @@ -51,7 +51,7 @@ public class ItemEngineerGoggles extends ItemArmorAA implements IGoggles { @OnlyIn(Dist.CLIENT) @SubscribeEvent public void onClientTick(TickEvent.ClientTickEvent event) { - PlayerEntity player = ClientProxy.getCurrentPlayer(); + /* PlayerEntity player = ClientProxy.getCurrentPlayer(); if (player != null && isWearing(player)) { ItemStack face = player.inventory.armor.get(3); if (((IGoggles) face.getItem()).displaySpectralMobs()) { @@ -85,7 +85,7 @@ public class ItemEngineerGoggles extends ItemArmorAA implements IGoggles { } } this.cachedGlowingEntities.clear(); - } + }*/ } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFillingWand.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFillingWand.java index 3b87c0a2d..e674bfcf2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFillingWand.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFillingWand.java @@ -33,6 +33,8 @@ import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.text.IFormattableTextComponent; import net.minecraft.util.text.ITextComponent; import net.minecraft.world.World; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; import javax.annotation.Nullable; import java.util.List; @@ -85,7 +87,7 @@ public class ItemFillingWand extends ItemEnergy { ItemStack stack = context.getPlayer().getItemInHand(context.getHand()); if (!context.getLevel().isClientSide && context.getPlayer().getUseItemRemainingTicks() <= 0) { - if (context.getPlayer().isShiftKeyDown()) { + if (context.getPlayer().isCrouching()) { BlockState state = context.getLevel().getBlockState(context.getClickedPos()); saveData(state, stack); return ActionResultType.SUCCESS; @@ -218,6 +220,7 @@ public class ItemFillingWand extends ItemEnergy { } } + @OnlyIn(Dist.CLIENT) @Override public void appendHoverText(ItemStack stack, @Nullable World worldIn, List tooltip, ITooltipFlag flagIn) { super.appendHoverText(stack, worldIn, tooltip, flagIn); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFilter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFilter.java index ef5c6f484..83c82d927 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFilter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFilter.java @@ -24,6 +24,8 @@ import net.minecraft.util.Hand; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.StringTextComponent; import net.minecraft.world.World; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.fml.network.NetworkHooks; import javax.annotation.Nullable; @@ -44,6 +46,7 @@ public class ItemFilter extends ItemBase { return ActionResult.pass(player.getItemInHand(hand)); } + @OnlyIn(Dist.CLIENT) @Override public void appendHoverText(ItemStack stack, @Nullable World worldIn, List tooltip, ITooltipFlag flagIn) { super.appendHoverText(stack, worldIn, tooltip, flagIn); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemHairBall.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemHairBall.java index 1b4343706..4be2aa7f7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemHairBall.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemHairBall.java @@ -36,7 +36,7 @@ public class ItemHairBall extends ItemBase { super(); // TODO: [port] move this. - MinecraftForge.EVENT_BUS.register(this); + //MinecraftForge.EVENT_BUS.register(this); } @SubscribeEvent diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLaserWrench.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLaserWrench.java index 70fefe604..0f7b45293 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLaserWrench.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLaserWrench.java @@ -26,6 +26,8 @@ import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TranslationTextComponent; import net.minecraft.world.World; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; import java.util.List; @@ -88,6 +90,7 @@ public class ItemLaserWrench extends ItemBase { // return new CompoundNBT(); // } + @OnlyIn(Dist.CLIENT) @Override public void appendHoverText(ItemStack stack, World playerIn, List list, ITooltipFlag advanced) { BlockPos coords = ItemPhantomConnector.getStoredPosition(stack); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPhantomConnector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPhantomConnector.java index eeef98196..7607025e6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPhantomConnector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPhantomConnector.java @@ -29,6 +29,8 @@ import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TranslationTextComponent; import net.minecraft.world.World; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; import javax.annotation.Nullable; import java.util.List; @@ -112,6 +114,7 @@ public class ItemPhantomConnector extends ItemBase { return new CompoundNBT(); } + @OnlyIn(Dist.CLIENT) @Override public void appendHoverText(ItemStack stack, @Nullable World playerIn, List list, ITooltipFlag advanced) { BlockPos coords = getStoredPosition(stack); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPlayerProbe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPlayerProbe.java index 0c4dd0240..c33fb8855 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPlayerProbe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPlayerProbe.java @@ -27,6 +27,8 @@ import net.minecraft.util.Hand; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TranslationTextComponent; import net.minecraft.world.World; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; import javax.annotation.Nullable; import java.util.List; @@ -108,6 +110,7 @@ public class ItemPlayerProbe extends ItemBase { return ActionResultType.FAIL; } + @OnlyIn(Dist.CLIENT) @Override public void appendHoverText(ItemStack stack, @Nullable World playerIn, List tooltip, ITooltipFlag advanced) { if (stack.getOrCreateTag().contains("Name")) { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPotionRing.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPotionRing.java index bd20045de..3c844dce9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPotionRing.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPotionRing.java @@ -23,6 +23,8 @@ import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.MathHelper; import net.minecraft.util.text.ITextComponent; import net.minecraft.world.World; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; import javax.annotation.Nullable; import java.util.List; @@ -218,6 +220,7 @@ public class ItemPotionRing extends ItemBase implements IDisplayStandItem { return false; } + @OnlyIn(Dist.CLIENT) @Override public void appendHoverText(ItemStack stack, @Nullable World playerIn, List tooltip, ITooltipFlag advanced) { super.appendHoverText(stack, playerIn, tooltip, advanced); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSolidifiedExperience.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSolidifiedExperience.java index f8bbbc981..3ff7e4e08 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSolidifiedExperience.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSolidifiedExperience.java @@ -36,7 +36,7 @@ public class ItemSolidifiedExperience extends ItemBase { super(); // TODO: [port] move this to another place - MinecraftForge.EVENT_BUS.register(this); + //MinecraftForge.EVENT_BUS.register(this); } @SubscribeEvent diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWaterBowl.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWaterBowl.java index 1075a1a16..4ebae3c3c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWaterBowl.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWaterBowl.java @@ -40,7 +40,7 @@ public class ItemWaterBowl extends ItemBase { public ItemWaterBowl() { super(ActuallyItems.defaultProps().stacksTo(1)); - MinecraftForge.EVENT_BUS.register(this); + //MinecraftForge.EVENT_BUS.register(this); } @SubscribeEvent diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWingsOfTheBats.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWingsOfTheBats.java index 2da1e53a0..11c61c83c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWingsOfTheBats.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWingsOfTheBats.java @@ -41,7 +41,7 @@ public class ItemWingsOfTheBats extends ItemBase { super(ActuallyItems.defaultProps().stacksTo(1)); // TODO: Lets move this somewhere global. Don't like event logic in a single place. - MinecraftForge.EVENT_BUS.register(this); + //MinecraftForge.EVENT_BUS.register(this); } /** @@ -67,23 +67,23 @@ public class ItemWingsOfTheBats extends ItemBase { @Override public double getDurabilityForDisplay(ItemStack stack) { - PlayerEntity player = ClientProxy.getCurrentPlayer(); +/* PlayerEntity player = ClientProxy.getCurrentPlayer(); if (player != null) { // PlayerData.PlayerSave data = PlayerData.getDataFromPlayer(player); double diff = MAX_FLY_TIME - 1;//data.batWingsFlyTime; // TODO: fix me return 1 - diff / MAX_FLY_TIME; - } + }*/ //TODO return super.getDurabilityForDisplay(stack); } @Override public int getRGBDurabilityForDisplay(ItemStack stack) { - PlayerEntity player = ClientProxy.getCurrentPlayer(); +/* PlayerEntity player = ClientProxy.getCurrentPlayer(); if (player != null) { // PlayerData.PlayerSave data = PlayerData.getDataFromPlayer(player); int curr = 1;//data.batWingsFlyTime; // TODO: fix me return MathHelper.hsvToRgb(Math.max(0.0F, 1 - (float) curr / MAX_FLY_TIME) / 3.0F, 1.0F, 1.0F); - } + }*/ return super.getRGBDurabilityForDisplay(stack); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWorm.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWorm.java index 9eee1f13a..fddbf2f0c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWorm.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWorm.java @@ -35,7 +35,7 @@ public class ItemWorm extends ItemBase { public ItemWorm() { super(); - MinecraftForge.EVENT_BUS.register(this); + //MinecraftForge.EVENT_BUS.register(this); // TODO: [port] Not sure what this does // this.addPropertyOverride(new ResourceLocation(ActuallyAdditions.MODID, "snail"), (IItemPropertyGetter) (stack, world, entity) -> "snail mail".equalsIgnoreCase(stack.getDisplayName().getString()) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemEnergy.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemEnergy.java index f476bb500..2b1afb135 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemEnergy.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemEnergy.java @@ -67,6 +67,7 @@ public abstract class ItemEnergy extends ItemBase { // } + @OnlyIn(Dist.CLIENT) @Override public void appendHoverText(ItemStack stack, @Nullable World worldIn, List tooltip, ITooltipFlag flagIn) { super.appendHoverText(stack, worldIn, tooltip, flagIn); @@ -77,7 +78,6 @@ public abstract class ItemEnergy extends ItemBase { } @Override - @OnlyIn(Dist.CLIENT) public boolean isFoil(ItemStack stack) { return false; } @@ -112,11 +112,9 @@ public abstract class ItemEnergy extends ItemBase { @Override public int getRGBDurabilityForDisplay(ItemStack stack) { - PlayerEntity player = ClientProxy.getCurrentPlayer(); - if (player != null && player.level != null) { - float[] color = AssetUtil.getWheelColor(player.level.getGameTime() % 256); - return MathHelper.color(color[0] / 255F, color[1] / 255F, color[2] / 255F); - } + //float[] color = MathHelper.hsvToRgb(1, 1, 1); + //float[] color = AssetUtil.getWheelColor(player.level.getGameTime() % 256); + //return MathHelper.color(color[0] / 255F, color[1] / 255F, color[2] / 255F); return super.getRGBDurabilityForDisplay(stack); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java b/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java index 8c712a7e8..21d95f875 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java @@ -81,7 +81,4 @@ public class ClientProxy { // COLOR_PRODIVIDING_BLOCKS_FOR_REGISTERING.add(block); // } - public static ClientPlayerEntity getCurrentPlayer() { - return Minecraft.getInstance().player; - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/CrusherRecipeRegistry.java b/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/CrusherRecipeRegistry.java index 37342e994..41464c20d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/CrusherRecipeRegistry.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/CrusherRecipeRegistry.java @@ -10,6 +10,10 @@ package de.ellpeck.actuallyadditions.mod.recipe; +import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; +import de.ellpeck.actuallyadditions.mod.crafting.CrushingRecipe; +import net.minecraft.item.ItemStack; + public final class CrusherRecipeRegistry { // // public static final ArrayList SEARCH_CASES = new ArrayList<>(); @@ -103,11 +107,11 @@ public final class CrusherRecipeRegistry { // return false; // } // - // public static CrusherRecipe getRecipeFromInput(ItemStack input) { - // for (CrusherRecipe recipe : ActuallyAdditionsAPI.CRUSHER_RECIPES) - // if (recipe.matches(input)) return recipe; - // return null; - // } + public static CrushingRecipe getRecipeFromInput(ItemStack input) { + for (CrushingRecipe recipe : ActuallyAdditionsAPI.CRUSHER_RECIPES) + if (recipe.matches(input)) return recipe; + return null; + } // // public static class SearchCase { // diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java index 0a2ae6f09..7a215da5a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java @@ -118,7 +118,7 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements ItemStack stack = this.inv.getStackInSlot(0); if (!stack.isEmpty()) { for (SolidFuelRecipe fuelRecipe : ActuallyAdditionsAPI.SOLID_FUEL_RECIPES) { - if (fuelRecipe.matches(new SingleItem(stack), null)) { + if (fuelRecipe.matches(stack)) { this.currentRecipe = fuelRecipe; this.maxBurnTime = fuelRecipe.getBurnTime(); this.currentBurnTime = this.maxBurnTime; @@ -151,9 +151,8 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements @Override public IAcceptor getAcceptor() { return (slot, stack, automation) -> { - SingleItem singleItem = new SingleItem(stack); for (SolidFuelRecipe recipe : ActuallyAdditionsAPI.SOLID_FUEL_RECIPES) { - if (recipe.matches(singleItem, null))return true; + if (recipe.matches(stack))return true; } return false; }; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCrusher.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCrusher.java index 84bc5c7d1..d18cd5d44 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCrusher.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCrusher.java @@ -15,6 +15,7 @@ import de.ellpeck.actuallyadditions.mod.crafting.CrushingRecipe; import de.ellpeck.actuallyadditions.mod.inventory.CrusherContainer; import de.ellpeck.actuallyadditions.mod.misc.SoundHandler; import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor; +import de.ellpeck.actuallyadditions.mod.recipe.CrusherRecipeRegistry; import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor; import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IRemover; import de.ellpeck.actuallyadditions.mod.util.StackUtil; @@ -31,6 +32,7 @@ import net.minecraft.util.Direction; import net.minecraft.util.SoundCategory; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.TranslationTextComponent; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.energy.IEnergyStorage; @@ -216,7 +218,7 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto } public void finishCrushing(int theInput, int theFirstOutput, int theSecondOutput) { - CrushingRecipe recipe = null; //CrusherRecipeRegistry.getRecipeFromInput(this.inv.getStackInSlot(theInput));//TODO + CrushingRecipe recipe = CrusherRecipeRegistry.getRecipeFromInput(this.inv.getStackInSlot(theInput));//TODO if (recipe == null) { return; } @@ -281,7 +283,7 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto @Override public ITextComponent getDisplayName() { - return StringTextComponent.EMPTY; + return new TranslationTextComponent("container.actuallyadditions.crusher"); } @Nullable diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/ResourceReloader.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/ResourceReloader.java index 468eca2ac..f0f192d94 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/ResourceReloader.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/ResourceReloader.java @@ -6,19 +6,17 @@ import de.ellpeck.actuallyadditions.mod.crafting.ActuallyRecipes; import net.minecraft.item.crafting.RecipeManager; import net.minecraft.resources.DataPackRegistries; import net.minecraft.resources.IResourceManager; -import net.minecraftforge.resource.IResourceType; -import net.minecraftforge.resource.ISelectiveResourceReloadListener; +import net.minecraft.resources.IResourceManagerReloadListener; -import java.util.function.Predicate; - -public class ResourceReloader implements ISelectiveResourceReloadListener { +@SuppressWarnings("deprecation") +public class ResourceReloader implements IResourceManagerReloadListener { private final DataPackRegistries data; public ResourceReloader(DataPackRegistries dataPackRegistries) { data = dataPackRegistries; } @Override - public void onResourceManagerReload(IResourceManager resourceManager, Predicate resourcePredicate) { + public void onResourceManagerReload(IResourceManager pResourceManager) { RecipeManager recipeManager = data.getRecipeManager(); ActuallyAdditionsAPI.EMPOWERER_RECIPES.clear(); ActuallyAdditionsAPI.EMPOWERER_RECIPES.addAll(recipeManager.getAllRecipesFor(ActuallyRecipes.Types.EMPOWERING)); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java index 08e1a04a7..e8130a3a6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java @@ -127,7 +127,7 @@ public final class WorldUtil { int drain = from.extractEnergy(maxTransfer, true); if (drain > 0) { int filled = to.receiveEnergy(drain, false); - to.extractEnergy(filled, false); + from.extractEnergy(filled, false); } }); }); diff --git a/src/main/java/de/ellpeck/actuallyadditions/registration/AABlockReg.java b/src/main/java/de/ellpeck/actuallyadditions/registration/AABlockReg.java index c429c5539..6b1d59789 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/registration/AABlockReg.java +++ b/src/main/java/de/ellpeck/actuallyadditions/registration/AABlockReg.java @@ -15,10 +15,9 @@ import java.util.function.Function; import java.util.function.Supplier; public class AABlockReg implements Supplier { -//public class AABlock implements Supplier { private final String name; - private final RegistryObject block; - private final RegistryObject item; + private RegistryObject block; + private RegistryObject item; private RegistryObject> tileEntityType; public AABlockReg(String name, Supplier blockSupplier, Function itemSupplier, Supplier tileSupplier) { diff --git a/src/main/resources/assets/actuallyadditions/blockstates/canola_oil.json b/src/main/resources/assets/actuallyadditions/blockstates/canola_oil.json new file mode 100644 index 000000000..8cb636ad1 --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/blockstates/canola_oil.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "actuallyadditions:block/canola_oil" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/lang/en_us.json b/src/main/resources/assets/actuallyadditions/lang/en_us.json index 154276c70..635f665e0 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_us.json +++ b/src/main/resources/assets/actuallyadditions/lang/en_us.json @@ -121,8 +121,8 @@ "block.actuallyadditions.giant_chest": "Small Storage Crate", "block.actuallyadditions.giant_chest_medium": "Medium Storage Crate", "block.actuallyadditions.giant_chest_large": "Large Storage Crate", - "block.actuallyadditions.grinder": "Crusher", - "block.actuallyadditions.grinder_double": "Double Crusher", + "block.actuallyadditions.crusher": "Crusher", + "block.actuallyadditions.double_crusher": "Double Crusher", "block.actuallyadditions.furnace_double": "Powered Furnace", "block.actuallyadditions.fishing_net": "Fishing Net", "block.actuallyadditions.furnace_solar": "Solar Panel", @@ -643,8 +643,8 @@ "_comment": "Container Names", "container.actuallyadditions.inputter": "ESD", "container.actuallyadditions.inputterAdvanced": "Advanced ESD", - "container.actuallyadditions.grinder": "Crusher", - "container.actuallyadditions.grinderDouble": "Double Crusher", + "container.actuallyadditions.crusher": "Crusher", + "container.actuallyadditions.double_crusher": "Double Crusher", "container.actuallyadditions.furnaceDouble": "Powered Furnace", "container.actuallyadditions.feeder": "Feeder", "container.actuallyadditions.giantChest": "Small Storage Crate", diff --git a/src/main/resources/assets/actuallyadditions/models/block/canola_oil.json b/src/main/resources/assets/actuallyadditions/models/block/canola_oil.json new file mode 100644 index 000000000..ea5c7b4a7 --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/models/block/canola_oil.json @@ -0,0 +1,5 @@ +{ + "textures": { + "particle": "actuallyadditions:fluid/canola_oil_still" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/textures/fluid/canola_oil_flowing.png b/src/main/resources/assets/actuallyadditions/textures/fluid/canola_oil_flowing.png new file mode 100644 index 000000000..f5982ec90 Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/fluid/canola_oil_flowing.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/fluid/canola_oil_flowing.png.mcmeta b/src/main/resources/assets/actuallyadditions/textures/fluid/canola_oil_flowing.png.mcmeta new file mode 100644 index 000000000..4f0718ac9 --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/textures/fluid/canola_oil_flowing.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/textures/fluid/canola_oil_still.png b/src/main/resources/assets/actuallyadditions/textures/fluid/canola_oil_still.png new file mode 100644 index 000000000..59569bc40 Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/fluid/canola_oil_still.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/fluid/canola_oil_still.png.mcmeta b/src/main/resources/assets/actuallyadditions/textures/fluid/canola_oil_still.png.mcmeta new file mode 100644 index 000000000..0645f48c6 --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/textures/fluid/canola_oil_still.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +}