diff --git a/gradle.properties b/gradle.properties index b1dfe88..230647f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ minecraft_version=1.20.1 yarn_mappings=1.20.1+build.10 loader_version=0.18.3 # Mod Properties -mod_version=26.3.8 +mod_version=26.3.9 maven_group=dev.tggamesyt archives_base_name=szar # Dependencies diff --git a/src/client/java/dev/tggamesyt/szar/client/RouletteScreen.java b/src/client/java/dev/tggamesyt/szar/client/RouletteScreen.java index fb6877a..fc2696d 100644 --- a/src/client/java/dev/tggamesyt/szar/client/RouletteScreen.java +++ b/src/client/java/dev/tggamesyt/szar/client/RouletteScreen.java @@ -64,7 +64,7 @@ public class RouletteScreen extends HandledScreen { this.handler = handler; this.blockEntity = handler.blockEntity; this.backgroundWidth = 326; - this.backgroundHeight = 194; + this.backgroundHeight = 240; this.inventory = inventory; } @@ -217,17 +217,17 @@ public class RouletteScreen extends HandledScreen { int guiLeft = (width - backgroundWidth) / 2; int guiTop = (height - backgroundHeight) / 2; context.drawText(textRenderer, Text.literal(spinString), - guiLeft + 190, guiTop + 115, 0x373737, false); + guiLeft + 190, guiTop + 115, 0x404040, false); } protected void drawWheel(DrawContext context) { int cx = ((width - backgroundWidth) / 2) + 255; - int cy = ((height - backgroundHeight) / 2) + 155; + int cy = ((height - backgroundHeight) / 2) + 180; Identifier wheelTex = new Identifier(Szar.MOD_ID, "textures/gui/roulette_wheel.png"); Identifier ballTex = new Identifier(Szar.MOD_ID, "textures/gui/roulette_ball.png"); - int imgWidth = 64; - int imgHeight = 64; + int imgWidth = 128; + int imgHeight = 128; context.getMatrices().push(); context.getMatrices().translate(cx, cy, 0); @@ -263,6 +263,14 @@ public class RouletteScreen extends HandledScreen { return super.mouseClicked(mouseX, mouseY, button); } + @Override + protected void drawForeground(DrawContext context, int mouseX, int mouseY) { + // Draw title (top left) + context.drawText(textRenderer, title, titleX, titleY, 0x404040, false); + // Draw "Inventory" label — move it down by changing the Y + context.drawText(textRenderer, playerInventoryTitle, playerInventoryTitleX, playerInventoryTitleY + 73, 0x404040, false); + } + @Override public void removed() { super.removed(); diff --git a/src/main/java/dev/tggamesyt/szar/RouletteBlockEntity.java b/src/main/java/dev/tggamesyt/szar/RouletteBlockEntity.java index 28fca7d..c007852 100644 --- a/src/main/java/dev/tggamesyt/szar/RouletteBlockEntity.java +++ b/src/main/java/dev/tggamesyt/szar/RouletteBlockEntity.java @@ -40,9 +40,9 @@ public class RouletteBlockEntity extends BlockEntity { "red", "black", "red", "black", "red", // 1-5 "black", "red", "black", "red", "black",// 6-10 "black", "red", "black", "red", "black",// 11-15 - "red", "black", "red", "black", "black",// 16-20 + "red", "black", "red", "red", "black",// 16-20 "red", "black", "red", "black", "red", // 21-25 - "black", "red", "red", "black", "red", // 26-30 + "black", "red", "black", "black", "red", // 26-30 "black", "red", "black", "red", "black",// 31-35 "red" // 36 }; diff --git a/src/main/java/dev/tggamesyt/szar/RouletteScreenHandler.java b/src/main/java/dev/tggamesyt/szar/RouletteScreenHandler.java index f039a78..36b4608 100644 --- a/src/main/java/dev/tggamesyt/szar/RouletteScreenHandler.java +++ b/src/main/java/dev/tggamesyt/szar/RouletteScreenHandler.java @@ -13,8 +13,8 @@ public class RouletteScreenHandler extends ScreenHandler { public final RouletteBlockEntity blockEntity; public static final int SLOT_SIZE = 18; - public static final int GRID_START_X = 60; - public static final int GRID_START_Y = 8; + public static final int GRID_START_X = 50; + public static final int GRID_START_Y = 7; private static int gx(int col) { return GRID_START_X + (col - 1) * SLOT_SIZE; } private static int gy(int row) { return GRID_START_Y + (row - 1) * SLOT_SIZE; } @@ -87,7 +87,7 @@ public class RouletteScreenHandler extends ScreenHandler { this.addSlot(new BetSlot(inv.thirds, 2, gx(14), gy(3))); // === Player inventory === - int playerInvY = GRID_START_Y + 5 * SLOT_SIZE + 14; + int playerInvY = GRID_START_Y + 5 * SLOT_SIZE + 60; for (int y = 0; y < 3; y++) for (int x = 0; x < 9; x++) this.addSlot(new Slot(playerInv, x + y * 9 + 9, 8 + x * 18, playerInvY + y * 18)); diff --git a/src/main/java/dev/tggamesyt/szar/Szar.java b/src/main/java/dev/tggamesyt/szar/Szar.java index c16f806..73f340c 100644 --- a/src/main/java/dev/tggamesyt/szar/Szar.java +++ b/src/main/java/dev/tggamesyt/szar/Szar.java @@ -876,8 +876,8 @@ public class Szar implements ModInitializer { Registries.BLOCK, new Identifier(MOD_ID, "roulette"), new RouletteBlock( - AbstractBlock.Settings - .copy(Blocks.IRON_BLOCK) + FabricBlockSettings.create() + .strength(2.0f, 3.0f) ) ); public static final BlockEntityType ROULETTE_BLOCKENTITY = Registry.register( @@ -1001,8 +1001,8 @@ public class Szar implements ModInitializer { Registries.BLOCK, new Identifier(MOD_ID, "slot_machine"), new SlotMachineBlock( - AbstractBlock.Settings - .copy(Blocks.IRON_BLOCK) + FabricBlockSettings.create() + .strength(2.0f, 3.0f) ) ); public static final BlockEntityType SLOT_MACHINE_BLOCKENTITY = Registry.register( diff --git a/src/main/resources/assets/szar/textures/gui/roulette.png b/src/main/resources/assets/szar/textures/gui/roulette.png index bb27ed9..c0debe3 100644 Binary files a/src/main/resources/assets/szar/textures/gui/roulette.png and b/src/main/resources/assets/szar/textures/gui/roulette.png differ diff --git a/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json b/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json new file mode 100644 index 0000000..a2e547b --- /dev/null +++ b/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json @@ -0,0 +1,6 @@ +{ + "values": [ + "szar:roulette", + "szar:slot_machine" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/szar/loot_tables/blocks/roulette.json b/src/main/resources/data/szar/loot_tables/blocks/roulette.json new file mode 100644 index 0000000..ffb091e --- /dev/null +++ b/src/main/resources/data/szar/loot_tables/blocks/roulette.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "szar:roulette" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/szar/loot_tables/blocks/slot_machine.json b/src/main/resources/data/szar/loot_tables/blocks/slot_machine.json new file mode 100644 index 0000000..aa23504 --- /dev/null +++ b/src/main/resources/data/szar/loot_tables/blocks/slot_machine.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "szar:slot_machine" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/szar/recipes/roulette.json b/src/main/resources/data/szar/recipes/roulette.json new file mode 100644 index 0000000..bda2ae6 --- /dev/null +++ b/src/main/resources/data/szar/recipes/roulette.json @@ -0,0 +1,29 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "BGR", + "WSW", + " W " + ], + "key": { + "R": { + "item": "minecraft:red_wool" + }, + "B": { + "item": "minecraft:black_wool" + }, + "G": { + "item": "minecraft:lime_wool" + }, + "S": { + "item": "minecraft:redstone_block" + }, + "W": { + "tag": "minecraft:logs" + } + }, + "result": { + "item": "szar:roulette", + "count": 1 + } +} diff --git a/src/main/resources/data/szar/recipes/slot_machine.json b/src/main/resources/data/szar/recipes/slot_machine.json new file mode 100644 index 0000000..2164bdb --- /dev/null +++ b/src/main/resources/data/szar/recipes/slot_machine.json @@ -0,0 +1,26 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "WRW", + "SSL", + "WRW" + ], + "key": { + "R": { + "item": "minecraft:redstone_block" + }, + "L": { + "item": "minecraft:lever" + }, + "S": { + "tag": "szar:lucky_items" + }, + "W": { + "item": "minecraft:red_wool" + } + }, + "result": { + "item": "szar:slot_machine", + "count": 1 + } +} diff --git a/src/main/resources/data/szar/tags/items/lucky_items.json b/src/main/resources/data/szar/tags/items/lucky_items.json new file mode 100644 index 0000000..bd7bf60 --- /dev/null +++ b/src/main/resources/data/szar/tags/items/lucky_items.json @@ -0,0 +1,14 @@ +{ + "values": [ + "minecraft:deepslate_emerald_ore", + "minecraft:bell", + "minecraft:apple", + "minecraft:sweet_berries", + "minecraft:glow_berries", + "minecraft:melon_slice", + "minecraft:chorus_fruit", + "minecraft:golden_apple", + "minecraft:enchanted_golden_apple", + "minecraft:rabbit_foot" + ] +} \ No newline at end of file