-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
751405e
commit b253cca
Showing
3 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
src/main/java/dev/cammiescorner/arcanuscontinuum/mixin/common/AbstractArrowMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,19 @@ | ||
package dev.cammiescorner.arcanuscontinuum.mixin.common; | ||
|
||
import com.llamalad7.mixinextras.injector.wrapoperation.Operation; | ||
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; | ||
import net.minecraft.world.entity.projectile.AbstractArrow; | ||
import net.minecraft.world.phys.Vec3; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
|
||
@Mixin(AbstractArrow.class) | ||
public class AbstractArrowMixin { | ||
@WrapOperation(method = "tick", at = @At( | ||
value = "INVOKE", | ||
target = "Lnet/minecraft/world/entity/projectile/AbstractArrow;getDeltaMovement()Lnet/minecraft/world/phys/Vec3;" | ||
)) | ||
private Vec3 pleaseWork(AbstractArrow instance, Operation<Vec3> original) { | ||
return original.call(instance).scale(0.5); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
src/main/java/dev/cammiescorner/arcanuscontinuum/mixin/common/EntityMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,45 @@ | ||
package dev.cammiescorner.arcanuscontinuum.mixin.common; | ||
|
||
import net.minecraft.world.entity.Entity; | ||
import net.minecraft.world.phys.Vec3; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.ModifyVariable; | ||
|
||
@Mixin(Entity.class) | ||
public class EntityMixin { | ||
@Shadow private Vec3 deltaMovement; | ||
private Entity self = (Entity) (Object) this; | ||
|
||
@ModifyVariable(method = "move", at = @At("HEAD"), argsOnly = true) | ||
private Vec3 modifyMotion(Vec3 value) { | ||
return value.scale(0.5); | ||
} | ||
|
||
// @WrapOperation(method = "saveWithoutId", at = @At( | ||
// value = "INVOKE", | ||
// target = "Lnet/minecraft/world/entity/Entity;getDeltaMovement()Lnet/minecraft/world/phys/Vec3;" | ||
// )) | ||
// private Vec3 saveDeltaMovementField(Entity instance, Operation<Vec3> original) { | ||
// return deltaMovement; | ||
// } | ||
// | ||
// @ModifyReturnValue(method = "isNoGravity", at = @At("RETURN")) | ||
// private boolean noGrav(boolean original) { | ||
// return !(self instanceof Player); | ||
// } | ||
// | ||
// @ModifyReturnValue(method = "getDeltaMovement", at = @At("RETURN")) | ||
// private Vec3 slowMovement(Vec3 original) { | ||
// return self instanceof Player ? original : original.scale(0.5); | ||
// } | ||
// | ||
// @WrapOperation(method = "addDeltaMovement", at = @At( | ||
// value = "INVOKE", | ||
// target = "Lnet/minecraft/world/entity/Entity;getDeltaMovement()Lnet/minecraft/world/phys/Vec3;" | ||
// )) | ||
// private Vec3 painPainPain(Entity instance, Operation<Vec3> original) { | ||
// return deltaMovement; | ||
// } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters