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);
|
parent.setWaterAnimalSpawnLimit(limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override public int getWaterAmbientSpawnLimit() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public void setWaterAmbientSpawnLimit(int limit) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getAmbientSpawnLimit() {
|
public int getAmbientSpawnLimit() {
|
||||||
return parent.getAmbientSpawnLimit();
|
return parent.getAmbientSpawnLimit();
|
||||||
@ -1284,19 +1292,27 @@ public class AsyncWorld extends PassthroughExtent implements World {
|
|||||||
return parent.getHighestBlockAt(location, heightmap);
|
return parent.getHighestBlockAt(location, heightmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getTicksPerWaterSpawns() {
|
public long getTicksPerWaterSpawns() throws UnsupportedOperationException {
|
||||||
throw new UnsupportedOperationException();
|
return parent.getTicksPerWaterSpawns();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTicksPerWaterSpawns(int ticksPerWaterSpawns) {
|
public void setTicksPerWaterSpawns(int ticksPerWaterSpawns) throws UnsupportedOperationException {
|
||||||
throw new UnsupportedOperationException();
|
parent.setTicksPerWaterSpawns(ticksPerWaterSpawns);
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getTicksPerAmbientSpawns() {
|
@Override public long getTicksPerWaterAmbientSpawns() {
|
||||||
throw new UnsupportedOperationException();
|
return parent.getTicksPerWaterAmbientSpawns();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTicksPerAmbientSpawns(int ticksPerAmbientSpawns) {
|
@Override public void setTicksPerWaterAmbientSpawns(int ticksPerAmbientSpawns) {
|
||||||
throw new UnsupportedOperationException();
|
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 com.sk89q.jnbt.Tag;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import org.apache.commons.lang.Validate;
|
import org.apache.commons.lang.Validate;
|
||||||
import org.bukkit.NamespacedKey;
|
import org.bukkit.NamespacedKey;
|
||||||
import org.bukkit.persistence.PersistentDataAdapterContext;
|
import org.bukkit.persistence.PersistentDataAdapterContext;
|
||||||
import org.bukkit.persistence.PersistentDataContainer;
|
import org.bukkit.persistence.PersistentDataContainer;
|
||||||
import org.bukkit.persistence.PersistentDataType;
|
import org.bukkit.persistence.PersistentDataType;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
public final class AsyncDataContainer implements PersistentDataContainer {
|
public final class AsyncDataContainer implements PersistentDataContainer {
|
||||||
private final CompoundTag root;
|
private final CompoundTag root;
|
||||||
|
private final Set<NamespacedKey> keys = new HashSet<>();
|
||||||
|
|
||||||
public AsyncDataContainer(CompoundTag root) {
|
public AsyncDataContainer(CompoundTag root) {
|
||||||
this.root = 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(type, "The provided type for the custom value was null");
|
||||||
Validate.notNull(value, "The provided value 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)));
|
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) {
|
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;
|
return z != null ? z : defaultValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override public @NotNull Set<NamespacedKey> getKeys() {
|
||||||
|
return keys;
|
||||||
|
}
|
||||||
|
|
||||||
public void remove(NamespacedKey key) {
|
public void remove(NamespacedKey key) {
|
||||||
Validate.notNull(key, "The provided key for the custom value was null");
|
Validate.notNull(key, "The provided key for the custom value was null");
|
||||||
get(false).remove(key.toString());
|
get(false).remove(key.toString());
|
||||||
|
keys.remove(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isEmpty() {
|
public boolean isEmpty() {
|
||||||
|
Loading…
Reference in New Issue
Block a user