Skip to content

Commit

Permalink
Make it actually load into an IDE on latest FG
Browse files Browse the repository at this point in the history
  • Loading branch information
me4502 committed Feb 16, 2019
1 parent c1c8483 commit e886e0b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 8 deletions.
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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
33 changes: 27 additions & 6 deletions worldedit-forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ buildscript {
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')
Expand All @@ -30,6 +30,25 @@ targetCompatibility = 1.8
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')
}

Expand Down Expand Up @@ -69,11 +88,13 @@ shadowJar {
}
}

//reobf {
// shadowJar {
// mappingType = 'SEARGE'
// }
//}
afterEvaluate {
reobf {
shadowJar {
mappings = createMcpToSrg.output
}
}
}

task deobfJar(type: Jar) {
from sourceSets.main.output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
}
Expand Down

0 comments on commit e886e0b

Please sign in to comment.