-
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.
Some UI testing and basic item implementation
- Loading branch information
Showing
8 changed files
with
104 additions
and
3 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
32 changes: 32 additions & 0 deletions
32
src/main/java/com/fureniku/metropolis/client/screens/UIRenderHandler.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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.fureniku.metropolis.client.screens; | ||
|
||
import com.fureniku.metropolis.utils.Debug; | ||
import com.mojang.blaze3d.systems.RenderSystem; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.GuiGraphics; | ||
import net.minecraft.client.renderer.GameRenderer; | ||
import net.minecraftforge.client.gui.overlay.ForgeGui; | ||
import net.minecraftforge.client.gui.overlay.IGuiOverlay; | ||
|
||
public class UIRenderHandler implements IGuiOverlay { | ||
|
||
public UIRenderHandler(ForgeGui forgeGui, GuiGraphics guiGraphics, float v, int i, int i1) { | ||
render(forgeGui, guiGraphics, v, i, i1); | ||
} | ||
|
||
@Override | ||
public void render(ForgeGui gui, GuiGraphics guiGraphics, float partialTick, int screenWidth, int screenHeight) { | ||
RenderSystem.setShader(GameRenderer::getPositionColorShader); | ||
|
||
// Maybe this draw a rectangle on the screen. | ||
// First, second, third and fourth arguments may set a position. | ||
// Fifth argument may set color. | ||
guiGraphics.fill(100, 120, 140, 160, 0xFFFFFF); | ||
|
||
// This draw text on the screen. The method have no problem. | ||
// Third and fourth arguments set a position. | ||
// Fifth argument sets text color. | ||
// Sixth argument sets shadow. | ||
guiGraphics.drawString(Minecraft.getInstance().font, "test", 100, 140, 0xFFFFFF, true); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/com/fureniku/metropolis/items/MetroItemBase.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.fureniku.metropolis.items; | ||
|
||
import net.minecraft.world.item.Item; | ||
|
||
public class MetroItemBase extends Item { | ||
|
||
public MetroItemBase(Properties props) { | ||
super(props); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/com/fureniku/metropolis/items/MetroItemSimple.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.fureniku.metropolis.items; | ||
|
||
public class MetroItemSimple extends MetroItemBase { | ||
|
||
public MetroItemSimple() { | ||
this(64); | ||
} | ||
|
||
public MetroItemSimple(int stackSize) { | ||
super(new Properties().stacksTo(stackSize)); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/com/fureniku/metropolis/items/MetroItemToolBase.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.fureniku.metropolis.items; | ||
|
||
public class MetroItemToolBase extends MetroItemBase { | ||
|
||
public MetroItemToolBase(int durability) { | ||
super(new Properties().stacksTo(1).fireResistant().defaultDurability(durability)); | ||
} | ||
} |
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
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/metropolis/models/item/test_basic_item.json
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"parent": "item/generated", | ||
"textures": { | ||
"layer0": "metropolis:item/test_basic_item" | ||
} | ||
} |
Binary file added
BIN
+391 Bytes
src/main/resources/assets/metropolis/textures/item/test_basic_item.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.