Remove reflection
This commit is contained in:
parent
d050f6d976
commit
816178f1bf
1 changed files with 2 additions and 8 deletions
|
@ -1,6 +1,6 @@
|
||||||
package org.dimdev.dimdoors.util.schematic;
|
package org.dimdev.dimdoors.util.schematic;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import org.dimdev.dimdoors.mixin.RedstoneWireBlockAccessor;
|
||||||
|
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.block.Blocks;
|
import net.minecraft.block.Blocks;
|
||||||
|
@ -35,12 +35,6 @@ public class SchematicRedstoneFixer {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static WireConnection getRenderConnectionType(BlockView world, BlockPos pos, Direction direction) {
|
private static WireConnection getRenderConnectionType(BlockView world, BlockPos pos, Direction direction) {
|
||||||
try {
|
return ((RedstoneWireBlockAccessor) Blocks.REDSTONE_WIRE).invokeGetRenderConnectionType(world, pos, direction);
|
||||||
Method m = RedstoneWireBlock.class.getDeclaredMethod("getRenderConnectionType", BlockView.class, BlockPos.class, Direction.class);
|
|
||||||
m.setAccessible(true);
|
|
||||||
return (WireConnection) m.invoke(Blocks.REDSTONE_WIRE, world, pos, direction);
|
|
||||||
} catch (ReflectiveOperationException e) {
|
|
||||||
throw new AssertionError(e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue