Skip to content

Commit 5c2c4f6

Browse files
authored
Merge pull request #635 from ItzKatze/master
feat: Gemstone Grinder
2 parents adf68ba + 7bc201c commit 5c2c4f6

File tree

21 files changed

+1100
-659
lines changed

21 files changed

+1100
-659
lines changed

commons/src/main/java/net/swofty/commons/skyblock/item/ItemType.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,8 @@ public enum ItemType {
773773
PLASMA(Material.PLAYER_HEAD, Rarity.RARE),
774774
VOLTA(Material.PLAYER_HEAD, Rarity.RARE),
775775
CORLEONITE(Material.PLAYER_HEAD, Rarity.EPIC),
776+
LANTERN(Material.PLAYER_HEAD, Rarity.RARE),
777+
INFINI_TORCH(Material.TORCH, Rarity.EPIC),
776778

777779
/**
778780
* Travel Scrolls

commons/src/main/java/net/swofty/commons/skyblock/item/attribute/attributes/ItemAttributeGemData.java

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,13 @@ public GemData loadFromString(String string) {
3636
String[] gemSplit = gem.split(":");
3737
int index = Integer.parseInt(gemSplit[0]);
3838
ItemType filledWith = null;
39+
boolean unlocked = false;
3940

4041
if (!gemSplit[1].equals("null")) {
4142
filledWith = ItemType.valueOf(gemSplit[1]);
4243
}
4344

44-
gemData.putGem(new GemData.GemSlots(index, filledWith));
45+
gemData.putGem(new GemData.GemSlots(index, filledWith, unlocked));
4546
}
4647

4748
return gemData;
@@ -52,11 +53,8 @@ public String saveIntoString() {
5253
List<String> serializedGems = new ArrayList<>();
5354

5455
this.value.slots.forEach(gem -> {
55-
if (gem.filledWith == null) {
56-
serializedGems.add(gem.index + ":null");
57-
} else {
58-
serializedGems.add(gem.index + ":" + gem.filledWith.name());
59-
}
56+
String filledWith = gem.filledWith == null ? "null" : gem.filledWith.name();
57+
serializedGems.add(gem.index + ":" + filledWith + ":" + gem.unlocked);
6058
});
6159

6260
return String.join(",", serializedGems);
@@ -74,14 +72,12 @@ public void putGem(GemSlots slot) {
7472
}
7573

7674
public boolean hasGem(int index) {
77-
boolean hasGem = false;
7875
for (GemSlots slot : slots) {
7976
if (slot.index == index) {
80-
hasGem = true;
81-
break;
77+
return true;
8278
}
8379
}
84-
return hasGem;
80+
return false;
8581
}
8682

8783
public GemSlots getGem(int index) {
@@ -93,12 +89,34 @@ public GemSlots getGem(int index) {
9389
return null;
9490
}
9591

92+
public boolean isSlotUnlocked(int index) {
93+
GemSlots slot = getGem(index);
94+
return slot != null && slot.unlocked;
95+
}
96+
97+
public void unlockSlot(int index) {
98+
GemSlots existing = getGem(index);
99+
if (existing != null) {
100+
existing.unlocked = true;
101+
} else {
102+
putGem(new GemSlots(index, null, true));
103+
}
104+
}
105+
106+
public void removeGem(int index) {
107+
GemSlots existing = getGem(index);
108+
if (existing != null) {
109+
existing.filledWith = null;
110+
}
111+
}
112+
96113
@AllArgsConstructor
97114
@Getter
98115
@Setter
99116
public static class GemSlots {
100117
public int index;
101118
public @Nullable ItemType filledWith;
119+
public boolean unlocked;
102120
}
103121
}
104-
}
122+
}

configuration/skyblock/items/mining/flawless.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ items:
2727
- id: GEMSTONE_IMPL
2828
rarity: FLAWLESS
2929
gemstone: JADE
30-
skull_texture: d3623521c8111ad29e9dcf7acc56085a9ab07da732d1518976aee61d0b3e3bd6
30+
skull_texture: f89f75e0b00378a583dbba728dcdc6e9346f31dd601d448f3d60615c7465cc3e
3131
- id: TRACKED_UNIQUE
3232
- id: CUSTOM_DISPLAY_NAME
3333
display_name: Flawless Jade Gemstone

configuration/skyblock/items/mining/mining.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ items:
66
breaking_power: 1.0
77
components:
88
- id: PICKAXE
9+
910
- id: ROOKIE_PICKAXE
1011
rarity: COMMON
1112
default_statistics:
@@ -14,3 +15,22 @@ items:
1415
damage: 15.0
1516
components:
1617
- id: PICKAXE
18+
19+
- id: LANTERN
20+
material: PLAYER_HEAD
21+
rarity: RARE
22+
components:
23+
- id: CUSTOM_DISPLAY_NAME
24+
display_name: Lantern
25+
- id: SKULL_HEAD
26+
texture: 16e5682b4a0e5af5237fb9960983c623eab04ec01b90147c4df4c90a7be664d5
27+
- id: NOT_FINISHED_YET
28+
29+
- id: INFINI_TORCH
30+
material: TORCH
31+
rarity: EPIC
32+
components:
33+
- id: CUSTOM_DISPLAY_NAME
34+
display_name: InfiniTorch™
35+
- id: NOT_FINISHED_YET
36+
- id: ENCHANTED

type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/TypeDwarvenMinesLoader.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
package net.swofty.type.dwarvenmines;
22

33
import net.kyori.adventure.key.Key;
4+
import net.kyori.adventure.text.Component;
5+
import net.kyori.adventure.text.format.NamedTextColor;
6+
import net.kyori.adventure.text.format.TextDecoration;
47
import net.minestom.server.MinecraftServer;
8+
import net.minestom.server.coordinate.Point;
59
import net.minestom.server.coordinate.Pos;
610
import net.minestom.server.registry.RegistryKey;
711
import net.minestom.server.world.DimensionType;
@@ -10,15 +14,20 @@
1014
import net.swofty.commons.CustomWorlds;
1115
import net.swofty.commons.ServerType;
1216
import net.swofty.commons.ServiceType;
17+
import net.swofty.commons.bedwars.map.BedWarsMapsConfig;
1318
import net.swofty.proxyapi.redis.ProxyToClient;
1419
import net.swofty.proxyapi.redis.ServiceToClient;
20+
import net.swofty.type.dwarvenmines.gui.GUIGemstoneGrinder;
1521
import net.swofty.type.dwarvenmines.tab.DwarvenMinesServerModule;
22+
import net.swofty.type.generic.HypixelConst;
1623
import net.swofty.type.generic.SkyBlockTypeLoader;
24+
import net.swofty.type.generic.entity.InteractionEntity;
1725
import net.swofty.type.generic.entity.npc.HypixelNPC;
1826
import net.swofty.type.generic.event.HypixelEventClass;
1927
import net.swofty.type.generic.tab.TablistManager;
2028
import net.swofty.type.generic.tab.TablistModule;
2129
import net.swofty.type.skyblockgeneric.SkyBlockGenericLoader;
30+
import net.swofty.type.skyblockgeneric.entity.TextDisplayEntity;
2231
import net.swofty.type.skyblockgeneric.tabmodules.AccountInformationModule;
2332
import net.swofty.type.skyblockgeneric.tabmodules.SkyBlockPlayersOnlineModule;
2433
import org.jetbrains.annotations.Nullable;
@@ -41,13 +50,23 @@ public void onInitialize(MinecraftServer server) {
4150

4251
@Override
4352
public void afterInitialize(MinecraftServer server) {
53+
Point gemstoneGrinderPos = new Pos(85.5, 199, -116.5);
4454

55+
InteractionEntity gemstoneGrinder = new InteractionEntity(1.1f, 1.1f, (p, event) -> {
56+
new GUIGemstoneGrinder().open(p);
57+
});
58+
TextDisplayEntity gemstoneGrinderText = new TextDisplayEntity(Component.text("Gemstone Grinder", NamedTextColor.LIGHT_PURPLE), meta -> {});
59+
TextDisplayEntity gemstoneGrinderClick = new TextDisplayEntity(Component.text("CLICK").color(NamedTextColor.YELLOW).decorate(TextDecoration.BOLD), meta -> {});
60+
61+
gemstoneGrinder.setInstance(HypixelConst.getInstanceContainer(), gemstoneGrinderPos);
62+
gemstoneGrinderText.setInstance(HypixelConst.getInstanceContainer(), gemstoneGrinderPos.add(0, 1.3, 0));
63+
gemstoneGrinderClick.setInstance(HypixelConst.getInstanceContainer(), gemstoneGrinderPos.add(0, 0.9, 0));
4564
}
4665

4766
@Override
4867
public LoaderValues getLoaderValues() {
4968
return new LoaderValues(
50-
(_) -> new Pos(-85, 200, -123, -90, 0),
69+
(_) -> new Pos(-48.5, 200, -121.5, -90, 0),
5170
true
5271
);
5372
}

0 commit comments

Comments
 (0)