当前位置: 首页>>代码示例>>Java>>正文


Java AbstractInsnNode.getPrevious方法代码示例

本文整理汇总了Java中org.objectweb.asm.tree.AbstractInsnNode.getPrevious方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractInsnNode.getPrevious方法的具体用法?Java AbstractInsnNode.getPrevious怎么用?Java AbstractInsnNode.getPrevious使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.objectweb.asm.tree.AbstractInsnNode的用法示例。


在下文中一共展示了AbstractInsnNode.getPrevious方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findPreviousLabel

import org.objectweb.asm.tree.AbstractInsnNode; //导入方法依赖的package包/类
public LabelNode findPreviousLabel(AbstractInsnNode node) {
	while (node.getPrevious() != null) {
		if (node.getPrevious() instanceof LabelNode)
			return (LabelNode) node.getPrevious();
		node = node.getPrevious();
	}
	return null;
}
 
开发者ID:PorPit,项目名称:MineCamera,代码行数:9,代码来源:Transformer.java

示例2: getMethodTransformers

import org.objectweb.asm.tree.AbstractInsnNode; //导入方法依赖的package包/类
@Override
public MethodTransformer[] getMethodTransformers() {
	
	MethodTransformer transformDoStitch = new MethodTransformer() {
		public String getMethodName() {return CoreLoader.isObfuscated ? "c" : "doStitch";}
		public String getDescName() {return "()V";}
		
		@Override
		public void transform(ClassNode classNode, MethodNode method, boolean obfuscated) {
			CLTLog.info("Found method: " + method.name + " " + method.desc);
			AbstractInsnNode instruction = method.instructions.getLast();
			
			//find ProgressManager.pop
			for (int i = 0; i < 5; i++) {
				instruction = instruction.getPrevious();
			}
			
			InsnList toInsert = new InsnList();
			
			//TransformerUtil.createTextureMap(stitchSlots);
			toInsert.add(new VarInsnNode(ALOAD, 0)); //this
			toInsert.add(new FieldInsnNode(GETFIELD, classNode.name,
					obfuscated ? "field_94317_b" : "stitchSlots", "Ljava/util/List;")); //stitchSlots
			toInsert.add(new MethodInsnNode(INVOKESTATIC, Type.getInternalName(TransformerUtil.class),
					"createTextureMap", "(Ljava/util/List;)V", false)); //TransformerUtil.createTextureMap
			
			method.instructions.insertBefore(instruction, toInsert);
		}
	};
	
	return new MethodTransformer[] {transformDoStitch};
}
 
开发者ID:18107,项目名称:MC-Ray-Tracer,代码行数:33,代码来源:StitcherTransformer.java

示例3: getMethodTransformers

import org.objectweb.asm.tree.AbstractInsnNode; //导入方法依赖的package包/类
@Override
public MethodTransformer[] getMethodTransformers() {
	
	MethodTransformer transformSetupCameraTransform = new MethodTransformer() {
		public String getMethodName() {return CoreLoader.isObfuscated ? "a" : "setupCameraTransform";}
		public String getDescName() {return "(FI)V";}
		
		/**
		 * Transforms {@link net.minecraft.client.renderer.EntityRenderer#setupCameraTransform()}
		 */
		public void transform(ClassNode classNode, MethodNode method, boolean obfuscated) {
			CLTLog.info("Found method: " + method.name + " " + method.desc);
			for (AbstractInsnNode instruction : method.instructions.toArray()) {
				if (instruction.getOpcode() == TABLESWITCH) {
					CLTLog.info("Found tableswitch in method " + getMethodName());
					
					//Go back to orientCamera
					for (int i = 0; i < 8+4; i++) {
						instruction = instruction.getPrevious();
					}
					InsnList toInsert = new InsnList();
					
					//GlStateManager.translate(0, 0, -0.05F);
					toInsert.add(new InsnNode(FCONST_0)); //0
					toInsert.add(new InsnNode(FCONST_0)); //0
					toInsert.add(new LdcInsnNode(-0.05f)); //-0.05
					toInsert.add(new MethodInsnNode(INVOKESTATIC, Type.getInternalName(GlStateManager.class),
							obfuscated ? "func_179109_b" : "translate", "(FFF)V", false));
					
					method.instructions.insertBefore(instruction, toInsert);
					
					break;
				}
			}
		}
	};
	
	return new MethodTransformer[] {transformSetupCameraTransform};
}
 
