mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-07 16:26:14 +00:00
Rereg
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package Iris.extensions.org.bukkit.Chunk;
|
||||
|
||||
import com.volmit.iris.platform.bukkit.wrapper.BukkitChunk;
|
||||
import manifold.ext.rt.api.Extension;
|
||||
import manifold.ext.rt.api.This;
|
||||
import org.bukkit.Chunk;
|
||||
|
||||
@Extension
|
||||
public class XChunk {
|
||||
public static BukkitChunk bukkitChunk(@This Chunk self) {
|
||||
return BukkitChunk.of(self);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package Iris.extensions.org.bukkit.NamespacedKey;
|
||||
|
||||
import com.volmit.iris.platform.bukkit.wrapper.BukkitKey;
|
||||
import manifold.ext.rt.api.Extension;
|
||||
import manifold.ext.rt.api.This;
|
||||
import org.bukkit.NamespacedKey;
|
||||
|
||||
@Extension
|
||||
public class XNamespacedKey {
|
||||
public static BukkitKey bukkitKey(@This NamespacedKey self) {
|
||||
return BukkitKey.of(self);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package Iris.extensions.org.bukkit.World;
|
||||
|
||||
import com.volmit.iris.platform.bukkit.wrapper.BukkitWorld;
|
||||
import manifold.ext.rt.api.Extension;
|
||||
import manifold.ext.rt.api.This;
|
||||
import org.bukkit.World;
|
||||
|
||||
@Extension
|
||||
public class XWorld {
|
||||
public static BukkitWorld bukkitWorld(@This World self) {
|
||||
return BukkitWorld.of(self);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package Iris.extensions.org.bukkit.block.Biome;
|
||||
|
||||
import com.volmit.iris.platform.bukkit.wrapper.BukkitBiome;
|
||||
import com.volmit.iris.platform.bukkit.wrapper.BukkitKey;
|
||||
import manifold.ext.rt.api.Extension;
|
||||
import manifold.ext.rt.api.This;
|
||||
import org.bukkit.block.Biome;
|
||||
|
||||
@Extension
|
||||
public class XBiome {
|
||||
public static BukkitKey bukkitKey(@This Biome self) {
|
||||
return self.getKey().bukkitKey();
|
||||
}
|
||||
|
||||
public static BukkitBiome bukkitBiome(@This Biome self) {
|
||||
return BukkitBiome.of(self);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package Iris.extensions.org.bukkit.block.data.BlockData;
|
||||
|
||||
import com.volmit.iris.platform.bukkit.wrapper.BukkitBlock;
|
||||
import com.volmit.iris.platform.bukkit.wrapper.BukkitKey;
|
||||
import manifold.ext.rt.api.Extension;
|
||||
import manifold.ext.rt.api.This;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
|
||||
@Extension
|
||||
public class XBlockData {
|
||||
public static BukkitKey bukkitKey(@This BlockData self) {
|
||||
return self.getMaterial().getKey().bukkitKey();
|
||||
}
|
||||
|
||||
public static BukkitBlock bukkitBlock(@This BlockData self) {
|
||||
return BukkitBlock.of(self);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package Iris.extensions.org.bukkit.entity.Player;
|
||||
|
||||
import com.volmit.iris.platform.bukkit.wrapper.BukkitPlayer;
|
||||
import manifold.ext.rt.api.Extension;
|
||||
import manifold.ext.rt.api.This;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@Extension
|
||||
public class XPlayer {
|
||||
public static BukkitPlayer bukkitPlayer(@This Player self) {
|
||||
return BukkitPlayer.of(self);
|
||||
}
|
||||
}
|
||||
@@ -1,44 +1,34 @@
|
||||
package com.volmit.iris.platform.bukkit;
|
||||
|
||||
import com.volmit.iris.engine.object.NSKey;
|
||||
import com.volmit.iris.engine.object.biome.NativeBiome;
|
||||
import com.volmit.iris.engine.object.block.IrisBlock;
|
||||
import com.volmit.iris.platform.IrisPlatform;
|
||||
import com.volmit.iris.platform.PlatformDataTransformer;
|
||||
import com.volmit.iris.platform.PlatformTransformer;
|
||||
import com.volmit.iris.platform.bukkit.transformers.BukkitBiomeTransformer;
|
||||
import com.volmit.iris.platform.bukkit.transformers.BukkitBlockDataTransformer;
|
||||
import com.volmit.iris.platform.bukkit.transformers.BukkitNamespaceTransformer;
|
||||
import com.volmit.iris.platform.PlatformBiome;
|
||||
import com.volmit.iris.platform.PlatformBlock;
|
||||
import com.volmit.iris.platform.PlatformWorld;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Biome;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class IrisBukkit extends JavaPlugin implements IrisPlatform<NamespacedKey, BlockData, Biome> {
|
||||
public class IrisBukkit extends JavaPlugin implements IrisPlatform {
|
||||
private static IrisBukkit instance;
|
||||
private PlatformTransformer<NamespacedKey, NSKey> namespaceTransformer;
|
||||
private PlatformDataTransformer<BlockData, IrisBlock> blockDataTransformer;
|
||||
private PlatformDataTransformer<Biome, NativeBiome> biomeTransformer;
|
||||
|
||||
public void onEnable()
|
||||
{
|
||||
public void onEnable() {
|
||||
instance = this;
|
||||
namespaceTransformer = new BukkitNamespaceTransformer();
|
||||
blockDataTransformer = new BukkitBlockDataTransformer();
|
||||
biomeTransformer = new BukkitBiomeTransformer();
|
||||
}
|
||||
|
||||
public void onDisable()
|
||||
{
|
||||
public void onDisable() {
|
||||
|
||||
}
|
||||
|
||||
public static IrisBukkit getInstance()
|
||||
{
|
||||
public static IrisBukkit getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
@@ -46,4 +36,35 @@ public class IrisBukkit extends JavaPlugin implements IrisPlatform<NamespacedKey
|
||||
public String getPlatformName() {
|
||||
return "Bukkit";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Stream<PlatformBlock> getBlocks() {
|
||||
//This is because it's a method extension
|
||||
//noinspection Convert2MethodRef
|
||||
return Arrays.stream(Material.values()).parallel().filter(Material::isBlock).map(Material::createBlockData).map(i -> i.bukkitBlock());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Stream<PlatformBiome> getBiomes() {
|
||||
//This is because it's a method extension
|
||||
//noinspection Convert2MethodRef
|
||||
return Arrays.stream(Biome.values()).parallel().filter((i) -> i != Biome.CUSTOM).map(i -> i.bukkitBiome());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWorldLoaded(String name) {
|
||||
return Bukkit.getWorlds().keepWhere(i -> i.getName().equals(name)).isNotEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlatformWorld getWorld(String name) {
|
||||
World w = Bukkit.getWorld(name);
|
||||
|
||||
if(w == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return w.bukkitWorld();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.volmit.iris.platform.bukkit.transformers;
|
||||
|
||||
import com.volmit.iris.engine.object.NSKey;
|
||||
import com.volmit.iris.engine.object.biome.NativeBiome;
|
||||
import com.volmit.iris.platform.PlatformDataTransformer;
|
||||
import com.volmit.iris.platform.PlatformTransformer;
|
||||
import com.volmit.iris.platform.bukkit.IrisBukkit;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.WorldType;
|
||||
import org.bukkit.block.Biome;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class BukkitBiomeTransformer implements PlatformDataTransformer<Biome, NativeBiome> {
|
||||
@Override
|
||||
public Stream<Biome> getRegistry() {
|
||||
return Arrays.stream(Biome.values()).parallel().filter((i) -> i != Biome.CUSTOM);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NSKey getKey(Biome nativeType) {
|
||||
return IrisBukkit.getInstance().getNamespaceTransformer().toIris(nativeType.getKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTypeName() {
|
||||
return "Block";
|
||||
}
|
||||
|
||||
@Override
|
||||
public NativeBiome toIris(Biome biome) {
|
||||
PlatformTransformer<NamespacedKey, NSKey> transformer = IrisBukkit.getInstance().getNamespaceTransformer();
|
||||
return new NativeBiome(transformer.toIris(biome.getKey()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Biome toNative(NativeBiome nativeBiome) {
|
||||
PlatformTransformer<NamespacedKey, NSKey> transformer = IrisBukkit.getInstance().getNamespaceTransformer();
|
||||
return Biome.values().stream().filter((i) -> transformer.toIris(i.getKey()).equals(nativeBiome.getKey())).findFirst().get();
|
||||
}
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
package com.volmit.iris.platform.bukkit.transformers;
|
||||
|
||||
import art.arcane.amulet.util.Platform;
|
||||
import com.volmit.iris.engine.object.NSKey;
|
||||
import com.volmit.iris.engine.object.block.IrisBlock;
|
||||
import com.volmit.iris.platform.PlatformDataTransformer;
|
||||
import com.volmit.iris.platform.PlatformTransformer;
|
||||
import com.volmit.iris.platform.bukkit.IrisBukkit;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.block.Biome;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class BukkitBlockDataTransformer implements PlatformDataTransformer<BlockData, IrisBlock> {
|
||||
@Override
|
||||
public Stream<BlockData> getRegistry() {
|
||||
return Arrays.stream(Material.values()).parallel().filter(Material::isBlock).map(Material::createBlockData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NSKey getKey(BlockData nativeType) {
|
||||
return IrisBukkit.getInstance().getNamespaceTransformer().toIris(nativeType.getMaterial().getKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTypeName() {
|
||||
return "Biome";
|
||||
}
|
||||
|
||||
@Override
|
||||
public IrisBlock toIris(BlockData blockData) {
|
||||
PlatformTransformer<NamespacedKey, NSKey> transformer = IrisBukkit.getInstance().getNamespaceTransformer();
|
||||
|
||||
String s = blockData.getAsString(true);
|
||||
|
||||
if(s.contains("["))
|
||||
{
|
||||
Map<String, String> properties = new HashMap<>();
|
||||
String[] props = new String[]{s.split("\\Q[\\E")[1].split("\\Q]\\E")[0]};
|
||||
String[] p;
|
||||
if(props[0].contains(","))
|
||||
{
|
||||
for(String i : props[0].split("\\Q,\\E"))
|
||||
{
|
||||
p = i.split("\\Q=\\E");
|
||||
properties.put(p[0], p[1]);
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
p = props[0].split("\\Q=\\E");
|
||||
properties.put(p[0], p[1]);
|
||||
}
|
||||
|
||||
return new IrisBlock(transformer.toIris(blockData.getMaterial().getKey()), properties);
|
||||
}
|
||||
|
||||
else {
|
||||
return new IrisBlock(transformer.toIris(blockData.getMaterial().getKey()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockData toNative(IrisBlock irisBlock) {
|
||||
return Bukkit.createBlockData(irisBlock.toString());
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.volmit.iris.platform.bukkit.transformers;
|
||||
|
||||
import com.volmit.iris.engine.object.NSKey;
|
||||
import com.volmit.iris.platform.PlatformTransformer;
|
||||
import org.bukkit.NamespacedKey;
|
||||
|
||||
public class BukkitNamespaceTransformer implements PlatformTransformer<NamespacedKey, NSKey> {
|
||||
@Override
|
||||
public NSKey toIris(NamespacedKey namespacedKey) {
|
||||
return new NSKey(namespacedKey.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public NamespacedKey toNative(NSKey nsKey) {
|
||||
return new NamespacedKey(nsKey.getNamespace(), nsKey.getKey());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.volmit.iris.platform.bukkit.wrapper;
|
||||
|
||||
import com.volmit.iris.platform.PlatformBiome;
|
||||
import com.volmit.iris.platform.PlatformNamespaceKey;
|
||||
import lombok.Data;
|
||||
import org.bukkit.block.Biome;
|
||||
|
||||
@Data
|
||||
public class BukkitBiome implements PlatformBiome {
|
||||
private final Biome delegate;
|
||||
|
||||
private BukkitBiome(Biome delegate) {
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlatformNamespaceKey getKey() {
|
||||
return delegate.getKey().bukkitKey();
|
||||
}
|
||||
|
||||
public static BukkitBiome of(Biome biome) {
|
||||
return new BukkitBiome(biome);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.volmit.iris.platform.bukkit.wrapper;
|
||||
|
||||
import com.volmit.iris.platform.PlatformBlock;
|
||||
import com.volmit.iris.platform.PlatformNamespaceKey;
|
||||
import lombok.Data;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class BukkitBlock implements PlatformBlock {
|
||||
private final BlockData delegate;
|
||||
private final Map<String, String> properties;
|
||||
|
||||
private BukkitBlock(BlockData delegate, Map<String, String> properties) {
|
||||
this.delegate = delegate;
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
private BukkitBlock(BlockData delegate) {
|
||||
this.delegate = delegate;
|
||||
String s = delegate.getAsString(true);
|
||||
|
||||
if(s.contains("[")) {
|
||||
Map<String, String> properties = new HashMap<>();
|
||||
String[] props = new String[] {s.split("\\Q[\\E")[1].split("\\Q]\\E")[0]};
|
||||
String[] p;
|
||||
if(props[0].contains(",")) {
|
||||
for(String i : props[0].split("\\Q,\\E")) {
|
||||
p = i.split("\\Q=\\E");
|
||||
properties.put(p[0], p[1]);
|
||||
}
|
||||
} else {
|
||||
p = props[0].split("\\Q=\\E");
|
||||
properties.put(p[0], p[1]);
|
||||
}
|
||||
|
||||
this.properties = Collections.unmodifiableMap(properties);
|
||||
} else {
|
||||
this.properties = Map.of();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getProperties() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlatformNamespaceKey getKey() {
|
||||
return delegate.getMaterial().getKey().bukkitKey();
|
||||
}
|
||||
|
||||
public static BukkitBlock of(BlockData blockData) {
|
||||
return new BukkitBlock(blockData);
|
||||
}
|
||||
|
||||
public static BukkitBlock of(Material material) {
|
||||
return of(material.createBlockData());
|
||||
}
|
||||
|
||||
public static BukkitBlock of(String raw) {
|
||||
return of(Bukkit.createBlockData(raw));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.volmit.iris.platform.bukkit.wrapper;
|
||||
|
||||
import com.volmit.iris.platform.PlatformChunk;
|
||||
import org.bukkit.Chunk;
|
||||
|
||||
public class BukkitChunk implements PlatformChunk {
|
||||
private final Chunk delegate;
|
||||
|
||||
private BukkitChunk(Chunk delegate) {
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getX() {
|
||||
return delegate.getX();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getZ() {
|
||||
return delegate.getZ();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unload(boolean save, boolean force) {
|
||||
if(force) {
|
||||
delegate.getPluginChunkTickets().forEach(delegate::removePluginChunkTicket);
|
||||
}
|
||||
|
||||
delegate.unload(save);
|
||||
}
|
||||
|
||||
public static BukkitChunk of(Chunk chunk) {
|
||||
return new BukkitChunk(chunk);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.volmit.iris.platform.bukkit.wrapper;
|
||||
|
||||
import com.volmit.iris.platform.PlatformNamespaceKey;
|
||||
import lombok.Data;
|
||||
import org.bukkit.NamespacedKey;
|
||||
|
||||
@Data
|
||||
public class BukkitKey implements PlatformNamespaceKey {
|
||||
private final NamespacedKey delegate;
|
||||
|
||||
private BukkitKey(NamespacedKey delegate) {
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNamespace() {
|
||||
return delegate.getNamespace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return delegate.getKey();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return delegate.toString();
|
||||
}
|
||||
|
||||
public static BukkitKey of(String nsk) {
|
||||
if(nsk.contains(":")) {
|
||||
String[] f = nsk.split("\\Q:\\E");
|
||||
return of(f[0], f[1]);
|
||||
}
|
||||
|
||||
return of("minecraft", nsk);
|
||||
}
|
||||
|
||||
public static BukkitKey of(String namespace, String key) {
|
||||
return of(new NamespacedKey(namespace, key));
|
||||
}
|
||||
|
||||
public static BukkitKey of(NamespacedKey key) {
|
||||
return new BukkitKey(key);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.volmit.iris.platform.bukkit.wrapper;
|
||||
|
||||
import art.arcane.amulet.geometry.Vec;
|
||||
import com.volmit.iris.platform.PlatformPlayer;
|
||||
import com.volmit.iris.platform.PlatformWorld;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class BukkitPlayer implements PlatformPlayer {
|
||||
private final Player delegate;
|
||||
|
||||
private BukkitPlayer(Player delegate) {
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UUID getUUID() {
|
||||
return delegate.getUniqueId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return delegate.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec getLocation() {
|
||||
return delegate.getLocation().vec();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlatformWorld getWorld() {
|
||||
return delegate.getWorld().bukkitWorld();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUseIris() {
|
||||
return delegate.isOp();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessage(String message) {
|
||||
delegate.sendMessage(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendActionBar(String message) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendTitleMessage(String title, String subtitle, int in, int stay, int out) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public static BukkitPlayer of(Player player) {
|
||||
return new BukkitPlayer(player);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.volmit.iris.platform.bukkit.wrapper;
|
||||
|
||||
import com.volmit.iris.platform.PlatformBiome;
|
||||
import com.volmit.iris.platform.PlatformBlock;
|
||||
import com.volmit.iris.platform.PlatformChunk;
|
||||
import com.volmit.iris.platform.PlatformPlayer;
|
||||
import com.volmit.iris.platform.PlatformWorld;
|
||||
import com.volmit.iris.util.WorldHeight;
|
||||
import lombok.Data;
|
||||
import org.bukkit.World;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Data
|
||||
public class BukkitWorld implements PlatformWorld {
|
||||
private final World delegate;
|
||||
private final WorldHeight worldHeight;
|
||||
|
||||
private BukkitWorld(World delegate) {
|
||||
this.delegate = delegate;
|
||||
this.worldHeight = new WorldHeight(delegate.getMinHeight(), delegate.getMaxHeight());
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorldHeight getHeight() {
|
||||
return worldHeight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return delegate.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getFolder() {
|
||||
return delegate.getWorldFolder();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<PlatformPlayer> getPlayers() {
|
||||
//noinspection Convert2MethodRef
|
||||
return delegate.getPlayers().stream().map(i -> i.bukkitPlayer()).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<PlatformChunk> getLoadedChunks() {
|
||||
//noinspection Convert2MethodRef
|
||||
return delegate.getLoadedChunks().stream().map(i -> i.bukkitChunk()).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlatformChunk getOrLoadChunk(int x, int z) {
|
||||
return delegate.getChunkAt(x, z).bukkitChunk();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlatformBlock getBlock(int x, int y, int z) {
|
||||
return delegate.getBlockAt(x, y, z).getBlockData().bukkitBlock();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlatformBiome getBiome(int x, int y, int z) {
|
||||
return delegate.getBiome(x, y, z).bukkitBiome();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getSeed() {
|
||||
return delegate.getSeed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isChunkLoaded(int x, int z) {
|
||||
return delegate.isChunkLoaded(x, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlock(int x, int y, int z, PlatformBlock block) {
|
||||
delegate.setBlockData(x, y, z, ((BukkitBlock) block).getDelegate());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBiome(int x, int y, int z, PlatformBiome biome) {
|
||||
delegate.setBiome(x, y, z, ((BukkitBiome) biome).getDelegate());
|
||||
}
|
||||
|
||||
public static BukkitWorld of(World world) {
|
||||
return new BukkitWorld(world);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user