mirror of
https://github.com/GTMEGA/EndlessIDs.git
synced 2026-11-17 09:55:06 +00:00
restyle code
This commit is contained in:
58 files changed
+567
-480
No files matched your search
@@ -2,26 +2,29 @@ package com.falsepattern.endlessids;
|
||||
|
||||
import code.elix_x.coremods.antiidconflict.managers.BiomesManager;
|
||||
import com.falsepattern.endlessids.constants.ExtendedConstants;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
|
||||
@Mod(modid = Tags.MODID,
|
||||
version = Tags.VERSION,
|
||||
name = Tags.MODNAME,
|
||||
acceptedMinecraftVersions = "[1.7.10]",
|
||||
dependencies = "required-after:falsepatternlib@[0.8.2,);\n" +
|
||||
"after:antiidconflict")
|
||||
dependencies = "required-after:falsepatternlib@[0.8.2,);after:antiidconflict")
|
||||
public class EndlessIDs {
|
||||
public static final Logger LOG = LogManager.getLogger(Tags.MODNAME);
|
||||
public static BiomeGenBase[] fakeBiomeArray;
|
||||
public static boolean postInitFinished = false;
|
||||
|
||||
private static void antiIdConflictLatePatch() {
|
||||
BiomesManager.conflicts = new BiomesManager.ConflictingBiomes[ExtendedConstants.biomeIDCount];
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void preInit(FMLPreInitializationEvent e) {
|
||||
if (Loader.isModLoaded("antiidconflict")) {
|
||||
@@ -34,8 +37,4 @@ public class EndlessIDs {
|
||||
postInitFinished = true;
|
||||
fakeBiomeArray = null;
|
||||
}
|
||||
|
||||
private static void antiIdConflictLatePatch() {
|
||||
BiomesManager.conflicts = new BiomesManager.ConflictingBiomes[ExtendedConstants.biomeIDCount];
|
||||
}
|
||||
}
|
||||
@@ -4,13 +4,14 @@ import com.falsepattern.endlessids.constants.ExtendedConstants;
|
||||
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
|
||||
import com.falsepattern.endlessids.mixin.helpers.IExtendedBlockStorageMixin;
|
||||
import lombok.val;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
||||
import java.nio.ShortBuffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ShortBuffer;
|
||||
|
||||
public class Hooks {
|
||||
|
||||
@@ -22,7 +23,7 @@ public class Hooks {
|
||||
System.arraycopy(msb, 0, ret, lsb.length * 2, lsb.length);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
public static void setBlockData(final IExtendedBlockStorageMixin ebs, final byte[] data, final int offset) {
|
||||
val lsb = ebs.getLSB();
|
||||
val msb = ebs.getMSB();
|
||||
@@ -47,9 +48,11 @@ public class Hooks {
|
||||
byte3Data[i] = ebsMSB[i];
|
||||
}
|
||||
val idLSB = (ebsLSB[i] & 0xFFFF);
|
||||
byte1Data[i] = (byte)(idLSB & 0xFF);
|
||||
byte1Data[i] = (byte) (idLSB & 0xFF);
|
||||
|
||||
if (idLSB <= 0xFF) continue;
|
||||
if (idLSB <= 0xFF) {
|
||||
continue;
|
||||
}
|
||||
val nibbleIndex = i >> 1;
|
||||
val nibbleShift = (i & 1) * 4;
|
||||
if (byte2BottomNibbleData == null) {
|
||||
@@ -57,7 +60,9 @@ public class Hooks {
|
||||
}
|
||||
byte2BottomNibbleData[nibbleIndex] |= ((idLSB >>> 8) & 0xF) << nibbleShift;
|
||||
|
||||
if (idLSB <= 0xFFF) continue;
|
||||
if (idLSB <= 0xFFF) {
|
||||
continue;
|
||||
}
|
||||
if (byte2TopNibbleData == null) {
|
||||
byte2TopNibbleData = new byte[ebsLSB.length / 2];
|
||||
}
|
||||
@@ -65,12 +70,15 @@ public class Hooks {
|
||||
|
||||
}
|
||||
nbt.setByteArray("Blocks", byte1Data);
|
||||
if (byte2BottomNibbleData != null)
|
||||
if (byte2BottomNibbleData != null) {
|
||||
nbt.setByteArray("Add", byte2BottomNibbleData);
|
||||
if (byte2TopNibbleData != null)
|
||||
}
|
||||
if (byte2TopNibbleData != null) {
|
||||
nbt.setByteArray("BlocksB2Hi", byte2TopNibbleData);
|
||||
if (byte3Data != null)
|
||||
}
|
||||
if (byte3Data != null) {
|
||||
nbt.setByteArray("BlocksB3", byte3Data);
|
||||
}
|
||||
}
|
||||
|
||||
public static void readChunkFromNbt(final IExtendedBlockStorageMixin ebs, final NBTTagCompound nbt) {
|
||||
@@ -94,7 +102,7 @@ public class Hooks {
|
||||
if (byte2TopNibbleData != null) {
|
||||
id |= ((byte2TopNibbleData[i >> 1] >> nibbleShift) & 0xF) << 12;
|
||||
}
|
||||
lsb[i] = (short)id;
|
||||
lsb[i] = (short) id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,15 +112,15 @@ public class Hooks {
|
||||
int cntNonEmpty = 0;
|
||||
int cntTicking = 0;
|
||||
for (int off = 0; off < blkIdsLSB.length; ++off) {
|
||||
final int id = ((blkIdsLSB[off] & 0xFFFF) | ((blkIdsMSB[off] & 0xFF) << 16)) & ExtendedConstants.blockIDMask;
|
||||
final int id =
|
||||
((blkIdsLSB[off] & 0xFFFF) | ((blkIdsMSB[off] & 0xFF) << 16)) & ExtendedConstants.blockIDMask;
|
||||
if (id > 0) {
|
||||
final Block block = (Block)Block.blockRegistry.getObjectById(id);
|
||||
final Block block = (Block) Block.blockRegistry.getObjectById(id);
|
||||
if (block == null) {
|
||||
if (IEConfig.removeInvalidBlocks) {
|
||||
blkIdsLSB[off] = 0;
|
||||
}
|
||||
}
|
||||
else if (block != Blocks.air) {
|
||||
} else if (block != Blocks.air) {
|
||||
++cntNonEmpty;
|
||||
if (block.getTickRandomly()) {
|
||||
++cntTicking;
|
||||
@@ -123,11 +131,12 @@ public class Hooks {
|
||||
ebs.setBlockRefCount(cntNonEmpty);
|
||||
ebs.setTickRefCount(cntTicking);
|
||||
}
|
||||
|
||||
|
||||
public static int getIdFromBlockWithCheck(final Block block, final Block oldBlock) {
|
||||
final int id = Block.getIdFromBlock(block);
|
||||
if (IEConfig.catchUnregisteredBlocks && id == -1) {
|
||||
throw new IllegalArgumentException("Block " + block + " is not registered. <-- Say about this to the author of this mod, or you can try to enable \"RemoveInvalidBlocks\" option in EID config.");
|
||||
throw new IllegalArgumentException("Block " + block +
|
||||
" is not registered. <-- Say about this to the author of this mod, or you can try to enable \"RemoveInvalidBlocks\" option in EID config.");
|
||||
}
|
||||
if (id >= 0 && id <= ExtendedConstants.maxBlockID) {
|
||||
return id;
|
||||
@@ -143,9 +152,9 @@ public class Hooks {
|
||||
public static byte[] shortToByteArray(short[] shortArray) {
|
||||
byte[] byteArray = new byte[512];
|
||||
|
||||
for(int i = 0; i < 256; ++i) {
|
||||
byteArray[i] = (byte)(shortArray[i] & 255);
|
||||
byteArray[i + 256] = (byte)(shortArray[i] >>> 8);
|
||||
for (int i = 0; i < 256; ++i) {
|
||||
byteArray[i] = (byte) (shortArray[i] & 255);
|
||||
byteArray[i + 256] = (byte) (shortArray[i] >>> 8);
|
||||
}
|
||||
return byteArray;
|
||||
}
|
||||
@@ -153,8 +162,8 @@ public class Hooks {
|
||||
public static short[] byteToShortArray(byte[] byteArray) {
|
||||
short[] shortArray = new short[256];
|
||||
|
||||
for(int i = 0; i < 256; ++i) {
|
||||
shortArray[i] = (short)(byteArray[i + 256] << 8 | byteArray[i]);
|
||||
for (int i = 0; i < 256; ++i) {
|
||||
shortArray[i] = (short) (byteArray[i + 256] << 8 | byteArray[i]);
|
||||
}
|
||||
|
||||
return shortArray;
|
||||
@@ -164,7 +173,7 @@ public class Hooks {
|
||||
short[] shortArray = new short[256];
|
||||
|
||||
for (int i = 0; i < 256; i++) {
|
||||
shortArray[i] = (short)(byteArray[i] & 0xff);
|
||||
shortArray[i] = (short) (byteArray[i] & 0xff);
|
||||
}
|
||||
|
||||
return shortArray;
|
||||
@@ -173,18 +182,18 @@ public class Hooks {
|
||||
public static int readBiomeArrayFromPacket(Chunk chunk, byte[] array, int offset) {
|
||||
byte[] byteArray = new byte[512];
|
||||
System.arraycopy(array, offset, byteArray, 0, 512);
|
||||
((IChunkMixin)chunk).setBiomeShortArray(byteToShortArray(byteArray));
|
||||
((IChunkMixin) chunk).setBiomeShortArray(byteToShortArray(byteArray));
|
||||
return byteArray.length;
|
||||
}
|
||||
|
||||
public static int writeBiomeArrayToPacket(Chunk chunk, byte[] array, int offset) {
|
||||
byte[] byteArray = shortToByteArray(((IChunkMixin)chunk).getBiomeShortArray());
|
||||
byte[] byteArray = shortToByteArray(((IChunkMixin) chunk).getBiomeShortArray());
|
||||
System.arraycopy(byteArray, 0, array, offset, 512);
|
||||
return byteArray.length;
|
||||
}
|
||||
|
||||
public static void writeChunkBiomeArrayToNbt(Chunk chunk, NBTTagCompound nbt) {
|
||||
byte[] byteArray = shortToByteArray(((IChunkMixin)chunk).getBiomeShortArray());
|
||||
byte[] byteArray = shortToByteArray(((IChunkMixin) chunk).getBiomeShortArray());
|
||||
nbt.setByteArray("Biomes16", byteArray);
|
||||
}
|
||||
|
||||
@@ -196,7 +205,7 @@ public class Hooks {
|
||||
data = oldBiomeByteToNewShortArray(nbt.getByteArray("Biomes"));
|
||||
}
|
||||
if (data != null) {
|
||||
((IChunkMixin)chunk).setBiomeShortArray(data);
|
||||
((IChunkMixin) chunk).setBiomeShortArray(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,11 +12,13 @@ public class IEConfig {
|
||||
@Config.Comment("Extend DataWatcher IDs. Vanilla limit is 31, new limit is 127.")
|
||||
public static boolean extendDataWatcher = false;
|
||||
|
||||
@Config.Comment("Setting this value greater than 0 will reduce RAM usage, at the cost of less available Block IDs.\n" +
|
||||
"Notice: This does not affect ITEM IDs.\n" +
|
||||
"By default, block IDs can also go up to 16 Million, and each additional bit in this setting halves\n" +
|
||||
"this value.\n" +
|
||||
"(0: 16M, 1: 8M, 2: 4M, 3: 2M, 4: 1M, 5: 512K, 6: 256K, 7: 128K, 8: 64K, 9: 32K, 10: 16K, 11: 8K, 12: 4K)\n")
|
||||
@Config.RangeInt(min = 0, max = 12)
|
||||
@Config.Comment(
|
||||
"Setting this value greater than 0 will reduce RAM usage, at the cost of less available Block IDs.\n" +
|
||||
"Notice: This does not affect ITEM IDs.\n" +
|
||||
"By default, block IDs can also go up to 16 Million, and each additional bit in this setting halves\n" +
|
||||
"this value.\n" +
|
||||
"(0: 16M, 1: 8M, 2: 4M, 3: 2M, 4: 1M, 5: 512K, 6: 256K, 7: 128K, 8: 64K, 9: 32K, 10: 16K, 11: 8K, 12: 4K)\n")
|
||||
@Config.RangeInt(min = 0,
|
||||
max = 12)
|
||||
public static int countCorrectionBits = 0;
|
||||
}
|
||||
@@ -1,20 +1,23 @@
|
||||
package com.falsepattern.endlessids;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.falsepattern.endlessids.asm.IETransformer;
|
||||
import com.falsepattern.lib.config.ConfigException;
|
||||
import com.falsepattern.lib.config.ConfigurationManager;
|
||||
|
||||
import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
|
||||
|
||||
import static cpw.mods.fml.relauncher.IFMLLoadingPlugin.*;
|
||||
import java.util.Map;
|
||||
|
||||
import static cpw.mods.fml.relauncher.IFMLLoadingPlugin.DependsOn;
|
||||
import static cpw.mods.fml.relauncher.IFMLLoadingPlugin.MCVersion;
|
||||
import static cpw.mods.fml.relauncher.IFMLLoadingPlugin.Name;
|
||||
import static cpw.mods.fml.relauncher.IFMLLoadingPlugin.TransformerExclusions;
|
||||
|
||||
@MCVersion("1.7.10")
|
||||
@Name(Tags.MODID)
|
||||
@TransformerExclusions({ "com.falsepattern.endlessids.asm" })
|
||||
@TransformerExclusions({"com.falsepattern.endlessids.asm"})
|
||||
@DependsOn("falsepatternlib")
|
||||
public class IEPlugin implements IFMLLoadingPlugin
|
||||
{
|
||||
public class IEPlugin implements IFMLLoadingPlugin {
|
||||
static {
|
||||
try {
|
||||
ConfigurationManager.registerConfig(IEConfig.class);
|
||||
@@ -22,26 +25,27 @@ public class IEPlugin implements IFMLLoadingPlugin
|
||||
System.err.println("Failed to load EndlessIDs config. Using defaults.");
|
||||
}
|
||||
}
|
||||
|
||||
public IEPlugin() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
public String[] getASMTransformerClass() {
|
||||
return new String[] { IETransformer.class.getName() };
|
||||
return new String[]{IETransformer.class.getName()};
|
||||
}
|
||||
|
||||
|
||||
public String getModContainerClass() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public String getSetupClass() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public void injectData(final Map<String, Object> data) {
|
||||
IETransformer.isObfuscated = (Boolean) data.get("runtimeDeobfuscationEnabled");
|
||||
}
|
||||
|
||||
|
||||
public String getAccessTransformerClass() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@ import net.minecraft.world.biome.BiomeGenBase;
|
||||
public class PlaceholderBiome extends BiomeGenBase {
|
||||
public PlaceholderBiome(int id, BiomeGenBase parent) {
|
||||
super(id);
|
||||
biomeName = "EndlessIDs ID conflict avoidance placeholder for ID " + parent.biomeID +
|
||||
" [" + parent.getClass().getName() + "]";
|
||||
biomeName = "EndlessIDs ID conflict avoidance placeholder for ID " + parent.biomeID + " [" +
|
||||
parent.getClass().getName() + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
package com.falsepattern.endlessids.asm;
|
||||
|
||||
public class AsmTransformException extends RuntimeException
|
||||
{
|
||||
public class AsmTransformException extends RuntimeException {
|
||||
private static final long serialVersionUID = 5128914670008752449L;
|
||||
|
||||
|
||||
public AsmTransformException(final String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
|
||||
public AsmTransformException(final Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
|
||||
public AsmTransformException(final String message, final Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
@@ -1,26 +1,20 @@
|
||||
package com.falsepattern.endlessids.asm;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
import org.objectweb.asm.util.Printer;
|
||||
import org.objectweb.asm.util.TraceMethodVisitor;
|
||||
import org.objectweb.asm.util.Textifier;
|
||||
import org.objectweb.asm.tree.InsnList;
|
||||
import java.util.ListIterator;
|
||||
import org.objectweb.asm.tree.AbstractInsnNode;
|
||||
import org.objectweb.asm.tree.ClassNode;
|
||||
import org.objectweb.asm.tree.FieldNode;
|
||||
import org.objectweb.asm.tree.InsnNode;
|
||||
import org.objectweb.asm.tree.IntInsnNode;
|
||||
import org.objectweb.asm.tree.LdcInsnNode;
|
||||
import org.objectweb.asm.tree.AbstractInsnNode;
|
||||
import org.objectweb.asm.tree.FieldNode;
|
||||
import org.objectweb.asm.tree.MethodNode;
|
||||
import org.objectweb.asm.tree.ClassNode;
|
||||
|
||||
public class AsmUtil
|
||||
{
|
||||
import java.util.ListIterator;
|
||||
|
||||
public class AsmUtil {
|
||||
public AsmUtil() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
public static FieldNode findField(final ClassNode cn, final String name, final boolean optional) {
|
||||
for (final FieldNode ret : cn.fields) {
|
||||
if (name.equals(ret.name)) {
|
||||
@@ -32,7 +26,7 @@ public class AsmUtil
|
||||
}
|
||||
throw new FieldNotFoundException(name);
|
||||
}
|
||||
|
||||
|
||||
public static boolean transformInlinedSizeMethod(final ClassNode cn, final MethodNode method, final int oldValue, final int newValue, final boolean optional) {
|
||||
boolean found = false;
|
||||
boolean foundOnce = false;
|
||||
@@ -42,30 +36,23 @@ public class AsmUtil
|
||||
final AbstractInsnNode insn = it.next();
|
||||
if (insn.getOpcode() == 3 && oldValue == 0) {
|
||||
found = true;
|
||||
}
|
||||
else if (insn.getOpcode() == 4 && oldValue == 1) {
|
||||
} else if (insn.getOpcode() == 4 && oldValue == 1) {
|
||||
found = true;
|
||||
}
|
||||
else if (insn.getOpcode() == 5 && oldValue == 2) {
|
||||
} else if (insn.getOpcode() == 5 && oldValue == 2) {
|
||||
found = true;
|
||||
}
|
||||
else if (insn.getOpcode() == 6 && oldValue == 3) {
|
||||
} else if (insn.getOpcode() == 6 && oldValue == 3) {
|
||||
found = true;
|
||||
}
|
||||
else if (insn.getOpcode() == 7 && oldValue == 4) {
|
||||
} else if (insn.getOpcode() == 7 && oldValue == 4) {
|
||||
found = true;
|
||||
}
|
||||
else if (insn.getOpcode() == 8 && oldValue == 5) {
|
||||
} else if (insn.getOpcode() == 8 && oldValue == 5) {
|
||||
found = true;
|
||||
}
|
||||
else if (insn.getOpcode() == 18) {
|
||||
final LdcInsnNode node = (LdcInsnNode)insn;
|
||||
if (node.cst instanceof Integer && (int)node.cst == oldValue) {
|
||||
} else if (insn.getOpcode() == 18) {
|
||||
final LdcInsnNode node = (LdcInsnNode) insn;
|
||||
if (node.cst instanceof Integer && (int) node.cst == oldValue) {
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
else if (insn.getOpcode() == 17 || insn.getOpcode() == 16) {
|
||||
final IntInsnNode node2 = (IntInsnNode)insn;
|
||||
} else if (insn.getOpcode() == 17 || insn.getOpcode() == 16) {
|
||||
final IntInsnNode node2 = (IntInsnNode) insn;
|
||||
if (node2.operand == oldValue) {
|
||||
found = true;
|
||||
}
|
||||
@@ -74,29 +61,21 @@ public class AsmUtil
|
||||
foundOnce = true;
|
||||
if (newValue == 0) {
|
||||
it.set(new InsnNode(3));
|
||||
}
|
||||
else if (newValue == 1) {
|
||||
} else if (newValue == 1) {
|
||||
it.set(new InsnNode(4));
|
||||
}
|
||||
else if (newValue == 2) {
|
||||
} else if (newValue == 2) {
|
||||
it.set(new InsnNode(5));
|
||||
}
|
||||
else if (newValue == 3) {
|
||||
} else if (newValue == 3) {
|
||||
it.set(new InsnNode(6));
|
||||
}
|
||||
else if (newValue == 4) {
|
||||
} else if (newValue == 4) {
|
||||
it.set(new InsnNode(7));
|
||||
}
|
||||
else if (newValue == 5) {
|
||||
} else if (newValue == 5) {
|
||||
it.set(new InsnNode(8));
|
||||
}
|
||||
else if (newValue >= -128 && newValue <= 127) {
|
||||
} else if (newValue >= -128 && newValue <= 127) {
|
||||
it.set(new IntInsnNode(16, newValue));
|
||||
}
|
||||
else if (newValue >= -32768 && newValue <= 32767) {
|
||||
} else if (newValue >= -32768 && newValue <= 32767) {
|
||||
it.set(new IntInsnNode(17, newValue));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
it.set(new LdcInsnNode(newValue));
|
||||
}
|
||||
found = false;
|
||||
@@ -107,5 +86,5 @@ public class AsmUtil
|
||||
}
|
||||
return foundOnce;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,35 +1,17 @@
|
||||
package com.falsepattern.endlessids.asm;
|
||||
|
||||
import java.util.HashMap;
|
||||
import com.falsepattern.endlessids.asm.transformer.FmlRegistry;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public enum ClassEdit
|
||||
{
|
||||
FmlRegistry(new FmlRegistry(), new String[] { "cpw.mods.fml.common.registry.GameData", "cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry" }),
|
||||
public enum ClassEdit {
|
||||
FmlRegistry(new FmlRegistry(), new String[]{"cpw.mods.fml.common.registry.GameData",
|
||||
"cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry"}),
|
||||
;
|
||||
|
||||
|
||||
private static final Map<String, ClassEdit> editMap;
|
||||
private final IClassNodeTransformer transformer;
|
||||
private final String[] classNames;
|
||||
|
||||
ClassEdit(final IClassNodeTransformer transformer, final String[] classNames) {
|
||||
this.transformer = transformer;
|
||||
this.classNames = classNames;
|
||||
}
|
||||
|
||||
public static ClassEdit get(final String className) {
|
||||
return ClassEdit.editMap.get(className);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name();
|
||||
}
|
||||
|
||||
public IClassNodeTransformer getTransformer() {
|
||||
return this.transformer;
|
||||
}
|
||||
|
||||
|
||||
static {
|
||||
editMap = new HashMap<>();
|
||||
for (final ClassEdit edit : values()) {
|
||||
@@ -38,4 +20,24 @@ public enum ClassEdit
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final IClassNodeTransformer transformer;
|
||||
private final String[] classNames;
|
||||
|
||||
ClassEdit(final IClassNodeTransformer transformer, final String[] classNames) {
|
||||
this.transformer = transformer;
|
||||
this.classNames = classNames;
|
||||
}
|
||||
|
||||
public static ClassEdit get(final String className) {
|
||||
return ClassEdit.editMap.get(className);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name();
|
||||
}
|
||||
|
||||
public IClassNodeTransformer getTransformer() {
|
||||
return this.transformer;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.falsepattern.endlessids.asm;
|
||||
|
||||
public class FieldNotFoundException extends AsmTransformException
|
||||
{
|
||||
public class FieldNotFoundException extends AsmTransformException {
|
||||
public FieldNotFoundException(final String field) {
|
||||
super("can't find field " + field);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.falsepattern.endlessids.asm;
|
||||
|
||||
import org.objectweb.asm.tree.ClassNode;
|
||||
|
||||
public interface IClassNodeTransformer
|
||||
{
|
||||
public interface IClassNodeTransformer {
|
||||
void transform(final ClassNode p0, final boolean p1);
|
||||
}
|
||||
@@ -2,23 +2,27 @@ package com.falsepattern.endlessids.asm;
|
||||
|
||||
import com.falsepattern.endlessids.Tags;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.objectweb.asm.util.CheckClassAdapter;
|
||||
import org.objectweb.asm.ClassWriter;
|
||||
import org.objectweb.asm.ClassVisitor;
|
||||
import org.objectweb.asm.ClassReader;
|
||||
import org.objectweb.asm.tree.ClassNode;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.objectweb.asm.ClassReader;
|
||||
import org.objectweb.asm.ClassVisitor;
|
||||
import org.objectweb.asm.ClassWriter;
|
||||
import org.objectweb.asm.tree.ClassNode;
|
||||
import org.objectweb.asm.util.CheckClassAdapter;
|
||||
|
||||
import net.minecraft.launchwrapper.IClassTransformer;
|
||||
|
||||
public class IETransformer implements IClassTransformer
|
||||
{
|
||||
public class IETransformer implements IClassTransformer {
|
||||
public static final Logger logger;
|
||||
public static boolean isObfuscated;
|
||||
|
||||
static {
|
||||
logger = LogManager.getLogger(Tags.MODNAME + " ASM");
|
||||
}
|
||||
|
||||
public IETransformer() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
public byte[] transform(final String name, final String transformedName, final byte[] bytes) {
|
||||
if (bytes == null) {
|
||||
return bytes;
|
||||
@@ -33,29 +37,25 @@ public class IETransformer implements IClassTransformer
|
||||
reader.accept(cn, 0);
|
||||
try {
|
||||
edit.getTransformer().transform(cn, IETransformer.isObfuscated);
|
||||
}
|
||||
catch (AsmTransformException t) {
|
||||
IETransformer.logger.error("Error transforming {} with {}: {}", transformedName, edit.getName(), t.getMessage());
|
||||
} catch (AsmTransformException t) {
|
||||
IETransformer.logger.error("Error transforming {} with {}: {}", transformedName, edit.getName(),
|
||||
t.getMessage());
|
||||
throw t;
|
||||
}
|
||||
catch (Throwable t2) {
|
||||
IETransformer.logger.error("Error transforming {} with {}: {}", transformedName, edit.getName(), t2.getMessage());
|
||||
} catch (Throwable t2) {
|
||||
IETransformer.logger.error("Error transforming {} with {}: {}", transformedName, edit.getName(),
|
||||
t2.getMessage());
|
||||
throw new RuntimeException(t2);
|
||||
}
|
||||
final ClassWriter writer = new ClassWriter(0);
|
||||
try {
|
||||
final ClassVisitor check = new CheckClassAdapter(writer);
|
||||
cn.accept(check);
|
||||
}
|
||||
catch (Throwable t3) {
|
||||
IETransformer.logger.error("Error verifying {} transformed with {}: {}", transformedName, edit.getName(), t3.getMessage());
|
||||
} catch (Throwable t3) {
|
||||
IETransformer.logger.error("Error verifying {} transformed with {}: {}", transformedName, edit.getName(),
|
||||
t3.getMessage());
|
||||
throw new RuntimeException(t3);
|
||||
}
|
||||
IETransformer.logger.debug("Patched {} successfully.", edit.getName());
|
||||
return writer.toByteArray();
|
||||
}
|
||||
|
||||
static {
|
||||
logger = LogManager.getLogger(Tags.MODNAME + " ASM");
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.falsepattern.endlessids.asm;
|
||||
|
||||
public class MethodNotFoundException extends AsmTransformException
|
||||
{
|
||||
public class MethodNotFoundException extends AsmTransformException {
|
||||
public MethodNotFoundException(final String method) {
|
||||
super("can't find method " + method);
|
||||
}
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
package com.falsepattern.endlessids.asm.transformer;
|
||||
|
||||
import com.falsepattern.endlessids.asm.AsmTransformException;
|
||||
import com.falsepattern.endlessids.asm.AsmUtil;
|
||||
import com.falsepattern.endlessids.asm.IClassNodeTransformer;
|
||||
import com.falsepattern.endlessids.constants.ExtendedConstants;
|
||||
import com.falsepattern.endlessids.constants.VanillaConstants;
|
||||
import lombok.var;
|
||||
import org.objectweb.asm.tree.FieldNode;
|
||||
import com.falsepattern.endlessids.asm.AsmTransformException;
|
||||
import org.objectweb.asm.tree.MethodNode;
|
||||
import com.falsepattern.endlessids.asm.AsmUtil;
|
||||
import org.objectweb.asm.tree.ClassNode;
|
||||
import com.falsepattern.endlessids.asm.IClassNodeTransformer;
|
||||
import org.objectweb.asm.tree.MethodNode;
|
||||
|
||||
public class FmlRegistry implements IClassNodeTransformer
|
||||
{
|
||||
public class FmlRegistry implements IClassNodeTransformer {
|
||||
public FmlRegistry() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void transform(final ClassNode cn, final boolean obfuscated) {
|
||||
var field = AsmUtil.findField(cn, "MAX_BLOCK_ID", true);
|
||||
@@ -28,7 +26,8 @@ public class FmlRegistry implements IClassNodeTransformer
|
||||
}
|
||||
boolean found = false;
|
||||
for (final MethodNode method : cn.methods) {
|
||||
if (AsmUtil.transformInlinedSizeMethod(cn, method, VanillaConstants.maxBlockID, ExtendedConstants.maxBlockID, true)) {
|
||||
if (AsmUtil.transformInlinedSizeMethod(cn, method, VanillaConstants.maxBlockID,
|
||||
ExtendedConstants.maxBlockID, true)) {
|
||||
found = true;
|
||||
}
|
||||
AsmUtil.transformInlinedSizeMethod(cn, method, 31999, ExtendedConstants.maxBlockID, true);
|
||||
|
||||
@@ -13,9 +13,8 @@ public class ExtendedConstants {
|
||||
|
||||
//BlockItemIDs
|
||||
public static final int nibblesPerID = bitsPerID / 4;
|
||||
public static final int nibblesPerMetadata = bitsPerMetadata / 4;
|
||||
|
||||
public static final int bytesPerID = (nibblesPerID + 1) / 2;
|
||||
public static final int nibblesPerMetadata = bitsPerMetadata / 4;
|
||||
public static final int bytesPerIDPlusMetadata = (nibblesPerID + nibblesPerMetadata + 1) / 2;
|
||||
|
||||
public static final int blockIDMask = (1 << bitsPerID) - 1;
|
||||
@@ -32,12 +31,10 @@ public class ExtendedConstants {
|
||||
public static final int biomeIDMask = biomeIDCount - 1;
|
||||
public static final int biomeIDNull = biomeIDMask;
|
||||
public static final int bytesPerBiome = (bitsPerBiome + 7) / 8;
|
||||
|
||||
//Chunk
|
||||
public static final int bytesPerChunk = bytesPerBiome * 256 + bytesPerEBS * 16;
|
||||
//DataWatcher
|
||||
public static final int watchableCount = 1 << watchableBits;
|
||||
public static final int maxWatchableID = watchableCount - 1;
|
||||
public static final int watchableMask = (0x7 << watchableBits) | maxWatchableID;
|
||||
|
||||
//Chunk
|
||||
public static final int bytesPerChunk = bytesPerBiome * 256 + bytesPerEBS * 16;
|
||||
}
|
||||
@@ -11,9 +11,8 @@ public class VanillaConstants {
|
||||
|
||||
//BlockItemIDs
|
||||
public static final int nibblesPerID = bitsPerID / 4;
|
||||
public static final int nibblesPerMetadata = bitsPerMetadata / 4;
|
||||
|
||||
public static final int bytesPerID = (nibblesPerID + 1) / 2;
|
||||
public static final int nibblesPerMetadata = bitsPerMetadata / 4;
|
||||
public static final int bytesPerIDPlusMetadata = (nibblesPerID + nibblesPerMetadata + 1) / 2;
|
||||
|
||||
public static final int blockIDMask = (1 << bitsPerID) - 1;
|
||||
@@ -30,12 +29,10 @@ public class VanillaConstants {
|
||||
public static final int biomeIDMask = biomeIDCount - 1;
|
||||
public static final int biomeIDNull = biomeIDMask;
|
||||
public static final int bytesPerBiome = (bitsPerBiome + 7) / 8;
|
||||
|
||||
//Chunk
|
||||
public static final int bytesPerChunk = bytesPerBiome * 256 + bytesPerEBS * 16;
|
||||
//DataWatcher
|
||||
public static final int watchableCount = 1 << watchableBits;
|
||||
public static final int maxWatchableID = watchableCount - 1;
|
||||
public static final int watchableMask = (0x7 << watchableBits) | maxWatchableID;
|
||||
|
||||
//Chunk
|
||||
public static final int bytesPerChunk = bytesPerBiome * 256 + bytesPerEBS * 16;
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
package com.falsepattern.endlessids.mixin.helpers;
|
||||
|
||||
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
|
||||
|
||||
public interface IChunkMixin {
|
||||
short[] getBiomeShortArray();
|
||||
|
||||
void setBiomeShortArray(short[] data);
|
||||
}
|
||||
+3
@@ -2,7 +2,10 @@ package com.falsepattern.endlessids.mixin.helpers;
|
||||
|
||||
public interface IExtendedBlockStorageMixin {
|
||||
void setBlockRefCount(int value);
|
||||
|
||||
void setTickRefCount(int value);
|
||||
|
||||
short[] getLSB();
|
||||
|
||||
byte[] getMSB();
|
||||
}
|
||||
+40
-31
@@ -3,17 +3,18 @@ package com.falsepattern.endlessids.mixin.mixins.client.vanilla;
|
||||
import com.falsepattern.endlessids.Hooks;
|
||||
import com.falsepattern.endlessids.constants.ExtendedConstants;
|
||||
import com.falsepattern.endlessids.mixin.helpers.IExtendedBlockStorageMixin;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.chunk.NibbleArray;
|
||||
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
@@ -22,23 +23,28 @@ import java.util.Map;
|
||||
@SuppressWarnings({"rawtypes", "WhileLoopReplaceableByForEach", "unchecked"})
|
||||
@Mixin(Chunk.class)
|
||||
public abstract class ChunkMixin {
|
||||
@Shadow public Map chunkTileEntityMap;
|
||||
@Shadow
|
||||
public Map chunkTileEntityMap;
|
||||
|
||||
@Shadow public World worldObj;
|
||||
@Shadow
|
||||
public World worldObj;
|
||||
@Shadow
|
||||
public boolean isLightPopulated;
|
||||
@Shadow
|
||||
public boolean isTerrainPopulated;
|
||||
@Shadow
|
||||
private ExtendedBlockStorage[] storageArrays;
|
||||
@Shadow
|
||||
private byte[] blockBiomeArray;
|
||||
|
||||
@Shadow private ExtendedBlockStorage[] storageArrays;
|
||||
@Shadow
|
||||
public abstract void generateHeightMap();
|
||||
|
||||
@Shadow private byte[] blockBiomeArray;
|
||||
@Shadow
|
||||
public abstract Block getBlock(int p_150810_1_, int p_150810_2_, int p_150810_3_);
|
||||
|
||||
@Shadow public boolean isLightPopulated;
|
||||
|
||||
@Shadow public boolean isTerrainPopulated;
|
||||
|
||||
@Shadow public abstract void generateHeightMap();
|
||||
|
||||
@Shadow public abstract Block getBlock(int p_150810_1_, int p_150810_2_, int p_150810_3_);
|
||||
|
||||
@Shadow public abstract int getBlockMetadata(int p_76628_1_, int p_76628_2_, int p_76628_3_);
|
||||
@Shadow
|
||||
public abstract int getBlockMetadata(int p_76628_1_, int p_76628_2_, int p_76628_3_);
|
||||
|
||||
/**
|
||||
* @author FalsePattern
|
||||
@@ -49,8 +55,8 @@ public abstract class ChunkMixin {
|
||||
public void fillChunk(byte[] var1, int var2, int var3, boolean var4) {
|
||||
Iterator var5 = this.chunkTileEntityMap.values().iterator();
|
||||
|
||||
while(var5.hasNext()) {
|
||||
TileEntity var6 = (TileEntity)var5.next();
|
||||
while (var5.hasNext()) {
|
||||
TileEntity var6 = (TileEntity) var5.next();
|
||||
var6.updateContainingBlockInfo();
|
||||
var6.getBlockMetadata();
|
||||
var6.getBlockType();
|
||||
@@ -60,7 +66,7 @@ public abstract class ChunkMixin {
|
||||
boolean var7 = !this.worldObj.provider.hasNoSky;
|
||||
|
||||
int var8;
|
||||
for(var8 = 0; var8 < this.storageArrays.length; ++var8) {
|
||||
for (var8 = 0; var8 < this.storageArrays.length; ++var8) {
|
||||
if ((var2 & 1 << var8) != 0) {
|
||||
if (this.storageArrays[var8] == null) {
|
||||
this.storageArrays[var8] = new ExtendedBlockStorage(var8 << 4, var7);
|
||||
@@ -74,7 +80,7 @@ public abstract class ChunkMixin {
|
||||
}
|
||||
|
||||
NibbleArray var9;
|
||||
for(var8 = 0; var8 < this.storageArrays.length; ++var8) {
|
||||
for (var8 = 0; var8 < this.storageArrays.length; ++var8) {
|
||||
if ((var2 & 1 << var8) != 0 && this.storageArrays[var8] != null) {
|
||||
var9 = this.storageArrays[var8].getMetadataArray();
|
||||
System.arraycopy(var1, var16, var9.data, 0, var9.data.length);
|
||||
@@ -82,7 +88,7 @@ public abstract class ChunkMixin {
|
||||
}
|
||||
}
|
||||
|
||||
for(var8 = 0; var8 < this.storageArrays.length; ++var8) {
|
||||
for (var8 = 0; var8 < this.storageArrays.length; ++var8) {
|
||||
if ((var2 & 1 << var8) != 0 && this.storageArrays[var8] != null) {
|
||||
var9 = this.storageArrays[var8].getBlocklightArray();
|
||||
System.arraycopy(var1, var16, var9.data, 0, var9.data.length);
|
||||
@@ -91,7 +97,7 @@ public abstract class ChunkMixin {
|
||||
}
|
||||
|
||||
if (var7) {
|
||||
for(var8 = 0; var8 < this.storageArrays.length; ++var8) {
|
||||
for (var8 = 0; var8 < this.storageArrays.length; ++var8) {
|
||||
if ((var2 & 1 << var8) != 0 && this.storageArrays[var8] != null) {
|
||||
var9 = this.storageArrays[var8].getSkylightArray();
|
||||
System.arraycopy(var1, var16, var9.data, 0, var9.data.length);
|
||||
@@ -101,10 +107,10 @@ public abstract class ChunkMixin {
|
||||
}
|
||||
|
||||
if (var4) {
|
||||
var16 += Hooks.readBiomeArrayFromPacket((Chunk)(Object)this, var1, var16);
|
||||
var16 += Hooks.readBiomeArrayFromPacket((Chunk) (Object) this, var1, var16);
|
||||
}
|
||||
|
||||
for(var8 = 0; var8 < this.storageArrays.length; ++var8) {
|
||||
for (var8 = 0; var8 < this.storageArrays.length; ++var8) {
|
||||
if (this.storageArrays[var8] != null && (var2 & 1 << var8) != 0) {
|
||||
this.storageArrays[var8].removeInvalidBlocks();
|
||||
}
|
||||
@@ -116,21 +122,24 @@ public abstract class ChunkMixin {
|
||||
ArrayList var10 = new ArrayList();
|
||||
|
||||
TileEntity var11;
|
||||
for(var5 = this.chunkTileEntityMap.values().iterator(); var5.hasNext(); var11.updateContainingBlockInfo()) {
|
||||
var11 = (TileEntity)var5.next();
|
||||
for (var5 = this.chunkTileEntityMap.values().iterator(); var5.hasNext(); var11.updateContainingBlockInfo()) {
|
||||
var11 = (TileEntity) var5.next();
|
||||
int var12 = var11.xCoord & 15;
|
||||
int var13 = var11.yCoord;
|
||||
int var14 = var11.zCoord & 15;
|
||||
Block var15 = var11.getBlockType();
|
||||
if ((var15 != this.getBlock(var12, var13, var14) || var11.blockMetadata != this.getBlockMetadata(var12, var13, var14)) && var11.shouldRefresh(var15, this.getBlock(var12, var13, var14), var11.blockMetadata, this.getBlockMetadata(var12, var13, var14), this.worldObj, var12, var13, var14)) {
|
||||
if ((var15 != this.getBlock(var12, var13, var14) ||
|
||||
var11.blockMetadata != this.getBlockMetadata(var12, var13, var14)) &&
|
||||
var11.shouldRefresh(var15, this.getBlock(var12, var13, var14), var11.blockMetadata,
|
||||
this.getBlockMetadata(var12, var13, var14), this.worldObj, var12, var13, var14)) {
|
||||
var10.add(var11);
|
||||
}
|
||||
}
|
||||
|
||||
Iterator var17 = var10.iterator();
|
||||
|
||||
while(var17.hasNext()) {
|
||||
TileEntity var18 = (TileEntity)var17.next();
|
||||
while (var17.hasNext()) {
|
||||
TileEntity var18 = (TileEntity) var17.next();
|
||||
var18.invalidate();
|
||||
}
|
||||
|
||||
|
||||
+11
-8
@@ -1,14 +1,15 @@
|
||||
package com.falsepattern.endlessids.mixin.mixins.client.vanilla;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.multiplayer.WorldClient;
|
||||
import net.minecraft.client.network.NetHandlerPlayClient;
|
||||
import net.minecraft.network.play.server.S22PacketMultiBlockChange;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.DataInputStream;
|
||||
@@ -18,7 +19,8 @@ import java.io.IOException;
|
||||
@Mixin(NetHandlerPlayClient.class)
|
||||
public abstract class NetHandlerPlayClientMixin {
|
||||
|
||||
@Shadow private WorldClient clientWorldController;
|
||||
@Shadow
|
||||
private WorldClient clientWorldController;
|
||||
|
||||
|
||||
/**
|
||||
@@ -32,7 +34,7 @@ public abstract class NetHandlerPlayClientMixin {
|
||||
if (packetIn.func_148921_d() != null) {
|
||||
DataInputStream dataInput = new DataInputStream(new ByteArrayInputStream(packetIn.func_148921_d()));
|
||||
|
||||
for(int var5 = 0; var5 < packetIn.func_148922_e(); ++var5) {
|
||||
for (int var5 = 0; var5 < packetIn.func_148922_e(); ++var5) {
|
||||
short var6 = dataInput.readShort();
|
||||
short idLSB = dataInput.readShort();
|
||||
byte idMSB = dataInput.readByte();
|
||||
@@ -41,7 +43,8 @@ public abstract class NetHandlerPlayClientMixin {
|
||||
int var10 = var6 >> 12 & 15;
|
||||
int var11 = var6 >> 8 & 15;
|
||||
int var12 = var6 & 255;
|
||||
this.clientWorldController.func_147492_c(var10 + var2, var12, var11 + var3, Block.getBlockById(id), var9);
|
||||
this.clientWorldController.func_147492_c(var10 + var2, var12, var11 + var3, Block.getBlockById(id),
|
||||
var9);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-2
@@ -2,15 +2,17 @@ package com.falsepattern.endlessids.mixin.mixins.client.vanilla;
|
||||
|
||||
import com.falsepattern.endlessids.constants.ExtendedConstants;
|
||||
import com.falsepattern.endlessids.constants.VanillaConstants;
|
||||
import net.minecraft.client.multiplayer.PlayerControllerMP;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.Constant;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
|
||||
import net.minecraft.client.multiplayer.PlayerControllerMP;
|
||||
|
||||
@Mixin(PlayerControllerMP.class)
|
||||
public abstract class PlayerControllerMPMixin {
|
||||
@ModifyConstant(method = "onPlayerDestroyBlock",
|
||||
constant = @Constant(intValue = VanillaConstants.bitsPerID, ordinal = 0),
|
||||
constant = @Constant(intValue = VanillaConstants.bitsPerID,
|
||||
ordinal = 0),
|
||||
require = 1)
|
||||
private int extend1(int constant) {
|
||||
return ExtendedConstants.bitsPerID;
|
||||
|
||||
+4
-3
@@ -2,13 +2,14 @@ package com.falsepattern.endlessids.mixin.mixins.client.vanilla;
|
||||
|
||||
import com.falsepattern.endlessids.constants.ExtendedConstants;
|
||||
import com.falsepattern.endlessids.constants.VanillaConstants;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.RenderGlobal;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.Constant;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
|
||||
import net.minecraft.client.renderer.RenderGlobal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Mixin(RenderGlobal.class)
|
||||
public abstract class RenderGlobalMixin {
|
||||
|
||||
+3
-1
@@ -14,7 +14,9 @@ import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
@Mixin(BiomeGenBase.class)
|
||||
public abstract class BiomeGenBaseMixin {
|
||||
@Shadow @Final private static BiomeGenBase[] biomeList;
|
||||
@Shadow
|
||||
@Final
|
||||
private static BiomeGenBase[] biomeList;
|
||||
|
||||
@CallerSensitive
|
||||
@Redirect(method = "getBiomeGenArray",
|
||||
|
||||
+3
-3
@@ -2,10 +2,8 @@ package com.falsepattern.endlessids.mixin.mixins.common.antiidconflict;
|
||||
|
||||
import code.elix_x.coremods.antiidconflict.core.AsmHooks;
|
||||
import com.falsepattern.endlessids.PlaceholderBiome;
|
||||
import org.spongepowered.asm.lib.Opcodes;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Mutable;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
@@ -14,7 +12,9 @@ import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
@Mixin(BiomeGenBase.class)
|
||||
public abstract class BiomeGenBasePlaceholderMixin {
|
||||
@Shadow @Final private static BiomeGenBase[] biomeList;
|
||||
@Shadow
|
||||
@Final
|
||||
private static BiomeGenBase[] biomeList;
|
||||
|
||||
@SuppressWarnings({"InvalidInjectorMethodSignature", "UnresolvedMixinReference", "MixinAnnotationTarget"})
|
||||
@Redirect(method = "<init>(IZ)V",
|
||||
|
||||
+3
-2
@@ -17,7 +17,8 @@ import net.minecraft.world.chunk.Chunk;
|
||||
@Mixin(value = ATGChunkProvider.class,
|
||||
remap = false)
|
||||
public abstract class ATGChunkProviderMixin {
|
||||
@Shadow private BiomeGenBase[] biomesForGeneration;
|
||||
@Shadow
|
||||
private BiomeGenBase[] biomesForGeneration;
|
||||
|
||||
@Inject(method = "provideChunk",
|
||||
at = @At(value = "INVOKE",
|
||||
@@ -27,7 +28,7 @@ public abstract class ATGChunkProviderMixin {
|
||||
locals = LocalCapture.CAPTURE_FAILHARD,
|
||||
require = 1)
|
||||
private void hijackChunkBiomeSetup(int chunkX, int chunkY, CallbackInfoReturnable<Chunk> cir, Block[] data, byte[] abyte, Chunk chunk) {
|
||||
val chunkBiomes = ((IChunkMixin)chunk).getBiomeShortArray();
|
||||
val chunkBiomes = ((IChunkMixin) chunk).getBiomeShortArray();
|
||||
for (int i = 0; i < chunkBiomes.length; i++) {
|
||||
chunkBiomes[i] = (short) biomesForGeneration[i].biomeID;
|
||||
}
|
||||
|
||||
+4
-2
@@ -7,10 +7,12 @@ import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.Constant;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
|
||||
@Mixin(value = BlockHelper.class, remap = false)
|
||||
@Mixin(value = BlockHelper.class,
|
||||
remap = false)
|
||||
public abstract class BlockHelperMixin {
|
||||
@ModifyConstant(method = "<clinit>",
|
||||
constant = {@Constant(intValue = VanillaConstants.blockIDCount), @Constant(intValue = VanillaConstants.blockIDCount / 4)},
|
||||
constant = {@Constant(intValue = VanillaConstants.blockIDCount),
|
||||
@Constant(intValue = VanillaConstants.blockIDCount / 4)},
|
||||
require = 1)
|
||||
private static int extend(int constant) {
|
||||
return ExtendedConstants.blockIDCount;
|
||||
|
||||
+2
-1
@@ -7,7 +7,8 @@ import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.Constant;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
|
||||
@Mixin(value = BlockProperties.class, remap = false)
|
||||
@Mixin(value = BlockProperties.class,
|
||||
remap = false)
|
||||
public abstract class BlockPropertiesMixin {
|
||||
@ModifyConstant(method = "<clinit>",
|
||||
constant = @Constant(intValue = VanillaConstants.blockIDCount),
|
||||
|
||||
+2
-1
@@ -14,7 +14,8 @@ public abstract class ConfigManagerCoreMixin {
|
||||
constant = @Constant(stringValue = "Biome ID for Moon (Mars will be this + 1, Asteroids + 2 etc). Allowed range 40-250."),
|
||||
require = 1)
|
||||
private static String modifyHint(String constant) {
|
||||
return "Biome ID for Moon (Mars will be this + 1, Asteroids + 2 etc). Allowed range 40-" + (ExtendedConstants.biomeIDCount - 6);
|
||||
return "Biome ID for Moon (Mars will be this + 1, Asteroids + 2 etc). Allowed range 40-" +
|
||||
(ExtendedConstants.biomeIDCount - 6);
|
||||
}
|
||||
|
||||
@ModifyConstant(method = "syncConfig",
|
||||
|
||||
+7
-6
@@ -7,14 +7,15 @@ import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.Constant;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
|
||||
@Mixin(value = MFQM.class, remap = false)
|
||||
@Mixin(value = MFQM.class,
|
||||
remap = false)
|
||||
public abstract class MFQMDataWatcherMixin {
|
||||
@ModifyConstant(method = "preInit",
|
||||
constant = {
|
||||
@Constant(intValue = VanillaConstants.maxWatchableID, ordinal = 0),
|
||||
@Constant(intValue = VanillaConstants.maxWatchableID, ordinal = 1),
|
||||
@Constant(intValue = VanillaConstants.maxWatchableID, ordinal = 2)
|
||||
},
|
||||
constant = {@Constant(intValue = VanillaConstants.maxWatchableID,
|
||||
ordinal = 0), @Constant(intValue = VanillaConstants.maxWatchableID,
|
||||
ordinal = 1),
|
||||
@Constant(intValue = VanillaConstants.maxWatchableID,
|
||||
ordinal = 2)},
|
||||
require = 3)
|
||||
private int extendWatchableIDLimit(int constant) {
|
||||
return ExtendedConstants.maxWatchableID;
|
||||
|
||||
@@ -7,13 +7,11 @@ import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.Constant;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
|
||||
@Mixin(value = MFQM.class, remap = false)
|
||||
@Mixin(value = MFQM.class,
|
||||
remap = false)
|
||||
public abstract class MFQMMixin {
|
||||
@ModifyConstant(method = "preInit",
|
||||
constant = {
|
||||
@Constant(intValue = VanillaConstants.maxBlockID),
|
||||
@Constant(intValue = 31999)
|
||||
},
|
||||
constant = {@Constant(intValue = VanillaConstants.maxBlockID), @Constant(intValue = 31999)},
|
||||
require = 2)
|
||||
private int extendWatchableIDLimit(int constant) {
|
||||
return ExtendedConstants.maxBlockID;
|
||||
@@ -23,6 +21,7 @@ public abstract class MFQMMixin {
|
||||
constant = @Constant(stringValue = "Must be different in range between 20 and 31"),
|
||||
require = 1)
|
||||
private String changeConfigText(String constant) {
|
||||
return constant + " (Notice from EndlessIDs: If you enable the ExtendDataWatcher config option in the endlessids config file, the maximum value will be 127 instead, same for the other datawatcher ids in this file)";
|
||||
return constant +
|
||||
" (Notice from EndlessIDs: If you enable the ExtendDataWatcher config option in the endlessids config file, the maximum value will be 127 instead, same for the other datawatcher ids in this file)";
|
||||
}
|
||||
}
|
||||
+16
-8
@@ -3,29 +3,35 @@ package com.falsepattern.endlessids.mixin.mixins.common.ubc;
|
||||
import com.falsepattern.endlessids.mixin.helpers.IExtendedBlockStorageMixin;
|
||||
import exterminatorJeff.undergroundBiomes.worldGen.BiomeUndergroundDecorator;
|
||||
import exterminatorJeff.undergroundBiomes.worldGen.OreUBifier;
|
||||
import net.minecraft.world.chunk.NibbleArray;
|
||||
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(value = BiomeUndergroundDecorator.class, remap = false)
|
||||
import net.minecraft.world.chunk.NibbleArray;
|
||||
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
|
||||
|
||||
@Mixin(value = BiomeUndergroundDecorator.class,
|
||||
remap = false)
|
||||
public abstract class BiomeUndergroundDecoratorMixin {
|
||||
private static NibbleArray fakeArray;
|
||||
private ThreadLocal<IExtendedBlockStorageMixin> ebs;
|
||||
|
||||
@Redirect(method = {"replaceChunkOres(IILnet/minecraft/world/World;)V", "replaceChunkOres(Lnet/minecraft/world/chunk/IChunkProvider;II)V"},
|
||||
@Redirect(method = {"replaceChunkOres(IILnet/minecraft/world/World;)V",
|
||||
"replaceChunkOres(Lnet/minecraft/world/chunk/IChunkProvider;II)V"},
|
||||
at = @At(value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/chunk/storage/ExtendedBlockStorage;getBlockLSBArray()[B"),
|
||||
require = 2)
|
||||
private byte[] returnMSBasLSB(ExtendedBlockStorage instance) {
|
||||
if (ebs == null) ebs = new ThreadLocal<>();
|
||||
if (ebs == null) {
|
||||
ebs = new ThreadLocal<>();
|
||||
}
|
||||
IExtendedBlockStorageMixin iebs = (IExtendedBlockStorageMixin) instance;
|
||||
ebs.set(iebs);
|
||||
return iebs.getMSB();
|
||||
}
|
||||
|
||||
@Redirect(method = {"replaceChunkOres(IILnet/minecraft/world/World;)V", "replaceChunkOres(Lnet/minecraft/world/chunk/IChunkProvider;II)V"},
|
||||
@Redirect(method = {"replaceChunkOres(IILnet/minecraft/world/World;)V",
|
||||
"replaceChunkOres(Lnet/minecraft/world/chunk/IChunkProvider;II)V"},
|
||||
at = @At(value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/chunk/storage/ExtendedBlockStorage;getBlockMSBArray()Lnet/minecraft/world/chunk/NibbleArray;"),
|
||||
require = 4)
|
||||
@@ -33,7 +39,8 @@ public abstract class BiomeUndergroundDecoratorMixin {
|
||||
return fakeArray == null ? (fakeArray = new NibbleArray(4096, 4)) : fakeArray;
|
||||
}
|
||||
|
||||
@Redirect(method = {"replaceChunkOres(IILnet/minecraft/world/World;)V", "replaceChunkOres(Lnet/minecraft/world/chunk/IChunkProvider;II)V"},
|
||||
@Redirect(method = {"replaceChunkOres(IILnet/minecraft/world/World;)V",
|
||||
"replaceChunkOres(Lnet/minecraft/world/chunk/IChunkProvider;II)V"},
|
||||
at = @At(value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/chunk/NibbleArray;get(III)I"),
|
||||
require = 2)
|
||||
@@ -41,7 +48,8 @@ public abstract class BiomeUndergroundDecoratorMixin {
|
||||
return ebs.get().getLSB()[y << 8 | z << 4 | x] & 0xFFFF;
|
||||
}
|
||||
|
||||
@Redirect(method = {"replaceChunkOres(IILnet/minecraft/world/World;)V", "replaceChunkOres(Lnet/minecraft/world/chunk/IChunkProvider;II)V"},
|
||||
@Redirect(method = {"replaceChunkOres(IILnet/minecraft/world/World;)V",
|
||||
"replaceChunkOres(Lnet/minecraft/world/chunk/IChunkProvider;II)V"},
|
||||
at = @At(value = "INVOKE",
|
||||
target = "LexterminatorJeff/undergroundBiomes/worldGen/OreUBifier;blockReplacer(I)LexterminatorJeff/undergroundBiomes/worldGen/OreUBifier$BlockReplacer;"),
|
||||
require = 2)
|
||||
|
||||
+2
-1
@@ -7,7 +7,8 @@ import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.Constant;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
|
||||
@Mixin(value = OreUBifier.class, remap = false)
|
||||
@Mixin(value = OreUBifier.class,
|
||||
remap = false)
|
||||
public abstract class OreUBifierMixin {
|
||||
@ModifyConstant(method = "renewBlockReplacers",
|
||||
constant = @Constant(intValue = VanillaConstants.blockIDCount),
|
||||
|
||||
+11
-5
@@ -3,8 +3,6 @@ package com.falsepattern.endlessids.mixin.mixins.common.vanilla.biome;
|
||||
import com.falsepattern.endlessids.PlaceholderBiome;
|
||||
import com.falsepattern.endlessids.constants.ExtendedConstants;
|
||||
import com.falsepattern.endlessids.constants.VanillaConstants;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
@@ -14,11 +12,17 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
@Mixin(BiomeGenBase.class)
|
||||
public abstract class BiomeGenBaseMixin {
|
||||
@Shadow @Final private static BiomeGenBase[] biomeList;
|
||||
@Shadow
|
||||
@Final
|
||||
private static BiomeGenBase[] biomeList;
|
||||
|
||||
@Shadow @Final public int biomeID;
|
||||
@Shadow
|
||||
@Final
|
||||
public int biomeID;
|
||||
|
||||
@ModifyConstant(method = "<clinit>",
|
||||
constant = @Constant(intValue = VanillaConstants.biomeIDCount),
|
||||
@@ -31,7 +35,9 @@ public abstract class BiomeGenBaseMixin {
|
||||
at = @At(value = "RETURN"),
|
||||
require = 1)
|
||||
private void generatePlaceholders(int p_i1971_1_, boolean register, CallbackInfo ci) {
|
||||
if (((Object)this) instanceof PlaceholderBiome) return;
|
||||
if (((Object) this) instanceof PlaceholderBiome) {
|
||||
return;
|
||||
}
|
||||
if (biomeID >= 128 && biomeList[biomeID - 128] == null) {
|
||||
new PlaceholderBiome(biomeID - 128, (BiomeGenBase) (Object) this);
|
||||
}
|
||||
|
||||
+6
-2
@@ -13,10 +13,14 @@ import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
@Mixin(BiomeGenBase.class)
|
||||
public abstract class BiomeGenBasePlaceholderMixin {
|
||||
@Shadow @Final private static BiomeGenBase[] biomeList;
|
||||
@Shadow
|
||||
@Final
|
||||
private static BiomeGenBase[] biomeList;
|
||||
|
||||
@Mutable
|
||||
@Shadow @Final public int biomeID;
|
||||
@Shadow
|
||||
@Final
|
||||
public int biomeID;
|
||||
|
||||
@Redirect(method = "<init>(IZ)V",
|
||||
at = @At(value = "FIELD",
|
||||
|
||||
+2
-1
@@ -2,11 +2,12 @@ package com.falsepattern.endlessids.mixin.mixins.common.vanilla.misc;
|
||||
|
||||
import com.falsepattern.endlessids.constants.ExtendedConstants;
|
||||
import com.falsepattern.endlessids.constants.VanillaConstants;
|
||||
import net.minecraft.block.BlockFire;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.Constant;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
|
||||
import net.minecraft.block.BlockFire;
|
||||
|
||||
@Mixin(BlockFire.class)
|
||||
public abstract class BlockFireMixin {
|
||||
@ModifyConstant(method = {"<init>", "rebuildFireInfo", "getFlammability", "getEncouragement"},
|
||||
|
||||
+14
-9
@@ -3,9 +3,6 @@ package com.falsepattern.endlessids.mixin.mixins.common.vanilla.misc;
|
||||
import com.falsepattern.endlessids.constants.ExtendedConstants;
|
||||
import com.falsepattern.endlessids.constants.VanillaConstants;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.entity.DataWatcher;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
@@ -13,13 +10,18 @@ import org.spongepowered.asm.mixin.injection.Constant;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
import net.minecraft.entity.DataWatcher;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Mixin(DataWatcher.class)
|
||||
public abstract class DataWatcherMixin {
|
||||
@ModifyConstant(method = {"addObject", "writeWatchedListToPacketBuffer", "func_151509_a", "writeWatchableObjectToPacketBuffer"},
|
||||
@ModifyConstant(method = {"addObject", "writeWatchedListToPacketBuffer", "func_151509_a",
|
||||
"writeWatchableObjectToPacketBuffer"},
|
||||
constant = @Constant(intValue = VanillaConstants.maxWatchableID),
|
||||
require = 4)
|
||||
private static int extend1(int constant) {
|
||||
@@ -27,14 +29,16 @@ public abstract class DataWatcherMixin {
|
||||
}
|
||||
|
||||
@ModifyConstant(method = "writeWatchableObjectToPacketBuffer",
|
||||
constant = @Constant(intValue = VanillaConstants.watchableBits, ordinal = 0),
|
||||
constant = @Constant(intValue = VanillaConstants.watchableBits,
|
||||
ordinal = 0),
|
||||
require = 1)
|
||||
private static int extend2(int constant) {
|
||||
return ExtendedConstants.watchableBits;
|
||||
}
|
||||
|
||||
@ModifyConstant(method = "writeWatchableObjectToPacketBuffer",
|
||||
constant = @Constant(intValue = VanillaConstants.watchableMask, ordinal = 0),
|
||||
constant = @Constant(intValue = VanillaConstants.watchableMask,
|
||||
ordinal = 0),
|
||||
require = 1)
|
||||
private static int extend3(int constant) {
|
||||
return ExtendedConstants.watchableMask;
|
||||
@@ -53,10 +57,11 @@ public abstract class DataWatcherMixin {
|
||||
* @reason Direct port from dumped code
|
||||
*/
|
||||
@Overwrite
|
||||
public static List<DataWatcher.WatchableObject> readWatchedListFromPacketBuffer(PacketBuffer packet) throws IOException {
|
||||
public static List<DataWatcher.WatchableObject> readWatchedListFromPacketBuffer(PacketBuffer packet)
|
||||
throws IOException {
|
||||
ArrayList<DataWatcher.WatchableObject> watchables = null;
|
||||
|
||||
for(short id = packet.readShort(); id != 32767; id = packet.readShort()) {
|
||||
for (short id = packet.readShort(); id != 32767; id = packet.readShort()) {
|
||||
if (watchables == null) {
|
||||
watchables = new ArrayList<>();
|
||||
}
|
||||
@@ -64,7 +69,7 @@ public abstract class DataWatcherMixin {
|
||||
int flag = (id >> ExtendedConstants.watchableBits) & 0x7;
|
||||
int watchableID = id & ExtendedConstants.maxWatchableID;
|
||||
DataWatcher.WatchableObject watchable = null;
|
||||
switch(flag) {
|
||||
switch (flag) {
|
||||
case 0:
|
||||
watchable = new DataWatcher.WatchableObject(flag, watchableID, packet.readByte());
|
||||
break;
|
||||
|
||||
+4
-2
@@ -2,15 +2,17 @@ package com.falsepattern.endlessids.mixin.mixins.common.vanilla.misc;
|
||||
|
||||
import com.falsepattern.endlessids.constants.ExtendedConstants;
|
||||
import com.falsepattern.endlessids.constants.VanillaConstants;
|
||||
import net.minecraft.server.management.ItemInWorldManager;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.Constant;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
|
||||
import net.minecraft.server.management.ItemInWorldManager;
|
||||
|
||||
@Mixin(ItemInWorldManager.class)
|
||||
public abstract class ItemInWorldManagerMixin {
|
||||
@ModifyConstant(method = "tryHarvestBlock",
|
||||
constant = @Constant(intValue = VanillaConstants.bitsPerID, ordinal = 0),
|
||||
constant = @Constant(intValue = VanillaConstants.bitsPerID,
|
||||
ordinal = 0),
|
||||
require = 1)
|
||||
private int extend1(int constant) {
|
||||
return ExtendedConstants.bitsPerID;
|
||||
|
||||
+2
-1
@@ -2,11 +2,12 @@ package com.falsepattern.endlessids.mixin.mixins.common.vanilla.misc;
|
||||
|
||||
import com.falsepattern.endlessids.constants.ExtendedConstants;
|
||||
import com.falsepattern.endlessids.constants.VanillaConstants;
|
||||
import net.minecraft.stats.StatList;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.Constant;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
|
||||
import net.minecraft.stats.StatList;
|
||||
|
||||
@Mixin(StatList.class)
|
||||
public abstract class StatListMixin {
|
||||
@ModifyConstant(method = "<clinit>",
|
||||
|
||||
+2
-1
@@ -2,11 +2,12 @@ package com.falsepattern.endlessids.mixin.mixins.common.vanilla.misc;
|
||||
|
||||
import com.falsepattern.endlessids.constants.ExtendedConstants;
|
||||
import com.falsepattern.endlessids.constants.VanillaConstants;
|
||||
import net.minecraft.world.World;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.Constant;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@Mixin(World.class)
|
||||
public abstract class WorldMixin {
|
||||
@ModifyConstant(method = "func_147480_a",
|
||||
|
||||
+26
-24
@@ -1,55 +1,59 @@
|
||||
package com.falsepattern.endlessids.mixin.mixins.common.vanilla.networking;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@Mixin(PacketBuffer.class)
|
||||
public abstract class PacketBufferMixin {
|
||||
|
||||
@Shadow public abstract int readInt();
|
||||
@Shadow
|
||||
public abstract int readInt();
|
||||
|
||||
@Shadow public abstract short readShort();
|
||||
@Shadow
|
||||
public abstract short readShort();
|
||||
|
||||
@Shadow public abstract byte readByte();
|
||||
@Shadow
|
||||
public abstract byte readByte();
|
||||
|
||||
@Shadow public abstract NBTTagCompound readNBTTagCompoundFromBuffer() throws IOException;
|
||||
@Shadow
|
||||
public abstract NBTTagCompound readNBTTagCompoundFromBuffer() throws IOException;
|
||||
|
||||
@Shadow public abstract ByteBuf writeInt(int p_writeInt_1_);
|
||||
@Shadow
|
||||
public abstract ByteBuf writeInt(int p_writeInt_1_);
|
||||
|
||||
@Shadow public abstract ByteBuf writeByte(int p_writeByte_1_);
|
||||
@Shadow
|
||||
public abstract ByteBuf writeByte(int p_writeByte_1_);
|
||||
|
||||
@Shadow public abstract ByteBuf writeShort(int p_writeShort_1_);
|
||||
@Shadow
|
||||
public abstract ByteBuf writeShort(int p_writeShort_1_);
|
||||
|
||||
@Shadow public abstract void writeNBTTagCompoundToBuffer(NBTTagCompound p_150786_1_) throws IOException;
|
||||
@Shadow
|
||||
public abstract void writeNBTTagCompoundToBuffer(NBTTagCompound p_150786_1_) throws IOException;
|
||||
|
||||
/**
|
||||
* @author FalsePattern
|
||||
* @reason ID extension
|
||||
*/
|
||||
@Overwrite
|
||||
public void writeItemStackToBuffer(ItemStack p_150788_1_) throws IOException
|
||||
{
|
||||
if (p_150788_1_ == null)
|
||||
{
|
||||
public void writeItemStackToBuffer(ItemStack p_150788_1_) throws IOException {
|
||||
if (p_150788_1_ == null) {
|
||||
this.writeInt(-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.writeInt(Item.getIdFromItem(p_150788_1_.getItem()));
|
||||
this.writeByte(p_150788_1_.stackSize);
|
||||
this.writeShort(p_150788_1_.getItemDamage());
|
||||
NBTTagCompound nbttagcompound = null;
|
||||
|
||||
if (p_150788_1_.getItem().isDamageable() || p_150788_1_.getItem().getShareTag())
|
||||
{
|
||||
if (p_150788_1_.getItem().isDamageable() || p_150788_1_.getItem().getShareTag()) {
|
||||
nbttagcompound = p_150788_1_.stackTagCompound;
|
||||
}
|
||||
|
||||
@@ -62,13 +66,11 @@ public abstract class PacketBufferMixin {
|
||||
* @reason ID extension
|
||||
*/
|
||||
@Overwrite
|
||||
public ItemStack readItemStackFromBuffer() throws IOException
|
||||
{
|
||||
public ItemStack readItemStackFromBuffer() throws IOException {
|
||||
ItemStack itemstack = null;
|
||||
int id = this.readInt();
|
||||
|
||||
if (id >= 0)
|
||||
{
|
||||
if (id >= 0) {
|
||||
byte b0 = this.readByte();
|
||||
short damage = this.readShort();
|
||||
itemstack = new ItemStack(Item.getItemById(id), b0, damage);
|
||||
|
||||
+12
-11
@@ -5,15 +5,16 @@ import com.falsepattern.endlessids.constants.ExtendedConstants;
|
||||
import com.falsepattern.endlessids.constants.VanillaConstants;
|
||||
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
|
||||
import com.falsepattern.endlessids.mixin.helpers.IExtendedBlockStorageMixin;
|
||||
import net.minecraft.network.play.server.S21PacketChunkData;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Constant;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
import net.minecraft.network.play.server.S21PacketChunkData;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
|
||||
|
||||
@Mixin(S21PacketChunkData.class)
|
||||
public abstract class S21PacketChunkDataMixin {
|
||||
|
||||
@@ -24,13 +25,6 @@ public abstract class S21PacketChunkDataMixin {
|
||||
return ExtendedConstants.bytesPerChunk;
|
||||
}
|
||||
|
||||
@ModifyConstant(method = "readPacketData",
|
||||
constant = @Constant(intValue = VanillaConstants.bytesPerEBS),
|
||||
require = 1)
|
||||
private int increaseReadSize(int constant) {
|
||||
return ExtendedConstants.bytesPerEBS;
|
||||
}
|
||||
|
||||
@Redirect(method = "func_149269_a",
|
||||
at = @At(value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/chunk/storage/ExtendedBlockStorage;getBlockLSBArray()[B"),
|
||||
@@ -44,6 +38,13 @@ public abstract class S21PacketChunkDataMixin {
|
||||
target = "Lnet/minecraft/world/chunk/Chunk;getBiomeArray()[B"),
|
||||
require = 1)
|
||||
private static byte[] getBiomesArrayShort(Chunk instance) {
|
||||
return Hooks.shortToByteArray(((IChunkMixin)instance).getBiomeShortArray());
|
||||
return Hooks.shortToByteArray(((IChunkMixin) instance).getBiomeShortArray());
|
||||
}
|
||||
|
||||
@ModifyConstant(method = "readPacketData",
|
||||
constant = @Constant(intValue = VanillaConstants.bytesPerEBS),
|
||||
require = 1)
|
||||
private int increaseReadSize(int constant) {
|
||||
return ExtendedConstants.bytesPerEBS;
|
||||
}
|
||||
}
|
||||
+9
-6
@@ -1,29 +1,32 @@
|
||||
package com.falsepattern.endlessids.mixin.mixins.common.vanilla.networking;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.network.play.server.S22PacketMultiBlockChange;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Constant;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.network.play.server.S22PacketMultiBlockChange;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
@Mixin(S22PacketMultiBlockChange.class)
|
||||
public abstract class S22PacketMultiBlockChangeMixin {
|
||||
private int id;
|
||||
private int meta;
|
||||
|
||||
//TODO magic number
|
||||
@ModifyConstant(method = "<init>(I[SLnet/minecraft/world/chunk/Chunk;)V",
|
||||
constant = @Constant(intValue = 4, ordinal = 0),
|
||||
constant = @Constant(intValue = 4,
|
||||
ordinal = 0),
|
||||
require = 1)
|
||||
private int extend1(int constant) {
|
||||
return 6;
|
||||
}
|
||||
|
||||
private int id;
|
||||
private int meta;
|
||||
@Redirect(method = "<init>(I[SLnet/minecraft/world/chunk/Chunk;)V",
|
||||
at = @At(value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/chunk/Chunk;getBlock(III)Lnet/minecraft/block/Block;"),
|
||||
|
||||
+2
-1
@@ -2,11 +2,12 @@ package com.falsepattern.endlessids.mixin.mixins.common.vanilla.networking;
|
||||
|
||||
import com.falsepattern.endlessids.constants.ExtendedConstants;
|
||||
import com.falsepattern.endlessids.constants.VanillaConstants;
|
||||
import net.minecraft.network.play.server.S24PacketBlockAction;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.Constant;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
|
||||
import net.minecraft.network.play.server.S24PacketBlockAction;
|
||||
|
||||
@Mixin(S24PacketBlockAction.class)
|
||||
public abstract class S24PacketBlockActionMixin {
|
||||
@ModifyConstant(method = {"readPacketData", "writePacketData"},
|
||||
|
||||
+2
-1
@@ -2,11 +2,12 @@ package com.falsepattern.endlessids.mixin.mixins.common.vanilla.networking;
|
||||
|
||||
import com.falsepattern.endlessids.constants.ExtendedConstants;
|
||||
import com.falsepattern.endlessids.constants.VanillaConstants;
|
||||
import net.minecraft.network.play.server.S26PacketMapChunkBulk;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.Constant;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
|
||||
import net.minecraft.network.play.server.S26PacketMapChunkBulk;
|
||||
|
||||
@Mixin(S26PacketMapChunkBulk.class)
|
||||
public abstract class S26PacketMapChunkBulkMixin {
|
||||
@ModifyConstant(method = "readPacketData",
|
||||
|
||||
+15
-14
@@ -2,6 +2,9 @@ package com.falsepattern.endlessids.mixin.mixins.common.vanilla.storage;
|
||||
|
||||
import com.falsepattern.endlessids.Hooks;
|
||||
import com.falsepattern.endlessids.mixin.helpers.IExtendedBlockStorageMixin;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -13,8 +16,6 @@ import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.chunk.NibbleArray;
|
||||
import net.minecraft.world.chunk.storage.AnvilChunkLoader;
|
||||
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@@ -28,7 +29,7 @@ public abstract class AnvilChunkLoaderMixin {
|
||||
*/
|
||||
@Overwrite
|
||||
private void writeChunkToNBT(Chunk p_75820_1_, World p_75820_2_, NBTTagCompound p_75820_3_) {
|
||||
p_75820_3_.setByte("V", (byte)1);
|
||||
p_75820_3_.setByte("V", (byte) 1);
|
||||
p_75820_3_.setInteger("xPos", p_75820_1_.xPosition);
|
||||
p_75820_3_.setInteger("zPos", p_75820_1_.zPosition);
|
||||
p_75820_3_.setLong("LastUpdate", p_75820_2_.getTotalWorldTime());
|
||||
@@ -43,11 +44,11 @@ public abstract class AnvilChunkLoaderMixin {
|
||||
int var8 = var4.length;
|
||||
|
||||
NBTTagCompound var11;
|
||||
for(int var9 = 0; var9 < var8; ++var9) {
|
||||
for (int var9 = 0; var9 < var8; ++var9) {
|
||||
ExtendedBlockStorage var10 = var7[var9];
|
||||
if (var10 != null) {
|
||||
var11 = new NBTTagCompound();
|
||||
var11.setByte("Y", (byte)(var10.getYLocation() >> 4 & 255));
|
||||
var11.setByte("Y", (byte) (var10.getYLocation() >> 4 & 255));
|
||||
Hooks.writeChunkToNbt(var11, (IExtendedBlockStorageMixin) var10);
|
||||
|
||||
var11.setByteArray("Data", var10.getMetadataArray().data);
|
||||
@@ -68,11 +69,11 @@ public abstract class AnvilChunkLoaderMixin {
|
||||
NBTTagList var21 = new NBTTagList();
|
||||
|
||||
Iterator var22;
|
||||
for(var8 = 0; var8 < p_75820_1_.entityLists.length; ++var8) {
|
||||
for (var8 = 0; var8 < p_75820_1_.entityLists.length; ++var8) {
|
||||
var22 = p_75820_1_.entityLists[var8].iterator();
|
||||
|
||||
while(var22.hasNext()) {
|
||||
Entity var12 = (Entity)var22.next();
|
||||
while (var22.hasNext()) {
|
||||
Entity var12 = (Entity) var22.next();
|
||||
var11 = new NBTTagCompound();
|
||||
if (var12.writeToNBTOptional(var11)) {
|
||||
p_75820_1_.hasEntities = true;
|
||||
@@ -85,8 +86,8 @@ public abstract class AnvilChunkLoaderMixin {
|
||||
NBTTagList var23 = new NBTTagList();
|
||||
var22 = p_75820_1_.chunkTileEntityMap.values().iterator();
|
||||
|
||||
while(var22.hasNext()) {
|
||||
TileEntity var13 = (TileEntity)var22.next();
|
||||
while (var22.hasNext()) {
|
||||
TileEntity var13 = (TileEntity) var22.next();
|
||||
var11 = new NBTTagCompound();
|
||||
var13.writeToNBT(var11);
|
||||
var23.appendTag(var11);
|
||||
@@ -99,14 +100,14 @@ public abstract class AnvilChunkLoaderMixin {
|
||||
NBTTagList var17 = new NBTTagList();
|
||||
Iterator var18 = var24.iterator();
|
||||
|
||||
while(var18.hasNext()) {
|
||||
NextTickListEntry var19 = (NextTickListEntry)var18.next();
|
||||
while (var18.hasNext()) {
|
||||
NextTickListEntry var19 = (NextTickListEntry) var18.next();
|
||||
NBTTagCompound var20 = new NBTTagCompound();
|
||||
var20.setInteger("i", Block.getIdFromBlock(var19.func_151351_a()));
|
||||
var20.setInteger("x", var19.xCoord);
|
||||
var20.setInteger("y", var19.yCoord);
|
||||
var20.setInteger("z", var19.zCoord);
|
||||
var20.setInteger("t", (int)(var19.scheduledTime - var15));
|
||||
var20.setInteger("t", (int) (var19.scheduledTime - var15));
|
||||
var20.setInteger("p", var19.priority);
|
||||
var17.appendTag(var20);
|
||||
}
|
||||
@@ -134,7 +135,7 @@ public abstract class AnvilChunkLoaderMixin {
|
||||
ExtendedBlockStorage[] var8 = new ExtendedBlockStorage[var7];
|
||||
boolean var9 = !p_75823_1_.provider.hasNoSky;
|
||||
|
||||
for(int var10 = 0; var10 < var6.tagCount(); ++var10) {
|
||||
for (int var10 = 0; var10 < var6.tagCount(); ++var10) {
|
||||
NBTTagCompound var11 = var6.getCompoundTagAt(var10);
|
||||
byte var12 = var11.getByte("Y");
|
||||
ExtendedBlockStorage var13 = new ExtendedBlockStorage(var12 << 4, var9);
|
||||
|
||||
+14
-8
@@ -5,10 +5,6 @@ import com.falsepattern.endlessids.Tags;
|
||||
import com.falsepattern.endlessids.constants.ExtendedConstants;
|
||||
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
|
||||
import lombok.val;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.biome.WorldChunkManager;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
@@ -18,13 +14,23 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.biome.WorldChunkManager;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@Mixin(Chunk.class)
|
||||
public abstract class ChunkMixin implements IChunkMixin {
|
||||
@Shadow private byte[] blockBiomeArray;
|
||||
@Shadow @Final public int xPosition;
|
||||
@Shadow @Final public int zPosition;
|
||||
@Shadow
|
||||
@Final
|
||||
public int xPosition;
|
||||
@Shadow
|
||||
@Final
|
||||
public int zPosition;
|
||||
@Shadow
|
||||
private byte[] blockBiomeArray;
|
||||
private short[] blockBiomeShortArray;
|
||||
|
||||
@Inject(method = "<init>(Lnet/minecraft/world/World;II)V",
|
||||
@@ -33,7 +39,7 @@ public abstract class ChunkMixin implements IChunkMixin {
|
||||
private void initShortArray(World p_i1995_1_, int p_i1995_2_, int p_i1995_3_, CallbackInfo ci) {
|
||||
blockBiomeArray = null;
|
||||
blockBiomeShortArray = new short[16 * 16];
|
||||
Arrays.fill(blockBiomeShortArray, (short)-1);
|
||||
Arrays.fill(blockBiomeShortArray, (short) -1);
|
||||
}
|
||||
|
||||
private void emergencyCrash() {
|
||||
|
||||
+10
-7
@@ -2,9 +2,6 @@ package com.falsepattern.endlessids.mixin.mixins.common.vanilla.storage;
|
||||
|
||||
import com.falsepattern.endlessids.Hooks;
|
||||
import com.falsepattern.endlessids.mixin.helpers.IExtendedBlockStorageMixin;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
@@ -12,10 +9,16 @@ import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
|
||||
|
||||
@Mixin(ExtendedBlockStorage.class)
|
||||
public abstract class ExtendedBlockStorageMixin implements IExtendedBlockStorageMixin {
|
||||
@Shadow private int blockRefCount;
|
||||
@Shadow private int tickRefCount;
|
||||
@Shadow
|
||||
private int blockRefCount;
|
||||
@Shadow
|
||||
private int tickRefCount;
|
||||
private short[] lsbArray;
|
||||
private byte[] msbArray;
|
||||
|
||||
@@ -58,8 +61,8 @@ public abstract class ExtendedBlockStorageMixin implements IExtendedBlockStorage
|
||||
int index = y << 8 | z << 4 | x;
|
||||
int lsb = id & 0xFFFF;
|
||||
int msb = (id >>> 16) & 0xFF;
|
||||
lsbArray[index] = (short)lsb;
|
||||
msbArray[index] = (byte)msb;
|
||||
lsbArray[index] = (short) lsb;
|
||||
msbArray[index] = (byte) msb;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+21
-23
@@ -1,38 +1,39 @@
|
||||
package com.falsepattern.endlessids.mixin.mixins.common.vanilla.storage;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
@Mixin(ItemStack.class)
|
||||
public abstract class ItemStackMixin {
|
||||
|
||||
@Shadow private Item field_151002_e;
|
||||
@Shadow
|
||||
public int stackSize;
|
||||
@Shadow
|
||||
public NBTTagCompound stackTagCompound;
|
||||
@Shadow
|
||||
int itemDamage;
|
||||
@Shadow
|
||||
private Item field_151002_e;
|
||||
|
||||
@Shadow public int stackSize;
|
||||
|
||||
@Shadow int itemDamage;
|
||||
|
||||
@Shadow public NBTTagCompound stackTagCompound;
|
||||
|
||||
@Shadow public abstract void func_150996_a(Item p_150996_1_);
|
||||
@Shadow
|
||||
public abstract void func_150996_a(Item p_150996_1_);
|
||||
|
||||
/**
|
||||
* @author FalsePattern
|
||||
* @reason ID extension
|
||||
*/
|
||||
@Overwrite
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbt)
|
||||
{
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
|
||||
nbt.setInteger("id", Item.getIdFromItem(this.field_151002_e));
|
||||
nbt.setByte("Count", (byte)this.stackSize);
|
||||
nbt.setShort("Damage", (short)this.itemDamage);
|
||||
nbt.setByte("Count", (byte) this.stackSize);
|
||||
nbt.setShort("Damage", (short) this.itemDamage);
|
||||
|
||||
if (this.stackTagCompound != null)
|
||||
{
|
||||
if (this.stackTagCompound != null) {
|
||||
nbt.setTag("tag", this.stackTagCompound);
|
||||
}
|
||||
|
||||
@@ -44,19 +45,16 @@ public abstract class ItemStackMixin {
|
||||
* @reason ID extension
|
||||
*/
|
||||
@Overwrite
|
||||
public void readFromNBT(NBTTagCompound nbt)
|
||||
{
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
func_150996_a(Item.getItemById(nbt.getInteger("id")));
|
||||
this.stackSize = nbt.getByte("Count");
|
||||
this.itemDamage = nbt.getShort("Damage");
|
||||
|
||||
if (this.itemDamage < 0)
|
||||
{
|
||||
if (this.itemDamage < 0) {
|
||||
this.itemDamage = 0;
|
||||
}
|
||||
|
||||
if (nbt.hasKey("tag", 10))
|
||||
{
|
||||
if (nbt.hasKey("tag", 10)) {
|
||||
this.stackTagCompound = nbt.getCompoundTag("tag");
|
||||
}
|
||||
}
|
||||
|
||||
+21
-14
@@ -1,30 +1,35 @@
|
||||
package com.falsepattern.endlessids.mixin.mixins.common.vanilla.worldgen;
|
||||
|
||||
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.gen.ChunkProviderEnd;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Random;
|
||||
|
||||
@Mixin(ChunkProviderEnd.class)
|
||||
public abstract class ChunkProviderEndMixin {
|
||||
|
||||
@Shadow private Random endRNG;
|
||||
@Shadow
|
||||
private Random endRNG;
|
||||
|
||||
@Shadow private BiomeGenBase[] biomesForGeneration;
|
||||
@Shadow
|
||||
private BiomeGenBase[] biomesForGeneration;
|
||||
|
||||
@Shadow private World endWorld;
|
||||
@Shadow
|
||||
private World endWorld;
|
||||
|
||||
@Shadow public abstract void func_147420_a(int p_147420_1_, int p_147420_2_, Block[] p_147420_3_, BiomeGenBase[] p_147420_4_);
|
||||
@Shadow
|
||||
public abstract void func_147420_a(int p_147420_1_, int p_147420_2_, Block[] p_147420_3_, BiomeGenBase[] p_147420_4_);
|
||||
|
||||
@Shadow public abstract void replaceBiomeBlocks(int p_147421_1_, int p_147421_2_, Block[] p_147421_3_, BiomeGenBase[] p_147421_4_, byte[] meta);
|
||||
@Shadow
|
||||
public abstract void replaceBiomeBlocks(int p_147421_1_, int p_147421_2_, Block[] p_147421_3_, BiomeGenBase[] p_147421_4_, byte[] meta);
|
||||
|
||||
/**
|
||||
* @author FalsePattern
|
||||
@@ -32,17 +37,19 @@ public abstract class ChunkProviderEndMixin {
|
||||
*/
|
||||
@Overwrite
|
||||
public Chunk provideChunk(int x, int z) {
|
||||
this.endRNG.setSeed((long)x * 341873128712L + (long)z * 132897987541L);
|
||||
this.endRNG.setSeed((long) x * 341873128712L + (long) z * 132897987541L);
|
||||
Block[] blocks = new Block[32768];
|
||||
byte[] metadatas = new byte[blocks.length];
|
||||
this.biomesForGeneration = this.endWorld.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, x * 16, z * 16, 16, 16);
|
||||
this.biomesForGeneration = this.endWorld.getWorldChunkManager()
|
||||
.loadBlockGeneratorData(this.biomesForGeneration, x * 16, z * 16, 16,
|
||||
16);
|
||||
this.func_147420_a(x, z, blocks, this.biomesForGeneration);
|
||||
this.replaceBiomeBlocks(x, z, blocks, this.biomesForGeneration, metadatas);
|
||||
Chunk chunk = new Chunk(this.endWorld, blocks, metadatas, x, z);
|
||||
short[] biomes = ((IChunkMixin)chunk).getBiomeShortArray();
|
||||
short[] biomes = ((IChunkMixin) chunk).getBiomeShortArray();
|
||||
|
||||
for(int i = 0; i < biomes.length; ++i) {
|
||||
biomes[i] = (short)this.biomesForGeneration[i].biomeID;
|
||||
for (int i = 0; i < biomes.length; ++i) {
|
||||
biomes[i] = (short) this.biomesForGeneration[i].biomeID;
|
||||
}
|
||||
|
||||
chunk.generateSkylightMap();
|
||||
|
||||
+22
-16
@@ -1,7 +1,11 @@
|
||||
package com.falsepattern.endlessids.mixin.mixins.common.vanilla.worldgen;
|
||||
|
||||
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
|
||||
import com.falsepattern.endlessids.mixin.helpers.IExtendedBlockStorageMixin;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
@@ -10,23 +14,25 @@ import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
|
||||
import net.minecraft.world.gen.ChunkProviderFlat;
|
||||
import net.minecraft.world.gen.MapGenBase;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
@Mixin(ChunkProviderFlat.class)
|
||||
public abstract class ChunkProviderFlatMixin implements IChunkProvider {
|
||||
@Shadow private World worldObj;
|
||||
@Shadow
|
||||
private World worldObj;
|
||||
|
||||
@Shadow @Final private Block[] cachedBlockIDs;
|
||||
@Shadow
|
||||
@Final
|
||||
private Block[] cachedBlockIDs;
|
||||
|
||||
@Shadow @Final private byte[] cachedBlockMetadata;
|
||||
@Shadow
|
||||
@Final
|
||||
private byte[] cachedBlockMetadata;
|
||||
|
||||
@Shadow @Final private List structureGenerators;
|
||||
@Shadow
|
||||
@Final
|
||||
private List structureGenerators;
|
||||
|
||||
/**
|
||||
* @author FalsePattern
|
||||
@@ -36,7 +42,7 @@ public abstract class ChunkProviderFlatMixin implements IChunkProvider {
|
||||
public Chunk provideChunk(int x, int z) {
|
||||
Chunk chunk = new Chunk(this.worldObj, x, z);
|
||||
|
||||
for(int Y = 0; Y < this.cachedBlockIDs.length; ++Y) {
|
||||
for (int Y = 0; Y < this.cachedBlockIDs.length; ++Y) {
|
||||
Block block = this.cachedBlockIDs[Y];
|
||||
if (block != null) {
|
||||
int ebsID = Y >> 4;
|
||||
@@ -46,8 +52,8 @@ public abstract class ChunkProviderFlatMixin implements IChunkProvider {
|
||||
chunk.getBlockStorageArray()[ebsID] = ebs;
|
||||
}
|
||||
|
||||
for(int X = 0; X < 16; ++X) {
|
||||
for(int Z = 0; Z < 16; ++Z) {
|
||||
for (int X = 0; X < 16; ++X) {
|
||||
for (int Z = 0; Z < 16; ++Z) {
|
||||
ebs.func_150818_a(X, Y & 15, Z, block);
|
||||
ebs.setExtBlockMetadata(X, Y & 15, Z, this.cachedBlockMetadata[Y]);
|
||||
}
|
||||
@@ -57,10 +63,10 @@ public abstract class ChunkProviderFlatMixin implements IChunkProvider {
|
||||
|
||||
chunk.generateSkylightMap();
|
||||
BiomeGenBase[] bgb = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(null, x * 16, z * 16, 16, 16);
|
||||
short[] biomeArray = ((IChunkMixin)chunk).getBiomeShortArray();
|
||||
short[] biomeArray = ((IChunkMixin) chunk).getBiomeShortArray();
|
||||
|
||||
for(int i = 0; i < biomeArray.length; ++i) {
|
||||
biomeArray[i] = (short)bgb[i].biomeID;
|
||||
for (int i = 0; i < biomeArray.length; ++i) {
|
||||
biomeArray[i] = (short) bgb[i].biomeID;
|
||||
}
|
||||
|
||||
for (Object o : this.structureGenerators) {
|
||||
|
||||
+37
-30
@@ -1,6 +1,11 @@
|
||||
package com.falsepattern.endlessids.mixin.mixins.common.vanilla.worldgen;
|
||||
|
||||
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
@@ -12,38 +17,38 @@ import net.minecraft.world.gen.structure.MapGenMineshaft;
|
||||
import net.minecraft.world.gen.structure.MapGenScatteredFeature;
|
||||
import net.minecraft.world.gen.structure.MapGenStronghold;
|
||||
import net.minecraft.world.gen.structure.MapGenVillage;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@Mixin(ChunkProviderGenerate.class)
|
||||
public abstract class ChunkProviderGenerateMixin implements IChunkProvider {
|
||||
@Shadow public abstract void func_147424_a(int p_147424_1_, int p_147424_2_, Block[] p_147424_3_);
|
||||
@Shadow
|
||||
private Random rand;
|
||||
@Shadow
|
||||
private BiomeGenBase[] biomesForGeneration;
|
||||
@Shadow
|
||||
private World worldObj;
|
||||
@Shadow
|
||||
private MapGenBase caveGenerator;
|
||||
@Shadow
|
||||
private MapGenBase ravineGenerator;
|
||||
@Shadow
|
||||
@Final
|
||||
private boolean mapFeaturesEnabled;
|
||||
@Shadow
|
||||
private MapGenMineshaft mineshaftGenerator;
|
||||
@Shadow
|
||||
private MapGenVillage villageGenerator;
|
||||
@Shadow
|
||||
private MapGenStronghold strongholdGenerator;
|
||||
@Shadow
|
||||
private MapGenScatteredFeature scatteredFeatureGenerator;
|
||||
|
||||
@Shadow private Random rand;
|
||||
@Shadow
|
||||
public abstract void func_147424_a(int p_147424_1_, int p_147424_2_, Block[] p_147424_3_);
|
||||
|
||||
@Shadow private BiomeGenBase[] biomesForGeneration;
|
||||
|
||||
@Shadow private World worldObj;
|
||||
|
||||
@Shadow public abstract void replaceBlocksForBiome(int p_147422_1_, int p_147422_2_, Block[] p_147422_3_, byte[] p_147422_4_, BiomeGenBase[] p_147422_5_);
|
||||
|
||||
@Shadow private MapGenBase caveGenerator;
|
||||
|
||||
@Shadow private MapGenBase ravineGenerator;
|
||||
|
||||
@Shadow @Final private boolean mapFeaturesEnabled;
|
||||
|
||||
@Shadow private MapGenMineshaft mineshaftGenerator;
|
||||
|
||||
@Shadow private MapGenVillage villageGenerator;
|
||||
|
||||
@Shadow private MapGenStronghold strongholdGenerator;
|
||||
|
||||
@Shadow private MapGenScatteredFeature scatteredFeatureGenerator;
|
||||
@Shadow
|
||||
public abstract void replaceBlocksForBiome(int p_147422_1_, int p_147422_2_, Block[] p_147422_3_, byte[] p_147422_4_, BiomeGenBase[] p_147422_5_);
|
||||
|
||||
/**
|
||||
* @author FalsePattern
|
||||
@@ -51,11 +56,13 @@ public abstract class ChunkProviderGenerateMixin implements IChunkProvider {
|
||||
*/
|
||||
@Overwrite
|
||||
public Chunk provideChunk(int x, int z) {
|
||||
this.rand.setSeed((long)x * 341873128712L + (long)z * 132897987541L);
|
||||
this.rand.setSeed((long) x * 341873128712L + (long) z * 132897987541L);
|
||||
Block[] blocks = new Block[65536];
|
||||
byte[] metadata = new byte[65536];
|
||||
this.func_147424_a(x, z, blocks);
|
||||
this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, x * 16, z * 16, 16, 16);
|
||||
this.biomesForGeneration = this.worldObj.getWorldChunkManager()
|
||||
.loadBlockGeneratorData(this.biomesForGeneration, x * 16, z * 16, 16,
|
||||
16);
|
||||
this.replaceBlocksForBiome(x, z, blocks, metadata, this.biomesForGeneration);
|
||||
this.caveGenerator.func_151539_a(this, this.worldObj, x, z, blocks);
|
||||
this.ravineGenerator.func_151539_a(this, this.worldObj, x, z, blocks);
|
||||
@@ -67,10 +74,10 @@ public abstract class ChunkProviderGenerateMixin implements IChunkProvider {
|
||||
}
|
||||
|
||||
Chunk chunk = new Chunk(this.worldObj, blocks, metadata, x, z);
|
||||
short[] biomes = ((IChunkMixin)chunk).getBiomeShortArray();
|
||||
short[] biomes = ((IChunkMixin) chunk).getBiomeShortArray();
|
||||
|
||||
for(int i = 0; i < biomes.length; ++i) {
|
||||
biomes[i] = (short)this.biomesForGeneration[i].biomeID;
|
||||
for (int i = 0; i < biomes.length; ++i) {
|
||||
biomes[i] = (short) this.biomesForGeneration[i].biomeID;
|
||||
}
|
||||
|
||||
chunk.generateSkylightMap();
|
||||
|
||||
+20
-16
@@ -1,6 +1,10 @@
|
||||
package com.falsepattern.endlessids.mixin.mixins.common.vanilla.worldgen;
|
||||
|
||||
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
@@ -9,26 +13,26 @@ import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.ChunkProviderHell;
|
||||
import net.minecraft.world.gen.MapGenBase;
|
||||
import net.minecraft.world.gen.structure.MapGenNetherBridge;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@Mixin(ChunkProviderHell.class)
|
||||
public abstract class ChunkProviderHellMixin implements IChunkProvider {
|
||||
|
||||
@Shadow private Random hellRNG;
|
||||
@Shadow
|
||||
public MapGenNetherBridge genNetherBridge;
|
||||
@Shadow
|
||||
private Random hellRNG;
|
||||
@Shadow
|
||||
private World worldObj;
|
||||
@Shadow
|
||||
private MapGenBase netherCaveGenerator;
|
||||
|
||||
@Shadow private World worldObj;
|
||||
@Shadow
|
||||
public abstract void func_147419_a(int p_147419_1_, int p_147419_2_, Block[] p_147419_3_);
|
||||
|
||||
@Shadow public abstract void func_147419_a(int p_147419_1_, int p_147419_2_, Block[] p_147419_3_);
|
||||
|
||||
@Shadow public abstract void replaceBiomeBlocks(int p_147418_1_, int p_147418_2_, Block[] p_147418_3_, byte[] meta, BiomeGenBase[] biomes);
|
||||
|
||||
@Shadow private MapGenBase netherCaveGenerator;
|
||||
|
||||
@Shadow public MapGenNetherBridge genNetherBridge;
|
||||
@Shadow
|
||||
public abstract void replaceBiomeBlocks(int p_147418_1_, int p_147418_2_, Block[] p_147418_3_, byte[] meta, BiomeGenBase[] biomes);
|
||||
|
||||
/**
|
||||
* @author FalsePattern
|
||||
@@ -36,7 +40,7 @@ public abstract class ChunkProviderHellMixin implements IChunkProvider {
|
||||
*/
|
||||
@Overwrite
|
||||
public Chunk provideChunk(int x, int z) {
|
||||
this.hellRNG.setSeed((long)x * 341873128712L + (long)z * 132897987541L);
|
||||
this.hellRNG.setSeed((long) x * 341873128712L + (long) z * 132897987541L);
|
||||
Block[] blocks = new Block[32768];
|
||||
byte[] metadata = new byte[blocks.length];
|
||||
BiomeGenBase[] bgb = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(null, x * 16, z * 16, 16, 16);
|
||||
@@ -45,10 +49,10 @@ public abstract class ChunkProviderHellMixin implements IChunkProvider {
|
||||
this.netherCaveGenerator.func_151539_a(this, this.worldObj, x, z, blocks);
|
||||
this.genNetherBridge.func_151539_a(this, this.worldObj, x, z, blocks);
|
||||
Chunk chunk = new Chunk(this.worldObj, blocks, metadata, x, z);
|
||||
short[] biomes = ((IChunkMixin)chunk).getBiomeShortArray();
|
||||
short[] biomes = ((IChunkMixin) chunk).getBiomeShortArray();
|
||||
|
||||
for(int i = 0; i < biomes.length; ++i) {
|
||||
biomes[i] = (short)bgb[i].biomeID;
|
||||
for (int i = 0; i < biomes.length; ++i) {
|
||||
biomes[i] = (short) bgb[i].biomeID;
|
||||
}
|
||||
|
||||
chunk.resetRelightChecks();
|
||||
|
||||
+2
-1
@@ -2,11 +2,12 @@ package com.falsepattern.endlessids.mixin.mixins.common.vanilla.worldgen;
|
||||
|
||||
import com.falsepattern.endlessids.constants.ExtendedConstants;
|
||||
import com.falsepattern.endlessids.constants.VanillaConstants;
|
||||
import net.minecraft.world.gen.layer.GenLayerRiverMix;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.Constant;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
|
||||
import net.minecraft.world.gen.layer.GenLayerRiverMix;
|
||||
|
||||
@Mixin(GenLayerRiverMix.class)
|
||||
public abstract class GenLayerRiverMixMixin {
|
||||
@ModifyConstant(method = "getInts",
|
||||
|
||||
+2
-2
@@ -2,12 +2,12 @@ package com.falsepattern.endlessids.mixin.mixins.common.vanilla.worldgen;
|
||||
|
||||
import com.falsepattern.endlessids.constants.ExtendedConstants;
|
||||
import com.falsepattern.endlessids.constants.VanillaConstants;
|
||||
import net.minecraft.world.gen.layer.GenLayerRiverMix;
|
||||
import net.minecraft.world.gen.layer.GenLayerVoronoiZoom;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.Constant;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
|
||||
import net.minecraft.world.gen.layer.GenLayerVoronoiZoom;
|
||||
|
||||
@Mixin(GenLayerVoronoiZoom.class)
|
||||
public abstract class GenLayerVoronoiZoomMixin {
|
||||
@ModifyConstant(method = "getInts",
|
||||
|
||||
+4
-2
@@ -5,7 +5,8 @@ import com.sk89q.worldedit.blocks.BaseBlock;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
|
||||
@Mixin(value = BaseBlock.class, remap = false)
|
||||
@Mixin(value = BaseBlock.class,
|
||||
remap = false)
|
||||
public abstract class BaseBlockMixin {
|
||||
private int idExtended;
|
||||
|
||||
@@ -16,7 +17,8 @@ public abstract class BaseBlockMixin {
|
||||
@Overwrite
|
||||
protected final void internalSetId(int id) {
|
||||
if (id > ExtendedConstants.maxBlockID) {
|
||||
throw new IllegalArgumentException("Can't have a block ID above " + ExtendedConstants.maxBlockID + " (" + id + " given)");
|
||||
throw new IllegalArgumentException(
|
||||
"Can't have a block ID above " + ExtendedConstants.maxBlockID + " (" + id + " given)");
|
||||
} else if (id < 0) {
|
||||
throw new IllegalArgumentException("Can't have a block ID below 0");
|
||||
} else {
|
||||
|
||||
@@ -9,7 +9,10 @@ import lombok.RequiredArgsConstructor;
|
||||
import java.util.List;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import static com.falsepattern.lib.mixin.IMixin.PredicateHelpers.*;
|
||||
import static com.falsepattern.lib.mixin.IMixin.PredicateHelpers.always;
|
||||
import static com.falsepattern.lib.mixin.IMixin.PredicateHelpers.avoid;
|
||||
import static com.falsepattern.lib.mixin.IMixin.PredicateHelpers.condition;
|
||||
import static com.falsepattern.lib.mixin.IMixin.PredicateHelpers.require;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public enum Mixin implements IMixin {
|
||||
@@ -31,7 +34,8 @@ public enum Mixin implements IMixin {
|
||||
//region Minecraft->common->biome
|
||||
BiomeDictionaryMixin(Side.COMMON, always(), "vanilla.biome.BiomeDictionaryMixin"),
|
||||
BiomeGenBaseMixin(Side.COMMON, always(), "vanilla.biome.BiomeGenBaseMixin"),
|
||||
BiomesGenBasePlaceholderMixin(Side.COMMON, avoid(TargetedMod.ANTIIDCONFLICT), "vanilla.biome.BiomeGenBasePlaceholderMixin"),
|
||||
BiomesGenBasePlaceholderMixin(Side.COMMON, avoid(TargetedMod.ANTIIDCONFLICT),
|
||||
"vanilla.biome.BiomeGenBasePlaceholderMixin"),
|
||||
//endregion Minecraft->common->biome
|
||||
//region Minecraft->common->misc
|
||||
BlockFireMixin(Side.COMMON, always(), "vanilla.misc.BlockFireMixin"),
|
||||
@@ -58,7 +62,8 @@ public enum Mixin implements IMixin {
|
||||
//endregion Minecraft
|
||||
//region AntiIDConflict->common
|
||||
AIDCBiomesGenBaseMixin(Side.COMMON, require(TargetedMod.ANTIIDCONFLICT), "antiidconflict.BiomeGenBaseMixin"),
|
||||
AIDCBiomesGenBasePlaceholderMixin(Side.COMMON, require(TargetedMod.ANTIIDCONFLICT), "antiidconflict.BiomeGenBasePlaceholderMixin"),
|
||||
AIDCBiomesGenBasePlaceholderMixin(Side.COMMON, require(TargetedMod.ANTIIDCONFLICT),
|
||||
"antiidconflict.BiomeGenBasePlaceholderMixin"),
|
||||
//endregion AntiIDConflict->common
|
||||
//region ATG->common
|
||||
ATGBiomeConfigMixin(Side.COMMON, require(TargetedMod.ATG), "atg.ATGBiomeConfigMixin"),
|
||||
@@ -73,14 +78,12 @@ public enum Mixin implements IMixin {
|
||||
DragonAPIBlockPropertiesMixin(Side.COMMON, require(TargetedMod.DRAGONAPI), "dragonapi.BlockPropertiesMixin"),
|
||||
//endregion DragonAPI->common
|
||||
//region GalactiCraftCore->common
|
||||
GalactiCraftCoreConfigManagerCoreMixin(Side.COMMON,
|
||||
require(TargetedMod.GALACTICRAFTCORE),
|
||||
GalactiCraftCoreConfigManagerCoreMixin(Side.COMMON, require(TargetedMod.GALACTICRAFTCORE),
|
||||
"galacticraft.ConfigManagerCoreMixin"),
|
||||
//endregion GalactiCraftCore->common
|
||||
//region MFQM->common
|
||||
MFQMMixin(Side.COMMON, require(TargetedMod.MFQM), "mfqm.MFQMMixin"),
|
||||
MFQMDataWatcherMixin(Side.COMMON,
|
||||
require(TargetedMod.MFQM).and(condition(() -> IEConfig.extendDataWatcher)),
|
||||
MFQMDataWatcherMixin(Side.COMMON, require(TargetedMod.MFQM).and(condition(() -> IEConfig.extendDataWatcher)),
|
||||
"mfqm.MFQMDataWatcherMixin"),
|
||||
//endregion MFQM->common
|
||||
//region UBC->common
|
||||
|
||||
@@ -6,7 +6,7 @@ import lombok.RequiredArgsConstructor;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import static com.falsepattern.lib.mixin.ITargetedMod.PredicateHelpers.*;
|
||||
import static com.falsepattern.lib.mixin.ITargetedMod.PredicateHelpers.startsWith;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public enum TargetedMod implements ITargetedMod {
|
||||
|
||||
Reference in new issue
Block a user