diff --git a/diffs/Item.diff b/diffs/Item.diff index 2dd1fda..06e58ad 100644 --- a/diffs/Item.diff +++ b/diffs/Item.diff @@ -1,8 +1,8 @@ diff --git a/src/minecraft/net/minecraft/src/Item.java b/src/minecraft/net/minecraft/src/Item.java -index 337c513..9bc1325 100644 +index 337c513..48fbe75 100644 --- a/src/minecraft/net/minecraft/src/Item.java +++ b/src/minecraft/net/minecraft/src/Item.java -@@ -776,0 +777,20 @@ public Item SetDefaultFurnaceBurnTime(int var1) +@@ -776,0 +777,25 @@ public Item SetDefaultFurnaceBurnTime(int var1) + public boolean IsPistonPackable(ItemStack stack) + { + return false; @@ -23,3 +23,8 @@ index 337c513..9bc1325 100644 + return 0; + } + ++ public boolean CanItemBeUsedByPlayer(World world, int x, int y, int z, int side, EntityPlayer player, ItemStack stack) ++ { ++ return true; ++ } ++ diff --git a/diffs/ItemBlock.diff b/diffs/ItemBlock.diff new file mode 100644 index 0000000..0188651 --- /dev/null +++ b/diffs/ItemBlock.diff @@ -0,0 +1,10 @@ +diff --git a/src/minecraft/net/minecraft/src/ItemBlock.java b/src/minecraft/net/minecraft/src/ItemBlock.java +index 8f64000..0254e30 100644 +--- a/src/minecraft/net/minecraft/src/ItemBlock.java ++++ b/src/minecraft/net/minecraft/src/ItemBlock.java +@@ -212,0 +213,5 @@ public void registerIcons(IconRegister par1IconRegister) ++ ++ public boolean CanItemBeUsedByPlayer(World world, int x, int y, int z, int side, EntityPlayer player, ItemStack stack) ++ { ++ return canPlaceItemBlockOnSide(world, x, y, z, side, player, stack); ++ } diff --git a/diffs/ThreadDownloadImageData.diff b/diffs/ThreadDownloadImageData.diff new file mode 100644 index 0000000..99a6a2e --- /dev/null +++ b/diffs/ThreadDownloadImageData.diff @@ -0,0 +1,7 @@ +diff --git a/src/minecraft/net/minecraft/src/ThreadDownloadImageData.java b/src/minecraft/net/minecraft/src/ThreadDownloadImageData.java +index 40d8470..a9f32b5 100644 +--- a/src/minecraft/net/minecraft/src/ThreadDownloadImageData.java ++++ b/src/minecraft/net/minecraft/src/ThreadDownloadImageData.java +@@ -26 +26 @@ public ThreadDownloadImageData(String par1, IImageBuffer par2IImageBuffer) +- (new ThreadDownloadImage(this, par1, par2IImageBuffer)).start(); ++ (new GPEThreadDownloadImage(this, par1, par2IImageBuffer)).start(); diff --git a/patcher/GPEBTWTweak_files.zip b/patcher/GPEBTWTweak_files.zip index ddb52fa..0ead46c 100644 Binary files a/patcher/GPEBTWTweak_files.zip and b/patcher/GPEBTWTweak_files.zip differ diff --git a/patcher/readme.txt b/patcher/readme.txt index 8116fd2..c4f88f1 100644 --- a/patcher/readme.txt +++ b/patcher/readme.txt @@ -1,8 +1,12 @@ -Grom PE's Better Than Wolves Total Conversion tweak mod v1.1 +Grom PE's Better Than Wolves Total Conversion tweak mod v1.1a (Compatible with Better Than Wolves V4.8911+) [********** Change Log ************] +v1.1a + +- Fixed compatibility with BTW version "4.ABBBBURNBABYBURNAHAHAHAHAHA". + v1.1 - Fixed compatibility with BTW version "4.AACK". diff --git a/patcher/scripts/tweaks_bed.js b/patcher/scripts/tweaks_bed.js index f542035..812aaa6 100644 --- a/patcher/scripts/tweaks_bed.js +++ b/patcher/scripts/tweaks_bed.js @@ -285,7 +285,7 @@ function(mn) INSERT_BEFORE ).process(mn); }); -tweak("sq", "EntityPlayer", BOTH, "l_()V", [0xB4066F18, 0x99096FE7, 0x723C726B, 0xD6667B48, 0xD7AA7A79], "Player won't mind napping at day", +tweak("sq", "EntityPlayer", BOTH, "l_()V", [0xB4066F18, 0x99096FE7, 0x723C726B, 0xD6667B48, 0xD7AA7A79, 0xE5047B58], "Player won't mind napping at day", function(mn) { for (var i = 0; i < mn.instructions.size(); i++) diff --git a/patcher/scripts/tweaks_gamelogic.js b/patcher/scripts/tweaks_gamelogic.js index c4e07bb..d21db5e 100644 --- a/patcher/scripts/tweaks_gamelogic.js +++ b/patcher/scripts/tweaks_gamelogic.js @@ -750,9 +750,9 @@ function(cn) }); takeMicroblockOwnership("FCItemBlockMoulding", 0x411E0779); takeMicroblockOwnership("FCItemBlockSidingAndCorner", 0x411E0779); -takeMicroblockOwnership("FCItemBlockWoodCornerStub", 0x2C60197); -takeMicroblockOwnership("FCItemBlockWoodMouldingStub", 0x2C60197); -takeMicroblockOwnership("FCItemBlockWoodSidingStub", 0x2C60197); +takeMicroblockOwnership("FCItemBlockWoodCornerStub", [0x2C60197, 0x9BB02C1]); +takeMicroblockOwnership("FCItemBlockWoodMouldingStub", [0x2C60197, 0x9BB02C1]); +takeMicroblockOwnership("FCItemBlockWoodSidingStub", [0x2C60197, 0x9BB02C1]); add("Addon_Glass$BlockStainedGlass", null, BOTH, "Making Deco stained glass inherit from GPEBlockGlass", function(cn) { @@ -955,7 +955,7 @@ function(mn) } } }); -tweak("ng", "EntityLiving", BOTH, "bE()F", [0x2F3E47DF, 0xB84C4738], "Restoring the effect of swiftness potions", +tweak("ng", "EntityLiving", BOTH, "bE()F", [0x2F3E47DF, 0xB84C4738, 0x56554569], "Restoring the effect of swiftness potions", function(mn) { var label = LabelNode(); diff --git a/patcher/scripts/tweaks_hooks.js b/patcher/scripts/tweaks_hooks.js index 9b98f00..b1270a3 100644 --- a/patcher/scripts/tweaks_hooks.js +++ b/patcher/scripts/tweaks_hooks.js @@ -271,20 +271,20 @@ if (isBTWVersionOrNewer("4.89666")) return true; }); } -tweak("bdr", "PlayerControllerMP", CLIENT, "a(Lsq;Laab;Lwm;IIIILarc;)Z", [0x5A6E2C5E, 0x48DE3024], "Hooking block placing decision", +tweak("bdr", "PlayerControllerMP", CLIENT, "a(Lsq;Laab;Lwm;IIIILarc;)Z", [0x5A6E2C5E, 0x48DE3024, 0xCA582922], "Hooking block placing decision", function(mn) { for (var i = 0; i < mn.instructions.size(); i++) { var n = mn.instructions.get(i); - if (isInstance(n, "org.objectweb.asm.tree.MethodInsnNode") && n.owner.equals("xn") && n.name.equals("a") && n.desc.equals("(Laab;IIIILsq;Lwm;)Z")) + if (isInstance(n, "org.objectweb.asm.tree.MethodInsnNode") && /*n.owner.equals("xn") && n.name.equals("a") &&*/ n.desc.equals("(Laab;IIIILsq;Lwm;)Z")) { mn.instructions.insert(n, toInsnList( [ VarInsnNode(FLOAD, 9), VarInsnNode(FLOAD, 10), VarInsnNode(FLOAD, 11), - MethodInsnNode(INVOKESTATIC, "GPEBTWTweak", "canPlaceItemBlock", "(Lxn;Laab;IIIILsq;Lwm;FFF)Z"), + MethodInsnNode(INVOKESTATIC, "GPEBTWTweak", "canPlaceItemBlock", "(Lwk;Laab;IIIILsq;Lwm;FFF)Z"), ] )); mn.instructions.remove(n); diff --git a/patcher/scripts/tweaks_vercompat.js b/patcher/scripts/tweaks_vercompat.js index 0a7993c..a426440 100644 --- a/patcher/scripts/tweaks_vercompat.js +++ b/patcher/scripts/tweaks_vercompat.js @@ -48,3 +48,29 @@ if (isBTWVersionOrNewer("4.AABABABA")) // tweaking overrides adapting, so have to call it manually add("GPEBlockChest", null, SERVER, "Removing client-only methods", removeClientOnlyMethods); } +if (isBTWVersionOrNewer("4.ABBBBURNBABYBURNAHAHAHAHAHA")) +{ + function changeOwner(mn) + { + for (var i = 0; i < mn.instructions.size(); i++) + { + var n = mn.instructions.get(i); + if (isInstance(n, "org.objectweb.asm.tree.MethodInsnNode") && n.owner.equals("FCItemBlockCustom")) + { + n.owner = "xn"; + return true; + } + } + } + tweak("GPEItemBlockMicro", null, BOTH, "(I)V", CHECKSUM_IGNORE, "(1/2) Changing inheritance from removed class", + changeOwner); + tweak("GPEItemBlockMicro", null, BOTH, "a(Lwm;Lsq;Laab;IIIIFFF)Z", CHECKSUM_IGNORE, "(1/3) Changing inheritance from removed class", + changeOwner); + add("GPEItemBlockMicro", null, BOTH, "(3/3) Changing inheritance from removed class", + function(cn) + { + cn.superName = "xn"; + }); + // tweaking overrides adapting, so have to call it manually + add("GPEItemBlockMicro", null, SERVER, "Removing client-only methods", removeClientOnlyMethods); +} diff --git a/tweaksrc/GPEBTWTweak.java b/tweaksrc/GPEBTWTweak.java index 38f568c..e802340 100644 --- a/tweaksrc/GPEBTWTweak.java +++ b/tweaksrc/GPEBTWTweak.java @@ -11,7 +11,7 @@ public class GPEBTWTweak extends FCAddOn { public static GPEBTWTweak instance; private static GPEBTWTweakProxy proxy; - public static final String tweakVersion = "1.1"; + public static final String tweakVersion = "1.1a"; private static boolean postPostInitialized = false; public static boolean isDecoPresent; @@ -1681,37 +1681,41 @@ private static void extendBlockIDs() FCTileEntityBeacon.InitializeEffectsByBlockID(); } - public static boolean canPlaceItemBlock(ItemBlock ib, World world, int x, int y, int z, int side, EntityPlayer player, ItemStack stack, float hitX, float hitY, float hitZ) + public static boolean canPlaceItemBlock(Item item, World world, int x, int y, int z, int side, EntityPlayer player, ItemStack stack, float hitX, float hitY, float hitZ) { - if (ib instanceof GPEItemBlockMicro) + if (item instanceof ItemBlock) { - GPEItemBlockMicro mi = (GPEItemBlockMicro)ib; - if (mi.attemptToCombineWithBlock(stack, world, x, y, z, side, hitX, hitY, hitZ, false, true)) - return true; + ItemBlock ib = (ItemBlock)item; + if (ib instanceof GPEItemBlockMicro) + { + GPEItemBlockMicro mi = (GPEItemBlockMicro)ib; + if (mi.attemptToCombineWithBlock(stack, world, x, y, z, side, hitX, hitY, hitZ, false, true)) + return true; + } + int id = ib.getBlockID(); + int meta = ib.getMetadata(stack.getItemDamage()); + Block block = Block.blocksList[id]; + if (block instanceof GPEBlockLadder || block instanceof FCIBlock) + { + switch (side) + { + case 0: --y; break; + case 1: ++y; break; + case 2: --z; break; + case 3: ++z; break; + case 4: --x; break; + case 5: ++x; break; + } + int newMeta = block.onBlockPlaced(world, x, y, z, side, hitX, hitY, hitZ, meta); + GPEWorldProxy4BB wp = new GPEWorldProxy4BB(world, x, y, z, id, newMeta); + block.setBlockBoundsBasedOnState(wp, x, y, z); + AxisAlignedBB bb = AxisAlignedBB.getAABBPool().getAABB( + (double)x + block.minX, (double)y + block.minY, (double)z + block.minZ, + (double)x + block.maxX, (double)y + block.maxY, (double)z + block.maxZ); + return world.checkNoEntityCollision(bb); + } } - int id = ib.getBlockID(); - int meta = ib.getMetadata(stack.getItemDamage()); - Block block = Block.blocksList[id]; - if (!(block instanceof GPEBlockLadder || block instanceof FCIBlock)) - { - return ib.canPlaceItemBlockOnSide(world, x, y, z, side, player, stack); - } - switch (side) - { - case 0: --y; break; - case 1: ++y; break; - case 2: --z; break; - case 3: ++z; break; - case 4: --x; break; - case 5: ++x; break; - } - int newMeta = block.onBlockPlaced(world, x, y, z, side, hitX, hitY, hitZ, meta); - GPEWorldProxy4BB wp = new GPEWorldProxy4BB(world, x, y, z, id, newMeta); - block.setBlockBoundsBasedOnState(wp, x, y, z); - AxisAlignedBB bb = AxisAlignedBB.getAABBPool().getAABB( - (double)x + block.minX, (double)y + block.minY, (double)z + block.minZ, - (double)x + block.maxX, (double)y + block.maxY, (double)z + block.maxZ); - return world.checkNoEntityCollision(bb); + return item.CanItemBeUsedByPlayer(world, x, y, z, side, player, stack); } public static int getMinimumDifficulty() diff --git a/tweaksrc/GPEItemBlockMicro.java b/tweaksrc/GPEItemBlockMicro.java index 3008de9..3f6aa57 100644 --- a/tweaksrc/GPEItemBlockMicro.java +++ b/tweaksrc/GPEItemBlockMicro.java @@ -1,6 +1,6 @@ package net.minecraft.src; -public abstract class GPEItemBlockMicro extends FCItemBlockCustom +public abstract class GPEItemBlockMicro extends FCItemBlockCustom // NOTE: change to ItemBlock if it fails to compile in newer BTW version. { public GPEItemBlockMicro(int id) {