Skip to content

Commit 21f7f58

Browse files
Merge pull request #1075 from eccentricdevotion
New rooms and bug fixes
2 parents aa00897 + 7284265 commit 21f7f58

File tree

103 files changed

+2256
-428
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+2256
-428
lines changed

.github/workflows/gradle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
branches: [ "master" ]
1010

1111
env:
12-
VERSION: '6.3.8'
12+
VERSION: '6.3.9'
1313
RELEASE_TAG: '1.21.11'
1414

1515
jobs:

build.gradle.kts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import java.io.ByteArrayOutputStream
55
plugins {
66
`java-library`
77
id("io.papermc.paperweight.userdev") version "2.0.0-SNAPSHOT"
8-
id("com.gradleup.shadow") version "9.3.0"
8+
id("com.gradleup.shadow") version "9.3.1"
99
id("java")
1010
id("io.papermc.hangar-publish-plugin") version "0.1.4"
1111
}
1212

1313
group = "me.eccentric_nz"
1414
val buildNumber = "-b${System.getenv("BUILD_NUMBER") ?: (System.getenv("SHORT_SHA") ?: ".local")}"
15-
version = "6.3.8${buildNumber}"
15+
version = "6.3.9${buildNumber}"
1616

1717
repositories {
1818
mavenCentral()
@@ -103,13 +103,13 @@ dependencies {
103103
compileOnly("net.citizensnpcs:citizensapi:2.0.41-SNAPSHOT") {
104104
isTransitive = false
105105
}
106-
compileOnly("com.palmergames.bukkit.towny:towny:0.102.0.2") {
106+
compileOnly("com.palmergames.bukkit.towny:towny:0.102.0.3") {
107107
isTransitive = false
108108
}
109-
compileOnly("org.mvplugins.multiverse.core:multiverse-core:5.4.0") {
109+
compileOnly("org.mvplugins.multiverse.core:multiverse-core:5.5.0") {
110110
isTransitive = false
111111
}
112-
compileOnly("org.mvplugins.multiverse.inventories:multiverse-inventories:5.3.0") {
112+
compileOnly("org.mvplugins.multiverse.inventories:multiverse-inventories:5.3.1") {
113113
isTransitive = false
114114
}
115115
compileOnly("dev.kitteh:factionsuuid:0.7.0") {
@@ -167,7 +167,7 @@ dependencies {
167167
compileOnly("org.swinglabs:swing-layout:1.0.3") {
168168
isTransitive = false
169169
}
170-
testImplementation(platform("org.junit:junit-bom:6.0.1"))
170+
testImplementation(platform("org.junit:junit-bom:6.0.2"))
171171
testImplementation("org.junit.jupiter:junit-jupiter")
172172
}
173173

src/main/java/me/eccentric_nz/TARDIS/ARS/JettisonRunnable.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,24 @@ public class JettisonRunnable implements Runnable {
4646
private final ARS room;
4747
private final int id;
4848
private final Player player;
49+
private final boolean relocate;
50+
51+
public JettisonRunnable(TARDIS plugin, JettisonSlot slot, ARS room, int id, Player player, boolean relocate) {
52+
this.plugin = plugin;
53+
this.slot = slot;
54+
this.room = room;
55+
this.id = id;
56+
this.player = player;
57+
this.relocate = relocate;
58+
}
4959

5060
public JettisonRunnable(TARDIS plugin, JettisonSlot slot, ARS room, int id, Player player) {
5161
this.plugin = plugin;
5262
this.slot = slot;
5363
this.room = room;
5464
this.id = id;
5565
this.player = player;
66+
this.relocate = false;
5667
}
5768

5869
@Override
@@ -133,7 +144,9 @@ public void run() {
133144
if (player.isOnline()) {
134145
plugin.getMessenger().send(player, TardisModule.TARDIS, "ENERGY_RECOVERED", String.format("%d", amount));
135146
}
136-
new RoomCleaner(plugin).removeRecords(r, id, world, player);
147+
if (!relocate) {
148+
new RoomCleaner(plugin).removeRecords(r, id, world, player);
149+
}
137150
}
138151
}
139152
}

src/main/java/me/eccentric_nz/TARDIS/ARS/TARDISARS.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public enum TARDISARS implements ARS {
3232
APIARY("BEE_NEST", "Apiary", 1, RoomVariant.APIARY.getKey()),
3333
AQUARIUM("TUBE_CORAL_BLOCK", "Aquarium", 1, RoomVariant.AQUARIUM.getKey()),
3434
ARBORETUM("OAK_LEAVES", "Arboretum", 1, RoomVariant.ARBORETUM.getKey()),
35+
ARCHITECTURAL("WAXED_COPPER_GRATE", "Architectural Reconfiguration System", 1, RoomVariant.ARCHITECTURAL.getKey()),
3536
BAKER("END_STONE", "4th Doctor's Secondary Console", 1, RoomVariant.BAKER.getKey()),
3637
BAMBOO("BAMBOO", "Bamboo", 1, RoomVariant.BAMBOO.getKey()),
3738
BEDROOM("GLOWSTONE", "Bedroom", 1, RoomVariant.BEDROOM.getKey()),
@@ -40,6 +41,7 @@ public enum TARDISARS implements ARS {
4041
EMPTY("GLASS", "Empty", 1, RoomVariant.EMPTY.getKey()),
4142
EYE("SHROOMLIGHT", "Eye of Harmony", 1, RoomVariant.EYE.getKey()),
4243
FARM("DIRT", "Mob Farm", 1, RoomVariant.FARM.getKey()),
44+
GALLERY("CHISELED_QUARTZ_BLOCK", "Art Gallery", 1, RoomVariant.GALLERY.getKey()),
4345
GARDEN("CHERRY_LEAVES", "Flower Garden", 1, RoomVariant.GARDEN.getKey()),
4446
GEODE("AMETHYST_BLOCK", "Geode", 1, RoomVariant.GEODE.getKey()),
4547
GRAVITY("MOSSY_COBBLESTONE", "Gravity Well", 1, RoomVariant.GRAVITY.getKey()),
@@ -50,6 +52,7 @@ public enum TARDISARS implements ARS {
5052
IGLOO("PACKED_ICE", "Igloo", 1, RoomVariant.IGLOO.getKey()),
5153
IISTUBIL("WHITE_GLAZED_TERRACOTTA", "Camel Stable", 1, RoomVariant.IISTUBIL.getKey()),
5254
KITCHEN("PUMPKIN", "Kitchen", 1, RoomVariant.KITCHEN.getKey()),
55+
LAUNDRY("VERDANT_FROGLIGHT", "Laundry", 1, RoomVariant.LAUNDRY.getKey()),
5356
LAVA("MAGMA_BLOCK", "Lava", 1, RoomVariant.LAVA.getKey()),
5457
LAZARUS("FURNACE", "Genetic Manipulator", 1, RoomVariant.LAZARUS.getKey()),
5558
LIBRARY("ENCHANTING_TABLE", "Library", 1, RoomVariant.LIBRARY.getKey()),

src/main/java/me/eccentric_nz/TARDIS/ARS/relocator/RoomRelocatorListener.java

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
public class RoomRelocatorListener extends ARSMethods implements Listener {
6161

6262
public final HashMap<UUID, Integer> relocation_slot = new HashMap<>();
63+
public final HashMap<UUID, ItemStack> level_switch = new HashMap<>();
6364

6465
public RoomRelocatorListener(TARDIS plugin) {
6566
super(plugin);
@@ -102,21 +103,21 @@ public void onRoomRelocatorClick(InventoryClickEvent event) {
102103
plugin.getMessenger().send(player, TardisModule.TARDIS, "RELOCATOR_GRAVITY");
103104
return;
104105
}
105-
if (!checkSlotForConsole(view, slot) && !selected_slot.containsKey(playerUUID)) {
106+
if (!checkSlotForConsole(view, slot) && !level_switch.containsKey(playerUUID)) {
106107
// select room to move
107-
selected_slot.put(playerUUID, slot);
108-
} else if (!relocation_slot.containsKey(playerUUID) && selected_slot.containsKey(playerUUID) && isEmptySlot(view, slot)) {
108+
setFromSlot(view, uuid, slot);
109+
} else if (!relocation_slot.containsKey(playerUUID) && level_switch.containsKey(playerUUID) && isEmptySlot(view, slot)) {
109110
relocation_slot.put(playerUUID, slot);
110111
// set slot to selected room with glint
111-
setRelocationSlots(view, playerUUID);
112+
setRelocationSlot(view, playerUUID);
112113
} else {
113114
// need to reset
114115
plugin.getMessenger().send(player, TardisModule.TARDIS, "RELOCATOR_RESET");
115116
}
116117
}
117118
case 10 -> loadMap(view, playerUUID, true); // load map
118119
case 12 -> {
119-
if (!selected_slot.containsKey(playerUUID) || !relocation_slot.containsKey(playerUUID)) {
120+
if (!level_switch.containsKey(playerUUID) || !relocation_slot.containsKey(playerUUID)) {
120121
plugin.getMessenger().send(player, TardisModule.TARDIS, "RELOCATOR_SELECT");
121122
return;
122123
}
@@ -140,8 +141,9 @@ public void onRoomRelocatorClick(InventoryClickEvent event) {
140141
}
141142
case 30 -> {
142143
// reset
143-
selected_slot.remove(playerUUID);
144+
level_switch.remove(playerUUID);
144145
relocation_slot.remove(playerUUID);
146+
level_switch.remove(uuid);
145147
loadMap(view, playerUUID, false);
146148
}
147149
default -> {
@@ -158,7 +160,7 @@ private void relocate(Player player, InventoryView view, int slot) {
158160
UUID playerUUID = player.getUniqueId();
159161
// start relocation
160162
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, () -> {
161-
selected_slot.remove(playerUUID);
163+
level_switch.remove(playerUUID);
162164
relocation_slot.remove(playerUUID);
163165
hasLoadedMap.remove(playerUUID);
164166
if (map_data.containsKey(playerUUID)) {
@@ -231,21 +233,21 @@ private void relocate(Player player, InventoryView view, int slot) {
231233
int ey = relocated.getY();
232234
int ex = relocated.getX();
233235
int ez = relocated.getZ();
234-
int diffy = ey - sy;
235-
int diffx = ex - sx;
236-
int diffz = ez - sz;
236+
int dy = ey - sy;
237+
int dx = ex - sx;
238+
int dz = ez - sz;
237239
// get the height of the schematic
238240
int height = getSchematicHeight(room);
239241
long a_long_time = (16 * 16 * height * (Math.round(20 / plugin.getConfig().getDouble("growth.room_speed"))));
240242
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, () -> {
241243
for (Map.Entry<Entity, Location> e : mobs.entrySet()) {
242-
Location tp = e.getValue().add(diffx, diffy, diffz);
244+
Location tp = e.getValue().add(dx, dy, dz);
243245
e.getKey().teleport(tp);
244246
}
245247
plugin.getMessenger().send(player, TardisModule.TARDIS, "ROOM_JETT", String.format("%d", tap.getJettison().size()));
246248
}, a_long_time);
247249
// do the jettison last
248-
JettisonRunnable jr = new JettisonRunnable(plugin, jettison, entry.getValue(), ids.get(playerUUID), player);
250+
JettisonRunnable jr = new JettisonRunnable(plugin, jettison, entry.getValue(), ids.get(playerUUID), player, true);
249251
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, jr, a_long_time + 50);
250252
// damage the circuit if configured
251253
DamageUtility.run(plugin, DiskCircuit.ARS, plugin.getTardisAPI().getIdOfTARDISPlayerIsIn(playerUUID), player);
@@ -290,20 +292,24 @@ private String getRoomName(InventoryView view, int slot) {
290292
return "";
291293
}
292294

293-
private void setRelocationSlots(InventoryView view, UUID uuid) {
294-
int from_slot = selected_slot.get(uuid);
295+
private void setRelocationSlot(InventoryView view, UUID uuid) {
295296
int to_slot = relocation_slot.get(uuid);
296-
ItemStack is = view.getItem(from_slot).clone();
297+
ItemStack is = level_switch.get(uuid).clone();
297298
ItemMeta im = is.getItemMeta();
298299
im.setEnchantmentGlintOverride(true);
299300
is.setItemMeta(im);
300301
setSlot(view, to_slot, is, uuid, true);
301-
view.setItem(to_slot, is);
302-
ItemStack tnt = ItemStack.of(Material.TNT, 1);
303-
ItemMeta j = tnt.getItemMeta();
304-
j.displayName(Component.text("Jettison"));
305-
tnt.setItemMeta(j);
306-
setSlot(view, from_slot, tnt, uuid, true);
302+
}
303+
304+
private void setFromSlot(InventoryView view, UUID uuid, int slot) {
305+
level_switch.put(uuid, view.getItem(slot));
306+
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, () -> {
307+
ItemStack tnt = ItemStack.of(Material.TNT, 1);
308+
ItemMeta j = tnt.getItemMeta();
309+
j.displayName(Component.text("Jettison"));
310+
tnt.setItemMeta(j);
311+
setSlot(view, slot, tnt, uuid, true);
312+
}, 2L);
307313
}
308314

309315
private boolean isEmptySlot(InventoryView view, int slot) {

src/main/java/me/eccentric_nz/TARDIS/TARDISConstants.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ public class TARDISConstants {
223223
* BlockData for MAGMA_BLOCK
224224
*/
225225
public static final BlockData MAGMA = Material.MAGMA_BLOCK.createBlockData();
226+
/**
227+
* BlockData for SOUL_SAND
228+
*/
229+
public static final BlockData SOUL_SAND = Material.SOUL_SAND.createBlockData();
226230
/**
227231
* BlockData for police box LIGHT
228232
*/

src/main/java/me/eccentric_nz/TARDIS/TARDISListenerRegisterer.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,11 @@
8989
import me.eccentric_nz.TARDIS.recipes.TARDISRecipeInventoryListener;
9090
import me.eccentric_nz.TARDIS.rooms.JettisonSeeder;
9191
import me.eccentric_nz.TARDIS.rooms.RoomSeeder;
92+
import me.eccentric_nz.TARDIS.rooms.architectural.ArchitecturalBlueprintsListener;
9293
import me.eccentric_nz.TARDIS.rooms.eye.ArtronCapacitorStorageListener;
9394
import me.eccentric_nz.TARDIS.rooms.eye.EyeDamageListener;
9495
import me.eccentric_nz.TARDIS.rooms.eye.SpaceHelmetListener;
96+
import me.eccentric_nz.TARDIS.rooms.laundry.WashingMachineListener;
9597
import me.eccentric_nz.TARDIS.rooms.library.LibraryListener;
9698
import me.eccentric_nz.TARDIS.rooms.smelter.SmelterListener;
9799
import me.eccentric_nz.TARDIS.schematic.SchematicWandListener;
@@ -173,6 +175,9 @@ void registerListeners() {
173175
plugin.getPM().registerEvents(buttonListener, plugin);
174176
plugin.getPM().registerEvents(new ARSListener(plugin), plugin);
175177
plugin.getPM().registerEvents(new ARSMapListener(plugin), plugin);
178+
if (plugin.getConfig().getBoolean("modules.blueprints")) {
179+
plugin.getPM().registerEvents(new ArchitecturalBlueprintsListener(plugin), plugin);
180+
}
176181
if (plugin.getConfig().getBoolean("allow.autonomous")) {
177182
plugin.getPM().registerEvents(new AutonomousGUIListener(plugin), plugin);
178183
}
@@ -361,6 +366,7 @@ void registerListeners() {
361366
plugin.getPM().registerEvents(new TARDISLightLevelFrameListener(plugin), plugin);
362367
plugin.getPM().registerEvents(new TARDISMonitorFrameListener(plugin), plugin);
363368
plugin.getPM().registerEvents(new PlayerShellListener(plugin), plugin);
369+
plugin.getPM().registerEvents(new WashingMachineListener(plugin), plugin);
364370
if (plugin.getConfig().getBoolean("allow.wg_flag_set") && plugin.getPM().isPluginEnabled("WorldGuard")) {
365371
plugin.getPM().registerEvents(new TARDISAntiBuildListener(plugin), plugin);
366372
}

src/main/java/me/eccentric_nz/TARDIS/artron/ArtronCondenserListener.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ public ArtronCondenserListener(TARDIS plugin) {
7676
*/
7777
@EventHandler(ignoreCancelled = true)
7878
public void onCondenserClose(InventoryCloseEvent event) {
79-
InventoryView view = event.getView();
8079
InventoryHolder holder = event.getInventory().getHolder(false);
8180
if (holder instanceof ArtronCondenserInventory chest) {
8281
if (!chest.getTitle().equals("Artron Condenser") && !chest.getTitle().equals("Server Condenser")) {

src/main/java/me/eccentric_nz/TARDIS/blueprints/BlueprintRoom.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
*/
1717
package me.eccentric_nz.TARDIS.blueprints;
1818

19+
import java.util.HashMap;
20+
1921
public enum BlueprintRoom {
2022

2123
ARCHITECTURAL("tardis.architectural"), // needed to grow rooms or use ARS
@@ -32,6 +34,7 @@ public enum BlueprintRoom {
3234
APIARY("tardis.room.apiary", BlueprintFeature.FARM),
3335
AQUARIUM("tardis.room.aquarium", BlueprintFeature.FARM),
3436
ARBORETUM("tardis.room.arboretum"),
37+
ARCHITECTURAL_ROOM("tardis.room.architectural"),
3538
BAKER("tardis.room.baker"),
3639
BAMBOO("tardis.room.bamboo", BlueprintFeature.FARM),
3740
BEDROOM("tardis.room.bedroom"),
@@ -40,6 +43,8 @@ public enum BlueprintRoom {
4043
EMPTY("tardis.room.empty"),
4144
EYE("tardis.room.eye"),
4245
FARM("tardis.room.farm", BlueprintFeature.FARM),
46+
GALLERY("tardis.room.gallery"),
47+
GARDEN("tardis.room.garden"),
4348
GEODE("tardis.room.geode"),
4449
GRAVITY("tardis.room.gravity"),
4550
GREENHOUSE("tardis.room.greenhouse"),
@@ -49,6 +54,7 @@ public enum BlueprintRoom {
4954
IGLOO("tardis.room.igloo", BlueprintFeature.FARM),
5055
IISTUBIL("tardis.room.iistubil", BlueprintFeature.FARM),
5156
KITCHEN("tardis.room.kitchen"),
57+
LAUNDRY("tardis.room.laundry"),
5258
LAVA("tardis.room.lava", BlueprintFeature.FARM),
5359
LAZARUS("tardis.room.lazarus", BlueprintFeature.LAZARUS),
5460
LIBRARY("tardis.room.library"),
@@ -74,6 +80,14 @@ public enum BlueprintRoom {
7480
WORKSHOP("tardis.room.workshop"),
7581
ZERO("tardis.room.zero");
7682

83+
public static HashMap<String, BlueprintRoom> PERMS = new HashMap<>();
84+
85+
static {
86+
for (BlueprintRoom room : BlueprintRoom.values()) {
87+
PERMS.put(room.permission, room);
88+
}
89+
}
90+
7791
private final String permission;
7892
private final BlueprintFeature feature;
7993

src/main/java/me/eccentric_nz/TARDIS/builders/interior/AbandonedBuildRunnable.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,11 @@ public void run() {
249249
}
250250
if (obj.has("item_frames")) {
251251
JsonArray frames = obj.get("item_frames").getAsJsonArray();
252-
for (int i = 0; i < frames.size(); i++) {
253-
ItemFrameSetter.curate(frames.get(i).getAsJsonObject(), cl, dbID);
254-
}
252+
ItemFrameSetter.curate(frames, cl, dbID);
255253
}
256254
if (obj.has("item_displays")) {
257255
JsonArray displays = obj.get("item_displays").getAsJsonArray();
258-
ItemDisplaySetter.process(displays, player, cl, dbID);
256+
ItemDisplaySetter.process(displays, player, cl, dbID);
259257
}
260258
// finished processing - update tardis table!
261259
plugin.getQueryFactory().doUpdate("tardis", set, where);
@@ -423,7 +421,7 @@ public void run() {
423421
String button = TARDISStaticLocationGetters.makeLocationStr(world, x, y, z);
424422
plugin.getQueryFactory().insertSyncControl(dbID, 1, button, 0);
425423
}
426-
if (type.equals(Material.JUKEBOX) && !(schm.getPermission().equals("eighth") && world.getBlockAt(x,y,z).getRelative(BlockFace.DOWN).getType() == Material.ANDESITE)) {
424+
if (type.equals(Material.JUKEBOX) && !(schm.getPermission().equals("eighth") && world.getBlockAt(x, y, z).getRelative(BlockFace.DOWN).getType() == Material.ANDESITE)) {
427425
// remember the location of this Advanced Console
428426
String advanced = TARDISStaticLocationGetters.makeLocationStr(world, x, y, z);
429427
plugin.getQueryFactory().insertSyncControl(dbID, 15, advanced, 0);

0 commit comments

Comments
 (0)