-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
efba8f1
commit 35c2fb5
Showing
7 changed files
with
46 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/generated/.cache/89b86ab0e66f527166d98df92ddbcf5416ed58f6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
// 1.19.2 2024-04-21T20:00:12.9330783 Language | ||
// 1.19.2 2024-04-22T20:37:07.5325428 Language | ||
186c3f9c9fe92b38b1958905153cee3079c2fa03 assets\the_origin_of_magic\lang\en_us.json |
2 changes: 1 addition & 1 deletion
2
src/main/generated/.cache/dc1d6e7286e7569a79007c10f809d49635ea1c49
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
// 1.19.2 2024-04-21T20:00:12.9355771 Block Loot Tables | ||
// 1.19.2 2024-04-22T20:37:07.5345493 Block Loot Tables | ||
fe57f13449a11436bbede8c37e01bd0d1cd87191 data\the_origin_of_magic\loot_tables\blocks\magic_workbench.json |
2 changes: 1 addition & 1 deletion
2
src/main/generated/.cache/f3798f81c7b6fecad2cbfec741314f8a66c0eca3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 18 additions & 15 deletions
33
...com/ictye/the_origin_of_magic/infrastructure/GUI/MagicWorkbench/MagicWorkbenchScreen.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,66 @@ | ||
package com.ictye.the_origin_of_magic.infrastructure.GUI.MagicWorkbench; | ||
|
||
import com.mojang.blaze3d.systems.RenderSystem; | ||
import net.minecraft.client.gui.Element; | ||
import net.minecraft.client.gui.screen.ingame.HandledScreen; | ||
import net.minecraft.client.render.GameRenderer; | ||
import net.minecraft.client.util.math.MatrixStack; | ||
import net.minecraft.entity.player.PlayerInventory; | ||
import net.minecraft.screen.ScreenHandler; | ||
import net.minecraft.screen.slot.Slot; | ||
import net.minecraft.text.Text; | ||
import net.minecraft.util.Identifier; | ||
|
||
import java.util.Optional; | ||
|
||
public class MagicWorkbenchScreen extends HandledScreen<ScreenHandler> { | ||
|
||
private static Text STAFFNAME = Text.empty(); | ||
private static final Identifier TEXTURE = new Identifier("the_origin_of_magic","textures/gui/magic_workbench.png"); | ||
|
||
public MagicWorkbenchScreen(ScreenHandler handler, PlayerInventory inventory, Text title) { | ||
super(handler, inventory, title); | ||
backgroundHeight = 204; | ||
backgroundWidth = 176; | ||
this.playerInventoryTitleY = this.backgroundHeight - 94; | ||
} | ||
|
||
public static void setSTAFFNAME(Text STAFFNAME) { | ||
MagicWorkbenchScreen.STAFFNAME = STAFFNAME; | ||
} | ||
|
||
|
||
|
||
@Override | ||
protected void drawBackground(MatrixStack matrices, float delta, int mouseX, int mouseY) { | ||
RenderSystem.setShader(GameRenderer::getPositionTexShader); | ||
RenderSystem.setShaderColor(1.0F,1.0F,1.0F,1.0F); | ||
RenderSystem.setShaderTexture(0,TEXTURE); | ||
int x = (width - backgroundWidth) / 2; | ||
int y = (height - backgroundHeight) / 2; | ||
drawTexture(matrices,x,y - 2 ,0,0,backgroundWidth,backgroundHeight); | ||
} | ||
drawTexture(matrices,this.x, this.y,354,0,backgroundWidth,backgroundHeight,550,550); | ||
for (int k = 0; k < this.handler.slots.size(); ++k){ | ||
if (!this.handler.slots.get(k).isEnabled()){ | ||
Slot slot = this.handler.slots.get(k); | ||
int slotX = this.x + slot.x - 1; | ||
int slotY = this.y + slot.y - 1; | ||
drawTexture(matrices,slotX,slotY,0,170,18,18,550,550); | ||
} | ||
} | ||
|
||
@Override | ||
public Optional<Element> hoveredElement(double mouseX, double mouseY) { | ||
return super.hoveredElement(mouseX, mouseY); | ||
} | ||
|
||
@Override | ||
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) { | ||
renderBackground(matrices); | ||
super.render(matrices, mouseX, mouseY, delta); | ||
drawMouseoverTooltip(matrices, mouseX, mouseY); | ||
textRenderer.draw(matrices,Text.translatable("text.the_origin_of_magic.magic_work_station.staff_state"),x + 45,y - 2 + 20, 0x3F3F3F); | ||
textRenderer. draw(matrices,STAFFNAME,x + 45,y - 2 + 29, 0x3F3F3F); | ||
} | ||
|
||
@Override | ||
protected void handledScreenTick() { | ||
super.handledScreenTick(); | ||
textRenderer.draw(matrices,Text.translatable("text.the_origin_of_magic.magic_work_station.staff_state"),x + 51,y + 18, 0x3F3F3F); | ||
textRenderer. draw(matrices,STAFFNAME,x + 51 + 2,y + 18 + 9, 0x3F3F3F); | ||
} | ||
|
||
@Override | ||
protected void init() { | ||
super.init(); | ||
// 将标题居中 | ||
titleX = (backgroundWidth - textRenderer.getWidth(title)) / 2; | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+2.07 KB
(330%)
src/main/resources/assets/the_origin_of_magic/textures/gui/magic_workbench.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.