Update Util.java added Ultra mode
I'm not sure, if it works please leave a comment, if you tested the new version and it worked (Ultra-Mode)
This commit is contained in:
@@ -9,10 +9,18 @@ import java.time.Instant;
|
|||||||
|
|
||||||
public class Util {
|
public class Util {
|
||||||
public static boolean canPvP(Player damager, Player victim){
|
public static boolean canPvP(Player damager, Player victim){
|
||||||
PersistentDataContainer victimPDC=damager.getPersistentDataContainer();
|
PersistentDataContainer damagerPDC=damager.getPersistentDataContainer();
|
||||||
Boolean toggle = victimPDC.get(new NamespacedKey(Pvptoggle.pvptoggle, "pvptoggle"),PersistentDataType.BOOLEAN);
|
PersistentDataContainer victimPDC=victim.getPersistentDataContainer();
|
||||||
|
Boolean toggle = damagerPDC.get(new NamespacedKey(Pvptoggle.pvptoggle, "pvptoggle"),PersistentDataType.BOOLEAN);
|
||||||
|
if (victimPDC.has(new NamespacedKey(Pvptoggle.pvptoggle, "ultra"),PersistentDataType.BOOLEAN)) {
|
||||||
|
Boolean ultravictim = victimPDC.get(new NamespacedKey(Pvptoggle.pvptoggle, "ultra"),PersistentDataType.BOOLEAN);
|
||||||
|
} else {Boolean ultravictim = false;}
|
||||||
|
if (damagerPDC.has(new NamespacedKey(Pvptoggle.pvptoggle, "ultra"),PersistentDataType.BOOLEAN)) {
|
||||||
|
Boolean ultradamager = damagerPDC.get(new NamespacedKey(Pvptoggle.pvptoggle, "ultra"),PersistentDataType.BOOLEAN);
|
||||||
|
} else {Boolean ultradamager = false;}
|
||||||
|
|
||||||
if(toggle!=null) {
|
if(toggle!=null) {
|
||||||
return !toggle || checkPvPData(damager, victim);
|
return !toggle || checkPvPData(damager, victim) || !ultradamager || !ultravictim;
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user