diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 000000000..e9b9fd5ac --- /dev/null +++ b/gradle.properties @@ -0,0 +1,3 @@ +# Sets default memory used for gradle commands. Can be overridden by user or command line properties. +# This is required to provide enough memory for the Minecraft decompilation process. +org.gradle.jvmargs=-Xmx3G diff --git a/worldedit-forge/build.gradle b/worldedit-forge/build.gradle index 1fbeb6350..2f9b34717 100644 --- a/worldedit-forge/build.gradle +++ b/worldedit-forge/build.gradle @@ -14,7 +14,7 @@ apply plugin: 'net.minecraftforge.gradle' def minecraftVersion = "1.13" -def forgeVersion = "24.0.116-1.13-pre" +def forgeVersion = "24.0.136-1.13-pre" dependencies { compile project(':worldedit-core') @@ -30,6 +30,25 @@ compile project(':worldedit-core') minecraft { mappings channel: 'snapshot', version: '20180921-1.13' + runs { + client = { + // recommended logging data for a userdev environment + properties 'forge.logging.markers': 'SCAN,REGISTRIES,REGISTRYDUMP' + // recommended logging level for the console + properties 'forge.logging.console.level': 'debug' + workingDirectory project.file('run').canonicalPath + source sourceSets.main + } + server = { + // recommended logging data for a userdev environment + properties 'forge.logging.markers': 'SCAN,REGISTRIES,REGISTRYDUMP' + // recommended logging level for the console + properties 'forge.logging.console.level': 'debug' + workingDirectory project.file('run').canonicalPath + source sourceSets.main + } + } + accessTransformer = file('worldedit_at.cfg') } @@ -69,11 +88,13 @@ compile project(':worldedit-core') } } -//reobf { -// shadowJar { -// mappingType = 'SEARGE' -// } -//} +afterEvaluate { + reobf { + shadowJar { + mappings = createMcpToSrg.output + } + } +} task deobfJar(type: Jar) { from sourceSets.main.output diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntity.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntity.java index 595effbe3..96e97cf29 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntity.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntity.java @@ -30,6 +30,7 @@ import com.sk89q.worldedit.world.NullWorld; import com.sk89q.worldedit.world.entity.EntityTypes; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ResourceLocation; import java.lang.ref.WeakReference; @@ -48,11 +49,11 @@ class ForgeEntity implements Entity { public BaseEntity getState() { net.minecraft.entity.Entity entity = entityRef.get(); if (entity != null) { - String id = entity.getType().getRegistryName().toString(); + ResourceLocation id = entity.getType().getRegistryName(); if (id != null) { NBTTagCompound tag = new NBTTagCompound(); entity.writeWithoutTypeId(tag); - return new BaseEntity(EntityTypes.get(id), NBTConverter.fromNative(tag)); + return new BaseEntity(EntityTypes.get(id.toString()), NBTConverter.fromNative(tag)); } else { return null; }