diff --git a/build.gradle b/build.gradle index e09459004..93cfab1da 100644 --- a/build.gradle +++ b/build.gradle @@ -72,20 +72,21 @@ tasks.withType(JavaCompile) { options.encoding = 'utf8' } +def commonManifest = { + attributes 'FMLCorePlugin': 'biomesoplenty.common.asm.BOPLoadingPlugin' + attributes 'FMLCorePluginContainsFMLMod': 'true' + attributes 'ForceLoadAsMod': true + attributes 'FMLAT': 'biomesoplenty_at.cfg' + attributes 'TweakClass': "org.spongepowered.asm.launch.MixinTweaker" + attributes 'TweakOrder': "10000" +} + jar { from(project("Mixin").sourceSets.main.output) { exclude 'LICENSE.txt' } - manifest { - attributes 'FMLCorePlugin': 'biomesoplenty.common.asm.BOPLoadingPlugin' - attributes 'FMLCorePluginContainsFMLMod': 'true' - attributes 'ForceLoadAsMod': true - attributes 'FMLAT': 'biomesoplenty_at.cfg' - attributes 'TweakClass': "org.spongepowered.asm.launch.MixinTweaker" - attributes 'TweakOrder': "10000" - } - + manifest commonManifest classifier = 'universal' } @@ -140,6 +141,8 @@ task sourceJar(type: Jar) { task deobfJar(type: Jar) { from sourceSets.main.output from project("Mixin").sourceSets.main.output + + manifest commonManifest classifier = 'deobf' } diff --git a/src/main/java/biomesoplenty/common/mixin/biome/MixinBiomeDecorator.java b/src/main/java/biomesoplenty/common/mixin/biome/MixinBiomeDecorator.java index b81696ba1..a385baad6 100644 --- a/src/main/java/biomesoplenty/common/mixin/biome/MixinBiomeDecorator.java +++ b/src/main/java/biomesoplenty/common/mixin/biome/MixinBiomeDecorator.java @@ -26,9 +26,16 @@ import biomesoplenty.api.biome.IGenerator; @Mixin(BiomeDecorator.class) public class MixinBiomeDecorator implements IExtendedDecorator { - private Map> generatorMap = new HashMap(); + private Map> generatorMap; //TODO: Come up with a better sequencing system - private Map generatorSequenceMap = new HashMap(); + private Map generatorSequenceMap; + + @Inject(method = "", at = @At("RETURN")) + private void onConstructed(CallbackInfo callbackInfo) + { + this.generatorMap = new HashMap(); + this.generatorSequenceMap = new HashMap(); + } @Override public void addGenerator(String key, IGenerator generator, Decorate.EventType nextFeature) diff --git a/src/main/java/biomesoplenty/common/mixin/biome/MixinBiomeGenBase.java b/src/main/java/biomesoplenty/common/mixin/biome/MixinBiomeGenBase.java index b5e2af591..6c4be9edf 100644 --- a/src/main/java/biomesoplenty/common/mixin/biome/MixinBiomeGenBase.java +++ b/src/main/java/biomesoplenty/common/mixin/biome/MixinBiomeGenBase.java @@ -26,11 +26,13 @@ public abstract class MixinBiomeGenBase implements IExtendedBiome @Shadow public BiomeDecorator theBiomeDecorator; - private BiomeOwner biomeOwner = BiomeOwner.OTHER; + private BiomeOwner biomeOwner; @Inject(method = "(IZ)V", at = @At("RETURN")) private void onConstructed(int biomeId, boolean register, CallbackInfo callbackInfo) { + this.biomeOwner = BiomeOwner.OTHER; + //Prevents Forge from wiping all of our added data this.theBiomeDecorator = new BiomeDecorator(); }