Skip to content

Commit

Permalink
Update ASM to 1.12.2
Browse files Browse the repository at this point in the history
Match changes to:
 - Entity#moveRelative (extra parameter)
 - EntityLivingBase#moveEntityWithHeading (extra parameter)

EntityLivingBase#moveEntityWithHeading is now EntityLivingBase#travel,
 though from a code standpoint, that is irrelevant
  • Loading branch information
Mysteryem committed Oct 16, 2017
1 parent 6e3678a commit e4f1e3e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
@IFMLLoadingPlugin.TransformerExclusions({"uk.co.mysterymayhem.gravitymod.asm.FMLLoadingPlugin"})
@IFMLLoadingPlugin.Name("mysttmtgravitymod")
@IFMLLoadingPlugin.MCVersion("1.11.2")
@IFMLLoadingPlugin.MCVersion("1.12.2")
// Extra late so we patch after most other mods so we can more easily tell if a patch has failed (I don't trust other mods to detect when they fail)
@IFMLLoadingPlugin.SortingIndex(value = 9001)
public class FMLLoadingPlugin implements IFMLLoadingPlugin {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/uk/co/mysterymayhem/gravitymod/asm/Ref.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ public class Ref {
public static final MethodName Entity$getLookVec_name = new MethodName("getLookVec", "func_70040_Z");
public static final MethodName Entity$isOffsetPositionInLiquid_name = new MethodName("isOffsetPositionInLiquid", "func_70038_c");
public static final MethodName Entity$move_name = new MethodName("move", "func_70091_d");
public static final MethodName Entity$moveRelative_name = new MethodName("moveRelative", "func_70060_a");
public static final MethodName Entity$moveRelative_name = new MethodName("moveRelative", "func_191958_b");
public static final MethodName Entity$onUpdate_name = new MethodName("onUpdate", "func_70071_h_");
public static final MethodName Entity$pushOutOfBlocks = new MethodName("pushOutOfBlocks", "func_145771_j");
public static final MethodName EntityItem$combineItems_name = new MethodName("combineItems", "func_70289_a");
public static final MethodName EntityLivingBase$jump_name = new MethodName("jump", "func_70664_aZ");
public static final MethodName EntityLivingBase$moveEntityWithHeading_name = new MethodName("moveEntityWithHeading", "func_70612_e");
public static final MethodName EntityLivingBase$travel_name = new MethodName("travel", "func_191986_a");
public static final MethodName EntityLivingBase$onLivingUpdate_name = new MethodName("onLivingUpdate", "func_70636_d");
public static final MethodName EntityLivingBase$updateDistance_name = new MethodName("updateDistance", "func_110146_f");
public static final MethodName EntityPlayer$getFoodStats_name = new MethodName("getFoodStats", "func_71024_bL");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public PatchEntityLivingBase() {
// FIXME: Elytra flying doesn't work
// I didn't write a comment for patching this method.
// Go look at the comments for each patch added in its constructor
this.addMethodPatch(new MoveEntityWithHeading());
this.addMethodPatch(new Travel());

// This method is pretty badly named in my opinion, it seems to set up the turn of the player's head or body
// (I'm not sure), however it's rendering based and the rotation needs to be made relative. Only the
Expand Down Expand Up @@ -69,9 +69,9 @@ else if (Ref.EntityLivingBase$rotationYaw_GET.is(fieldInsnNode)) {
);
}

private class MoveEntityWithHeading extends MethodPatcher {
private class Travel extends MethodPatcher {

MoveEntityWithHeading() {
Travel() {

//FIXME: Elyta flying doesn't work!
// Replaces getLookVec in the Elytra movement with a relative version
Expand Down Expand Up @@ -122,7 +122,7 @@ private class MoveEntityWithHeading extends MethodPatcher {
return true;
}
else {
Transformer.die("Failed to find 3 uses of ALOAD 0 before inserted \"" + Ref.Hooks$getBlockPostBelowEntity + "\" in " + Ref.EntityLivingBase$moveEntityWithHeading_name);
Transformer.die("Failed to find 3 uses of ALOAD 0 before inserted \"" + Ref.Hooks$getBlockPostBelowEntity + "\" in " + Ref.EntityLivingBase$travel_name);
}
}
return false;
Expand Down Expand Up @@ -156,7 +156,7 @@ private class MoveEntityWithHeading extends MethodPatcher {
return true;
}
else {
Transformer.die("Failed to find 3 uses of ALOAD 0 before inserted \"" + Ref.Hooks$setPooledMutableBlockPosToBelowEntity + "\" in " + Ref.EntityLivingBase$moveEntityWithHeading_name);
Transformer.die("Failed to find 3 uses of ALOAD 0 before inserted \"" + Ref.Hooks$setPooledMutableBlockPosToBelowEntity + "\" in " + Ref.EntityLivingBase$travel_name);
}
}
return false;
Expand Down Expand Up @@ -253,7 +253,7 @@ private class MoveEntityWithHeading extends MethodPatcher {

@Override
protected boolean shouldPatchMethod(MethodNode methodNode) {
return Ref.EntityLivingBase$moveEntityWithHeading_name.is(methodNode);
return Ref.EntityLivingBase$travel_name.is(methodNode);
}
}
}

0 comments on commit e4f1e3e

Please sign in to comment.