Skip to content

Commit b7d511b

Browse files
Merge remote-tracking branch 'origin/master'
# Conflicts: # type.generic/src/main/java/net/swofty/type/generic/data/datapoints/DatapointParkourData.java
2 parents 7d9a445 + 548abe2 commit b7d511b

File tree

39 files changed

+1401
-692
lines changed

39 files changed

+1401
-692
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+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package net.swofty.commons.skyblock.item.attribute.attributes;
2+
3+
import net.swofty.commons.skyblock.item.attribute.ItemAttribute;
4+
import net.swofty.commons.skyblock.statistics.ItemStatistics;
5+
import org.jetbrains.annotations.Nullable;
6+
7+
public class ItemAttributeStoredPotential extends ItemAttribute<Integer> {
8+
@Override
9+
public String getKey() {
10+
return "stored_potential";
11+
}
12+
13+
@Override
14+
public Integer getDefaultValue(@Nullable ItemStatistics defaultStatistics) {
15+
return 0;
16+
}
17+
18+
@Override
19+
public Integer loadFromString(String string) {
20+
try {
21+
return Integer.parseInt(string);
22+
} catch (NumberFormatException e) {
23+
return 0;
24+
}
25+
}
26+
27+
@Override
28+
public String saveIntoString() {
29+
return String.valueOf(getValue());
30+
}
31+
32+
}

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

configuration/skyblock/items/mining/pickaxe.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ items:
22
- id: PROMISING_PICKAXE
33
rarity: UNCOMMON
44
default_statistics:
5-
damage: 30.0
6-
mining_speed: 1500.0
5+
damage: 20.0
6+
mining_speed: 50.0
77
breaking_power: 3.0
88
components:
9+
- id: ABILITY
10+
abilities:
11+
- STORED_POTENTIAL
912
- id: PICKAXE
1013
- id: SELLABLE
1114
value: 10.0

type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/TypeBedWarsLobbyLoader.java

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import net.swofty.type.bedwarslobby.item.impl.BedWarsMenu;
1414
import net.swofty.type.bedwarslobby.item.impl.Collectibles;
1515
import net.swofty.type.bedwarslobby.launchpad.BedWarsLaunchPads;
16+
import net.swofty.type.bedwarslobby.parkour.BedWarsLobbyParkour;
1617
import net.swofty.type.bedwarslobby.util.BedWarsLobbyMap;
1718
import net.swofty.type.generic.HypixelConst;
1819
import net.swofty.type.generic.HypixelGenericLoader;
@@ -27,10 +28,7 @@
2728
import net.swofty.type.generic.tab.TablistModule;
2829
import net.swofty.type.bedwarslobby.tab.BedWarsPlayersOnlineModule;
2930
import net.swofty.type.lobby.LobbyTypeLoader;
30-
import net.swofty.type.lobby.events.LobbyBlockBreak;
31-
import net.swofty.type.lobby.events.LobbyItemEvents;
32-
import net.swofty.type.lobby.events.LobbyLaunchPadEvents;
33-
import net.swofty.type.lobby.events.LobbyPlayerJoinEvents;
31+
import net.swofty.type.lobby.events.*;
3432
import net.swofty.type.lobby.item.LobbyItem;
3533
import net.swofty.type.lobby.item.LobbyItemHandler;
3634
import net.swofty.type.lobby.item.impl.HidePlayers;
@@ -40,6 +38,7 @@
4038
import net.swofty.type.lobby.launchpad.LaunchPad;
4139
import net.swofty.type.lobby.launchpad.LaunchPadHandler;
4240
import net.swofty.type.lobby.parkour.LobbyParkourManager;
41+
import net.swofty.type.lobby.parkour.Parkour;
4342
import org.jetbrains.annotations.Nullable;
4443
import org.tinylog.Logger;
4544

@@ -50,6 +49,7 @@
5049

