Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public someclass {
- public static void waterInHell(World world, int x, int y, int z) {
- Block b = world.getBlock(x, y, z);
- if (b.blockMaterial != Material.water) {
- return;
- }
- if (world.provider.isHellWorld) {
- world.setBlockToAir(x, y, z);
- world.playAuxSFX(1004, x, y, z, 0);
- world.playAuxSFX(2000, x, y, z, 4);
- }
- }
- }
- /* somewhere in your ASM transformer */
- MethodNode method = ASMHelper.findMethod(classNode, "/*TODO: get obf name*/", "onBlockAdded", VOID_TYPE, WORLD_TYPE, INT_TYPE, INT_TYPE, INT_TYPE);
- InsnList patch = new InsnList();
- patch.add(new VarInsnNode(ALOAD, 1));
- patch.add(new VarInsnNode(ILOAD, 2));
- patch.add(new VarInsnNode(ILOAD, 3));
- patch.add(new VarInsnNode(ILOAD, 4));
- patch.add(new MethodInsnNode(INVOKESTATIC, "cofh/asm/whatever/someclass", "waterInHell", getMethodDescriptor(VOID_TYPE, WORLD_TYPE, INT_TYPE, INT_TYPE, INT_TYPE)));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement