Major command changes that don't work yet.

This commit is contained in:
MattBDev
2019-07-05 20:46:48 -04:00
parent ffc2092d93
commit 8108d0a936
399 changed files with 13558 additions and 7985 deletions

View File

@ -24,6 +24,7 @@ import com.sk89q.jnbt.Tag;
import com.sk89q.worldedit.entity.BaseEntity;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.registry.state.Property;
import com.sk89q.worldedit.world.DataFixer;
import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockStateHolder;
@ -44,6 +45,21 @@ import javax.annotation.Nullable;
*/
public interface BukkitImplAdapter<T> extends IBukkitAdapter {
/**
* Get the Minecraft data version for the current world data.
*
* @return the data version
*/
int getDataVersion();
/**
* Get a data fixer, or null if not supported
*
* @return the data fixer
*/
@Nullable
DataFixer getDataFixer();
/**
* Get the block at the given location.
*
@ -104,7 +120,7 @@ public interface BukkitImplAdapter<T> extends IBukkitAdapter {
default BlockMaterial getMaterial(BlockType blockType) {
return null;
}
default BlockMaterial getMaterial(BlockState blockState) {
return null;
}
@ -116,7 +132,7 @@ public interface BukkitImplAdapter<T> extends IBukkitAdapter {
default T fromNative(Tag foreign) {
return null;
}
/**
* Send the given NBT data to the player.
*

View File

@ -52,7 +52,7 @@ public class BukkitImplLoader {
"**\n" +
"** When working with blocks or undoing, chests will be empty, signs\n" +
"** will be blank, and so on. There will be no support for entity\n" +
"** and biome-related functions.\n" +
"** and block property-related functions.\n" +
"**\n" +
"** Please see http://wiki.sk89q.com/wiki/WorldEdit/Bukkit_adapters\n" +
"**********************************************\n";
@ -160,9 +160,6 @@ public class BukkitImplLoader {
if (cls.isSynthetic()) continue;
if (BukkitImplAdapter.class.isAssignableFrom(cls)) {
return (BukkitImplAdapter) cls.newInstance();
} else {
log.warn("Failed to load the Bukkit adapter class '" + className +
"' because it does not implement " + BukkitImplAdapter.class.getCanonicalName());
}
} catch (ClassNotFoundException e) {
log.warn("Failed to load the Bukkit adapter class '" + className +
@ -171,7 +168,6 @@ public class BukkitImplLoader {
log.warn("Failed to load the Bukkit adapter class '" + className +
"' that is not supposed to be raising this error", e);
} catch (Throwable e) {
e.printStackTrace();
if (className.equals(customCandidate)) {
log.warn("Failed to load the Bukkit adapter class '" + className + "'", e);
}

View File

@ -371,6 +371,6 @@ public interface IBukkitAdapter {
}
default BiomeType adapt(Biome biome) {
return BiomeTypes.get(biome.name().toLowerCase());
return BiomeTypes.register(biome.name().toLowerCase());
}
}