开发者ID:18107,项目名称:MC-Ray-Tracer,代码行数:40,代码来源:EntityRendererTransformer.java

示例4: getMethodTransformers

import org.objectweb.asm.tree.AbstractInsnNode; //导入方法依赖的package包/类
@Override
public MethodTransformer[] getMethodTransformers() {
	
	MethodTransformer transformRenderParticle = new MethodTransformer() {

		@Override
		public MethodName getName() {
			return Names.Particle_renderParticle;
		}
		
		@Override
		public void transform(ClassNode classNode, MethodNode method, boolean obfuscated) {
			CLTLog.info("Found method: " + method.name + " " + method.desc);
			
			for (AbstractInsnNode instruction : method.instructions.toArray()) {
				if (instruction.getOpcode() == BIPUSH &&
						instruction.getNext().getOpcode() == GETSTATIC) {
					CLTLog.info("Found BIPUSH in method " + getName().all());
					
					instruction = instruction.getPrevious();
					
					transformParticle(classNode, method, instruction, 15);
					
					break;
				}
			}
		}
	};
	
	return new MethodTransformer[] {transformRenderParticle};
}
 
开发者ID:shaunlebron,项目名称:flex-fov,代码行数:32,代码来源:ParticleSweepAttackTransformer.java

示例5: getMethodTransformers

import org.objectweb.asm.tree.AbstractInsnNode; //导入方法依赖的package包/类
@Override
public MethodTransformer[] getMethodTransformers() {
	
	MethodTransformer transformRenderParticle = new MethodTransformer() {

		@Override
		public MethodName getName() {
			return Names.Particle_renderParticle;
		}
		
		@Override
		public void transform(ClassNode classNode, MethodNode method, boolean obfuscated) {
			CLTLog.info("Found method: " + method.name + " " + method.desc);
			
			for (AbstractInsnNode instruction : method.instructions.toArray()) {
				if (instruction.getOpcode() == ANEWARRAY) {
					CLTLog.info("Found ANEWARRAY in method " + getName().all());
					
					instruction = instruction.getPrevious();
					
					transformParticle(classNode, method, instruction, 14);
					
					break;
				}
			}
		}
	};
	
	return new MethodTransformer[] {transformRenderParticle};
}
 
开发者ID:shaunlebron,项目名称:flex-fov,代码行数:31,代码来源:ParticleTransformer.java

示例6: transform

import org.objectweb.asm.tree.AbstractInsnNode; //导入方法依赖的package包/类
@Override
public void transform(ClassNode clazz, MethodNode method, InsnMatcher matcher) {
	AbstractInsnNode ret = AsmUtils.getPreviousRealInsn(method.instructions.getLast());
	AbstractInsnNode aload = ret.getPrevious();

	InsnList list = new InsnList();
	list.add(new TypeInsnNode(Opcodes.NEW, "com/wyverngame/anvil/api/server/action/AnvilBehaviour"));
	list.add(new InsnNode(Opcodes.DUP));

	method.instructions.insertBefore(aload, list);
	method.instructions.insertBefore(ret, new MethodInsnNode(Opcodes.INVOKESPECIAL, "com/wyverngame/anvil/api/server/action/AnvilBehaviour", "<init>", "(Lcom/wurmonline/server/behaviours/Behaviour;)V", false));
}
 
开发者ID:jonathanedgecombe,项目名称:anvil,代码行数:13,代码来源:GetBehavioursTransformer.java

示例7: getPreviousRealInsn

import org.objectweb.asm.tree.AbstractInsnNode; //导入方法依赖的package包/类
public static @Nullable AbstractInsnNode getPreviousRealInsn(AbstractInsnNode insn) {
	while ((insn = insn.getPrevious()) != null && insn.getOpcode() == -1);
	return insn;
}
 
开发者ID:jonathanedgecombe,项目名称:anvil,代码行数:5,代码来源:AsmUtils.java

示例8: getPreviousPseudoInsn

import org.objectweb.asm.tree.AbstractInsnNode; //导入方法依赖的package包/类
public static @Nullable AbstractInsnNode getPreviousPseudoInsn(AbstractInsnNode insn) {
	while ((insn = insn.getPrevious()) != null && insn.getOpcode() != -1);
	return insn;
}
 
开发者ID:jonathanedgecombe,项目名称:anvil,代码行数:5,代码来源:AsmUtils.java


注:本文中的org.objectweb.asm.tree.AbstractInsnNode.getPrevious方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。