mirror of
https://github.com/RonanPlugins/BetterRTP.git
synced 2026-11-28 08:44:07 +00:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
48f211b1ad | ||
|
|
077c55723d | ||
|
|
2971c1a407 | ||
|
|
e6ccb3be55 | ||
|
|
9ab1648bfb |
No files matched your search
@@ -9,3 +9,4 @@ target
|
||||
BetterRTP.wiki/
|
||||
.DS_Store
|
||||
.vscode/
|
||||
node_modules/
|
||||
@@ -2,6 +2,9 @@
|
||||
<b><a>Welcome to BetterRTPAddons's repository!</a></b>
|
||||
</p>
|
||||
|
||||
BetterRTP-Addons is a paid resource, adding optional middleware to BetterRTP to help financially support the developement of BetterRTP.
|
||||
But this can be compiled free of charge if you know how to compile maven resources!
|
||||
|
||||
## Where's the Lang files?/Want to Contribute translating?
|
||||
All language files are located [here](src/main/resources/lang)
|
||||
feel free to fork one of the language files and help translate!
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<groupId>me.SuperRonanCraft</groupId>
|
||||
<artifactId>BetterRTP</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>3.6.12</version>
|
||||
<version>3.6.13</version>
|
||||
|
||||
<!-- Upload patches to https://repo.ronanplugins.com/#/ -->
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import me.SuperRonanCraft.BetterRTP.player.rtp.RTP_TYPE;
|
||||
import me.SuperRonanCraft.BetterRTP.references.PermissionNode;
|
||||
import me.SuperRonanCraft.BetterRTP.references.file.FileOther;
|
||||
import me.SuperRonanCraft.BetterRTP.references.messages.Message_RTP;
|
||||
import me.SuperRonanCraft.BetterRTP.references.messages.MessagesCore;
|
||||
import me.SuperRonanCraft.BetterRTP.references.web.Updater;
|
||||
import me.SuperRonanCraft.BetterRTP.references.helpers.HelperRTP;
|
||||
import me.SuperRonanCraft.BetterRTP.versions.AsyncHandler;
|
||||
@@ -12,6 +13,8 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class Join {
|
||||
|
||||
static void event(PlayerJoinEvent e) {
|
||||
@@ -25,12 +28,17 @@ public class Join {
|
||||
|
||||
//Updater
|
||||
private static void updater(Player p) {
|
||||
if (!getPl().getFiles().getType(FileOther.FILETYPE.CONFIG).getBoolean("Settings.DisableUpdater") && PermissionNode.UPDATER.check(p))
|
||||
if (!getPl().getDescription().getVersion().equals(Updater.updatedVersion))
|
||||
Message_RTP.sms(p, "&7There is currently an update for &6BetterRTP &7version &e#" +
|
||||
Updater.updatedVersion + " &7you have version &e#" + getPl().getDescription().getVersion());
|
||||
if (!getPl().getFiles().getType(FileOther.FILETYPE.CONFIG).getBoolean("Settings.DisableUpdater") && PermissionNode.UPDATER.check(p)) {
|
||||
if (!getPl().getDescription().getVersion().equals(Updater.updatedVersion)) {
|
||||
String currentVersion = getPl().getDescription().getVersion();
|
||||
String newVersion = Updater.updatedVersion;
|
||||
|
||||
MessagesCore.UPDATE.send(p, Arrays.asList(currentVersion, newVersion));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//RTP on first join
|
||||
private static void rtpOnFirstJoin(Player p) {
|
||||
if (getPl().getSettings().isRtpOnFirstJoin_Enabled() && !p.hasPlayedBefore())
|
||||
|
||||
@@ -19,6 +19,7 @@ public enum MessagesCore {
|
||||
OTHER_BIOME("Other.Biome"),
|
||||
NOTEXIST("NotExist"),
|
||||
RELOAD("Reload"),
|
||||
UPDATE("Update"),
|
||||
NOPERMISSION("NoPermission.Basic"),
|
||||
NOPERMISSION_WORLD("NoPermission.World"),
|
||||
DISABLED_WORLD("DisabledWorld"),
|
||||
|
||||
+5
-1
@@ -64,9 +64,13 @@ public class PlaceholderAnalyzer {
|
||||
str = str.replaceAll(Placeholders.WORLD.name, info);
|
||||
if (str.contains(Placeholders.COOLDOWN.name))
|
||||
str = str.replaceAll(Placeholders.COOLDOWN.name, info);
|
||||
if (str.contains(Placeholders.CURRENTDVERSION.name))
|
||||
str = str.replaceAll(Placeholders.CURRENTDVERSION.name, info);
|
||||
|
||||
if (str.contains(Placeholders.NEWVERSION.name))
|
||||
str = str.replaceAll(Placeholders.NEWVERSION.name, info);
|
||||
return str;
|
||||
}
|
||||
|
||||
private static String location(String str, Location loc) {
|
||||
if (str.contains(Placeholders.LOCATION_X.name))
|
||||
str = str.replace(Placeholders.LOCATION_X.name, String.valueOf(loc.getBlockX()));
|
||||
|
||||
+3
@@ -17,6 +17,9 @@ public enum Placeholders {
|
||||
PRICE("price"),
|
||||
DELAY("delay"),
|
||||
TIME("time"),
|
||||
// Updater
|
||||
NEWVERSION("newVersion"),
|
||||
CURRENTDVERSION("currentVersion"),
|
||||
//Other
|
||||
BIOME("biome")
|
||||
;
|
||||
|
||||
@@ -105,19 +105,13 @@ public class QueueHandler implements Listener { //Randomly queues up some safe l
|
||||
}
|
||||
|
||||
public static boolean isInSquare(Location loc, RTPWorld rtpWorld) {
|
||||
int center_x = rtpWorld.getCenterX();
|
||||
int center_z = rtpWorld.getCenterZ();
|
||||
int radius = rtpWorld.getMaxRadius();
|
||||
int radius_max = rtpWorld.getMaxRadius();
|
||||
int radius_min = rtpWorld.getMinRadius();
|
||||
int x = loc.getBlockX();
|
||||
int z = loc.getBlockZ();
|
||||
boolean xright = x <= center_x + radius && x >= center_x + radius_min;
|
||||
boolean xleft = x >= center_x - radius && x <= center_x - radius_min;
|
||||
if (!(xleft || xright))
|
||||
return false;
|
||||
boolean zbottom = z <= center_z + radius && z >= center_z + radius_min;
|
||||
boolean ztop = z >= center_z - radius && z <= center_z - radius_min;
|
||||
return ztop || zbottom;
|
||||
int x = loc.getBlockX() - rtpWorld.getCenterX();
|
||||
int z = loc.getBlockZ() - rtpWorld.getCenterZ();
|
||||
return ((Math.abs(x)>=radius_min || Math.abs(z)>=radius_min) && (Math.abs(x) <= radius_max && Math.abs(z) <= radius_max));
|
||||
// Returns true if the x or z coordinate is above the MinRadius and if they are both under the MaxRadius. Returns false otherwise.
|
||||
// (All locations provided should be below the MaxRadius anyway, but I put it in just in-case.)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ Messages:
|
||||
NotSafe: '&cCould not find safe spot within %attempts% attempts! &7%player% was not rtp''d!'
|
||||
Biome: '&cSeems like the biome&7 %biome%&c does not exist! &7Try using the tab list!'
|
||||
Reload: '&eConfig reloaded successfully!'
|
||||
Update: '&7There is currently an update for &6BetterRTP &7version &e#%newVersion% &7you have version &e#%currentVersion%'
|
||||
NoPermission:
|
||||
Basic: '&cSorry! &7You don''t have permission to use this command! &8Permission: %permission%'
|
||||
World: '&cSorry! &7You are not allowed rtp in the %world% world! &8Permission: %permission%'
|
||||
@@ -61,4 +62,4 @@ Usage:
|
||||
Location: '&cUsage&7: /%command% edit location <location_name> <max/min/useworldborder/center> <value>'
|
||||
Worldtype: '&cUsage&7: /%command% edit world_type <world> <NETHER/NORMAL>'
|
||||
Override: '&cUsage&7: /%command% edit override <world> <world_to>'
|
||||
BlacklistedBlocks: '&cUsage&7: /%command% edit blacklistedblocks <add/remove> <block_id>'
|
||||
BlacklistedBlocks: '&cUsage&7: /%command% edit blacklistedblocks <add/remove> <block_id>'
|
||||
Reference in new issue
Block a user