generated from NeoForgeMDKs/MDK-1.21.1-ModDevGradle
-
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
21df8c3
commit ddd3e83
Showing
15 changed files
with
253 additions
and
2 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924
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,4 @@ | ||
// 1.21.1 2025-01-10T20:56:41.675605318 Registries | ||
1cdd93f8a6bb79a07d1657ef616b5bd4fbdb247d data/researchd/researchd/research_pack/end.json | ||
89ac98c63d706e87b221fe288b9947b8018976ca data/researchd/researchd/research_pack/nether.json | ||
f077b1491836c0ad25f25653e259fb15df317440 data/researchd/researchd/research_pack/overworld.json |
5 changes: 5 additions & 0 deletions
5
src/generated/resources/data/researchd/researchd/research_pack/end.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,5 @@ | ||
{ | ||
"type": "researchd:simple", | ||
"color": -16711936, | ||
"customTexture": {} | ||
} |
5 changes: 5 additions & 0 deletions
5
src/generated/resources/data/researchd/researchd/research_pack/nether.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,5 @@ | ||
{ | ||
"type": "researchd:simple", | ||
"color": -16776961, | ||
"customTexture": {} | ||
} |
5 changes: 5 additions & 0 deletions
5
src/generated/resources/data/researchd/researchd/research_pack/overworld.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,5 @@ | ||
{ | ||
"type": "researchd:simple", | ||
"color": -65536, | ||
"customTexture": {} | ||
} |
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
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
46 changes: 46 additions & 0 deletions
46
src/main/java/com/portingdeadmods/researchd/client/screens/graph/ResearchNode.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,46 @@ | ||
package com.portingdeadmods.researchd.client.screens.graph; | ||
|
||
import com.portingdeadmods.researchd.api.research.Research; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.GuiGraphics; | ||
import net.minecraft.client.gui.components.AbstractWidget; | ||
import net.minecraft.client.gui.narration.NarrationElementOutput; | ||
import net.minecraft.network.chat.Component; | ||
|
||
import java.util.List; | ||
|
||
public class ResearchNode extends AbstractWidget { | ||
private Research research; | ||
private List<ResearchNode> next; | ||
|
||
public ResearchNode(Research research, int x, int y) { | ||
super(x, y, 20, 20, Component.empty()); | ||
this.research = research; | ||
} | ||
|
||
public void setResearch(Research research) { | ||
this.research = research; | ||
} | ||
|
||
public Research getResearch() { | ||
return research; | ||
} | ||
|
||
public void addNext(ResearchNode next) { | ||
this.next.add(next); | ||
} | ||
|
||
public void removeNext(ResearchNode toRemove) { | ||
this.next.remove(toRemove); | ||
} | ||
|
||
@Override | ||
protected void renderWidget(GuiGraphics guiGraphics, int x, int y, float v) { | ||
guiGraphics.renderItem(research.icon().getDefaultInstance(), x, y); | ||
} | ||
|
||
@Override | ||
protected void updateWidgetNarration(NarrationElementOutput narrationElementOutput) { | ||
|
||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/com/portingdeadmods/researchd/client/screens/list/EntryType.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,21 @@ | ||
package com.portingdeadmods.researchd.client.screens.list; | ||
|
||
import com.portingdeadmods.researchd.Researchd; | ||
import net.minecraft.resources.ResourceLocation; | ||
|
||
public enum EntryType { | ||
RESEARCHED(Researchd.rl("entry_green")), | ||
RESEARCHABLE(Researchd.rl("entry_yellow")), | ||
LOCKED(Researchd.rl("entry_red")); | ||
|
||
private final ResourceLocation spriteTexture; | ||
|
||
EntryType(ResourceLocation spriteTexture) { | ||
this.spriteTexture = spriteTexture; | ||
} | ||
|
||
public ResourceLocation getSpriteTexture() { | ||
return spriteTexture; | ||
} | ||
|
||
} |
62 changes: 62 additions & 0 deletions
62
src/main/java/com/portingdeadmods/researchd/client/screens/list/TechList.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,62 @@ | ||
package com.portingdeadmods.researchd.client.screens.list; | ||
|
||
import com.portingdeadmods.researchd.impl.research.SimpleResearch; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.GuiGraphics; | ||
import net.minecraft.client.gui.components.AbstractWidget; | ||
import net.minecraft.client.gui.narration.NarrationElementOutput; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.util.RandomSource; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraft.world.item.Items; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.function.Consumer; | ||
|
||
public class TechList extends AbstractWidget { | ||
private final List<List<TechListEntry>> researches; | ||
private final int rows; | ||
private final int cols; | ||
|
||
// DEBUG | ||
private final List<Item> items = List.of(Items.DIAMOND, Items.IRON_AXE, Items.FURNACE, Items.MINECART); | ||
|
||
public TechList(int x, int y, int rows, int cols) { | ||
super(x, y, TechListEntry.WIDTH * rows, TechListEntry.HEIGHT * cols, Component.empty()); | ||
this.researches = new ArrayList<>(); | ||
this.rows = rows; | ||
this.cols = cols; | ||
} | ||
|
||
public void fillList() { | ||
for (int col = 0; col < cols; col++) { | ||
List<TechListEntry> entries = new ArrayList<>(); | ||
for (int row = 0; row < rows; row++) { | ||
RandomSource random = Minecraft.getInstance().level.random; | ||
int randInt = random.nextInt(0, items.size()); | ||
int randType = random.nextInt(0, 3); | ||
entries.add(new TechListEntry(SimpleResearch.debug(this.items.get(randInt)), EntryType.values()[randType], getX() + row * TechListEntry.WIDTH, getY() + col * TechListEntry.HEIGHT)); | ||
} | ||
this.researches.add(entries); | ||
} | ||
} | ||
|
||
@Override | ||
protected void renderWidget(GuiGraphics guiGraphics, int mouseX, int mouseY, float v) { | ||
} | ||
|
||
@Override | ||
protected void updateWidgetNarration(NarrationElementOutput narrationElementOutput) { | ||
|
||
} | ||
|
||
@Override | ||
public void visitWidgets(Consumer<AbstractWidget> consumer) { | ||
for (int col = 0; col < cols; col++) { | ||
for (int row = 0; row < rows; row++) { | ||
consumer.accept(this.researches.get(col).get(row)); | ||
} | ||
} | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
src/main/java/com/portingdeadmods/researchd/client/screens/list/TechListEntry.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,58 @@ | ||
package com.portingdeadmods.researchd.client.screens.list; | ||
|
||
import com.mojang.blaze3d.vertex.PoseStack; | ||
import com.portingdeadmods.researchd.api.research.Research; | ||
import net.minecraft.client.gui.GuiGraphics; | ||
import net.minecraft.client.gui.components.AbstractWidget; | ||
import net.minecraft.client.gui.narration.NarrationElementOutput; | ||
import net.minecraft.client.renderer.RenderType; | ||
import net.minecraft.network.chat.Component; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public class TechListEntry extends AbstractWidget { | ||
public static final int WIDTH = 20; | ||
public static final int HEIGHT = 24; | ||
|
||
private Research research; | ||
private EntryType type; | ||
|
||
public TechListEntry(@Nullable Research research, @Nullable EntryType type, int x, int y) { | ||
super(x, y, WIDTH, HEIGHT, Component.empty()); | ||
this.research = research; | ||
this.type = type; | ||
} | ||
|
||
public Research getResearch() { | ||
return research; | ||
} | ||
|
||
public EntryType getType() { | ||
return type; | ||
} | ||
|
||
public void setResearch(Research research) { | ||
this.research = research; | ||
} | ||
|
||
public void setType(EntryType type) { | ||
this.type = type; | ||
} | ||
|
||
@Override | ||
protected void renderWidget(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) { | ||
if (type != null) { | ||
guiGraphics.blitSprite(type.getSpriteTexture(), getX(), getY(), WIDTH, HEIGHT); | ||
|
||
guiGraphics.renderItem(research.icon().getDefaultInstance(), getX() + 2, getY() + 2); | ||
|
||
if (isHovered()) { | ||
int color = -2130706433; | ||
guiGraphics.fillGradient(RenderType.guiOverlay(), getX() + 1, getY() + 1, getX() + 20, getY() + 20, color, color, 0); | ||
} | ||
} | ||
} | ||
|
||
@Override | ||
protected void updateWidgetNarration(NarrationElementOutput narrationElementOutput) { | ||
} | ||
} |
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 added
BIN
+863 Bytes
src/main/resources/assets/researchd/textures/gui/research_screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+144 Bytes
src/main/resources/assets/researchd/textures/gui/sprites/entry_green.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+146 Bytes
src/main/resources/assets/researchd/textures/gui/sprites/entry_red.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+142 Bytes
src/main/resources/assets/researchd/textures/gui/sprites/entry_yellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.