Skip to content

Commit

Permalink
Merge pull request #843 from eccentricdevotion/difficulty
Browse files Browse the repository at this point in the history
Update to 1.21
  • Loading branch information
eccentricdevotion authored Jun 18, 2024
2 parents e879cda + b515974 commit 741082d
Show file tree
Hide file tree
Showing 512 changed files with 5,680 additions and 2,043 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Jenkins CI builds can be found here:
[http://tardisjenkins.duckdns.org:8080/job/TARDIS/](http://tardisjenkins.duckdns.org:8080/job/TARDIS/)

[![Jenkins status](https://img.shields.io/website?down_message=offline&label=Jenkins&style=for-the-badge&up_message=online&url=http%3A%2F%2Ftardisjenkins.duckdns.org%3A8080%2F)](http://tardisjenkins.duckdns.org:8080/job/TARDIS/)
![Build Status](https://img.shields.io/jenkins/build?jobUrl=http%3A%2F%2Ftardisjenkins.duckdns.org%3A8080%2Fjob%2FTARDIS&style=for-the-badge)
![Build Status](https://img.shields.io/jenkins/build?jobUrl=http://tardisjenkins.duckdns.org:8080/job/TARDIS&style=for-the-badge)
![GitHub last commit](https://img.shields.io/github/last-commit/eccentricdevotion/TARDIS?style=for-the-badge)

![GitHub top language](https://img.shields.io/github/languages/top/eccentricdevotion/TARDIS?style=for-the-badge)
Expand All @@ -37,6 +37,7 @@ Jenkins CI builds can be found here:
![Spigot size](https://img.shields.io/spiget/download-size/45729?label=Spigot%20size&style=for-the-badge)
![bStats Servers](https://img.shields.io/bstats/servers/11698?style=for-the-badge)

![1.20.6 downloads](https://img.shields.io/github/downloads/eccentricdevotion/TARDIS/1.20.6/total?style=for-the-badge)
![1.20.4 downloads](https://img.shields.io/github/downloads/eccentricdevotion/TARDIS/1.20.4/total?style=for-the-badge)
![1.20.3 downloads](https://img.shields.io/github/downloads/eccentricdevotion/TARDIS/1.20.3/total?style=for-the-badge)
![1.20.2 downloads](https://img.shields.io/github/downloads/eccentricdevotion/TARDIS/1.20.2/total?style=for-the-badge)
Expand Down
24 changes: 15 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>me.eccentric_nz.TARDIS</groupId>
<artifactId>TARDIS</artifactId>
<version>5.6.0</version>
<version>5.7.0</version>
<name>TARDIS</name>
<description>A Doctor Who Plugin</description>
<properties>
Expand Down Expand Up @@ -170,9 +170,9 @@
</goals>
<id>remap-obf</id>
<configuration>
<srgIn>org.spigotmc:minecraft-server:1.20.6-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
<srgIn>org.spigotmc:minecraft-server:1.21-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
<reverse>true</reverse>
<remappedDependencies>org.spigotmc:spigot:1.20.6-R0.1-SNAPSHOT:jar:remapped-mojang
<remappedDependencies>org.spigotmc:spigot:1.21-R0.1-SNAPSHOT:jar:remapped-mojang
</remappedDependencies>
<remappedArtifactAttached>true</remappedArtifactAttached>
<remappedClassifierName>remapped-obf</remappedClassifierName>
Expand All @@ -188,8 +188,8 @@
<inputFile>
${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar
</inputFile>
<srgIn>org.spigotmc:minecraft-server:1.20.6-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
<remappedDependencies>org.spigotmc:spigot:1.20.6-R0.1-SNAPSHOT:jar:remapped-obf
<srgIn>org.spigotmc:minecraft-server:1.21-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
<remappedDependencies>org.spigotmc:spigot:1.21-R0.1-SNAPSHOT:jar:remapped-obf
</remappedDependencies>
</configuration>
</execution>
Expand Down Expand Up @@ -256,7 +256,7 @@
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.20.6-R0.1-SNAPSHOT</version>
<version>1.21-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<exclusions>
<exclusion>
Expand All @@ -280,7 +280,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.20.6-R0.1-SNAPSHOT</version>
<version>1.21-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>
Expand Down Expand Up @@ -349,7 +349,7 @@
<dependency>
<groupId>com.palmergames.bukkit.towny</groupId>
<artifactId>towny</artifactId>
<version>0.100.2.0</version>
<version>0.100.3.0</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -486,7 +486,7 @@
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.5</version>
<version>2.11.6</version>
<type>jar</type>
<scope>provided</scope>
<exclusions>
Expand Down Expand Up @@ -565,6 +565,12 @@
<version>2.7.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>xyz.jpenilla</groupId>
<artifactId>squaremap-api</artifactId>
<version>1.2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.MilkBowl</groupId>
<artifactId>VaultAPI</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import me.eccentric_nz.TARDIS.TARDIS;
import me.eccentric_nz.TARDIS.blueprints.TARDISPermission;
import me.eccentric_nz.TARDIS.custommodeldata.GUIArs;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import me.eccentric_nz.TARDIS.commands.sudo.TARDISSudoTracker;
import me.eccentric_nz.TARDIS.enumeration.TardisModule;
import me.eccentric_nz.TARDIS.utility.TARDISStringUtils;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import me.eccentric_nz.TARDIS.enumeration.TardisModule;
import me.eccentric_nz.TARDIS.move.TARDISDoorListener;
import me.eccentric_nz.TARDIS.travel.TARDISDoorLocation;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@
import me.eccentric_nz.TARDIS.commands.sudo.TARDISSudoTracker;
import me.eccentric_nz.TARDIS.database.resultset.*;
import me.eccentric_nz.TARDIS.enumeration.Consoles;
import me.eccentric_nz.TARDIS.enumeration.Difficulty;
import me.eccentric_nz.TARDIS.enumeration.DiskCircuit;
import me.eccentric_nz.TARDIS.enumeration.TardisModule;
import me.eccentric_nz.TARDIS.rooms.RoomRequiredLister;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.InventoryView;
Expand Down Expand Up @@ -347,7 +346,7 @@ void close(Player player) {
delay += period;
}
// damage the circuit if configured
if (plugin.getConfig().getBoolean("circuits.damage") && !plugin.getDifficulty().equals(Difficulty.EASY) && plugin.getConfig().getInt("circuits.uses.ars") > 0) {
if (plugin.getConfig().getBoolean("circuits.damage") && plugin.getConfig().getInt("circuits.uses.ars") > 0) {
// get the id of the TARDIS this player is in
int id = plugin.getTardisAPI().getIdOfTARDISPlayerIsIn(playerUUID);
TARDISCircuitChecker tcc = new TARDISCircuitChecker(plugin, id);
Expand Down
37 changes: 25 additions & 12 deletions src/main/java/me/eccentric_nz/TARDIS/TARDIS.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import me.eccentric_nz.TARDIS.mapping.TARDISBlueMap;
import me.eccentric_nz.TARDIS.mapping.TARDISDynmap;
import me.eccentric_nz.TARDIS.mapping.TARDISMapper;
import me.eccentric_nz.TARDIS.mapping.TARDISSquareMap;
import me.eccentric_nz.TARDIS.messaging.AdventureMessage;
import me.eccentric_nz.TARDIS.messaging.SpigotMessage;
import me.eccentric_nz.TARDIS.messaging.TARDISMessage;
Expand Down Expand Up @@ -140,10 +141,9 @@ public class TARDIS extends JavaPlugin {
private final HashMap<String, String> versions = new HashMap<>();
private final String versionRegex = "(\\d+[.])+\\d+";
private final Pattern versionPattern = Pattern.compile(versionRegex);
private final String serverStr = "1.20.6";
private TARDISChatGUI jsonKeeper;
private final String serverStr = "1.21";
private TARDISChatGUI<?> jsonKeeper;
private TARDISUpdateChatGUI updateChatGUI;
// public TARDISFurnaceRecipe fornacis;
private Calendar afterCal;
private Calendar beforeCal;
private ConsoleCommandSender console;
Expand Down Expand Up @@ -171,6 +171,7 @@ public class TARDIS extends JavaPlugin {
private FileConfiguration itemsConfig;
private FileConfiguration blasterConfig;
private FileConfiguration customModelConfig;
private FileConfiguration systemUpgradesConfig;
private HashMap<String, Integer> condensables;
private BukkitTask standbyTask;
private TARDISChameleonPreset presets;
Expand All @@ -192,7 +193,7 @@ public class TARDIS extends JavaPlugin {
private TARDISHelper tardisHelper = null;
private TARDISMultiverseHelper mvHelper = null;
private String prefix;
private Difficulty difficulty;
private CraftingDifficulty craftingDifficulty;
private WorldManager worldManager;
private BukkitTask recordingTask;
private NamespacedKey oldBlockKey;
Expand Down Expand Up @@ -423,10 +424,10 @@ public void onEnable() {
generalKeeper = new TARDISGeneralInstanceKeeper(this);
generalKeeper.setQuotes(quotes());
try {
difficulty = Difficulty.valueOf(getConfig().getString("preferences.difficulty", "EASY").toUpperCase(Locale.ENGLISH));
craftingDifficulty = CraftingDifficulty.valueOf(getConfig().getString("difficulty.crafting", "EASY").toUpperCase(Locale.ENGLISH));
} catch (IllegalArgumentException e) {
debug("Could not determine difficulty setting, using EASY");
difficulty = Difficulty.EASY;
craftingDifficulty = CraftingDifficulty.EASY;
}
// register recipes
figura = new TARDISShapedRecipe(this);
Expand All @@ -452,6 +453,8 @@ public void onEnable() {
getMessenger().message(console, TardisModule.TARDIS, "Loading Mapping Module");
if (mapper.equals("dynmap")) {
tardisMapper = new TARDISDynmap(this);
} else if (mapper.equals("squaremap")) {
tardisMapper = new TARDISSquareMap(this);
} else {
tardisMapper = new TARDISBlueMap(this);
}
Expand Down Expand Up @@ -885,6 +888,15 @@ public FileConfiguration getCustomModelConfig() {
return customModelConfig;
}

/**
* Gets the system upgrades configuration
*
* @return the system upgrades configuration
*/
public FileConfiguration getSystemUpgradesConfig() {
return systemUpgradesConfig;
}

/**
* Gets the language configuration
*
Expand Down Expand Up @@ -1232,17 +1244,17 @@ public List<String> getCleanUpWorlds() {
*
* @return the TARDIS Difficulty level
*/
public Difficulty getDifficulty() {
return difficulty;
public CraftingDifficulty getCraftingDifficulty() {
return craftingDifficulty;
}

/**
* Sets the TARDIS Difficulty level
*
* @param difficulty the {@link Difficulty} level to set
* @param craftingDifficulty the {@link CraftingDifficulty} level to set
*/
public void setDifficulty(Difficulty difficulty) {
this.difficulty = difficulty;
public void setDifficulty(CraftingDifficulty craftingDifficulty) {
this.craftingDifficulty = craftingDifficulty;
}

/**
Expand Down Expand Up @@ -1648,7 +1660,7 @@ private void loadCustomConfigs() {
"monsters.yml",
"planets.yml",
"recipes.yml", "rooms.yml",
"shop.yml",
"shop.yml", "system_upgrades.yml",
"tag.yml",
"vortex_manipulator.yml"
);
Expand Down Expand Up @@ -1690,6 +1702,7 @@ private void loadCustomConfigs() {
blasterConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "blaster.yml"));
}
customModelConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "custom_models.yml"));
systemUpgradesConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "system_upgrades.yml"));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
import me.eccentric_nz.TARDIS.desktop.TARDISThemeMenuListener;
import me.eccentric_nz.TARDIS.desktop.TARDISWallMenuListener;
import me.eccentric_nz.TARDIS.display.TARDISDisplayListener;
import me.eccentric_nz.TARDIS.enumeration.Difficulty;
import me.eccentric_nz.TARDIS.enumeration.InventoryManager;
import me.eccentric_nz.TARDIS.flight.FlightGamemodeListener;
import me.eccentric_nz.TARDIS.flight.TARDISHandbrakeListener;
Expand All @@ -73,6 +72,7 @@
import me.eccentric_nz.TARDIS.listeners.controls.*;
import me.eccentric_nz.TARDIS.mobfarming.TARDISFarmingMenuListener;
import me.eccentric_nz.TARDIS.move.*;
import me.eccentric_nz.TARDIS.particles.TARDISParticleGUIListener;
import me.eccentric_nz.TARDIS.planets.*;
import me.eccentric_nz.TARDIS.recipes.TARDISRecipeCategoryListener;
import me.eccentric_nz.TARDIS.recipes.TARDISRecipeInventoryListener;
Expand All @@ -92,6 +92,7 @@
import me.eccentric_nz.TARDIS.travel.save.TARDISSavesPlanetListener;
import me.eccentric_nz.TARDIS.universaltranslator.TARDISTranslateChatListener;
import me.eccentric_nz.TARDIS.update.TARDISUpdateListener;
import me.eccentric_nz.TARDIS.upgrades.TARDISSystemTreeListener;
import me.eccentric_nz.tardischemistry.block.ChemistryBlockListener;
import me.eccentric_nz.tardischemistry.compound.CompoundGUIListener;
import me.eccentric_nz.tardischemistry.compound.GlueListener;
Expand Down Expand Up @@ -168,7 +169,7 @@ TARDISInformationSystemListener registerListeners() {
plugin.getPM().registerEvents(new TARDISArtronFurnaceListener(plugin), plugin);
plugin.getPM().registerEvents(new TARDISBeaconColouringListener(plugin), plugin);
plugin.getPM().registerEvents(new TARDISBindListener(plugin), plugin);
if (!plugin.getDifficulty().equals(Difficulty.HARD)) {
if (plugin.getConfig().getBoolean("difficulty.biome_reader")) {
plugin.getPM().registerEvents(new TARDISBiomeReaderListener(plugin), plugin);
}
plugin.getPM().registerEvents(new TARDISBlockDamageListener(plugin), plugin);
Expand Down Expand Up @@ -241,6 +242,7 @@ TARDISInformationSystemListener registerListeners() {
plugin.getPM().registerEvents(new TARDISPerceptionFilterListener(plugin), plugin);
}
plugin.getPM().registerEvents(new TARDISPaperBagListener(plugin), plugin);
plugin.getPM().registerEvents(new TARDISParticleGUIListener(plugin), plugin);
plugin.getPM().registerEvents(new TARDISPistonListener(plugin), plugin);
plugin.getPM().registerEvents(new TARDISPortalListener(plugin), plugin);
plugin.getPM().registerEvents(new TARDISPrefsMenuListener(plugin), plugin);
Expand Down Expand Up @@ -281,6 +283,7 @@ TARDISInformationSystemListener registerListeners() {
plugin.getPM().registerEvents(new TARDISSpawnListener(plugin), plugin);
plugin.getPM().registerEvents(new TARDISStattenheimListener(plugin), plugin);
plugin.getPM().registerEvents(new TARDISStorageListener(plugin), plugin);
plugin.getPM().registerEvents(new TARDISSystemTreeListener(plugin), plugin);
plugin.getPM().registerEvents(new TARDISTagListener(plugin), plugin);
plugin.getPM().registerEvents(new TARDISTelepathicListener(plugin), plugin);
plugin.getPM().registerEvents(new TARDISTeleportListener(plugin), plugin);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import me.eccentric_nz.TARDIS.TARDIS;
import me.eccentric_nz.TARDIS.api.Parameters;
import me.eccentric_nz.TARDIS.database.data.Throticle;
import me.eccentric_nz.TARDIS.database.resultset.ResultSetControls;
import me.eccentric_nz.TARDIS.database.resultset.ResultSetDestinations;
import me.eccentric_nz.TARDIS.database.resultset.ResultSetHomeLocation;
Expand Down Expand Up @@ -173,10 +174,11 @@ public String process() {
TARDISEPSRunnable EPS_runnable = new TARDISEPSRunnable(plugin, message, player, playerUUIDs, id, eps, creeper);
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, EPS_runnable, 20L);
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, () -> {
Throticle throticle = new Throticle(SpaceTimeThrottle.NORMAL, false);
// dematerialise
new TARDISDematerialiseToVortex(plugin, id, player, handbrake, SpaceTimeThrottle.NORMAL).run();
new TARDISDematerialiseToVortex(plugin, id, player, handbrake, throticle).run();
// materialise
new TARDISMaterialseFromVortex(plugin, id, player, handbrake, SpaceTimeThrottle.NORMAL).run();
new TARDISMaterialseFromVortex(plugin, id, player, handbrake, throticle).run();
}, 60L);
} else {
return "Could not disengage handbrake.";
Expand Down
Loading

0 comments on commit 741082d

Please sign in to comment.