Skip to content

Commit

Permalink
。。。
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuqi154 committed Oct 17, 2024
1 parent d8d03f2 commit a6d425b
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

{
"parent": "block/cube",
"texture_size": [64, 64],
"textures": {
"0": "mystias_izakaya:block/cookingrange",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"parent": "block/cube",
"texture_size": [64, 64],
"textures": {
"0": "mystias_izakaya:block/donation",
Expand Down

0 comments on commit a6d425b

Please sign in to comment.