smol ahh
This commit is contained in:
@@ -32,6 +32,7 @@ public class SlotMachineBlockEntity extends BlockEntity {
|
||||
|
||||
private final Random random = new Random();
|
||||
|
||||
final SimpleInventory betInventory = new SimpleInventory(1);
|
||||
public final int[] currentSymbol = new int[3];
|
||||
public final int[] finalSymbol = new int[3];
|
||||
public static final int TOTAL_SYMBOLS = 7;
|
||||
@@ -209,7 +210,7 @@ public class SlotMachineBlockEntity extends BlockEntity {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean onButtonClicked(PlayerEntity player, SlotMachineBlockEntity blockEntity, SimpleInventory betInventory) {
|
||||
public boolean onButtonClicked(PlayerEntity player, SlotMachineBlockEntity blockEntity) {
|
||||
blockEntity.setHandleClicked(true, player);
|
||||
ItemStack bet = betInventory.getStack(0);
|
||||
if (bet.isEmpty()) return false;
|
||||
|
||||
@@ -19,9 +19,6 @@ public class SlotMachineScreenHandler extends ScreenHandler {
|
||||
|
||||
|
||||
public final SlotMachineBlockEntity blockEntity;
|
||||
private final SimpleInventory betInventory = new SimpleInventory(1);
|
||||
|
||||
private final Random random = new Random();
|
||||
|
||||
public SlotMachineScreenHandler(int syncId, PlayerInventory playerInv, SlotMachineBlockEntity blockEntity) {
|
||||
super(Szar.SLOT_MACHINE_SCREEN_HANDLER_TYPE, syncId);
|
||||
@@ -31,7 +28,7 @@ public class SlotMachineScreenHandler extends ScreenHandler {
|
||||
this.addProperties(blockEntity.propertyDelegate);
|
||||
|
||||
// Bet slot
|
||||
this.addSlot(new Slot(betInventory, 0, 44, 35));
|
||||
this.addSlot(new Slot(blockEntity.betInventory, 0, 44, 35));
|
||||
|
||||
// Player inventory slots
|
||||
for (int y = 0; y < 3; y++)
|
||||
@@ -44,7 +41,7 @@ public class SlotMachineScreenHandler extends ScreenHandler {
|
||||
@Override
|
||||
public boolean onButtonClick(PlayerEntity player, int id) {
|
||||
if (id != 0 || blockEntity.getSpinning()) return false;
|
||||
return blockEntity.onButtonClicked(player, blockEntity, betInventory);
|
||||
return blockEntity.onButtonClicked(player, blockEntity);
|
||||
}
|
||||
/*
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user