Skip to content

Commit b79c191

Browse files
authored
Merge pull request #599 from ArikSquad/feat/jerrysworkshop
Jerry's workshop
2 parents 24bbee8 + 35b000f commit b79c191

34 files changed

Lines changed: 980 additions & 19 deletions

File tree

commons/src/main/java/net/swofty/commons/CustomWorlds.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public enum CustomWorlds {
1212
SKYBLOCK_THE_PARK("hypixel_skyblock_the_park"),
1313
SKYBLOCK_GALATEA("hypixel_skyblock_galatea"),
1414
SKYBLOCK_BACKWATER_BAYOU("hypixel_skyblock_backwater_bayou"),
15+
SKYBLOCK_JERRYS_WORKSHOP("hypixel_skyblock_jerrys_workshop"),
1516
SKYBLOCK_DUNGEON_HUB("hypixel_skyblock_dungeon_hub"),
1617
PROTOTYPE_LOBBY("hypixel_prototype_lobby"),
1718
BEDWARS_LOBBY("hypixel_bedwars_lobby"),

commons/src/main/java/net/swofty/commons/ServerType.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public enum ServerType {
1717
SKYBLOCK_THE_PARK(true),
1818
SKYBLOCK_GALATEA(true),
1919
SKYBLOCK_BACKWATER_BAYOU(true),
20+
SKYBLOCK_JERRYS_WORKSHOP(true),
2021
PROTOTYPE_LOBBY(false),
2122
BEDWARS_LOBBY(false),
2223
BEDWARS_GAME(false),

configuration/skyblock/Minestom.regions.csv

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,22 @@ gb2,GOBLIN_BURROWS,-60,163,180,-192,131,110,DWARVEN_MINES
8282
mist1,THE_MIST,-60,83,2,200,63,160,DWARVEN_MINES
8383
cliffv,CLIFFSIDE_VEINS,6,154,23,92,114,56,DWARVEN_MINES
8484
wilderness_1,WILDERNESS,58,71,118,123,76,123,HUB
85-
barn_1,THE_BARN,82,26,-177,250,120,-334,THE_FARMING_ISLANDS,
85+
barn_1,THE_BARN,82,26,-177,250,120,-334,THE_FARMING_ISLANDS
8686
birch_forest,BIRCH_PARK,-255,114,26,-336,41,-90,THE_PARK
8787
spruce_forest,SPRUCE_WOODS,-387,151,-22,-309,59,107,THE_PARK
8888
dark_thicket,DARK_THICKET,-333,148,-24,-415,59,-122,THE_PARK
8989
trial_of_fire,TRIALS_OF_FIRE,-369,120,-100,-357,101,-88,THE_PARK
9090
jungle,JUNGLE_ISLAND,-417,149,-130,-507,68,-18,THE_PARK
91-
savanna,SAVANNA_WOODLAND,-467,155,-20,-383,56,102,THE_PARK
91+
savanna,SAVANNA_WOODLAND,-467,155,-20,-383,56,102,THE_PARK
92+
sherry,SHERRYS_SHOWROOM,21,98,86,7,76,108,JERRYS_WORKSHOP
93+
jerry,JERRYS_WORKSHOP,139,183,200,-163,30,-167,JERRYS_WORKSHOP
94+
terry,TERRYS_SHACK,-87,94,30,-95,76,21,JERRYS_WORKSHOP
95+
pond,JERRY_POND,-82,110,-17,-35,68,63,JERRYS_WORKSHOP
96+
sunken_pond,SUNKEN_JERRY_POND,-68,74,106,-118,56,32,JERRYS_WORKSHOP
97+
mount,MOUNT_JERRY,-57,81,-40,51,158,-104,JERRYS_WORKSHOP
98+
hotsprings,HOT_SPRINGS,-32,82,-32,60,46,-86,JERRYS_WORKSHOP
99+
hotsprings2,HOT_SPRINGS,-1,74,-35,101,49,12,JERRYS_WORKSHOP
100+
glacial,GLACIAL_CAVE,56,88,20,111,63,115,JERRYS_WORKSHOP
101+
gary,GARYS_SHACK,56,102,52,49,118,63,JERRYS_WORKSHOP
102+
einary,EINARYS_EMPORIUM,-12,75,60,-21,86,66,JERRYS_WORKSHOP
103+
einary2,EINARYS_EMPORIUM,-21,75,66,-17,84,70,JERRYS_WORKSHOP

loader/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ dependencies {
3636
implementation(project(":type.thepark"))
3737
implementation(project(":type.galatea"))
3838
implementation(project(":type.backwaterbayou"))
39+
implementation(project(":type.jerrysworkshop"))
3940
implementation(project(":type.dungeonhub"))
4041
implementation(project(":type.skyblockgeneric"))
4142
implementation(project(":type.prototypelobby"))

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ include(":type.dwarvenmines")
2525
include(":type.thepark")
2626
include(":type.galatea")
2727
include(":type.backwaterbayou")
28+
include(":type.jerrysworkshop")
2829
include(":type.island")
2930
include(":type.hub")
3031
include(":type.dungeonhub")

type.generic/src/main/java/net/swofty/type/generic/HypixelGenericLoader.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
import net.swofty.commons.Configuration;
2222
import net.swofty.commons.CustomWorlds;
2323
import net.swofty.commons.ServerType;
24+
import net.swofty.type.generic.block.PlayerHeadBlockHandler;
25+
import net.swofty.type.generic.block.SignBlockHandler;
2426
import net.swofty.type.generic.command.HypixelCommand;
2527
import net.swofty.type.generic.data.GameDataHandlerRegistry;
2628
import net.swofty.type.generic.data.HypixelDataHandler;
@@ -198,6 +200,10 @@ public void initialize(MinecraftServer server) {
198200
GameDataHandlerRegistry.register(new BedWarsDataHandler());
199201
GameDataHandlerRegistry.register(new PrototypeLobbyDataHandler());
200202

203+
// Register Block Handlers
204+
MinecraftServer.getBlockManager().registerHandler(PlayerHeadBlockHandler.KEY, PlayerHeadBlockHandler::new);
205+
MinecraftServer.getBlockManager().registerHandler(SignBlockHandler.KEY, SignBlockHandler::new);
206+
201207
// Register NPCs
202208
if (mainInstance != null) {
203209
loader.getNPCs().forEach(HypixelNPC::register);
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package net.swofty.type.generic.block;
2+
3+
import net.kyori.adventure.key.Key;
4+
import net.minestom.server.instance.block.BlockHandler;
5+
import net.minestom.server.tag.Tag;
6+
import org.jspecify.annotations.NonNull;
7+
8+
import java.util.Collection;
9+
import java.util.Set;
10+
11+
public class PlayerHeadBlockHandler implements BlockHandler {
12+
public static final Key KEY = Key.key("minecraft:skull");
13+
14+
@Override
15+
public @NonNull Key getKey() {
16+
return KEY;
17+
}
18+
19+
@Override
20+
public @NonNull Collection<Tag<?>> getBlockEntityTags() {
21+
return Set.of(Tag.NBT("profile"));
22+
}
23+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package net.swofty.type.generic.block;
2+
3+
import net.kyori.adventure.key.Key;
4+
import net.minestom.server.instance.block.BlockHandler;
5+
import net.minestom.server.tag.Tag;
6+
import org.jetbrains.annotations.NotNull;
7+
8+
import java.util.Collection;
9+
import java.util.Set;
10+
11+
public final class SignBlockHandler implements BlockHandler {
12+
public static final Key KEY = Key.key("minecraft:sign");
13+
14+
@Override
15+
public @NotNull Key getKey() {
16+
return KEY;
17+
}
18+
19+
@Override
20+
public @NotNull Collection<Tag<?>> getBlockEntityTags() {
21+
return Set.of(
22+
Tag.Byte("is_waxed"),
23+
Tag.NBT("front_text"),
24+
Tag.NBT("back_text"));
25+
}
26+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package net.swofty.type.generic.data.datapoints;
2+
3+
import net.swofty.commons.protocol.JacksonSerializer;
4+
import net.swofty.type.generic.data.Datapoint;
5+
6+
import java.util.HashMap;
7+
import java.util.Map;
8+
9+
public class DatapointMapLongInteger extends Datapoint<Map<Long, Integer>> {
10+
private static final JacksonSerializer<Map<Long, Integer>> serializer =
11+
new JacksonSerializer<>((Class) Map.class);
12+
13+
public DatapointMapLongInteger(String key, Map<Long, Integer> value) {
14+
super(key, value, serializer);
15+
}
16+
17+
// Required for deepClone() reflection which passes HashMap.class
18+
public DatapointMapLongInteger(String key, HashMap<Long, Integer> value) {
19+
super(key, value, serializer);
20+
}
21+
22+
public DatapointMapLongInteger(String key) {
23+
super(key, new HashMap<>(), serializer);
24+
}
25+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package net.swofty.type.generic.data.datapoints;
2+
3+
import net.swofty.commons.protocol.JacksonSerializer;
4+
import net.swofty.type.generic.data.Datapoint;
5+
6+
import java.time.Year;
7+
import java.util.HashMap;
8+
import java.util.List;
9+
import java.util.Map;
10+
11+
public class DatapointPresentYear extends Datapoint<DatapointPresentYear.YearData> {
12+
private static final JacksonSerializer<DatapointPresentYear.YearData> serializer =
13+
new JacksonSerializer<>((Class) DatapointPresentYear.YearData.class);
14+
15+
public DatapointPresentYear(String key, YearData value) {
16+
super(key, value, serializer);
17+
}
18+
19+
public DatapointPresentYear(String key) {
20+
super(key, new YearData(0, List.of()), serializer);
21+
}
22+
23+
public record YearData(int year, List<Integer> value) {
24+
25+
}
26+
}

0 commit comments

Comments
 (0)