pueblos + hClaims support updated

This commit is contained in:
SuperRonanCraft 2021-05-18 17:59:04 -04:00
parent e7cf494107
commit 2739fb633c
8 changed files with 39 additions and 18 deletions

Binary file not shown.

BIN
LocalJars/hClaimsOLD.jar Normal file

Binary file not shown.

View File

@ -45,7 +45,7 @@
<repositoryLayout>default</repositoryLayout>
<groupId>com.hakan</groupId>
<artifactId>claimsystem</artifactId>
<version>1.1.1</version>
<version>2.1.8</version>
<packaging>jar</packaging>
<generatePom>true</generatePom>
</configuration>
@ -262,6 +262,13 @@
<version>012e53d</version>
<scope>provided</scope>
</dependency>
<!-- Peublos (https://www.spigotmc.org/resources/pueblos.91255/) -->
<dependency>
<groupId>com.github.SuperRonanCraft</groupId>
<artifactId>Pueblos</artifactId>
<version>master-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!-- Particles Library -->
<dependency>
<groupId>xyz.xenondevs</groupId>

View File

@ -42,6 +42,7 @@ public class RTPSounds {
}
void playSound(Location loc, Player p, String sound) {
if (BetterRTP.getInstance().getSettings().protocolLibSounds) {
try {
ProtocolManager pm = ProtocolLibrary.getProtocolManager();
WrapperPlayServerNamedSoundEffect packet = new WrapperPlayServerNamedSoundEffect(pm.createPacket(PacketType.Play.Server.NAMED_SOUND_EFFECT));
@ -51,8 +52,11 @@ public class RTPSounds {
packet.setEffectPositionZ(loc.getBlockZ());
packet.sendPacket(p);
} catch (NoClassDefFoundError | Exception e) {
BetterRTP.getInstance().getLogger().severe("ProtocolLib Sounds is enabled in the effects.yml file, but no ProtocolLib plugin was found!");
p.playSound(p.getLocation(), getSound(sound), 1F, 1F);
}
} else
p.playSound(p.getLocation(), getSound(sound), 1F, 1F);
}
private Sound getSound(String sound) {

View File

@ -14,9 +14,10 @@ public class Settings {
public int preloadRadius; //Amount of chunks to load around a safe rtp location (clamped (0 - 16))
//Dependencies
private final SoftDepends depends = new SoftDepends();
public boolean protocolLibSounds;
public void load() { //Load Settings
FileBasics.FILETYPE config = getPl().getFiles().getType(FileBasics.FILETYPE.CONFIG);
FileBasics.FILETYPE config = FileBasics.FILETYPE.CONFIG;
debug = config.getBoolean("Settings.Debugger");
delayEnabled = config.getBoolean("Settings.Delay.Enabled");
rtpOnFirstJoin_Enabled = config.getBoolean("Settings.RtpOnFirstJoin.Enabled");
@ -24,14 +25,11 @@ public class Settings {
rtpOnFirstJoin_SetAsRespawn = config.getBoolean("Settings.RtpOnFirstJoin.SetAsRespawn");
preloadRadius = config.getInt("Settings.PreloadRadius");
statusMessages = config.getBoolean("Settings.StatusMessages");
protocolLibSounds = FileBasics.FILETYPE.EFFECTS.getBoolean("Sounds.ProtocolLibSound");
depends.load();
}
public SoftDepends getsDepends() {
return depends;
}
private BetterRTP getPl() {
return BetterRTP.getInstance();
}
}

View File

@ -19,6 +19,7 @@ public class SoftDepends {
private boolean respect_hClaims = false;
private boolean respect_griefDefender = false;
private boolean respect_ultimateClaims = false;
private boolean respect_pueblos = false;
//RETURNABLES
private boolean worldguard = false;
private boolean griefprevention = false;
@ -31,6 +32,7 @@ public class SoftDepends {
private boolean hClaims = false;
private boolean griefDefender = false;
private boolean ultimateClaims = false;
private boolean pueblos = false;
public boolean isWorldguard() {
return worldguard;
@ -90,6 +92,7 @@ public class SoftDepends {
respect_hClaims = config.getBoolean( pre + "hClaims");
respect_griefDefender = config.getBoolean( pre + "GriefDefender");
respect_ultimateClaims = config.getBoolean( pre + "UltimateClaims");
respect_pueblos = config.getBoolean( pre + "Pueblos");
registerWorldguard();
registerGriefPrevention();
registerTowny();
@ -101,6 +104,7 @@ public class SoftDepends {
registerClaimAPIPandomim();
registerGriefDefender();
registerUltimateClaims();
registerPueblos();
}
public void registerWorldguard() {
@ -169,6 +173,12 @@ public class SoftDepends {
debug("Respecting `UltimateClaims` was " + (ultimateClaims ? "SUCCESSFULLY" : "NOT") + " registered");
}
public void registerPueblos() {
pueblos = respect_pueblos && Bukkit.getPluginManager().isPluginEnabled("Pueblos");
if (respect_pueblos)
debug("Respecting `Pueblos` was " + (pueblos ? "SUCCESSFULLY" : "NOT") + " registered");
}
private void debug(String str) {
if (BetterRTP.getInstance().getSettings().debug)
BetterRTP.getInstance().getLogger().log(Level.INFO, str);

View File

@ -1,5 +1,6 @@
Sounds:
Enabled: true
ProtocolLibSound: false
## More sounds at https://www.spigotmc.org/wiki/cc-sounds-list/
Delay: 'entity_tnt_primed'
Success: 'entity_generic_explode'

View File

@ -16,6 +16,7 @@ softdepend:
- hClaims
- GriefDefender
- UltimateClaims
- Pueblos
api-version: '1.13'
commands: