Remove reflection

This commit is contained in:
SD 2021-01-10 21:11:43 +05:30
parent d050f6d976
commit 816178f1bf
No known key found for this signature in database
GPG key ID: E36B57EE08544BC5

View file

@ -1,6 +1,6 @@
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.Blocks;
@ -35,12 +35,6 @@ public class SchematicRedstoneFixer {
}
private static WireConnection getRenderConnectionType(BlockView world, BlockPos pos, Direction direction) {
try {
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);
}
return ((RedstoneWireBlockAccessor) Blocks.REDSTONE_WIRE).invokeGetRenderConnectionType(world, pos, direction);
}
}