Skip to content

Commit d6e24da

Browse files
Floodgate forms for Bedrock players (#698)
* Start attempt to use Bedrock forms for floodgate/geyser users * More Bedrock Floodgate work * More Bedrock Floodgate work * Even more Bedrock Floodgate work * Update FloodgatePlayerPrefsForm.java * Some more forms * Desktop theme Bedrock forms * Floodgate map form * Floodgate Chameleon and transmat forms * Update FloodgateMapForm.java * Add Lazarus bedrock form * Floodgate genetic manipulator form * Start Genetic revamp * More genetic updates * Finish genetic revamp GUI is now paged rather than having to sneak onto pressure plate in Lazarus room Added new TWA monsters Added Ender Dragon * Add boss mobs to floodgate genetic GUI * Require TARDISChunkGenerator 4.12.1 * Floodgate testing * Update FloodGateControlForm.java * Delete FloodGateControlForm.java * Floodgate Destination Terminal * Update todo.md * Fix desktop theme for floodgate * Make floodgate map form actually work * Open floodgate forms where possible + add a couple more forms to build * Floodgate shell loader and weather forms * Create FloodgateTextures.java * Fix floodgate textures * Remove slot check from TARDISWeatherListener * Add atmospheric excitation to floodgate weather form * Update todo.md
1 parent 0281c9a commit d6e24da

File tree

64 files changed

+3632
-870
lines changed

Some content is hidden

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

64 files changed

+3632
-870
lines changed

pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>me.eccentric_nz.TARDIS</groupId>
55
<artifactId>TARDIS</artifactId>
6-
<version>4.12.1</version>
6+
<version>4.13.0</version>
77
<name>TARDIS</name>
88
<description>A Doctor Who Plugin</description>
99
<properties>
@@ -230,7 +230,7 @@
230230
<dependency>
231231
<groupId>me.eccentric_nz.tardisweepingangels</groupId>
232232
<artifactId>TARDISWeepingAngels</artifactId>
233-
<version>3.6.2</version>
233+
<version>4.1.0</version>
234234
<type>jar</type>
235235
<scope>compile</scope>
236236
<exclusions>

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public TARDIS() {
186186
versions.put("LibsDisguises", "10.0.26");
187187
versions.put("Multiverse-Core", "4.0");
188188
versions.put("Multiverse-Inventories", "4.0");
189-
versions.put("TARDISChunkGenerator", "4.12.0");
189+
versions.put("TARDISChunkGenerator", "4.12.1");
190190
versions.put("Towny", "0.95");
191191
versions.put("WorldBorder", "1.9.0");
192192
versions.put("WorldGuard", "7.0.8");

src/main/java/me/eccentric_nz/TARDIS/builders/TARDISSeedBlockProcessor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import me.eccentric_nz.TARDIS.messaging.TARDISMessage;
3131
import me.eccentric_nz.TARDIS.planets.TARDISAliasResolver;
3232
import me.eccentric_nz.TARDIS.planets.TARDISSpace;
33-
import me.eccentric_nz.TARDIS.utility.TARDISFloodgate;
33+
import me.eccentric_nz.TARDIS.floodgate.TARDISFloodgate;
3434
import me.eccentric_nz.TARDIS.utility.TARDISStaticUtils;
3535
import org.bukkit.Chunk;
3636
import org.bukkit.Location;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package me.eccentric_nz.TARDIS.chameleon;
2+
3+
import org.bukkit.Material;
4+
import org.bukkit.Tag;
5+
6+
import java.util.ArrayList;
7+
import java.util.List;
8+
9+
public class ShellLoaderProblemBlocks {
10+
11+
public static final List<Material> DO_FIRST = new ArrayList<>();
12+
13+
static {
14+
DO_FIRST.add(Material.LEVER);
15+
DO_FIRST.add(Material.REDSTONE_TORCH);
16+
DO_FIRST.add(Material.REDSTONE_WALL_TORCH);
17+
DO_FIRST.add(Material.TORCH);
18+
DO_FIRST.add(Material.WALL_TORCH);
19+
DO_FIRST.addAll(Tag.BUTTONS.getValues());
20+
DO_FIRST.addAll(Tag.DOORS.getValues());
21+
DO_FIRST.addAll(Tag.FLOWERS.getValues());
22+
DO_FIRST.addAll(Tag.TRAPDOORS.getValues());
23+
DO_FIRST.addAll(Tag.WALL_SIGNS.getValues());
24+
}
25+
}

src/main/java/me/eccentric_nz/TARDIS/chameleon/TARDISChameleonFrame.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
import org.bukkit.inventory.ItemStack;
2525
import org.bukkit.inventory.meta.ItemMeta;
2626

27-
class TARDISChameleonFrame {
27+
public class TARDISChameleonFrame {
2828

29-
void updateChameleonFrame(PRESET preset, String loc) {
29+
public void updateChameleonFrame(PRESET preset, String loc) {
3030
// get location of Chameleon frame
3131
Location location = TARDISStaticLocationGetters.getLocationFromBukkitString(loc);
3232
if (location != null) {

src/main/java/me/eccentric_nz/TARDIS/chameleon/TARDISChameleonPreset.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public TARDISChameleonPreset() {
172172
cave = new TARDISCavePreset();
173173
}
174174

175-
static TARDISChameleonColumn buildTARDISChameleonColumn(COMPASS d, String[][] strings) {
175+
public static TARDISChameleonColumn buildTARDISChameleonColumn(COMPASS d, String[][] strings) {
176176
TARDISChameleonColumn tcc;
177177
BlockData[][] blockDataArr = getBlockDataFromArray(strings);
178178
if (d.equals(COMPASS.EAST)) {

src/main/java/me/eccentric_nz/TARDIS/chameleon/TARDISShellLoaderListener.java

+4-15
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
import me.eccentric_nz.TARDIS.enumeration.PRESET;
3131
import me.eccentric_nz.TARDIS.listeners.TARDISMenuListener;
3232
import me.eccentric_nz.TARDIS.utility.TARDISStaticLocationGetters;
33-
import org.bukkit.*;
33+
import org.bukkit.ChatColor;
34+
import org.bukkit.Location;
35+
import org.bukkit.World;
3436
import org.bukkit.block.Block;
3537
import org.bukkit.entity.Player;
3638
import org.bukkit.event.EventHandler;
@@ -39,31 +41,18 @@
3941
import org.bukkit.inventory.InventoryView;
4042
import org.bukkit.inventory.ItemStack;
4143

42-
import java.util.ArrayList;
4344
import java.util.HashMap;
44-
import java.util.List;
4545

4646
/**
4747
* @author eccentric_nz
4848
*/
4949
public class TARDISShellLoaderListener extends TARDISMenuListener implements Listener {
5050

5151
private final TARDIS plugin;
52-
private final List<Material> problemBlocks = new ArrayList<>();
5352

5453
public TARDISShellLoaderListener(TARDIS plugin) {
5554
super(plugin);
5655
this.plugin = plugin;
57-
problemBlocks.add(Material.LEVER);
58-
problemBlocks.add(Material.REDSTONE_TORCH);
59-
problemBlocks.add(Material.REDSTONE_WALL_TORCH);
60-
problemBlocks.add(Material.TORCH);
61-
problemBlocks.add(Material.WALL_TORCH);
62-
problemBlocks.addAll(Tag.BUTTONS.getValues());
63-
problemBlocks.addAll(Tag.DOORS.getValues());
64-
problemBlocks.addAll(Tag.FLOWERS.getValues());
65-
problemBlocks.addAll(Tag.TRAPDOORS.getValues());
66-
problemBlocks.addAll(Tag.WALL_SIGNS.getValues());
6756
}
6857

6958
/**
@@ -154,7 +143,7 @@ public void onShellLoaderClick(InventoryClickEvent event) {
154143
for (int c = 0; c < 10; c++) {
155144
for (int y = fy; y < fy + 4; y++) {
156145
Block block = w.getBlockAt(fx + TARDISShellRoomConstructor.orderx[c], y, fz + TARDISShellRoomConstructor.orderz[c]);
157-
if (problemBlocks.contains(block.getType())) {
146+
if (ShellLoaderProblemBlocks.DO_FIRST.contains(block.getType())) {
158147
block.setBlockData(TARDISConstants.AIR);
159148
}
160149
}

src/main/java/me/eccentric_nz/TARDIS/commands/dev/TARDISAddRegionsCommand.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import me.eccentric_nz.TARDIS.builders.TARDISTIPSData;
2323
import me.eccentric_nz.TARDIS.database.TARDISDatabaseConnection;
2424
import me.eccentric_nz.TARDIS.planets.TARDISAliasResolver;
25-
import me.eccentric_nz.TARDIS.utility.TARDISFloodgate;
25+
import me.eccentric_nz.TARDIS.floodgate.TARDISFloodgate;
2626
import org.bukkit.command.CommandSender;
2727
import org.bukkit.configuration.file.FileConfiguration;
2828
import org.bukkit.configuration.file.YamlConfiguration;

src/main/java/me/eccentric_nz/TARDIS/commands/preferences/TARDISPrefsMenuListener.java

+18-14
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
import me.eccentric_nz.TARDIS.enumeration.Difficulty;
3232
import me.eccentric_nz.TARDIS.enumeration.DiskCircuit;
3333
import me.eccentric_nz.TARDIS.enumeration.FlightMode;
34+
import me.eccentric_nz.TARDIS.floodgate.FloodgateMapForm;
35+
import me.eccentric_nz.TARDIS.floodgate.TARDISFloodgate;
3436
import me.eccentric_nz.TARDIS.forcefield.TARDISForceField;
3537
import me.eccentric_nz.TARDIS.listeners.TARDISMenuListener;
3638
import me.eccentric_nz.TARDIS.messaging.TARDISMessage;
@@ -224,12 +226,16 @@ public void onPrefsMenuClick(InventoryClickEvent event) {
224226
if (rs.resultSet()) {
225227
// close this gui and load the TARDIS map
226228
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, () -> {
227-
Inventory new_inv = plugin.getServer().createInventory(p, 54, ChatColor.DARK_RED + "TARDIS Map");
228-
// close inventory
229-
p.closeInventory();
230-
// open new inventory
231-
new_inv.setContents(new TARDISARSMap(plugin).getMap());
232-
p.openInventory(new_inv);
229+
if (TARDISFloodgate.isFloodgateEnabled() && TARDISFloodgate.isBedrockPlayer(uuid)) {
230+
new FloodgateMapForm(plugin, uuid, rs.getTardis_id()).send();
231+
} else {
232+
Inventory new_inv = plugin.getServer().createInventory(p, 54, ChatColor.DARK_RED + "TARDIS Map");
233+
// close inventory
234+
p.closeInventory();
235+
// open new inventory
236+
new_inv.setContents(new TARDISARSMap(plugin).getMap());
237+
p.openInventory(new_inv);
238+
}
233239
}, 1L);
234240
} else {
235241
TARDISMessage.send(p, "NOT_IN_TARDIS");
@@ -274,7 +280,7 @@ public void onPrefsMenuClick(InventoryClickEvent event) {
274280
String value = (bool) ? plugin.getLanguage().getString("SET_OFF") : plugin.getLanguage().getString("SET_ON");
275281
int b = (bool) ? 0 : 1;
276282
switch (im.getDisplayName()) {
277-
case "Junk TARDIS": {
283+
case "Junk TARDIS" -> {
278284
// must be outside of the TARDIS
279285
HashMap<String, Object> wheret = new HashMap<>();
280286
wheret.put("uuid", uuid);
@@ -362,22 +368,21 @@ public void onPrefsMenuClick(InventoryClickEvent event) {
362368
TARDISMessage.send(p, message);
363369
p.performCommand("tardis rebuild");
364370
}
365-
break;
366371
}
367-
case "Companion Build":
372+
case "Companion Build" -> {
368373
String[] args = new String[2];
369374
args[0] = "";
370375
args[1] = value;
371376
new TARDISBuildCommand(plugin).toggleCompanionBuilding(p, args);
372-
break;
373-
case "Lock Containers":
377+
}
378+
case "Lock Containers" -> {
374379
if (bool) {
375380
plugin.getWorldGuardUtils().unlockContainers(p.getWorld(), p.getName());
376381
} else {
377382
plugin.getWorldGuardUtils().lockContainers(p.getWorld(), p.getName());
378383
}
379-
break;
380-
default: {
384+
}
385+
default -> {
381386
HashMap<String, Object> set = new HashMap<>();
382387
HashMap<String, Object> where = new HashMap<>();
383388
where.put("uuid", uuid.toString());
@@ -388,7 +393,6 @@ public void onPrefsMenuClick(InventoryClickEvent event) {
388393
set.put(lookup.get(im.getDisplayName()), b);
389394
}
390395
plugin.getQueryFactory().doUpdate("player_prefs", set, where);
391-
break;
392396
}
393397
}
394398
lore.set(0, value);

src/main/java/me/eccentric_nz/TARDIS/commands/tardis/TARDISDirectionCommand.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,11 @@ public boolean changeDirection(Player player, String[] args) {
153153
bd.setTardisID(id);
154154
bd.setThrottle(SpaceTimeThrottle.REBUILD);
155155
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, () -> plugin.getPresetBuilder().buildPreset(bd), 10L);
156+
TARDISMessage.send(player, "DIRECTION_CHANGED");
156157
}
157158
HashMap<String, Object> wherea = new HashMap<>();
158159
wherea.put("tardis_id", id);
159160
plugin.getQueryFactory().alterEnergyLevel("tardis", -amount, wherea, player);
160-
if (hid) {
161-
TARDISMessage.send(player, "DIRECTION_CHANGED");
162-
}
163161
// if they have a Direction Frame, update the rotation
164162
HashMap<String, Object> wheredf = new HashMap<>();
165163
wheredf.put("tardis_id", id);

src/main/java/me/eccentric_nz/TARDIS/commands/utils/TARDISWeather.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static void setClear(World world) {
3535
world.setStorm(false);
3636
}
3737

38-
static void setWeather(World world, Weather weather) {
38+
public static void setWeather(World world, Weather weather) {
3939
switch (weather) {
4040
case RAIN -> setRain(world);
4141
case THUNDER -> setThunder(world);

src/main/java/me/eccentric_nz/TARDIS/commands/utils/TARDISWeatherListener.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public void onWeatherMenuInteract(InventoryClickEvent event) {
7575
TARDISMessage.send(player, "ENERGY_NO_INIT");
7676
return;
7777
}
78-
if (plugin.getConfig().getBoolean("allow.power_down") && !tardis.isPowered_on() && slot != 6 && slot != 13 && slot != 20) {
78+
if (plugin.getConfig().getBoolean("allow.power_down") && !tardis.isPowered_on()) {
7979
TARDISMessage.send(player, "POWER_DOWN");
8080
return;
8181
}

src/main/java/me/eccentric_nz/TARDIS/companionGUI/TARDISCompanionAddGUIListener.java

+26-26
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,32 @@ public TARDISCompanionAddGUIListener(TARDIS plugin) {
4949
this.plugin = plugin;
5050
}
5151

52+
public static void addCompanion(int id, String comps, String puid) {
53+
HashMap<String, Object> tid = new HashMap<>();
54+
HashMap<String, Object> set = new HashMap<>();
55+
tid.put("tardis_id", id);
56+
if (comps != null && !comps.isEmpty() && !puid.equalsIgnoreCase("everyone")) {
57+
// add to the list
58+
String newList = comps + ":" + puid;
59+
set.put("companions", newList);
60+
} else {
61+
// make a list
62+
set.put("companions", puid);
63+
}
64+
TARDIS.plugin.getQueryFactory().doUpdate("tardis", set, tid);
65+
}
66+
67+
public static void addToRegion(String world, String owner, String companion) {
68+
// if using WorldGuard, add them to the region membership
69+
World w = TARDISAliasResolver.getWorldFromAlias(world);
70+
if (w != null) {
71+
Player player = TARDIS.plugin.getServer().getPlayer(companion);
72+
if (player != null) {
73+
TARDIS.plugin.getWorldGuardUtils().addMemberToRegion(w, owner, player.getUniqueId());
74+
}
75+
}
76+
}
77+
5278
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
5379
public void onCompanionAddGUIClick(InventoryClickEvent event) {
5480
InventoryView view = event.getView();
@@ -133,30 +159,4 @@ private void list(Player player) {
133159
}
134160
}, 5L);
135161
}
136-
137-
private void addCompanion(int id, String comps, String puid) {
138-
HashMap<String, Object> tid = new HashMap<>();
139-
HashMap<String, Object> set = new HashMap<>();
140-
tid.put("tardis_id", id);
141-
if (comps != null && !comps.isEmpty() && !puid.equalsIgnoreCase("everyone")) {
142-
// add to the list
143-
String newList = comps + ":" + puid;
144-
set.put("companions", newList);
145-
} else {
146-
// make a list
147-
set.put("companions", puid);
148-
}
149-
plugin.getQueryFactory().doUpdate("tardis", set, tid);
150-
}
151-
152-
private void addToRegion(String world, String owner, String companion) {
153-
// if using WorldGuard, add them to the region membership
154-
World w = TARDISAliasResolver.getWorldFromAlias(world);
155-
if (w != null) {
156-
Player player = plugin.getServer().getPlayer(companion);
157-
if (player != null) {
158-
plugin.getWorldGuardUtils().addMemberToRegion(w, owner, player.getUniqueId());
159-
}
160-
}
161-
}
162162
}

src/main/java/me/eccentric_nz/TARDIS/companionGUI/TARDISCompanionAddInventory.java

+21-23
Original file line numberDiff line numberDiff line change
@@ -50,30 +50,28 @@ public TARDISCompanionAddInventory(TARDIS plugin, Player player) {
5050
private ItemStack[] getItemStack() {
5151
ItemStack[] heads = new ItemStack[54];
5252
// get current companions
53+
List<String> comps;
5354
ResultSetTardisCompanions rs = new ResultSetTardisCompanions(plugin);
54-
if (rs.fromUUID(uuid.toString())) {
55-
List<String> comps;
56-
if (rs.getCompanions() != null && !rs.getCompanions().isEmpty()) {
57-
comps = Arrays.asList(rs.getCompanions().split(":"));
58-
} else {
59-
comps = new ArrayList<>();
60-
}
61-
int i = 0;
62-
for (Player p : plugin.getServer().getOnlinePlayers()) {
63-
if (i < 45) {
64-
UUID puid = p.getUniqueId();
65-
if (puid != uuid && !comps.contains(puid.toString()) && VanishChecker.canSee(player, p)) {
66-
ItemStack head = new ItemStack(Material.PLAYER_HEAD, 1);
67-
SkullMeta skull = (SkullMeta) head.getItemMeta();
68-
skull.setOwningPlayer(p);
69-
skull.setDisplayName(p.getName());
70-
ArrayList<String> lore = new ArrayList<>();
71-
lore.add(p.getUniqueId().toString());
72-
skull.setLore(lore);
73-
head.setItemMeta(skull);
74-
heads[i] = head;
75-
i++;
76-
}
55+
if (rs.fromUUID(uuid.toString()) && rs.getCompanions() != null && !rs.getCompanions().isEmpty()) {
56+
comps = Arrays.asList(rs.getCompanions().split(":"));
57+
} else {
58+
comps = new ArrayList<>();
59+
}
60+
int i = 0;
61+
for (Player p : plugin.getServer().getOnlinePlayers()) {
62+
if (i < 45) {
63+
UUID puid = p.getUniqueId();
64+
if (puid != uuid && !comps.contains(puid.toString()) && VanishChecker.canSee(player, p)) {
65+
ItemStack head = new ItemStack(Material.PLAYER_HEAD, 1);
66+
SkullMeta skull = (SkullMeta) head.getItemMeta();
67+
skull.setOwningPlayer(p);
68+
skull.setDisplayName(p.getName());
69+
ArrayList<String> lore = new ArrayList<>();
70+
lore.add(p.getUniqueId().toString());
71+
skull.setLore(lore);
72+
head.setItemMeta(skull);
73+
heads[i] = head;
74+
i++;
7775
}
7876
}
7977
}

0 commit comments

Comments
 (0)