Skip to content

Commit

Permalink
Replace BlockWallUtil with an access transformer
Browse files Browse the repository at this point in the history
  • Loading branch information
Tommsy64 committed May 24, 2018
1 parent c2a4848 commit 9035717
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 33 deletions.
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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/**'
Expand Down
2 changes: 1 addition & 1 deletion build.properties
Original file line number Diff line number Diff line change
@@ -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
3 changes: 1 addition & 2 deletions src/main/java/net/smart/moving/Orientation.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}
Expand Down
10 changes: 4 additions & 6 deletions src/main/java/net/smart/moving/SmartMovingBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
24 changes: 0 additions & 24 deletions src/main/java/net/smart/utilities/BlockWallUtil.java

This file was deleted.

1 change: 1 addition & 0 deletions src/main/resources/META-INF/smartmoving_at.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
public net.minecraft.block.BlockWall func_176253_e(Lnet/minecraft/world/IBlockAccess;Lnet/minecraft/util/math/BlockPos;)Z # canConnectTo

0 comments on commit 9035717

Please sign in to comment.