diff --git a/src/generated/resources/.cache/e0d3d0b8d9c807675613821fa865a35f707cd83f b/src/generated/resources/.cache/e0d3d0b8d9c807675613821fa865a35f707cd83f index 7f11dc4..94f0da3 100644 --- a/src/generated/resources/.cache/e0d3d0b8d9c807675613821fa865a35f707cd83f +++ b/src/generated/resources/.cache/e0d3d0b8d9c807675613821fa865a35f707cd83f @@ -1,2 +1,2 @@ -// 1.21 2024-08-14T01:55:49.7601336 Data Maps -a8bc32918970acec484472a12e6492804a8783f1 data/lingshi/data_maps/item/cooking_food.json +// 1.21 2024-08-17T18:08:32.4751382 Data Maps +93d8561309e6cfabdc62f0e31ff69d3f67e79b50 data/lingshi/data_maps/item/cooking_food.json diff --git a/src/generated/resources/data/lingshi/data_maps/item/cooking_food.json b/src/generated/resources/data/lingshi/data_maps/item/cooking_food.json index 197b315..7e9a766 100644 --- a/src/generated/resources/data/lingshi/data_maps/item/cooking_food.json +++ b/src/generated/resources/data/lingshi/data_maps/item/cooking_food.json @@ -1,12 +1,12 @@ { "values": { "lingshi:rice": { - "complete_time": 25.0, - "cooked_time": 15.0 + "complete_time": 25, + "cooked_time": 15 }, "minecraft:apple": { - "complete_time": 20.0, - "cooked_time": 5.0 + "complete_time": 20, + "cooked_time": 5 } } } \ No newline at end of file diff --git a/src/main/java/mczme/lingshi/client/BlockEntityRenderer/SkilletBER.java b/src/main/java/mczme/lingshi/client/BlockEntityRenderer/SkilletBER.java index f8d6929..eb2d975 100644 --- a/src/main/java/mczme/lingshi/client/BlockEntityRenderer/SkilletBER.java +++ b/src/main/java/mczme/lingshi/client/BlockEntityRenderer/SkilletBER.java @@ -10,9 +10,8 @@ import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; import net.minecraft.core.Direction; import net.minecraft.world.item.ItemDisplayContext; -import net.minecraft.world.item.ItemStack; +import net.neoforged.neoforge.items.ItemStackHandler; -import java.util.List; public class SkilletBER implements BlockEntityRenderer { @@ -22,18 +21,18 @@ public SkilletBER(BlockEntityRendererProvider.Context pContext){ @Override public void render(SkilletBlockEntity pBlockEntity, float pPartialTick, PoseStack pPoseStack, MultiBufferSource pBufferSource, int pPackedLight, int pPackedOverlay) { - List itemStack = pBlockEntity.getItemStacks(); + ItemStackHandler itemStack = pBlockEntity.getItemStacks(); Direction direction = pBlockEntity.getBlockState().getValue(ChoppingBoardBlock.FACING); - if(!itemStack.isEmpty()){ - for (int i = 0; i { - SkilletBlockEntity blockEntity; - public final ItemStackHandler inventory; + public SkilletBlockEntity blockEntity; protected final Level level; + private final ItemStackHandler itemStackHandler; public SkilletMenu(int pContainerId, Inventory pPlayerInventory, FriendlyByteBuf pContext) { this(pContainerId, pPlayerInventory, (SkilletBlockEntity) pPlayerInventory.player.level().getBlockEntity(pContext.readBlockPos())); @@ -36,26 +35,22 @@ public SkilletMenu(int pContainerId, Inventory pPlayerInventory, super(ModMenuTypes.SKILLET_MENU.get(), pContainerId); checkContainerSize(pPlayerInventory, 1); this.blockEntity = blockEntity; - this.inventory = blockEntity.getInventory(); this.level = pPlayerInventory.player.level(); - this.addWorkSlot(copy(blockEntity.getItemStacks())); + this.itemStackHandler = blockEntity.getItemStacks(); + this.addWorkSlot(itemStackHandler); layoutPlayerInventorySlots(pPlayerInventory); } - private void addWorkSlot(List itemStacks) { - if (itemStacks.size() < blockEntity.getMAX()) { - for (int i = itemStacks.size(); i < blockEntity.getMAX(); i++) - itemStacks.add(ItemStack.EMPTY); - } + private void addWorkSlot(ItemStackHandler itemStacks) { int[] X = {42, 60, 33, 51, 69, 93, 127}; int[] Y = {29, 29, 47, 47, 47, 29, 47}; for (int i = 0; i < blockEntity.getMAX(); i++) { - SlotItemHandler slot = new SlotItemHandler(inventory, i, X[i], Y[i]); - slot.set(itemStacks.get(i)); + SlotItemHandler slot = new SlotItemHandler(itemStackHandler, i, X[i], Y[i]); + slot.set(itemStacks.getStackInSlot(i)); this.addSlot(slot); } - this.addSlot(new SlotItemHandler(inventory, 5, X[5], Y[5])); - this.addSlot(new SlotItemHandler(inventory, 6, X[6], Y[6])); + this.addSlot(new SlotItemHandler(itemStackHandler, 5, X[5], Y[5])); + this.addSlot(new SlotItemHandler(itemStackHandler, 6, X[6], Y[6])); } private void layoutPlayerInventorySlots(Inventory playerInventory) { @@ -71,18 +66,6 @@ private void layoutPlayerInventorySlots(Inventory playerInventory) { } } - @Override - public void removed(Player pPlayer) { - blockEntity.getItemStacks().clear(); - for (int i = 0; i < blockEntity.getMAX(); i++) { - if (!this.getSlot(i).getItem().isEmpty()) { - blockEntity.setItem(this.getSlot(i).getItem()); - } - } - blockEntity.setChanged(); - super.removed(pPlayer); - } - @Override public ItemStack quickMoveStack(Player pPlayer, int pIndex) { ItemStack quickMovedStack = ItemStack.EMPTY; @@ -124,8 +107,8 @@ public boolean stillValid(Player pPlayer) { @Override public void fillCraftSlotsStackedContents(StackedContents pItemHelper) { - for (ItemStack itemstack : blockEntity.getItemStacks()) { - pItemHelper.accountSimpleStack(itemstack); + for (int i = 0; i < blockEntity.getMAX(); i++) { + pItemHelper.accountSimpleStack(itemStackHandler.getStackInSlot(i)); } } @@ -141,7 +124,7 @@ public void clearCraftingContent() { @Override public boolean recipeMatches(RecipeHolder pRecipe) { - return pRecipe.value().matches(new SkilletRecipeInput(getInputSlotItem(),blockEntity.getFluid(),null), this.level); + return pRecipe.value().matches(new SkilletRecipeInput(getInputSlotItem(),blockEntity.getFluid()), this.level); } @Override diff --git a/src/main/java/mczme/lingshi/client/screen/SkilletScreen.java b/src/main/java/mczme/lingshi/client/screen/SkilletScreen.java index 705a07c..474155a 100644 --- a/src/main/java/mczme/lingshi/client/screen/SkilletScreen.java +++ b/src/main/java/mczme/lingshi/client/screen/SkilletScreen.java @@ -2,6 +2,7 @@ import mczme.lingshi.client.menu.SkilletMenu; import mczme.lingshi.client.recipebook.SkilletRecipeBookComponent; +import mczme.lingshi.common.block.entity.SkilletBlockEntity; import mczme.lingshi.lingshi; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.ImageButton; @@ -63,7 +64,11 @@ public void render(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPa @Override protected void renderBg(GuiGraphics pGuiGraphics, float pPartialTick, int pMouseX, int pMouseY) { + SkilletBlockEntity blockEntity = this.menu.blockEntity; pGuiGraphics.blit(BACKGROUND_TEXTURE, this.leftPos, this.topPos, 0, 0, this.imageWidth, this.imageHeight); + if(blockEntity.isHeated(blockEntity.getLevel(),blockEntity.getBlockPos())){ + pGuiGraphics.blit(BACKGROUND_TEXTURE, this.leftPos+93, this.topPos+64, 0, 166, 14, 14); + } } @Override diff --git a/src/main/java/mczme/lingshi/common/block/SkilletBlock.java b/src/main/java/mczme/lingshi/common/block/SkilletBlock.java index 3c49bf3..6b909f1 100644 --- a/src/main/java/mczme/lingshi/common/block/SkilletBlock.java +++ b/src/main/java/mczme/lingshi/common/block/SkilletBlock.java @@ -17,6 +17,8 @@ import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.RenderShape; import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityTicker; +import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.properties.BlockStateProperties; @@ -69,7 +71,7 @@ protected InteractionResult useWithoutItem(BlockState pState, Level pLevel, Bloc if(!pLevel.isClientSide()){ pPlayer.openMenu(blockEntity,pPos); } - }else if(!blockEntity.getItemStacks().isEmpty()) { + }else if(!blockEntity.isEmpty()) { Containers.dropItemStack(pLevel, pPos.getX(), pPos.getY()+0.2, pPos.getZ(), blockEntity.dropItem()); blockEntity.setChanged(); } @@ -83,11 +85,11 @@ public BlockEntity newBlockEntity(BlockPos pPos, BlockState pState) { return new SkilletBlockEntity(pPos, pState); } -// @Nullable -// @Override -// public BlockEntityTicker getTicker(Level level, BlockState state, BlockEntityType type) { -// return type == BlockEntityTypes.SKILLET_BLOCKENTITY ? SkilletBlockEntity::tick : null; -// } + @Nullable + @Override + public BlockEntityTicker getTicker(Level pLevel, BlockState pState, BlockEntityType pType) { + return !pLevel.isClientSide ? SkilletBlockEntity::serverTick : null; + } @Override protected VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) { diff --git a/src/main/java/mczme/lingshi/common/block/entity/SkilletBlockEntity.java b/src/main/java/mczme/lingshi/common/block/entity/SkilletBlockEntity.java index 9428dc9..b9f9e7f 100644 --- a/src/main/java/mczme/lingshi/common/block/entity/SkilletBlockEntity.java +++ b/src/main/java/mczme/lingshi/common/block/entity/SkilletBlockEntity.java @@ -1,12 +1,12 @@ package mczme.lingshi.common.block.entity; import mczme.lingshi.client.menu.SkilletMenu; +import mczme.lingshi.common.block.entity.baseblockentity.ICanBeHeated; import mczme.lingshi.common.registry.BlockEntityTypes; import mczme.lingshi.lingshi; import net.minecraft.core.BlockPos; import net.minecraft.core.HolderLookup; import net.minecraft.nbt.CompoundTag; -import net.minecraft.nbt.ListTag; import net.minecraft.network.chat.Component; import net.minecraft.network.protocol.Packet; import net.minecraft.network.protocol.game.ClientGamePacketListener; @@ -23,44 +23,66 @@ import net.neoforged.neoforge.items.ItemStackHandler; import org.jetbrains.annotations.Nullable; -import java.util.ArrayList; -import java.util.List; +public class SkilletBlockEntity extends BlockEntity implements MenuProvider, ICanBeHeated { -public class SkilletBlockEntity extends BlockEntity implements MenuProvider { + private final int MAX_SLOT = 5; - private List itemStacks = new ArrayList<>(); private FluidStack fluidStacks = FluidStack.EMPTY; + private ItemStackHandler itemStackHandler = new ItemStackHandler(MAX_SLOT+2); - private final int MAX_SLOT = 5; - - private final ItemStackHandler inventory = new ItemStackHandler(MAX_SLOT + 2); public SkilletBlockEntity(BlockPos pPos, BlockState pBlockState) { super(BlockEntityTypes.SKILLET_BLOCKENTITY.get(), pPos, pBlockState); } public boolean isFull() { - return itemStacks.size() >= MAX_SLOT; + for (int i = 0; i < MAX_SLOT; i++) { + if(itemStackHandler.getStackInSlot(i).isEmpty()){ + return false; + } + } + return true; } - public ItemStack getItem(int slot) { - return itemStacks.get(slot); + public boolean isEmpty(){ + for (int i = 0; i < MAX_SLOT; i++) { + if(!itemStackHandler.getStackInSlot(i).isEmpty()){ + return false; + } + } + return fluidStacks.isEmpty(); } public ItemStack dropItem() { - return itemStacks.removeLast(); + for (int i = MAX_SLOT-1; i >=0; i--) { + if(!itemStackHandler.getStackInSlot(i).isEmpty()){ + ItemStack stack = itemStackHandler.getStackInSlot(i).copy(); + itemStackHandler.setStackInSlot(i,ItemStack.EMPTY); + return stack; + } + } + return ItemStack.EMPTY; } public FluidStack getFluid() { return fluidStacks; } - public List getItemStacks() { - return itemStacks; + public ItemStackHandler getItemStacks() { + return itemStackHandler; } public void setItem(ItemStack item) { - itemStacks.add(item); + for (int i = 0; i < MAX_SLOT; i++) { + if(itemStackHandler.getStackInSlot(i).isEmpty()){ + itemStackHandler.setStackInSlot(i,item); + break; + } + } + } + + public void setItem(ItemStack item,int slot) { + itemStackHandler.setStackInSlot(slot,item); } public void setFluid(FluidStack fluid) { @@ -71,10 +93,6 @@ public int getMAX() { return MAX_SLOT; } - public ItemStackHandler getInventory() { - return inventory; - } - @Override public Packet getUpdatePacket() { return ClientboundBlockEntityDataPacket.create(this); @@ -83,18 +101,7 @@ public Packet getUpdatePacket() { @Override public CompoundTag getUpdateTag(HolderLookup.Provider pRegistries) { CompoundTag tag = new CompoundTag(); - ListTag listtag = new ListTag(); - if (!itemStacks.isEmpty()) { - for (int i = 0; i < itemStacks.size(); i++) { - ItemStack itemstack = itemStacks.get(i); - if (!itemstack.isEmpty()) { - CompoundTag compoundtag = new CompoundTag(); - compoundtag.putByte("Slot", (byte) i); - listtag.add(itemstack.save(pRegistries, compoundtag)); - } - } - } - tag.put("skillet", listtag); + tag.put("items",itemStackHandler.serializeNBT(pRegistries)); if (!fluidStacks.isEmpty()) { tag.put("fluid", fluidStacks.save(pRegistries)); } @@ -103,14 +110,7 @@ public CompoundTag getUpdateTag(HolderLookup.Provider pRegistries) { @Override protected void loadAdditional(CompoundTag pTag, HolderLookup.Provider pRegistries) { - ListTag listtag = (ListTag) pTag.get("skillet"); - if (listtag != null) { - for (int i = 0; i < listtag.size(); i++) { - CompoundTag compoundtag = listtag.getCompound(i); - int j = compoundtag.getByte("Slot") & 255; - itemStacks.add(j, ItemStack.parse(pRegistries, compoundtag).orElse(ItemStack.EMPTY)); - } - } + itemStackHandler.deserializeNBT(pRegistries, pTag.getCompound("items")); if (pTag.get("fluid") != null) { fluidStacks = FluidStack.parse(pRegistries, pTag.getCompound("fluid")).orElse(FluidStack.EMPTY); } @@ -119,39 +119,10 @@ protected void loadAdditional(CompoundTag pTag, HolderLookup.Provider pRegistrie @Override protected void saveAdditional(CompoundTag pTag, HolderLookup.Provider pRegistries) { super.saveAdditional(pTag, pRegistries); - ListTag listtag = new ListTag(); - if (!this.itemStacks.isEmpty()) { - for (int i = 0; i < itemStacks.size(); i++) { - ItemStack itemstack = itemStacks.get(i); - if (!itemstack.isEmpty()) { - CompoundTag compoundtag = new CompoundTag(); - compoundtag.putByte("Slot", (byte) i); - listtag.add(itemstack.save(pRegistries, compoundtag)); - } - } - } + pTag.put("items",itemStackHandler.serializeNBT(pRegistries)); if (!this.fluidStacks.isEmpty()) { pTag.put("fluid", fluidStacks.save(pRegistries)); } - pTag.put("skillet", listtag); - } - - private void loadItem(CompoundTag pTag, HolderLookup.Provider pLevelRegistry) { - ListTag listtag = (ListTag) pTag.get("item"); - if (listtag != null) { - for (int i = 0; i < listtag.size(); i++) { - CompoundTag compoundtag = listtag.getCompound(i); - int j = compoundtag.getByte("Slot") & 255; - itemStacks.add(j, ItemStack.parse(pLevelRegistry, compoundtag).orElse(ItemStack.EMPTY)); - } - } else if (this.level != null && this.level.isClientSide()) { - for (int i = 0; i < pTag.size(); i++) { - itemStacks.add(i, ItemStack.parse(pLevelRegistry, pTag.getCompound("Item" + i)).orElse(ItemStack.EMPTY)); - } - } else { - itemStacks = new ArrayList<>(); - setChanged(); - } } @Override @@ -165,7 +136,12 @@ public AbstractContainerMenu createMenu(int pContainerId, Inventory pPlayerInven return new SkilletMenu(pContainerId, pPlayerInventory, this); } - public static void tick(Level level, BlockPos pos, BlockState state, SkilletBlockEntity blockEntity) { + public static void serverTick(Level pLevel, BlockPos pPos, BlockState blockState, T t) { + SkilletBlockEntity blockEntity = (SkilletBlockEntity) t; + boolean flag = blockEntity.isEmpty(); + boolean heat_flag = blockEntity.isHeated(pLevel,pPos); + int MAX_SLOT = blockEntity.MAX_SLOT; + blockEntity.setChanged(); } } diff --git a/src/main/java/mczme/lingshi/common/block/entity/baseblockentity/ICanBeHeated.java b/src/main/java/mczme/lingshi/common/block/entity/baseblockentity/ICanBeHeated.java new file mode 100644 index 0000000..460f2ef --- /dev/null +++ b/src/main/java/mczme/lingshi/common/block/entity/baseblockentity/ICanBeHeated.java @@ -0,0 +1,12 @@ +package mczme.lingshi.common.block.entity.baseblockentity; + +import mczme.lingshi.common.tag.ModTags; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.Level; + +public interface ICanBeHeated { + + default boolean isHeated(Level pLevel, BlockPos pPos){ + return pLevel.getBlockState(pPos.below()).is(ModTags.HEAT_SOURCE); + } +} diff --git a/src/main/java/mczme/lingshi/common/data/CookingFoodDataGen.java b/src/main/java/mczme/lingshi/common/data/CookingFoodDataGen.java index aa3f6c0..a9690e4 100644 --- a/src/main/java/mczme/lingshi/common/data/CookingFoodDataGen.java +++ b/src/main/java/mczme/lingshi/common/data/CookingFoodDataGen.java @@ -13,7 +13,7 @@ import java.util.concurrent.CompletableFuture; import java.util.function.Supplier; -import static mczme.lingshi.common.datamap.DataMapTypes.COOKING_FOOD; +import static mczme.lingshi.common.datamap.DataMapTypes.COOKING_FOOD_ITEM; public class CookingFoodDataGen extends DataMapProvider { @@ -27,15 +27,15 @@ protected void gather() { addCookingFood(ModItems.RICE,15,25); } - protected void addCookingFood(Item item , float cookedTime,float burntTime){ - builder(COOKING_FOOD).add(ResourceLocation.parse(item.toString()),new CookingFoodData(cookedTime,burntTime),false); + protected void addCookingFood(Item item , int cookedTime,int burntTime){ + builder(COOKING_FOOD_ITEM).add(ResourceLocation.parse(item.toString()),new CookingFoodData(cookedTime,burntTime),false); } - protected void addCookingFood(Supplier item , float cookedTime,float burntTime){ - builder(COOKING_FOOD).add(ResourceLocation.parse(item.get().toString()),new CookingFoodData(cookedTime,burntTime),false); + protected void addCookingFood(Supplier item , int cookedTime,int burntTime){ + builder(COOKING_FOOD_ITEM).add(ResourceLocation.parse(item.get().toString()),new CookingFoodData(cookedTime,burntTime),false); } - protected void addCookingFood(TagKey tag, float cookedTime,float burntTime){ - builder(COOKING_FOOD).add(tag,new CookingFoodData(cookedTime,burntTime),false); + protected void addCookingFood(TagKey tag, int cookedTime,int burntTime){ + builder(COOKING_FOOD_ITEM).add(tag,new CookingFoodData(cookedTime,burntTime),false); } } diff --git a/src/main/java/mczme/lingshi/common/datamap/DataMapTypes.java b/src/main/java/mczme/lingshi/common/datamap/DataMapTypes.java index d821c18..e45c370 100644 --- a/src/main/java/mczme/lingshi/common/datamap/DataMapTypes.java +++ b/src/main/java/mczme/lingshi/common/datamap/DataMapTypes.java @@ -5,12 +5,18 @@ import net.minecraft.core.registries.Registries; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; +import net.minecraft.world.level.material.Fluid; import net.neoforged.neoforge.registries.datamaps.DataMapType; public class DataMapTypes { - public static final DataMapType COOKING_FOOD = DataMapType.builder( + public static final DataMapType COOKING_FOOD_ITEM = DataMapType.builder( ResourceLocation.fromNamespaceAndPath(lingshi.MODID, "cooking_food"), Registries.ITEM, CookingFoodData.CODEC ).build(); + public static final DataMapType COOKING_FOOD_FLUID = DataMapType.builder( + ResourceLocation.fromNamespaceAndPath(lingshi.MODID, "cooking_food"), + Registries.FLUID, CookingFoodData.CODEC + ).build(); + } diff --git a/src/main/java/mczme/lingshi/common/datamap/ingredient/CookingFoodData.java b/src/main/java/mczme/lingshi/common/datamap/ingredient/CookingFoodData.java index a35c251..d03f7ee 100644 --- a/src/main/java/mczme/lingshi/common/datamap/ingredient/CookingFoodData.java +++ b/src/main/java/mczme/lingshi/common/datamap/ingredient/CookingFoodData.java @@ -4,10 +4,10 @@ import com.mojang.serialization.codecs.RecordCodecBuilder; -public record CookingFoodData(float cookedTime,float burntTime) { - static float MAX_TIME = 30; +public record CookingFoodData(int cookedTime,int burntTime) { + static int MAX_TIME = 30; - public CookingFoodData(float cookedTime,float burntTime){ + public CookingFoodData(int cookedTime,int burntTime){ if(cookedTime > MAX_TIME) this.cookedTime = MAX_TIME; else if(cookedTime < 0) this.cookedTime = 0; else this.cookedTime = cookedTime; @@ -15,8 +15,8 @@ public CookingFoodData(float cookedTime,float burntTime){ } public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( - Codec.FLOAT.fieldOf("cooked_time").forGetter(CookingFoodData::cookedTime), - Codec.FLOAT.fieldOf("complete_time").forGetter(CookingFoodData::burntTime) + Codec.INT.fieldOf("cooked_time").forGetter(CookingFoodData::cookedTime), + Codec.INT.fieldOf("complete_time").forGetter(CookingFoodData::burntTime) ).apply(instance, CookingFoodData::new)); } diff --git a/src/main/java/mczme/lingshi/common/event/Registry.java b/src/main/java/mczme/lingshi/common/event/Registry.java index 71ad950..62edf8d 100644 --- a/src/main/java/mczme/lingshi/common/event/Registry.java +++ b/src/main/java/mczme/lingshi/common/event/Registry.java @@ -1,15 +1,12 @@ package mczme.lingshi.common.event; -import mczme.lingshi.common.registry.BlockEntityTypes; import mczme.lingshi.lingshi; -import net.minecraft.world.level.block.entity.BlockEntityType; import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.common.EventBusSubscriber; -import net.neoforged.neoforge.capabilities.Capabilities; import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent; import net.neoforged.neoforge.registries.datamaps.RegisterDataMapTypesEvent; -import static mczme.lingshi.common.datamap.DataMapTypes.COOKING_FOOD; +import static mczme.lingshi.common.datamap.DataMapTypes.*; @EventBusSubscriber(modid = lingshi.MODID, bus = EventBusSubscriber.Bus.MOD) public class Registry { @@ -17,11 +14,13 @@ public class Registry { // data map @SubscribeEvent private static void registerDataMapTypes(RegisterDataMapTypesEvent event) { - event.register(COOKING_FOOD); + event.register(COOKING_FOOD_FLUID); + event.register(COOKING_FOOD_ITEM); } // Capabilities @SubscribeEvent private static void registerCapabilities(RegisterCapabilitiesEvent event) { - }} + } +} diff --git a/src/main/java/mczme/lingshi/common/recipe/input/SkilletRecipeInput.java b/src/main/java/mczme/lingshi/common/recipe/input/SkilletRecipeInput.java index e2927ea..a965759 100644 --- a/src/main/java/mczme/lingshi/common/recipe/input/SkilletRecipeInput.java +++ b/src/main/java/mczme/lingshi/common/recipe/input/SkilletRecipeInput.java @@ -10,12 +10,10 @@ public class SkilletRecipeInput implements RecipeInput { private final List items; private final FluidStack fluids; - private final ItemStack container; - public SkilletRecipeInput(List items, FluidStack fluid, ItemStack container) { + public SkilletRecipeInput(List items, FluidStack fluid) { this.items = items; this.fluids = fluid; - this.container = container; } @Override @@ -27,10 +25,6 @@ public FluidStack getFluid() { return this.fluids; } - public ItemStack getContainer() { - return container; - } - @Override public int size() { int i = fluids.isEmpty()?0:1; diff --git a/src/main/resources/assets/lingshi/textures/gui/container/skillet.png b/src/main/resources/assets/lingshi/textures/gui/container/skillet.png index 63c1af5..4b389d8 100644 Binary files a/src/main/resources/assets/lingshi/textures/gui/container/skillet.png and b/src/main/resources/assets/lingshi/textures/gui/container/skillet.png differ