diff --git a/src/main/java/org/hiedacamellia/mystiasizakaya/client/screen/CookingRangeUiScreen.java b/src/main/java/org/hiedacamellia/mystiasizakaya/client/screen/CookingRangeUiScreen.java index e66c45d..1f4f511 100644 --- a/src/main/java/org/hiedacamellia/mystiasizakaya/client/screen/CookingRangeUiScreen.java +++ b/src/main/java/org/hiedacamellia/mystiasizakaya/client/screen/CookingRangeUiScreen.java @@ -130,13 +130,8 @@ public void init() { MINetWork.PACKET_HANDLER.sendToServer(new CookingRangeUiButton(finalI+1, x, y, z)); CookingRangeUiButton.handleButtonAction(entity, finalI+1, pos); - }) { - @Override - public void render(GuiGraphics guiGraphics, int gx, int gy, float ticks) { - //if (slots.get(7+finalI).hasItem()) - super.render(guiGraphics, gx, gy, ticks); - } - }); + })); + selects.get(i).visible=false; } diff --git a/src/main/java/org/hiedacamellia/mystiasizakaya/client/screen/KitchenwaresUiScreen.java b/src/main/java/org/hiedacamellia/mystiasizakaya/client/screen/KitchenwaresUiScreen.java index df5e27d..268afc4 100644 --- a/src/main/java/org/hiedacamellia/mystiasizakaya/client/screen/KitchenwaresUiScreen.java +++ b/src/main/java/org/hiedacamellia/mystiasizakaya/client/screen/KitchenwaresUiScreen.java @@ -123,13 +123,8 @@ public void init() { MINetWork.PACKET_HANDLER.sendToServer(new CookingRangeUiButton(finalI+1, x, y, z)); CookingRangeUiButton.handleButtonAction(entity, finalI+1, pos); - }) { - @Override - public void render(GuiGraphics guiGraphics, int gx, int gy, float ticks) { - //if (slots.get(7+finalI).hasItem()) - super.render(guiGraphics, gx, gy, ticks); - } - }); + })); + selects.get(i).visible=false; } button_next = Button.builder(Component.translatable("gui.mystias_izakaya.cooking_range_ui.button_next"), e -> { diff --git a/src/main/java/org/hiedacamellia/mystiasizakaya/core/cooking/Main.java b/src/main/java/org/hiedacamellia/mystiasizakaya/core/cooking/Main.java index 2c43c86..b8a8548 100644 --- a/src/main/java/org/hiedacamellia/mystiasizakaya/core/cooking/Main.java +++ b/src/main/java/org/hiedacamellia/mystiasizakaya/core/cooking/Main.java @@ -69,45 +69,9 @@ public static void execute(LevelAccessor world, BlockPos pos, BlockState blockSt SetSlotItem.setEmptySlot(world, pos, 12); } else { - if (ItemStack.EMPTY == GetItemStack.getItemStack(world, pos, 4) - && !(ItemStack.EMPTY == GetItemStack.getItemStack(world, pos, 5))) { - SetSlotItem.setSlotItem(world, pos, GetItemStack.getItemStack(world, pos, 5), 4, 1); - SetSlotItem.setEmptySlot(world, pos, 5); - resetpage(world, pos); - SetSlotItem.setEmptySlot(world, pos, new int[]{7, 8, 9, 10, 11, 12}); - } - if (ItemStack.EMPTY == GetItemStack.getItemStack(world, pos, 3) - && !(ItemStack.EMPTY == GetItemStack.getItemStack(world, pos, 4))) { - SetSlotItem.setSlotItem(world, pos, GetItemStack.getItemStack(world, pos, 4), 3, 1); - SetSlotItem.setEmptySlot(world, pos, 4); - resetpage(world, pos); - SetSlotItem.setEmptySlot(world, pos, new int[]{7, 8, 9, 10, 11, 12}); - } - if (ItemStack.EMPTY == GetItemStack.getItemStack(world, pos, 2) - && !(ItemStack.EMPTY == GetItemStack.getItemStack(world, pos, 3))) { - SetSlotItem.setSlotItem(world, pos, GetItemStack.getItemStack(world, pos, 3), 2, 1); - SetSlotItem.setEmptySlot(world, pos, 3); - resetpage(world, pos); - SetSlotItem.setEmptySlot(world, pos, new int[]{7, 8, 9, 10, 11, 12}); - } - if (ItemStack.EMPTY == GetItemStack.getItemStack(world, pos, 1) - && !(ItemStack.EMPTY == GetItemStack.getItemStack(world, pos, 2))) { - SetSlotItem.setSlotItem(world, pos, GetItemStack.getItemStack(world, pos, 2), 1, 1); - SetSlotItem.setEmptySlot(world, pos, 2); - resetpage(world, pos); - SetSlotItem.setEmptySlot(world, pos, new int[]{7, 8, 9, 10, 11, 12}); - } - - if (ItemStack.EMPTY == GetItemStack.getItemStack(world, pos, 1)) { - SetSlotItem.setEmptySlot(world, pos, new int[]{7, 8, 9, 10, 11, 12}); - } util = GetItemStack.getItemStack(world, pos, 0); -// Debug.send(GetItemStack.getItemStack(world, pos, 1).getDescriptionId()); -// Debug.send(GetItemStack.getItemStack(world, pos, 2).getDescriptionId()); -// Debug.send(GetItemStack.getItemStack(world, pos, 3).getDescriptionId()); -// Debug.send(GetItemStack.getItemStack(world, pos, 4).getDescriptionId()); -// Debug.send(GetItemStack.getItemStack(world, pos, 5).getDescriptionId()); + if (util == ItemStack.EMPTY) { Block utilblcok = world.getBlockState(pos).getBlock(); diff --git a/src/main/java/org/hiedacamellia/mystiasizakaya/core/network/CookingRangeUiButton.java b/src/main/java/org/hiedacamellia/mystiasizakaya/core/network/CookingRangeUiButton.java index d88a5c1..b646257 100644 --- a/src/main/java/org/hiedacamellia/mystiasizakaya/core/network/CookingRangeUiButton.java +++ b/src/main/java/org/hiedacamellia/mystiasizakaya/core/network/CookingRangeUiButton.java @@ -17,6 +17,7 @@ import org.hiedacamellia.mystiasizakaya.content.common.block.entities.KitchenwaresEntity; import org.hiedacamellia.mystiasizakaya.content.inventory.CookingRangeUiMenu; import org.hiedacamellia.mystiasizakaya.core.cooking.Confirm; +import org.hiedacamellia.mystiasizakaya.core.debug.Debug; import org.hiedacamellia.mystiasizakaya.util.SelectTarget; import org.hiedacamellia.mystiasizakaya.util.cross.Pos; @@ -47,10 +48,8 @@ public static CookingRangeUiButton decode(FriendlyByteBuf buffer) { public static void handleButtonAction(Player entity, int buttonID, BlockPos pos) { Level world = entity.level(); - HashMap guistate = CookingRangeUiMenu.guistate; - // security measure to prevent arbitrary chunk generation - if (!world.hasChunkAt(pos)) - return; + Debug.getLogger().debug("Button{}",buttonID); + if (buttonID == 0) { Confirm.execute(world, pos); diff --git a/src/main/resources/assets/mystias_izakaya/models/block/cooking_range.json b/src/main/resources/assets/mystias_izakaya/models/block/cooking_range.json index b87136d..55e0f3c 100644 --- a/src/main/resources/assets/mystias_izakaya/models/block/cooking_range.json +++ b/src/main/resources/assets/mystias_izakaya/models/block/cooking_range.json @@ -1,6 +1,5 @@ { - "parent": "block/cube", "texture_size": [64, 64], "textures": { "0": "mystias_izakaya:block/cookingrange", diff --git a/src/main/resources/assets/mystias_izakaya/models/block/donation.json b/src/main/resources/assets/mystias_izakaya/models/block/donation.json index d65aab3..89eb6c5 100644 --- a/src/main/resources/assets/mystias_izakaya/models/block/donation.json +++ b/src/main/resources/assets/mystias_izakaya/models/block/donation.json @@ -1,5 +1,4 @@ { - "parent": "block/cube", "texture_size": [64, 64], "textures": { "0": "mystias_izakaya:block/donation",