diff --git a/build.gradle b/build.gradle index 5aae954..fb09d95 100644 --- a/build.gradle +++ b/build.gradle @@ -73,6 +73,11 @@ processResources { } jar { + manifest { + attributes( + 'FMLAT': "${project.name.toLowerCase()}_at.cfg" + ) + } configurations.embedded.each { dep -> from(project.zipTree(dep)) { exclude 'META-INF', 'META-INF/**' diff --git a/build.properties b/build.properties index 539dee5..2db9293 100644 --- a/build.properties +++ b/build.properties @@ -1,4 +1,4 @@ minecraft.version=1.10.2 minecraft.mappings=snapshot_20161111 forge.version=12.18.3.2511 -smartmoving.version=16.4-RC2 +smartmoving.version=16.4-RC3 diff --git a/src/main/java/net/smart/moving/Orientation.java b/src/main/java/net/smart/moving/Orientation.java index 0108858..078fc3d 100644 --- a/src/main/java/net/smart/moving/Orientation.java +++ b/src/main/java/net/smart/moving/Orientation.java @@ -42,7 +42,6 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.smart.moving.config.SmartMovingOptions; -import net.smart.utilities.BlockWallUtil; import net.smart.utilities.Name; import net.smart.utilities.Reflect; @@ -1747,7 +1746,7 @@ else if(isFenceBase(state)) if(block instanceof BlockFence) return ((BlockFence)block).canConnectTo(world, new BlockPos(i + direction._i, local_offset + j_offset, k + direction._k)); if(block instanceof BlockWall) - return BlockWallUtil.canConnectTo(block, world, new BlockPos(i + direction._i, local_offset + j_offset, k + direction._k)); + return ((BlockWall) block).canConnectTo(world, new BlockPos(i + direction._i, local_offset + j_offset, k + direction._k)); else if(SmartMovingOptions.hasBetterMisc && _canConnectFenceTo != null) return (Boolean)Reflect.Invoke(_canConnectFenceTo, block, world, i + direction._i, local_offset + j_offset, k + direction._k); } diff --git a/src/main/java/net/smart/moving/SmartMovingBase.java b/src/main/java/net/smart/moving/SmartMovingBase.java index 5334376..239bb07 100644 --- a/src/main/java/net/smart/moving/SmartMovingBase.java +++ b/src/main/java/net/smart/moving/SmartMovingBase.java @@ -20,6 +20,7 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockLiquid; import net.minecraft.block.BlockTrapDoor; +import net.minecraft.block.BlockWall; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; @@ -32,7 +33,6 @@ import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import net.smart.moving.config.SmartMovingOptions; -import net.smart.utilities.BlockWallUtil; import java.util.HashSet; import java.util.Iterator; @@ -390,11 +390,9 @@ public boolean climbingUpIsBlockedByCobbleStoneWall() int i = MathHelper.floor_double(sp.posX); int j = MathHelper.floor_double(getBoundingBox().maxY); int k = MathHelper.floor_double(sp.posZ); - if(getBlock(i, j, k) == Block.getBlockFromName("cobblestone_wall")) - return BlockWallUtil.canConnectTo( - Block.getBlockFromName("cobblestone_wall"), - sp.worldObj, - new BlockPos(i - orientation._i, j, k - orientation._k)); + Block block = getBlock(i, j, k); + if(block == Block.getBlockFromName("cobblestone_wall")) + return ((BlockWall) block).canConnectTo(sp.worldObj, new BlockPos(i - orientation._i, j, k - orientation._k)); } } return false; diff --git a/src/main/java/net/smart/utilities/BlockWallUtil.java b/src/main/java/net/smart/utilities/BlockWallUtil.java deleted file mode 100644 index 212e917..0000000 --- a/src/main/java/net/smart/utilities/BlockWallUtil.java +++ /dev/null @@ -1,24 +0,0 @@ -package net.smart.utilities; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockFenceGate; -import net.minecraft.block.BlockWall; -import net.minecraft.block.material.Material; -import net.minecraft.block.state.IBlockState; -import net.minecraft.init.Blocks; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; - -public class BlockWallUtil { - /** - * This has become private in {@link BlockWall}, duplicate the logic here. - */ - public static boolean canConnectTo(Block wall, IBlockAccess worldIn, BlockPos pos) - { - IBlockState iblockstate = worldIn.getBlockState(pos); - Material otherMaterial = iblockstate.getMaterial(); - Block other = iblockstate.getBlock(); - return (other != Blocks.BARRIER && other != wall && !(other instanceof BlockFenceGate)) - && (otherMaterial.isOpaque() && iblockstate.isFullCube()) && otherMaterial != Material.GOURD; - } -} diff --git a/src/main/resources/META-INF/smartmoving_at.cfg b/src/main/resources/META-INF/smartmoving_at.cfg new file mode 100644 index 0000000..954ff6d --- /dev/null +++ b/src/main/resources/META-INF/smartmoving_at.cfg @@ -0,0 +1 @@ +public net.minecraft.block.BlockWall func_176253_e(Lnet/minecraft/world/IBlockAccess;Lnet/minecraft/util/math/BlockPos;)Z # canConnectTo \ No newline at end of file