Skip to content

Commit 8568d46

Browse files
Merge pull request #58 from CodeMonkeysMods/Blacksmith-an-stuff
Added Wood Armor and The Blacksmith's Workbench
2 parents 3e92b59 + 324e8dc commit 8568d46

36 files changed

Lines changed: 2581 additions & 481 deletions

src/client/java/com/tcm/MineTale/MineTaleClient.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
package com.tcm.MineTale;
22

3-
import com.tcm.MineTale.block.workbenches.screen.FurnaceWorkbenchScreen;
4-
import com.tcm.MineTale.block.workbenches.screen.WorkbenchWorkbenchScreen;
3+
import com.tcm.MineTale.block.workbenches.menu.BlacksmithsWorkbenchMenu;
4+
import com.tcm.MineTale.block.workbenches.screen.*;
55
import com.tcm.MineTale.network.ClientboundNearbyInventorySyncPacket;
66

77
import java.util.List;
88

99
import com.tcm.MineTale.block.workbenches.menu.AbstractWorkbenchContainerMenu;
10-
import com.tcm.MineTale.block.workbenches.screen.ArmorersWorkbenchScreen;
11-
import com.tcm.MineTale.block.workbenches.screen.BuildersWorkbenchScreen;
12-
import com.tcm.MineTale.block.workbenches.screen.CampfireWorkbenchScreen;
13-
import com.tcm.MineTale.block.workbenches.screen.FarmersWorkbenchScreen;
1410
import com.tcm.MineTale.registry.ModBlocks;
1511
import com.tcm.MineTale.registry.ModMenuTypes;
1612

@@ -43,6 +39,8 @@ public void onInitializeClient() {
4339
MenuScreens.register(ModMenuTypes.ARMORERS_WORKBENCH_MENU, ArmorersWorkbenchScreen::new);
4440
MenuScreens.register(ModMenuTypes.FARMERS_WORKBENCH_MENU, FarmersWorkbenchScreen::new);
4541
MenuScreens.register(ModMenuTypes.BUILDERS_WORKBENCH_MENU, BuildersWorkbenchScreen::new);
42+
MenuScreens.register(ModMenuTypes.BLACKSMITHS_WORKBENCH_MENU, BlacksmithsWorkbenchScreen::new);
43+
MenuScreens.register(ModMenuTypes.FURNITURE_WORKBENCH_MENU, FurnitureWorkbenchScreen::new);
4644

4745
BlockRenderLayerMap.putBlock(ModBlocks.FURNACE_WORKBENCH_BLOCK_T1, ChunkSectionLayer.CUTOUT);
4846
BlockRenderLayerMap.putBlock(ModBlocks.FURNACE_WORKBENCH_BLOCK_T2, ChunkSectionLayer.CUTOUT);

src/client/java/com/tcm/MineTale/MineTaleDataGen.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
public class MineTaleDataGen implements DataGeneratorEntrypoint {
99

1010
/**
11-
* Initialize a data pack and register the mod's data providers for data generation.
11+
* Initialises the data pack and registers the mod's data providers for data generation.
1212
*
13-
* Registers language, model, recipe, block tag, and loot table providers so they
14-
* will run as part of the Fabric data generation pack created from the given generator.
13+
* Registers language, model, recipe, block tag, item tag and loot table providers
14+
* so they run as part of the Fabric data generation pack created from the provided generator.
1515
*
1616
* @param fabricDataGenerator the Fabric data generator used to create the data pack
1717
*/
@@ -23,6 +23,7 @@ public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) {
2323
pack.addProvider(ModModelProvider::new);
2424
pack.addProvider(ModRecipeProvider::new);
2525
pack.addProvider(ModBlockTagProvider::new);
26+
pack.addProvider(ModItemTagProvider::new);
2627
pack.addProvider(ModLootTableProvider::new);
2728
}
2829
}

src/client/java/com/tcm/MineTale/block/workbenches/screen/ArmorersWorkbenchScreen.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,12 @@ private static MineTaleRecipeBookComponent createRecipeBookComponent(ArmorersWor
8888
}
8989

9090
/**
91-
* Initialises the screen size and adds the three crafting buttons.
91+
* Initialises the screen size and creates three crafting buttons.
9292
*
93-
* Sets the GUI image dimensions, delegates further initialisation to the superclass,
94-
* and creates/registers three buttons wired to craft one, ten or all items
95-
* (they invoke handleCraftRequest with 1, 10 and -1 respectively; -1 signifies "All").
93+
* Sets the GUI image dimensions, performs superclass initialisation, and adds
94+
* three buttons that request crafting of 1, 10 or all items. Each button calls
95+
* {@code handleCraftRequest} with arguments 1, 10 and -1 respectively; -1
96+
* signifies "craft all".
9697
*/
9798
@Override
9899
protected void init() {
@@ -105,15 +106,15 @@ protected void init() {
105106
int defaultLeft = this.leftPos + 90;
106107
int defaultTop = this.topPos + 25;
107108

108-
this.craftOneBtn = addRenderableWidget(Button.builder(Component.literal("Craft"), (button) -> {
109+
this.craftOneBtn = addRenderableWidget(Button.builder(Component.translatable("gui.minetale.craftbtn"), (button) -> {
109110
handleCraftRequest(1);
110111
}).bounds(defaultLeft, defaultTop, 75, 20).build());
111112

112113
this.craftTenBtn = addRenderableWidget(Button.builder(Component.literal("x10"), (button) -> {
113114
handleCraftRequest(10);
114115
}).bounds(defaultLeft, defaultTop + 22, 35, 20).build());
115116

116-
this.craftAllBtn = addRenderableWidget(Button.builder(Component.literal("All"), (button) -> {
117+
this.craftAllBtn = addRenderableWidget(Button.builder(Component.translatable("gui.minetale.allbtn"), (button) -> {
117118
handleCraftRequest(-1); // -1 represents "All" logic
118119
}).bounds(defaultLeft + 40, defaultTop + 22, 35, 20).build());
119120
}

0 commit comments

Comments
 (0)