當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。