mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
implement 1.16 methods
This commit is contained in:
parent
f84958957c
commit
4ca19acb48
@ -884,6 +884,14 @@ public class AsyncWorld extends PassthroughExtent implements World {
|
||||
parent.setWaterAnimalSpawnLimit(limit);
|
||||
}
|
||||
|
||||
@Override public int getWaterAmbientSpawnLimit() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override public void setWaterAmbientSpawnLimit(int limit) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAmbientSpawnLimit() {
|
||||
return parent.getAmbientSpawnLimit();
|
||||
@ -1284,19 +1292,27 @@ public class AsyncWorld extends PassthroughExtent implements World {
|
||||
return parent.getHighestBlockAt(location, heightmap);
|
||||
}
|
||||
|
||||
public long getTicksPerWaterSpawns() {
|
||||
throw new UnsupportedOperationException();
|
||||
public long getTicksPerWaterSpawns() throws UnsupportedOperationException {
|
||||
return parent.getTicksPerWaterSpawns();
|
||||
}
|
||||
|
||||
public void setTicksPerWaterSpawns(int ticksPerWaterSpawns) {
|
||||
throw new UnsupportedOperationException();
|
||||
public void setTicksPerWaterSpawns(int ticksPerWaterSpawns) throws UnsupportedOperationException {
|
||||
parent.setTicksPerWaterSpawns(ticksPerWaterSpawns);
|
||||
}
|
||||
|
||||
public long getTicksPerAmbientSpawns() {
|
||||
throw new UnsupportedOperationException();
|
||||
@Override public long getTicksPerWaterAmbientSpawns() {
|
||||
return parent.getTicksPerWaterAmbientSpawns();
|
||||
}
|
||||
|
||||
public void setTicksPerAmbientSpawns(int ticksPerAmbientSpawns) {
|
||||
throw new UnsupportedOperationException();
|
||||
@Override public void setTicksPerWaterAmbientSpawns(int ticksPerAmbientSpawns) {
|
||||
parent.setTicksPerWaterAmbientSpawns(ticksPerAmbientSpawns);
|
||||
}
|
||||
|
||||
public long getTicksPerAmbientSpawns() throws UnsupportedOperationException {
|
||||
return parent.getTicksPerAmbientSpawns();
|
||||
}
|
||||
|
||||
public void setTicksPerAmbientSpawns(int ticksPerAmbientSpawns) throws UnsupportedOperationException {
|
||||
parent.setTicksPerAmbientSpawns(ticksPerAmbientSpawns);
|
||||
}
|
||||
}
|
||||
|
@ -5,16 +5,21 @@ import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.jnbt.Tag;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.persistence.PersistentDataAdapterContext;
|
||||
import org.bukkit.persistence.PersistentDataContainer;
|
||||
import org.bukkit.persistence.PersistentDataType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public final class AsyncDataContainer implements PersistentDataContainer {
|
||||
private final CompoundTag root;
|
||||
private final Set<NamespacedKey> keys = new HashSet<>();
|
||||
|
||||
public AsyncDataContainer(CompoundTag root) {
|
||||
this.root = root;
|
||||
@ -47,6 +52,7 @@ public final class AsyncDataContainer implements PersistentDataContainer {
|
||||
Validate.notNull(type, "The provided type for the custom value was null");
|
||||
Validate.notNull(value, "The provided value for the custom value was null");
|
||||
get().put(key.toString(), FaweCache.IMP.asTag(type.toPrimitive(value, null)));
|
||||
keys.add(key);
|
||||
}
|
||||
|
||||
public <T, Z> boolean has(NamespacedKey key, PersistentDataType<T, Z> type) {
|
||||
@ -69,9 +75,14 @@ public final class AsyncDataContainer implements PersistentDataContainer {
|
||||
return z != null ? z : defaultValue;
|
||||
}
|
||||
|
||||
@Override public @NotNull Set<NamespacedKey> getKeys() {
|
||||
return keys;
|
||||
}
|
||||
|
||||
public void remove(NamespacedKey key) {
|
||||
Validate.notNull(key, "The provided key for the custom value was null");
|
||||
get(false).remove(key.toString());
|
||||
keys.remove(key);
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
|
Loading…
Reference in New Issue
Block a user