Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,8 @@ public enum ItemType {
PLASMA(Material.PLAYER_HEAD, Rarity.RARE),
VOLTA(Material.PLAYER_HEAD, Rarity.RARE),
CORLEONITE(Material.PLAYER_HEAD, Rarity.EPIC),
LANTERN(Material.PLAYER_HEAD, Rarity.RARE),
INFINI_TORCH(Material.TORCH, Rarity.EPIC),

/**
* Travel Scrolls
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ public GemData loadFromString(String string) {
String[] gemSplit = gem.split(":");
int index = Integer.parseInt(gemSplit[0]);
ItemType filledWith = null;
boolean unlocked = false;

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

gemData.putGem(new GemData.GemSlots(index, filledWith));
gemData.putGem(new GemData.GemSlots(index, filledWith, unlocked));
}

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

this.value.slots.forEach(gem -> {
if (gem.filledWith == null) {
serializedGems.add(gem.index + ":null");
} else {
serializedGems.add(gem.index + ":" + gem.filledWith.name());
}
String filledWith = gem.filledWith == null ? "null" : gem.filledWith.name();
serializedGems.add(gem.index + ":" + filledWith + ":" + gem.unlocked);
});

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

public boolean hasGem(int index) {
boolean hasGem = false;
for (GemSlots slot : slots) {
if (slot.index == index) {
hasGem = true;
break;
return true;
}
}
return hasGem;
return false;
}

public GemSlots getGem(int index) {
Expand All @@ -93,12 +89,34 @@ public GemSlots getGem(int index) {
return null;
}

public boolean isSlotUnlocked(int index) {
GemSlots slot = getGem(index);
return slot != null && slot.unlocked;
}

public void unlockSlot(int index) {
GemSlots existing = getGem(index);
if (existing != null) {
existing.unlocked = true;
} else {
putGem(new GemSlots(index, null, true));
}
}

public void removeGem(int index) {
GemSlots existing = getGem(index);
if (existing != null) {
existing.filledWith = null;
}
}

@AllArgsConstructor
@Getter
@Setter
public static class GemSlots {
public int index;
public @Nullable ItemType filledWith;
public boolean unlocked;
}
}
}
}
2 changes: 1 addition & 1 deletion configuration/skyblock/items/mining/flawless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ items:
- id: GEMSTONE_IMPL
rarity: FLAWLESS
gemstone: JADE
skull_texture: d3623521c8111ad29e9dcf7acc56085a9ab07da732d1518976aee61d0b3e3bd6
skull_texture: f89f75e0b00378a583dbba728dcdc6e9346f31dd601d448f3d60615c7465cc3e
- id: TRACKED_UNIQUE
- id: CUSTOM_DISPLAY_NAME
display_name: Flawless Jade Gemstone
Expand Down
20 changes: 20 additions & 0 deletions configuration/skyblock/items/mining/mining.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ items:
breaking_power: 1.0
components:
- id: PICKAXE

- id: ROOKIE_PICKAXE
rarity: COMMON
default_statistics:
Expand All @@ -14,3 +15,22 @@ items:
damage: 15.0
components:
- id: PICKAXE

- id: LANTERN
material: PLAYER_HEAD
rarity: RARE
components:
- id: CUSTOM_DISPLAY_NAME
display_name: Lantern
- id: SKULL_HEAD
texture: 16e5682b4a0e5af5237fb9960983c623eab04ec01b90147c4df4c90a7be664d5
- id: NOT_FINISHED_YET

- id: INFINI_TORCH
material: TORCH
rarity: EPIC
components:
- id: CUSTOM_DISPLAY_NAME
display_name: InfiniTorch™
- id: NOT_FINISHED_YET
- id: ENCHANTED
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package net.swofty.type.dwarvenmines;

import net.kyori.adventure.key.Key;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.format.TextDecoration;
import net.minestom.server.MinecraftServer;
import net.minestom.server.coordinate.Point;
import net.minestom.server.coordinate.Pos;
import net.minestom.server.registry.RegistryKey;
import net.minestom.server.world.DimensionType;
Expand All @@ -10,15 +14,20 @@
import net.swofty.commons.CustomWorlds;
import net.swofty.commons.ServerType;
import net.swofty.commons.ServiceType;
import net.swofty.commons.bedwars.map.BedWarsMapsConfig;
import net.swofty.proxyapi.redis.ProxyToClient;
import net.swofty.proxyapi.redis.ServiceToClient;
import net.swofty.type.dwarvenmines.gui.GUIGemstoneGrinder;
import net.swofty.type.dwarvenmines.tab.DwarvenMinesServerModule;
import net.swofty.type.generic.HypixelConst;
import net.swofty.type.generic.SkyBlockTypeLoader;
import net.swofty.type.generic.entity.InteractionEntity;
import net.swofty.type.generic.entity.npc.HypixelNPC;
import net.swofty.type.generic.event.HypixelEventClass;
import net.swofty.type.generic.tab.TablistManager;
import net.swofty.type.generic.tab.TablistModule;
import net.swofty.type.skyblockgeneric.SkyBlockGenericLoader;
import net.swofty.type.skyblockgeneric.entity.TextDisplayEntity;
import net.swofty.type.skyblockgeneric.tabmodules.AccountInformationModule;
import net.swofty.type.skyblockgeneric.tabmodules.SkyBlockPlayersOnlineModule;
import org.jetbrains.annotations.Nullable;
Expand All @@ -41,13 +50,23 @@ public void onInitialize(MinecraftServer server) {

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

InteractionEntity gemstoneGrinder = new InteractionEntity(1.1f, 1.1f, (p, event) -> {
new GUIGemstoneGrinder().open(p);
});
TextDisplayEntity gemstoneGrinderText = new TextDisplayEntity(Component.text("Gemstone Grinder", NamedTextColor.LIGHT_PURPLE), meta -> {});
TextDisplayEntity gemstoneGrinderClick = new TextDisplayEntity(Component.text("CLICK").color(NamedTextColor.YELLOW).decorate(TextDecoration.BOLD), meta -> {});

gemstoneGrinder.setInstance(HypixelConst.getInstanceContainer(), gemstoneGrinderPos);
gemstoneGrinderText.setInstance(HypixelConst.getInstanceContainer(), gemstoneGrinderPos.add(0, 1.3, 0));
gemstoneGrinderClick.setInstance(HypixelConst.getInstanceContainer(), gemstoneGrinderPos.add(0, 0.9, 0));
}

@Override
public LoaderValues getLoaderValues() {
return new LoaderValues(
(_) -> new Pos(-85, 200, -123, -90, 0),
(_) -> new Pos(-48.5, 200, -121.5, -90, 0),
true
);
}
Expand Down
Loading