-
Notifications
You must be signed in to change notification settings - Fork 0
initial files for furnace block #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
05ca78e
ff15221
e5f7ae5
32cd980
152d88d
50d3a52
7a67138
9d46031
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,17 @@ | ||
| package com.tcm.MineTale; | ||
|
|
||
| import com.tcm.MineTale.block.workbenches.screen.FurnaceWorkbenchScreen; | ||
| import com.tcm.MineTale.registry.ModMenuTypes; | ||
|
|
||
| import net.fabricmc.api.ClientModInitializer; | ||
| import net.minecraft.client.gui.screens.MenuScreens; | ||
|
|
||
| public class MineTaleClient implements ClientModInitializer { | ||
| /** | ||
| * Registers the screen factory for the furnace workbench menu so the client can create FurnaceWorkbenchScreen instances for that menu type. | ||
| */ | ||
| @Override | ||
| public void onInitializeClient() { | ||
| // This entrypoint is suitable for setting up client-specific logic, such as rendering. | ||
| MenuScreens.register(ModMenuTypes.FURNACE_WORKBENCH_MENU, FurnaceWorkbenchScreen::new); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| package com.tcm.MineTale.block.workbenches.screen; | ||
|
|
||
| import com.tcm.MineTale.block.workbenches.menu.FurnaceWorkbenchMenu; | ||
|
|
||
| import net.minecraft.client.gui.GuiGraphics; | ||
| import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; | ||
| import net.minecraft.client.renderer.RenderPipelines; | ||
| import net.minecraft.resources.Identifier; | ||
| import net.minecraft.world.entity.player.Inventory; | ||
| import net.minecraft.network.chat.Component; | ||
|
|
||
| public class FurnaceWorkbenchScreen extends AbstractContainerScreen<FurnaceWorkbenchMenu> { | ||
| private static final Identifier TEXTURE = | ||
| // Identifier.fromNamespaceAndPath(MineTale.MOD_ID, "textures/gui/container/furnace_workbench.png"); | ||
| Identifier.withDefaultNamespace("textures/gui/container/furnace.png"); | ||
|
Comment on lines
+3
to
+15
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Find the FurnaceWorkbenchScreen file
find . -name "FurnaceWorkbenchScreen.java" -type fRepository: CodeMonkeysMods/MineTale Length of output: 155 🏁 Script executed: #!/bin/bash
# Search for furnace_workbench texture asset
find . -name "*furnace_workbench*" -type f 2>/dev/nullRepository: CodeMonkeysMods/MineTale Length of output: 50 🏁 Script executed: #!/bin/bash
# Search for MineTale class with MOD_ID constant
find . -name "MineTale.java" -type fRepository: CodeMonkeysMods/MineTale Length of output: 114 🏁 Script executed: #!/bin/bash
# Look at the FurnaceWorkbenchMenu to verify the layout
find . -name "FurnaceWorkbenchMenu.java" -type fRepository: CodeMonkeysMods/MineTale Length of output: 149 🏁 Script executed: #!/bin/bash
cat -n ./src/client/java/com/tcm/MineTale/block/workbenches/screen/FurnaceWorkbenchScreen.javaRepository: CodeMonkeysMods/MineTale Length of output: 1937 🏁 Script executed: #!/bin/bash
cat -n ./src/main/java/com/tcm/MineTale/block/workbenches/menu/FurnaceWorkbenchMenu.javaRepository: CodeMonkeysMods/MineTale Length of output: 6355 🏁 Script executed: #!/bin/bash
cat -n ./src/main/java/com/tcm/MineTale/MineTale.java | head -50Repository: CodeMonkeysMods/MineTale Length of output: 1384 🏁 Script executed: #!/bin/bash
# Double-check for texture assets in the correct asset directory structure
find . -path "*/assets/*/textures/gui/container/*furnace*" -type f 2>/dev/nullRepository: CodeMonkeysMods/MineTale Length of output: 50 Custom GUI texture asset must be created to match the 2x2 output slot layout. The menu defines a 2x2 output grid (slots at coordinates 116/134 × 21/39), but the vanilla furnace texture only has a single output slot. Either create the custom texture asset at 🤖 Prompt for AI Agents |
||
|
|
||
| /** | ||
| * Creates a new furnace workbench screen for the given menu, player inventory, and title. | ||
| * | ||
| * @param menu the container menu that provides slots and syncs state for this screen | ||
| * @param inventory the player's inventory to display and interact with | ||
| * @param title the title component shown at the top of the screen | ||
| */ | ||
| public FurnaceWorkbenchScreen(FurnaceWorkbenchMenu menu, Inventory inventory, Component title) { | ||
| super(menu, inventory, title); | ||
| } | ||
|
|
||
| /** | ||
| * Initializes the screen and centers the title horizontally by setting {@code titleLabelX}. | ||
| */ | ||
| @Override | ||
| protected void init() { | ||
| super.init(); | ||
| this.titleLabelX = (this.imageWidth - this.font.width(this.title)) / 2; | ||
| } | ||
|
|
||
| /** | ||
| * Draws the furnace workbench background texture onto the screen. | ||
| * | ||
| * @param guiGraphics the graphics context used for drawing | ||
| * @param f partial tick time used for interpolation | ||
| * @param i current mouse x position | ||
| * @param j current mouse y position | ||
| */ | ||
| protected void renderBg(GuiGraphics guiGraphics, float f, int i, int j) { | ||
| int k = this.leftPos; | ||
| int l = this.topPos; | ||
| guiGraphics.blit(RenderPipelines.GUI_TEXTURED, TEXTURE, k, l, 0.0F, 0.0F, this.imageWidth, this.imageHeight, 256, 256); | ||
| } | ||
|
|
||
| /** | ||
| * Renders the furnace workbench screen, drawing its background, contents, and tooltips. | ||
| * | ||
| * @param graphics the graphics context used for rendering | ||
| * @param mouseX the current mouse X coordinate | ||
| * @param mouseY the current mouse Y coordinate | ||
| * @param delta the frame time delta (partial tick) used for animated rendering | ||
| */ | ||
| @Override | ||
| public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) { | ||
| renderBackground(graphics, mouseX, mouseY, delta); | ||
| super.render(graphics, mouseX, mouseY, delta); | ||
| renderTooltip(graphics, mouseX, mouseY); | ||
| } | ||
|
Comment on lines
+1
to
+64
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: fd 'FurnaceWorkbenchScreen.java'Repository: CodeMonkeysMods/MineTale Length of output: 151 🏁 Script executed: rg -n --type=java 'FurnaceWorkbenchScreen' -C2Repository: CodeMonkeysMods/MineTale Length of output: 2288 🏁 Script executed: # Also check for source set configuration files
fd -e 'gradle' -e 'pom.xml' | head -20Repository: CodeMonkeysMods/MineTale Length of output: 96 🏁 Script executed: cat build.gradleRepository: CodeMonkeysMods/MineTale Length of output: 2416 🏁 Script executed: # Check if there are any other references to FurnaceWorkbenchScreen outside client code
rg 'FurnaceWorkbenchScreen' --type=java -lRepository: CodeMonkeysMods/MineTale Length of output: 204 Move client-only screen to src/client/java (architectural violation with split source sets).
🧰 Tools🪛 GitHub Actions: build[error] 1-39: Compilation failed due to missing Minecraft GUI classes and unresolved symbols. Errors include: cannot find symbol for net.minecraft.client.gui.GuiGraphics, net.minecraft.client.gui.screens.inventory.AbstractContainerScreen, net.minecraft.client.renderer.RenderPipelines, and many dependent members (e.g., GuiGraphics, AbstractContainerScreen, RenderPipelines, title/width/font fields). This indicates missing or incompatible Minecraft/LibGraft/Mixin APIs in the project setup. 🤖 Prompt for AI Agents |
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: CodeMonkeysMods/MineTale
Length of output: 919
Consider replacing
loom_version=1.15-SNAPSHOTwith a stable release.All versions are available in Maven repositories:
loader_version=0.18.4✓fabric_api_version=0.141.2+1.21.11✓loom_version=1.15-SNAPSHOTexists, but stable versions 1.15.1, 1.15.2, and 1.15.3 are also availableUsing the SNAPSHOT version introduces build instability unnecessarily when stable releases are available. Pin to
1.15.3(or the latest stable release appropriate for your build).🤖 Prompt for AI Agents