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> <repositoryLayout>default</repositoryLayout>
<groupId>com.hakan</groupId> <groupId>com.hakan</groupId>
<artifactId>claimsystem</artifactId> <artifactId>claimsystem</artifactId>
<version>1.1.1</version> <version>2.1.8</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<generatePom>true</generatePom> <generatePom>true</generatePom>
</configuration> </configuration>
@ -262,6 +262,13 @@
<version>012e53d</version> <version>012e53d</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </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 --> <!-- Particles Library -->
<dependency> <dependency>
<groupId>xyz.xenondevs</groupId> <groupId>xyz.xenondevs</groupId>

View File

@ -42,17 +42,21 @@ public class RTPSounds {
} }
void playSound(Location loc, Player p, String sound) { void playSound(Location loc, Player p, String sound) {
try { if (BetterRTP.getInstance().getSettings().protocolLibSounds) {
ProtocolManager pm = ProtocolLibrary.getProtocolManager(); try {
WrapperPlayServerNamedSoundEffect packet = new WrapperPlayServerNamedSoundEffect(pm.createPacket(PacketType.Play.Server.NAMED_SOUND_EFFECT)); ProtocolManager pm = ProtocolLibrary.getProtocolManager();
packet.setSoundName(sound); WrapperPlayServerNamedSoundEffect packet = new WrapperPlayServerNamedSoundEffect(pm.createPacket(PacketType.Play.Server.NAMED_SOUND_EFFECT));
packet.setEffectPositionX(loc.getBlockX()); packet.setSoundName(sound);
packet.setEffectPositionY(loc.getBlockY()); packet.setEffectPositionX(loc.getBlockX());
packet.setEffectPositionZ(loc.getBlockZ()); packet.setEffectPositionY(loc.getBlockY());
packet.sendPacket(p); packet.setEffectPositionZ(loc.getBlockZ());
} catch (NoClassDefFoundError | Exception e) { 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); p.playSound(p.getLocation(), getSound(sound), 1F, 1F);
}
} }
private Sound getSound(String sound) { 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)) public int preloadRadius; //Amount of chunks to load around a safe rtp location (clamped (0 - 16))
//Dependencies //Dependencies
private final SoftDepends depends = new SoftDepends(); private final SoftDepends depends = new SoftDepends();
public boolean protocolLibSounds;
public void load() { //Load Settings 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"); debug = config.getBoolean("Settings.Debugger");
delayEnabled = config.getBoolean("Settings.Delay.Enabled"); delayEnabled = config.getBoolean("Settings.Delay.Enabled");
rtpOnFirstJoin_Enabled = config.getBoolean("Settings.RtpOnFirstJoin.Enabled"); rtpOnFirstJoin_Enabled = config.getBoolean("Settings.RtpOnFirstJoin.Enabled");
@ -24,14 +25,11 @@ public class Settings {
rtpOnFirstJoin_SetAsRespawn = config.getBoolean("Settings.RtpOnFirstJoin.SetAsRespawn"); rtpOnFirstJoin_SetAsRespawn = config.getBoolean("Settings.RtpOnFirstJoin.SetAsRespawn");
preloadRadius = config.getInt("Settings.PreloadRadius"); preloadRadius = config.getInt("Settings.PreloadRadius");
statusMessages = config.getBoolean("Settings.StatusMessages"); statusMessages = config.getBoolean("Settings.StatusMessages");
protocolLibSounds = FileBasics.FILETYPE.EFFECTS.getBoolean("Sounds.ProtocolLibSound");
depends.load(); depends.load();
} }
public SoftDepends getsDepends() { public SoftDepends getsDepends() {
return depends; 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_hClaims = false;
private boolean respect_griefDefender = false; private boolean respect_griefDefender = false;
private boolean respect_ultimateClaims = false; private boolean respect_ultimateClaims = false;
private boolean respect_pueblos = false;
//RETURNABLES //RETURNABLES
private boolean worldguard = false; private boolean worldguard = false;
private boolean griefprevention = false; private boolean griefprevention = false;
@ -31,6 +32,7 @@ public class SoftDepends {
private boolean hClaims = false; private boolean hClaims = false;
private boolean griefDefender = false; private boolean griefDefender = false;
private boolean ultimateClaims = false; private boolean ultimateClaims = false;
private boolean pueblos = false;
public boolean isWorldguard() { public boolean isWorldguard() {
return worldguard; return worldguard;
@ -87,9 +89,10 @@ public class SoftDepends {
respect_lands = config.getBoolean( pre + "Lands"); respect_lands = config.getBoolean( pre + "Lands");
respect_residence = config.getBoolean( pre + "Residence"); respect_residence = config.getBoolean( pre + "Residence");
respect_kingdomsx = config.getBoolean( pre + "KingdomsX"); respect_kingdomsx = config.getBoolean( pre + "KingdomsX");
respect_hClaims = config.getBoolean( pre + "hClaims"); respect_hClaims = config.getBoolean( pre + "hClaims");
respect_griefDefender = config.getBoolean( pre + "GriefDefender"); respect_griefDefender = config.getBoolean( pre + "GriefDefender");
respect_ultimateClaims = config.getBoolean( pre + "UltimateClaims"); respect_ultimateClaims = config.getBoolean( pre + "UltimateClaims");
respect_pueblos = config.getBoolean( pre + "Pueblos");
registerWorldguard(); registerWorldguard();
registerGriefPrevention(); registerGriefPrevention();
registerTowny(); registerTowny();
@ -101,6 +104,7 @@ public class SoftDepends {
registerClaimAPIPandomim(); registerClaimAPIPandomim();
registerGriefDefender(); registerGriefDefender();
registerUltimateClaims(); registerUltimateClaims();
registerPueblos();
} }
public void registerWorldguard() { public void registerWorldguard() {
@ -169,6 +173,12 @@ public class SoftDepends {
debug("Respecting `UltimateClaims` was " + (ultimateClaims ? "SUCCESSFULLY" : "NOT") + " registered"); 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) { private void debug(String str) {
if (BetterRTP.getInstance().getSettings().debug) if (BetterRTP.getInstance().getSettings().debug)
BetterRTP.getInstance().getLogger().log(Level.INFO, str); BetterRTP.getInstance().getLogger().log(Level.INFO, str);

View File

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

View File

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