This commit is contained in:
Jesse Boyd 2017-02-18 20:49:18 +11:00
parent b9fdfb8b01
commit adaac51b36
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
4 changed files with 27 additions and 18 deletions

View File

@ -28,17 +28,8 @@ plugins {
apply plugin: 'net.minecrell.vanilla.server.library'
apply plugin: 'com.github.johnrengelman.shadow'
dependencies {
compile project(':core')
compile 'org.spongepowered:spongeapi:6.0.0-SNAPSHOT'
compile 'org.spongepowered:mixin:0.6.1-SNAPSHOT'
compile 'com.sk89q.worldedit:worldedit-forge-mc1.10.2:6.1.5'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
flatDir {dirs 'lib'}
maven {
name = 'forge'
url = 'http://files.minecraftforge.net/maven'
@ -52,6 +43,18 @@ repositories {
url = "http://repo.mcstats.org/content/repositories/releases/"
}
}
dependencies {
compile project(':core')
compile 'org.spongepowered:spongeapi:6.0.0-SNAPSHOT'
compile 'org.spongepowered:mixin:0.6.1-SNAPSHOT'
compile 'com.sk89q.worldedit:worldedit-sponge:6.1.7-SNAPSHOT'
compile name: 'worldedit-core-6.1.7-SNAPSHOT-dist'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
minecraft {
version = "1.11"
mappings = "snapshot_20161116"
@ -71,10 +74,12 @@ processResources {
shadowJar {
relocate 'org.yaml.snakeyaml', 'com.boydti.fawe.yaml'
dependencies {
include(dependency(':core'))
include(dependency('com.github.luben:zstd-jni:1.1.1'))
include(dependency('org.javassist:javassist:3.22.0-CR1'))
include(dependency('co.aikar:fastutil-lite:1.0'))
include(dependency(':core'))
include(dependency(name: 'worldedit-core-6.1.7-SNAPSHOT-dist'))
include(dependency('com.sk89q.worldedit:worldedit-sponge:6.1.7-SNAPSHOT'))
include(dependency('org.yaml:snakeyaml:1.16'))
}
archiveName = "${parent.name}-${project.name}-${parent.version}.jar"

Binary file not shown.

View File

@ -239,7 +239,7 @@ public class SpongeChunk_1_11 extends CharFaweChunk<Chunk, SpongeQueue_1_11> {
if (entityKey != null) {
Entity entity = EntityList.createEntityByIDFromName(entityKey, nmsWorld);
if (entity != null) {
NBTTagCompound tag = (NBTTagCompound) SpongeQueue_1_11.methodFromNative.invoke(null, nativeTag);
NBTTagCompound tag = (NBTTagCompound) SpongeQueue_1_11.methodFromNative.invoke(SpongeQueue_1_11.adapter, nativeTag);
entity.readFromNBT(tag);
tag.removeTag("UUIDMost");
tag.removeTag("UUIDLeast");
@ -383,7 +383,7 @@ public class SpongeChunk_1_11 extends CharFaweChunk<Chunk, SpongeQueue_1_11> {
BlockPos pos = new BlockPos(x, y, z); // Set pos
TileEntity tileEntity = nmsWorld.getTileEntity(pos);
if (tileEntity != null) {
NBTTagCompound tag = (NBTTagCompound) SpongeQueue_1_11.methodFromNative.invoke(null, nativeTag);
NBTTagCompound tag = (NBTTagCompound) SpongeQueue_1_11.methodFromNative.invoke(SpongeQueue_1_11.adapter, nativeTag);
tag.setInteger("x", pos.getX());
tag.setInteger("y", pos.getY());
tag.setInteger("z", pos.getZ());

View File

@ -12,6 +12,8 @@ import com.boydti.fawe.util.ReflectionUtils;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.jnbt.StringTag;
import com.sk89q.jnbt.Tag;
import com.sk89q.worldedit.sponge.SpongeWorldEdit;
import com.sk89q.worldedit.sponge.adapter.SpongeImplAdapter;
import com.sk89q.worldedit.world.biome.BaseBiome;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;
@ -81,12 +83,14 @@ public class SpongeQueue_1_11 extends NMSMappedFaweQueue<World, net.minecraft.wo
private static MutableGenLayer genLayer;
protected static final SpongeImplAdapter adapter;
static {
try {
emptySection = new ExtendedBlockStorage(0, true);
Class<?> converter = Class.forName("com.sk89q.worldedit.sponge.nms.NBTConverter");
methodFromNative = converter.getDeclaredMethod("toNative", Tag.class);
methodToNative = converter.getDeclaredMethod("fromNative", NBTBase.class);
adapter = SpongeWorldEdit.inst().getAdapter();
methodFromNative = adapter.getClass().getDeclaredMethod("toNative", Tag.class);
methodToNative = adapter.getClass().getDeclaredMethod("fromNative", NBTBase.class);
methodFromNative.setAccessible(true);
methodToNative.setAccessible(true);
@ -399,7 +403,7 @@ public class SpongeQueue_1_11 extends NMSMappedFaweQueue<World, net.minecraft.wo
NBTTagCompound tag = new NBTTagCompound();
tile.writeToNBT(tag); // readTileEntityIntoTag
BlockPos pos = entry.getKey();
CompoundTag nativeTag = (CompoundTag) methodToNative.invoke(null, tag);
CompoundTag nativeTag = (CompoundTag) methodToNative.invoke(SpongeQueue_1_11.adapter, tag);
previous.setTile(pos.getX(), pos.getY(), pos.getZ(), nativeTag);
}
}
@ -423,7 +427,7 @@ public class SpongeQueue_1_11 extends NMSMappedFaweQueue<World, net.minecraft.wo
if (id != null) {
NBTTagCompound tag = new NBTTagCompound();
ent.writeToNBT(tag); // readEntityIntoTag
CompoundTag nativeTag = (CompoundTag) methodToNative.invoke(null, tag);
CompoundTag nativeTag = (CompoundTag) methodToNative.invoke(SpongeQueue_1_11.adapter, tag);
Map<String, Tag> map = ReflectionUtils.getMap(nativeTag.getValue());
map.put("Id", new StringTag(id));
previous.setEntity(nativeTag);