This repository has been archived by the owner on Aug 30, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Mod can now veto JEID's mod support mixins - less hacky implementation * Creeping Nether biome is now properly set in v2.2 of the mod and up * HammerCore dependent mods are now able to change biomes - specifically requested in relation to Biome Paint Tools * New method for overriding JEID's mod support mixins. This should allow for cleaner solutions in future when issues such as DimensionalDevelopment/JustEnoughIDs#52 arise * Advanced Rocketry, now with lasers! * CleansingRitualMessage mixin no longer needed
- Loading branch information
Showing
41 changed files
with
473 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 0 additions & 33 deletions
33
...in/java/uk/bobbytables/jeidsi/compat/abyssalcraft/mixins/MixinCleansingRitualMessage.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
src/main/java/uk/bobbytables/jeidsi/core/compat/JeidModSupportPlugin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package uk.bobbytables.jeidsi.core.compat; | ||
|
||
import net.minecraftforge.fml.common.Loader; | ||
import net.minecraftforge.fml.common.ModContainer; | ||
import org.spongepowered.asm.lib.tree.ClassNode; | ||
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; | ||
import org.spongepowered.asm.mixin.extensibility.IMixinInfo; | ||
import uk.bobbytables.jeidsi.core.JEIDsILoadingPlugin; | ||
|
||
import java.util.List; | ||
import java.util.Set; | ||
|
||
public class JeidModSupportPlugin implements IMixinConfigPlugin { | ||
@Override | ||
public void onLoad(String s) { | ||
|
||
} | ||
|
||
@Override | ||
public String getRefMapperConfig() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean shouldApplyMixin(String s, String s1) { | ||
if (s.equals("com.cutievirus.creepingnether.entity.EntityPortal")) { | ||
JEIDsILoadingPlugin.LOGGER.info("Testing " + s1); | ||
for (ModContainer mod : Loader.instance().getModList()) { | ||
if (mod.getModId().equals("creepingnether")) { | ||
String[] modVersion = mod.getVersion().split("[.]"); | ||
if (Integer.parseInt(modVersion[0]) >= 2 && Integer.parseInt(modVersion[1]) >= 2) { | ||
JEIDsILoadingPlugin.LOGGER.info("Creeping Nether at v2.2.x, JEID mixin skipped"); | ||
return false; | ||
} | ||
} | ||
} | ||
} | ||
return true; | ||
} | ||
|
||
@Override | ||
public void acceptTargets(Set<String> set, Set<String> set1) { | ||
|
||
} | ||
|
||
@Override | ||
public List<String> getMixins() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public void preApply(String s, ClassNode classNode, String s1, IMixinInfo iMixinInfo) { | ||
|
||
} | ||
|
||
@Override | ||
public void postApply(String s, ClassNode classNode, String s1, IMixinInfo iMixinInfo) { | ||
|
||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...mpat/abyssalcraft/AbyssalCraftPlugin.java → ...mpat/abyssalcraft/AbyssalCraftPlugin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...t/abyssalcraft/mixins/MixinBiomeUtil.java → ...t/abyssalcraft/mixins/MixinBiomeUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...ain/java/uk/bobbytables/jeidsi/core/compat/advancedrocketry/mixins/MixinBiomeHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package uk.bobbytables.jeidsi.core.compat.advancedrocketry.mixins; | ||
|
||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.World; | ||
import net.minecraft.world.biome.Biome; | ||
import net.minecraft.world.chunk.Chunk; | ||
import org.dimdev.jeid.INewChunk; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Overwrite; | ||
import zmaster587.advancedRocketry.network.PacketBiomeIDChange; | ||
import zmaster587.advancedRocketry.util.BiomeHandler; | ||
import zmaster587.libVulpes.network.PacketHandler; | ||
import zmaster587.libVulpes.util.HashedBlockPosition; | ||
|
||
@Mixin(BiomeHandler.class) | ||
public class MixinBiomeHandler { | ||
/** | ||
* @author sk2048 | ||
*/ | ||
@Overwrite | ||
public static void changeBiome(World world, int biomeId, BlockPos pos) { | ||
Chunk chunk = world.getChunk(pos); | ||
|
||
Biome biome = world.getBiome(pos); | ||
Biome biomeTo = Biome.getBiome(biomeId); | ||
|
||
if (biome == biomeTo) | ||
return; | ||
|
||
if (biome.topBlock != biomeTo.topBlock) { | ||
BlockPos yy = world.getHeight(pos); | ||
|
||
for (; !world.getBlockState(yy).isOpaqueCube() || yy.getY() < 0; yy = yy.down()) ; | ||
|
||
if (world.getBlockState(yy) == biome.topBlock) | ||
world.setBlockState(yy, biomeTo.topBlock); | ||
} | ||
|
||
((INewChunk) chunk).getIntBiomeArray()[(pos.getZ() & 0xF) << 4 | pos.getX() & 0xF] = biomeId; | ||
chunk.markDirty(); | ||
|
||
PacketHandler.sendToNearby(new PacketBiomeIDChange(chunk, world, new HashedBlockPosition(pos)), world.provider.getDimension(), pos, 256); | ||
} | ||
|
||
/** | ||
* @author sk2048 | ||
*/ | ||
@Overwrite | ||
public static void changeBiome(World world, int biomeId, Chunk chunk, BlockPos pos) { | ||
changeBiome(world, biomeId, pos); | ||
} | ||
} |
90 changes: 90 additions & 0 deletions
90
...a/uk/bobbytables/jeidsi/core/compat/advancedrocketry/mixins/MixinPacketBiomeIDChange.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
package uk.bobbytables.jeidsi.core.compat.advancedrocketry.mixins; | ||
|
||
import io.netty.buffer.ByteBuf; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.world.chunk.Chunk; | ||
import org.dimdev.jeid.INewChunk; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Overwrite; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
import zmaster587.advancedRocketry.AdvancedRocketry; | ||
import zmaster587.advancedRocketry.network.PacketBiomeIDChange; | ||
import zmaster587.libVulpes.util.HashedBlockPosition; | ||
|
||
import static uk.bobbytables.jeidsi.JEIDsI.LOGGER; | ||
|
||
@Mixin(PacketBiomeIDChange.class) | ||
public class MixinPacketBiomeIDChange { | ||
@Shadow | ||
Chunk chunk; | ||
@Shadow | ||
int worldId, xPos, zPos; | ||
@Shadow | ||
HashedBlockPosition pos; | ||
|
||
int[] intArray; | ||
|
||
@Inject(method = "<init>()V", at = @At("RETURN")) | ||
public void onConstructed(CallbackInfo ci) { | ||
intArray = new int[256]; | ||
} | ||
|
||
/** | ||
* @author sk2048 | ||
*/ | ||
@Overwrite(remap = false) | ||
public void write(ByteBuf out) { | ||
out.writeInt(worldId); | ||
out.writeInt(chunk.x); | ||
out.writeInt(chunk.z); | ||
out.writeInt(pos.x); | ||
out.writeShort(pos.y); | ||
out.writeInt(pos.z); | ||
|
||
for (int biomeId : ((INewChunk) chunk).getIntBiomeArray()) { | ||
out.writeInt(biomeId); | ||
} | ||
} | ||
|
||
/** | ||
* @author sk2048 | ||
*/ | ||
@Overwrite(remap = false) | ||
public void readClient(ByteBuf in) { | ||
worldId = in.readInt(); | ||
xPos = in.readInt(); | ||
zPos = in.readInt(); | ||
|
||
pos.x = in.readInt(); | ||
pos.y = in.readShort(); | ||
pos.z = in.readInt(); | ||
|
||
for (int i = 0; i < 256; i++) { | ||
int biomeId = in.readInt(); | ||
intArray[i] = biomeId; | ||
} | ||
} | ||
|
||
|
||
/** | ||
* @author sk2048 | ||
*/ | ||
@Overwrite(remap = false) | ||
public void executeClient(EntityPlayer thePlayer) { | ||
if (thePlayer.world.provider.getDimension() == worldId) { | ||
chunk = thePlayer.world.getChunk(xPos, zPos); | ||
if (chunk.isLoaded()) { | ||
((INewChunk) chunk).setIntBiomeArray(intArray); | ||
chunk.markDirty(); | ||
thePlayer.world.markBlockRangeForRenderUpdate(pos.getBlockPos(), pos.getBlockPos()); | ||
|
||
if (Minecraft.getMinecraft().gameSettings.particleSetting < 2) | ||
AdvancedRocketry.proxy.spawnParticle("smallLazer", thePlayer.world, pos.x, pos.y, pos.z, 0, 0, 0); | ||
} | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...pat/bookshelf/mixins/MixinWorldUtils.java → ...pat/bookshelf/mixins/MixinWorldUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.