diff --git a/src/main/java/techreborn/TechRebornClient.java b/src/main/java/techreborn/TechRebornClient.java new file mode 100644 index 000000000..5a3e6e56e --- /dev/null +++ b/src/main/java/techreborn/TechRebornClient.java @@ -0,0 +1,57 @@ +package techreborn; + +import net.fabricmc.api.ClientModInitializer; +import net.fabricmc.fabric.api.client.model.ModelLoadingRegistry; +import net.fabricmc.fabric.api.event.client.ClientSpriteRegistryCallback; +import net.minecraft.client.render.model.BakedModel; +import net.minecraft.client.render.model.ModelBakeSettings; +import net.minecraft.client.render.model.ModelLoader; +import net.minecraft.client.render.model.UnbakedModel; +import net.minecraft.client.texture.Sprite; +import net.minecraft.client.texture.SpriteAtlasTexture; +import net.minecraft.util.Identifier; +import techreborn.client.render.DyamicCellBakedModel; + +import javax.annotation.Nullable; +import java.util.Collection; +import java.util.Collections; +import java.util.Set; +import java.util.function.Function; + +public class TechRebornClient implements ClientModInitializer { + + @Override + public void onInitializeClient() { + ClientSpriteRegistryCallback.event(SpriteAtlasTexture.BLOCK_ATLAS_TEX) + .register((spriteAtlasTexture, registry) -> registry.register(new Identifier("techreborn:item/cell_base"))); + + ModelLoadingRegistry.INSTANCE.registerVariantProvider(resourceManager -> (modelIdentifier, modelProviderContext) -> { + if(!modelIdentifier.getNamespace().equals("techreborn")){ + return null; + } + if(!modelIdentifier.getPath().equals("cell")){ + return null; + } + return new UnbakedModel() { + @Override + public Collection getModelDependencies() { + return Collections.emptyList(); + } + + @Override + public Collection getTextureDependencies(Function function, Set set) { + return Collections.emptyList(); + } + + @Nullable + @Override + public BakedModel bake(ModelLoader modelLoader, Function function, ModelBakeSettings modelBakeSettings) { + return new DyamicCellBakedModel(); + } + }; + }); + } + + + +} diff --git a/src/main/java/techreborn/blockentity/IndustrialCentrifugeBlockEntity.java b/src/main/java/techreborn/blockentity/IndustrialCentrifugeBlockEntity.java index f7d526b4e..a067e08bc 100644 --- a/src/main/java/techreborn/blockentity/IndustrialCentrifugeBlockEntity.java +++ b/src/main/java/techreborn/blockentity/IndustrialCentrifugeBlockEntity.java @@ -40,7 +40,7 @@ import techreborn.TechReborn; import techreborn.init.ModRecipes; import techreborn.init.TRContent; import techreborn.init.TRBlockEntities; -import techreborn.items.DynamicCell; +import techreborn.items.ItemDynamicCell; import java.util.List; @@ -65,8 +65,8 @@ public class IndustrialCentrifugeBlockEntity extends GenericMachineBlockEntity i public BuiltContainer createContainer(int syncID, final PlayerEntity player) { return new ContainerBuilder("centrifuge").player(player.inventory).inventory().hotbar() .addInventory().blockEntity(this) - .filterSlot(1, 40, 54, stack -> ItemUtils.isItemEqual(stack, DynamicCell.getEmptyCell(1), true, true)) - .filterSlot(0, 40, 34, stack -> !ItemUtils.isItemEqual(stack, DynamicCell.getEmptyCell(1), true, true)) + .filterSlot(1, 40, 54, stack -> ItemUtils.isItemEqual(stack, ItemDynamicCell.getEmptyCell(1), true, true)) + .filterSlot(0, 40, 34, stack -> !ItemUtils.isItemEqual(stack, ItemDynamicCell.getEmptyCell(1), true, true)) .outputSlot(2, 82, 44).outputSlot(3, 101, 25) .outputSlot(4, 120, 44).outputSlot(5, 101, 63).energySlot(6, 8, 72).syncEnergyValue() .syncCrafterValue().addInventory().create(this, syncID); diff --git a/src/main/java/techreborn/blockentity/machine/tier1/IndustrialElectrolyzerBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/IndustrialElectrolyzerBlockEntity.java index 5a1eab9f8..9a3a63546 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/IndustrialElectrolyzerBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/IndustrialElectrolyzerBlockEntity.java @@ -37,7 +37,7 @@ import techreborn.TechReborn; import techreborn.init.ModRecipes; import techreborn.init.TRContent; import techreborn.init.TRBlockEntities; -import techreborn.items.DynamicCell; +import techreborn.items.ItemDynamicCell; import techreborn.blockentity.GenericMachineBlockEntity; @RebornRegister(TechReborn.MOD_ID) @@ -61,8 +61,8 @@ public class IndustrialElectrolyzerBlockEntity extends GenericMachineBlockEntity public BuiltContainer createContainer(int syncID, final PlayerEntity player) { return new ContainerBuilder("industrialelectrolyzer").player(player.inventory).inventory().hotbar() .addInventory().blockEntity(this) - .filterSlot(1, 47, 72, stack -> ItemUtils.isItemEqual(stack, DynamicCell.getEmptyCell(1), true, true)) - .filterSlot(0, 81, 72, stack -> !ItemUtils.isItemEqual(stack, DynamicCell.getEmptyCell(1), true, true)) + .filterSlot(1, 47, 72, stack -> ItemUtils.isItemEqual(stack, ItemDynamicCell.getEmptyCell(1), true, true)) + .filterSlot(0, 81, 72, stack -> !ItemUtils.isItemEqual(stack, ItemDynamicCell.getEmptyCell(1), true, true)) .outputSlot(2, 51, 24).outputSlot(3, 71, 24).outputSlot(4, 91, 24).outputSlot(5, 111, 24) .energySlot(6, 8, 72).syncEnergyValue().syncCrafterValue().addInventory().create(this, syncID); } diff --git a/src/main/java/techreborn/client/render/DyamicCellBakedModel.java b/src/main/java/techreborn/client/render/DyamicCellBakedModel.java new file mode 100644 index 000000000..75c134203 --- /dev/null +++ b/src/main/java/techreborn/client/render/DyamicCellBakedModel.java @@ -0,0 +1,140 @@ +package techreborn.client.render; + +import net.fabricmc.fabric.api.client.render.fluid.v1.FluidRenderHandler; +import net.fabricmc.fabric.api.client.render.fluid.v1.FluidRenderHandlerRegistry; +import net.fabricmc.fabric.api.renderer.v1.Renderer; +import net.fabricmc.fabric.api.renderer.v1.RendererAccess; +import net.fabricmc.fabric.api.renderer.v1.material.RenderMaterial; +import net.fabricmc.fabric.api.renderer.v1.mesh.Mesh; +import net.fabricmc.fabric.api.renderer.v1.mesh.MeshBuilder; +import net.fabricmc.fabric.api.renderer.v1.mesh.MutableQuadView; +import net.fabricmc.fabric.api.renderer.v1.mesh.QuadEmitter; +import net.fabricmc.fabric.api.renderer.v1.model.FabricBakedModel; +import net.fabricmc.fabric.api.renderer.v1.render.RenderContext; +import net.minecraft.block.BlockState; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.render.model.BakedModel; +import net.minecraft.client.render.model.BakedQuad; +import net.minecraft.client.render.model.json.ModelItemPropertyOverrideList; +import net.minecraft.client.render.model.json.ModelTransformation; +import net.minecraft.client.texture.Sprite; +import net.minecraft.entity.LivingEntity; +import net.minecraft.fluid.Fluid; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Identifier; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.util.registry.Registry; +import net.minecraft.world.ExtendedBlockView; +import net.minecraft.world.World; + +import javax.annotation.Nullable; +import java.util.Collections; +import java.util.List; +import java.util.Random; +import java.util.function.Supplier; + +public class DyamicCellBakedModel implements BakedModel, FabricBakedModel { + + Sprite base; + + public DyamicCellBakedModel() { + base = MinecraftClient.getInstance().getSpriteAtlas().getSprite(new Identifier("techreborn:item/cell_base")); + } + + @Override + public void emitBlockQuads(ExtendedBlockView blockView, BlockState state, BlockPos pos, Supplier randomSupplier, RenderContext context) { + + } + + @Override + public void emitItemQuads(ItemStack stack, Supplier randomSupplier, RenderContext context) { + + Fluid fluid = null; + if(stack.hasTag() && stack.getTag().containsKey("fluid")){ + fluid = Registry.FLUID.get(new Identifier(stack.getTag().getString("fluid"))); + } + + context.meshConsumer().accept(getMesh(fluid)); + } + + @Override + public List getQuads(@Nullable BlockState blockState, @Nullable Direction direction, Random random) { + return Collections.emptyList(); + } + + //I have no idea what im doing, this works good enough for me, if you want to make it nicer a PR or tips would be appreciated, thanks. + private Mesh getMesh(Fluid fluid){ + Renderer renderer = RendererAccess.INSTANCE.getRenderer(); + MeshBuilder builder = renderer.meshBuilder(); + QuadEmitter emitter = builder.getEmitter(); + + RenderMaterial mat = renderer.materialFinder().disableDiffuse(0, true).find(); + + //TODO make the base texture 3d somehow + emitter.square(Direction.SOUTH, 0, 0, 1, 1, 0) + .material(mat) + .spriteColor(0, -1, -1, -1, -1) + .spriteBake(0, base, MutableQuadView.BAKE_LOCK_UV).emit(); + + if(fluid != null){ + FluidRenderHandler fluidRenderHandler = FluidRenderHandlerRegistry.INSTANCE.get(fluid); + if(fluidRenderHandler != null){ + Sprite fluidSprite = fluidRenderHandler.getFluidSprites(MinecraftClient.getInstance().world, BlockPos.ORIGIN, fluid.getDefaultState())[0]; + emitter.square(Direction.SOUTH, 0.4F, 0.25F, 0.6F, 0.75F, -0.0001F) + .material(mat) + .spriteColor(0, -1, -1, -1, -1) + .spriteBake(0, fluidSprite, MutableQuadView.BAKE_LOCK_UV).emit(); + } + } + + return builder.build(); + } + + + @Override + public boolean isVanillaAdapter() { + return false; + } + + @Override + public boolean useAmbientOcclusion() { + return true; + } + + @Override + public boolean hasDepthInGui() { + return true; + } + + @Override + public boolean isBuiltin() { + return false; + } + + @Override + public Sprite getSprite() { + return base; + } + + @Override + public ModelTransformation getTransformation() { + return ModelHelper.HANDHELD_ITEM_TRANSFORMS; + } + + protected class ItemProxy extends ModelItemPropertyOverrideList { + public ItemProxy() { + super(null, null, null, Collections.emptyList()); + } + + @Override + public BakedModel apply(BakedModel bakedModel, ItemStack itemStack, World world, LivingEntity livingEntity) { + return DyamicCellBakedModel.this; + } + } + + @Override + public ModelItemPropertyOverrideList getItemPropertyOverrides() { + return new ItemProxy(); + } +} diff --git a/src/main/java/techreborn/events/ModRegistry.java b/src/main/java/techreborn/events/ModRegistry.java index e30f55318..df07f37a1 100644 --- a/src/main/java/techreborn/events/ModRegistry.java +++ b/src/main/java/techreborn/events/ModRegistry.java @@ -45,7 +45,7 @@ import techreborn.init.TRArmorMaterial; import techreborn.init.TRContent; import techreborn.init.TRContent.*; import techreborn.init.TRToolTier; -import techreborn.items.DynamicCell; +import techreborn.items.ItemDynamicCell; import techreborn.items.ItemFrequencyTransmitter; import techreborn.items.ItemManual; import techreborn.items.ItemScrapBox; @@ -70,7 +70,6 @@ import techreborn.items.tool.vanilla.*; import techreborn.utils.InitUtils; import java.util.Arrays; -import java.util.function.Consumer; /** * @author drcrazy @@ -207,7 +206,7 @@ public class ModRegistry { RebornRegistry.registerItem(TRContent.SCRAP_BOX = InitUtils.setup(new ItemScrapBox(), "scrap_box")); RebornRegistry.registerItem(TRContent.MANUAL = InitUtils.setup(new ItemManual(), "manual")); RebornRegistry.registerItem(TRContent.DEBUG_TOOL = InitUtils.setup(new ItemDebugTool(), "debug_tool")); - RebornRegistry.registerItem(TRContent.CELL = InitUtils.setup(new DynamicCell(), "cell")); + RebornRegistry.registerItem(TRContent.CELL = InitUtils.setup(new ItemDynamicCell(), "cell")); TechReborn.LOGGER.debug("TechReborns Items Loaded"); } diff --git a/src/main/java/techreborn/init/ModFluids.java b/src/main/java/techreborn/init/ModFluids.java index a840976f9..153e5d79e 100644 --- a/src/main/java/techreborn/init/ModFluids.java +++ b/src/main/java/techreborn/init/ModFluids.java @@ -101,7 +101,7 @@ public enum ModFluids { Registry.register(Registry.ITEM, identifier, bucket); } - public Fluid getFluid() { + public RebornFluid getFluid() { return stillFluid; } diff --git a/src/main/java/techreborn/init/TRContent.java b/src/main/java/techreborn/init/TRContent.java index 0eea3b50b..3baa625ad 100644 --- a/src/main/java/techreborn/init/TRContent.java +++ b/src/main/java/techreborn/init/TRContent.java @@ -50,7 +50,7 @@ import techreborn.blocks.transformers.BlockLVTransformer; import techreborn.blocks.transformers.BlockMVTransformer; import techreborn.config.ConfigTechReborn; import techreborn.entities.EntityNukePrimed; -import techreborn.items.DynamicCell; +import techreborn.items.ItemDynamicCell; import techreborn.items.ItemUpgrade; import techreborn.utils.InitUtils; import techreborn.blockentity.storage.AdjustableSUBlockEntity; @@ -112,7 +112,7 @@ public class TRContent { public static Item FREQUENCY_TRANSMITTER; public static Item SCRAP_BOX; public static Item MANUAL; - public static DynamicCell CELL; + public static ItemDynamicCell CELL; // Gem armor & tools @Nullable diff --git a/src/main/java/techreborn/init/recipes/DistillationTowerRecipes.java b/src/main/java/techreborn/init/recipes/DistillationTowerRecipes.java index e57b529cb..3b7c267ec 100644 --- a/src/main/java/techreborn/init/recipes/DistillationTowerRecipes.java +++ b/src/main/java/techreborn/init/recipes/DistillationTowerRecipes.java @@ -25,7 +25,7 @@ package techreborn.init.recipes; import net.minecraft.item.ItemStack; -import techreborn.items.DynamicCell; +import techreborn.items.ItemDynamicCell; import techreborn.items.ItemCells; import java.security.InvalidParameterException; @@ -66,20 +66,20 @@ public class DistillationTowerRecipes extends RecipeMethods { int cellCount = 0; for (ItemStack stack : outputs) { - if (stack.getItem() instanceof DynamicCell) { + if (stack.getItem() instanceof ItemDynamicCell) { cellCount += stack.getCount(); } } - if (input.getItem() instanceof DynamicCell) { + if (input.getItem() instanceof ItemDynamicCell) { int inputCount = input.getCount(); if (cellCount < inputCount) { if (output2 == null) { - output2 = DynamicCell.getEmptyCell(inputCount - cellCount); + output2 = ItemDynamicCell.getEmptyCell(inputCount - cellCount); } else if (output3 == null) { - output3 = DynamicCell.getEmptyCell(inputCount - cellCount); + output3 = ItemDynamicCell.getEmptyCell(inputCount - cellCount); } else if (output4 == null) { - output4 = DynamicCell.getEmptyCell(inputCount - cellCount); + output4 = ItemDynamicCell.getEmptyCell(inputCount - cellCount); } } cellCount -= inputCount; @@ -92,7 +92,7 @@ public class DistillationTowerRecipes extends RecipeMethods { if (cellCount > 64) { throw new InvalidParameterException("Invalid Distillation tower outputs: " + outputs + "(Recipe requires > 64 cells)"); } - cells = DynamicCell.getEmptyCell(cellCount); + cells = ItemDynamicCell.getEmptyCell(cellCount); } // RecipeHandler.addRecipe(Reference.DistiLLATION_TOWER_RECIPE, new DistillationTowerRecipe(input, cells, output1, output2, output3, output4, ticks, euPerTick, oreDict)); } diff --git a/src/main/java/techreborn/init/recipes/IndustrialCentrifugeRecipes.java b/src/main/java/techreborn/init/recipes/IndustrialCentrifugeRecipes.java index a073226b4..f4536a096 100644 --- a/src/main/java/techreborn/init/recipes/IndustrialCentrifugeRecipes.java +++ b/src/main/java/techreborn/init/recipes/IndustrialCentrifugeRecipes.java @@ -27,7 +27,7 @@ package techreborn.init.recipes; import net.minecraft.block.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; -import techreborn.items.DynamicCell; +import techreborn.items.ItemDynamicCell; import java.security.InvalidParameterException; @@ -138,22 +138,22 @@ public class IndustrialCentrifugeRecipes extends RecipeMethods { int cellCount = 0; for (ItemStack stack : outputs) { - if (stack.getItem() instanceof DynamicCell) { + if (stack.getItem() instanceof ItemDynamicCell) { cellCount += stack.getCount(); } } if (input instanceof ItemStack) { - if (((ItemStack) input).getItem() instanceof DynamicCell) { + if (((ItemStack) input).getItem() instanceof ItemDynamicCell) { int inputCount = ((ItemStack) input).getCount(); if (cellCount < inputCount) { if (output2 == null) { - output2 = DynamicCell.getEmptyCell(inputCount - cellCount); + output2 = ItemDynamicCell.getEmptyCell(inputCount - cellCount); } else if (output3 == null) { - output3 = DynamicCell.getEmptyCell(inputCount - cellCount); + output3 = ItemDynamicCell.getEmptyCell(inputCount - cellCount); } else if (output4 == null) { - output4 = DynamicCell.getEmptyCell(inputCount - cellCount); + output4 = ItemDynamicCell.getEmptyCell(inputCount - cellCount); } } cellCount -= inputCount; @@ -169,7 +169,7 @@ public class IndustrialCentrifugeRecipes extends RecipeMethods { if (cellCount > 64) { throw new InvalidParameterException("Invalid industrial centrifuge outputs: " + outputs + "(Recipe requires > 64 cells)"); } - cells = DynamicCell.getEmptyCell(cellCount); + cells = ItemDynamicCell.getEmptyCell(cellCount); } //RecipeHandler.addRecipe(Reference.CENTRIFUGE_RECIPE, new CentrifugeRecipe(input, cells, output1, output2, output3, output4, ticks, 5, oreDict)); } diff --git a/src/main/java/techreborn/init/recipes/ScrapboxRecipes.java b/src/main/java/techreborn/init/recipes/ScrapboxRecipes.java index 3f8dbb45a..4f857bce1 100644 --- a/src/main/java/techreborn/init/recipes/ScrapboxRecipes.java +++ b/src/main/java/techreborn/init/recipes/ScrapboxRecipes.java @@ -29,7 +29,7 @@ import net.minecraft.block.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import techreborn.init.TRContent; -import techreborn.items.DynamicCell; +import techreborn.items.ItemDynamicCell; import techreborn.utils.StackWIPHandler; /** @@ -117,7 +117,7 @@ public class ScrapboxRecipes extends RecipeMethods { register(getStack(Items.GOLD_NUGGET)); register(getStack(Items.SHULKER_SHELL)); - register(DynamicCell.getEmptyCell(1)); + register(ItemDynamicCell.getEmptyCell(1)); register(getMaterial("water", Type.CELL)); register(getMaterial("compressedair", Type.CELL)); register(TRContent.Parts.SAP.getStack()); diff --git a/src/main/java/techreborn/items/ItemCells.java b/src/main/java/techreborn/items/ItemCells.java index 563e220e4..2c67369e9 100644 --- a/src/main/java/techreborn/items/ItemCells.java +++ b/src/main/java/techreborn/items/ItemCells.java @@ -32,7 +32,7 @@ import techreborn.utils.FluidUtils; public class ItemCells { public static ItemStack getCellByName(String name, int count) { if (name.equalsIgnoreCase("empty") || name.equalsIgnoreCase("cell")) { - return DynamicCell.getEmptyCell(count).copy(); + return ItemDynamicCell.getEmptyCell(count).copy(); } Fluid fluid = FluidUtils.getFluid("fluid" + name.toLowerCase()); if (fluid == null) { @@ -42,7 +42,7 @@ public class ItemCells { } } Validate.notNull(fluid, "The fluid " + name + " could not be found"); - return DynamicCell.getCellWithFluid(fluid, count); + return ItemDynamicCell.getCellWithFluid(fluid, count); } public static ItemStack getCellByName(String name) { diff --git a/src/main/java/techreborn/items/DynamicCell.java b/src/main/java/techreborn/items/ItemDynamicCell.java similarity index 90% rename from src/main/java/techreborn/items/DynamicCell.java rename to src/main/java/techreborn/items/ItemDynamicCell.java index f2b064727..bed0a8e20 100644 --- a/src/main/java/techreborn/items/DynamicCell.java +++ b/src/main/java/techreborn/items/ItemDynamicCell.java @@ -31,9 +31,11 @@ import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundTag; import net.minecraft.util.DefaultedList; +import net.minecraft.util.registry.Registry; import net.minecraft.world.World; import org.apache.commons.lang3.Validate; import net.minecraft.fluid.Fluid; +import reborncore.common.util.ItemNBTHelper; import techreborn.TechReborn; import techreborn.init.TRContent; import techreborn.utils.FluidUtils; @@ -41,11 +43,11 @@ import techreborn.utils.FluidUtils; /** * Created by modmuss50 on 17/05/2016. */ -public class DynamicCell extends Item { +public class ItemDynamicCell extends Item { public static final int CAPACITY = 1000; - public DynamicCell() { + public ItemDynamicCell() { super(new Item.Settings().group(TechReborn.ITEMGROUP)); } @@ -65,13 +67,6 @@ public class DynamicCell extends Item { } - public boolean tryAddCellToInventory(PlayerEntity player, ItemStack stack, Fluid fluid) { - if (player.inventory.insertStack(DynamicCell.getCellWithFluid(fluid))) { - stack.decrement(1); - return true; - } - return false; - } @Override public void appendStacks(ItemGroup tab, DefaultedList subItems) { @@ -101,7 +96,7 @@ public class DynamicCell extends Item { public static ItemStack getCellWithFluid(Fluid fluid, int stackSize) { Validate.notNull(fluid); ItemStack stack = new ItemStack(TRContent.CELL); - //getFluidHandler(stack).fill(new FluidStack(fluid, CAPACITY), true); + ItemNBTHelper.getNBT(stack).putString("fluid", Registry.FLUID.getId(fluid).toString()); stack.setCount(stackSize); return stack; } diff --git a/src/main/java/techreborn/proxies/ClientProxy.java b/src/main/java/techreborn/proxies/ClientProxy.java index 33bfacaac..03c873b38 100644 --- a/src/main/java/techreborn/proxies/ClientProxy.java +++ b/src/main/java/techreborn/proxies/ClientProxy.java @@ -31,7 +31,7 @@ import reborncore.api.blockentity.IUpgradeable; import reborncore.client.gui.builder.GuiBase; import reborncore.client.hud.StackInfoHUD; import techreborn.init.TRContent; -import techreborn.items.DynamicCell; +import techreborn.items.ItemDynamicCell; import techreborn.items.ItemFrequencyTransmitter; public class ClientProxy extends CommonProxy { @@ -56,7 +56,7 @@ public class ClientProxy extends CommonProxy { // StateMap rubberLeavesStateMap = new StateMap.Builder().ignore(BlockRubberLeaves.CHECK_DECAY, BlockRubberLeaves.DECAYABLE).build(); // ModelLoader.setCustomStateMapper(TRContent.RUBBER_LEAVES, rubberLeavesStateMap); GuiBase.wrenchStack = new ItemStack(TRContent.WRENCH); - GuiBase.fluidCellProvider = DynamicCell::getCellWithFluid; + GuiBase.fluidCellProvider = ItemDynamicCell::getCellWithFluid; } diff --git a/src/main/java/techreborn/utils/FluidUtils.java b/src/main/java/techreborn/utils/FluidUtils.java index 5909f34a7..722bcf767 100644 --- a/src/main/java/techreborn/utils/FluidUtils.java +++ b/src/main/java/techreborn/utils/FluidUtils.java @@ -27,12 +27,14 @@ package techreborn.utils; import io.github.prospector.silk.fluid.FluidInstance; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; +import net.minecraft.util.registry.Registry; import reborncore.common.util.RebornInventory; import reborncore.common.util.Tank; import net.minecraft.fluid.Fluid; import java.util.Collections; import java.util.List; +import java.util.stream.Collectors; public class FluidUtils { @@ -41,7 +43,7 @@ public class FluidUtils { } public static List getAllFluids() { - return Collections.emptyList(); + return Registry.FLUID.stream().collect(Collectors.toList()); } public static Fluid getFluid(String name){ diff --git a/src/main/java/techreborn/utils/RecipeUtils.java b/src/main/java/techreborn/utils/RecipeUtils.java index 71f07a88e..3e63310e3 100644 --- a/src/main/java/techreborn/utils/RecipeUtils.java +++ b/src/main/java/techreborn/utils/RecipeUtils.java @@ -25,13 +25,13 @@ package techreborn.utils; import net.minecraft.item.ItemStack; -import techreborn.items.DynamicCell; +import techreborn.items.ItemDynamicCell; import javax.annotation.Nonnull; public class RecipeUtils { @Nonnull public static ItemStack getEmptyCell(int stackSize) { - return DynamicCell.getEmptyCell(stackSize); + return ItemDynamicCell.getEmptyCell(stackSize); } } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 9ec2b1d32..f2df5bd88 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -8,6 +8,9 @@ "entrypoints": { "main": [ "techreborn.TechReborn" + ], + "client": [ + "techreborn.TechRebornClient" ] }, "requires": {