Update Util.java

new Function
This commit is contained in:
Benkralex
2023-08-21 16:09:52 +02:00
committed by GitHub
parent 3a3df920f4
commit 1a708c979f
@@ -54,4 +54,14 @@ public class Util {
damagersOfVictim.set(new NamespacedKey(Pvptoggle.pvptoggle, damagerUUID), PersistentDataType.LONG, Instant.now().getEpochSecond());
victimPDC.set(new NamespacedKey(Pvptoggle.pvptoggle,"pvpdamagers"), PersistentDataType.TAG_CONTAINER,damagersOfVictim);
}
public static void pdcTagContaineradd(Player p, NamespacedKey key, String s, Boolean value) {
PersistentDataContainer pdc = p.getPersistentDataContainer();
PersistentDataContainer pdctagcontainer = pdc.get(key, PersitentDataType.TAG_CONTAINER);
if(pdctagcontainer == null) {
pdc.tagcontainer = pdc.getAdapterContext().newPersistentDataContainer();
}
pdctagcontainer.set(new NamespacedKey(Pvptoggle.pvptoggle, s), PersistentDataType.BOOLEAN, value);
pdc.set(key,PersistentDataType.TAG_CONTAINER, pdctagcontainer);
}
}