5150
public class TypeBedWarsLobbyLoader implements LobbyTypeLoader {
5251
public static BedWarsLobbyMap bedWarsLobbyMap = new BedWarsLobbyMap();
52+
public static LobbyParkourManager parkourManager;
5353

5454
@Getter
5555
private final LobbyItemHandler itemHandler = new LobbyItemHandler();
@@ -59,6 +59,11 @@ public ServerType getType() {
5959
return ServerType.BEDWARS_LOBBY;
6060
}
6161

62+
@Override
63+
public Parkour getParkour() {
64+
return new BedWarsLobbyParkour();
65+
}
66+
6267
@Override
6368
public void onInitialize(MinecraftServer server) {
6469
}
@@ -93,13 +98,20 @@ public void afterInitialize(MinecraftServer server) {
9398
MinecraftServer.getSchedulerManager().buildTask(PlayerHolograms::updateExternalHolograms).delay(TaskSchedule.seconds(5))
9499
.repeat(TaskSchedule.seconds(2))
95100
.schedule();
101+
102+
parkourManager = new LobbyParkourManager(getParkour());
96103
}
97104

98105
@Override
99106
public List<LaunchPad> getLaunchPads() {
100107
return Arrays.asList(BedWarsLaunchPads.values());
101108
}
102109

110+
@Override
111+
public @Nullable LobbyParkourManager getParkourManager() {
112+
return parkourManager;
113+
}
114+
103115
@Override
104116
public Map<Integer, LobbyItem> getHotbarItems() {
105117
return Map.of(
@@ -112,11 +124,6 @@ public Map<Integer, LobbyItem> getHotbarItems() {
112124
);
113125
}
114126

115-
@Override
116-
public LobbyParkourManager getParkourManager() {
117-
return null;
118-
}
119-
120127
@Override
121128
public List<ServiceType> getRequiredServices() {
122129
return List.of(ServiceType.ORCHESTRATOR);
@@ -153,6 +160,7 @@ public List<HypixelEventClass> getTraditionalEvents() {
153160
).toList());
154161
// Add lobby base events
155162
events.add(new LobbyItemEvents());
163+
events.add(new LobbyParkourEvents());
156164
events.add(new LobbyLaunchPadEvents());
157165
events.add(new LobbyPlayerJoinEvents());
158166
events.add(new LobbyBlockBreak());
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package net.swofty.type.bedwarslobby.parkour;
2+
3+
import net.minestom.server.coordinate.BlockVec;
4+
import net.minestom.server.coordinate.Point;
5+
import net.minestom.server.coordinate.Pos;
6+
import net.swofty.type.generic.data.datapoints.DatapointParkourData;
7+
import net.swofty.type.lobby.parkour.Parkour;
8+
9+
import java.util.List;
10+
11+
public class BedWarsLobbyParkour implements Parkour {
12+
13+
@Override
14+
public DatapointParkourData.ParkourType getId() {
15+
return DatapointParkourData.ParkourType.BED_WARS_LOBBY;
16+
}
17+
18+
@Override
19+
public Pos getStartLocation() {
20+
return new Pos(-32.5, 72, -25.5, 135, 0);
21+
}
22+
23+
@Override
24+
public List<Point> getCheckpoints() {
25+
return List.of(
26+
new BlockVec(-34, 72, -27),
27+
new BlockVec(-36, 97, -113),
28+
new BlockVec(95, 92, -111),
29+
new BlockVec(144, 98, 2),
30+
new BlockVec(88, 99, 106),
31+
new BlockVec(45, 92, 117),
32+
new BlockVec(-70, 75, 118),
33+
new BlockVec(-41, 72, 38)
34+
);
35+
}
36+
}

type.crimsonisle/src/main/java/net/swofty/type/crimsonisle/events/ActionPlayerJoin.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ public void run(AsyncPlayerConfigurationEvent event) {
2323
.apply(player.getOriginServer())
2424
);
2525
}
26+
2627
}

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)