暂时回滚mixin写法
This commit is contained in:
parent
bec488777b
commit
e35c7ff530
1 changed files with 3 additions and 13 deletions
|
@ -1,11 +1,7 @@
|
|||
package com.atsuishio.superbwarfare.mixins;
|
||||
|
||||
import com.atsuishio.superbwarfare.entity.projectile.FastProjectile;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.network.protocol.game.ClientboundSetEntityMotionPacket;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
@ -47,15 +43,9 @@ public class ClientboundSetEntityMotionPacketMixin {
|
|||
// TODO 实现仅对 FastProjectile 对象的动量修改
|
||||
@Inject(method = "<init>(ILnet/minecraft/world/phys/Vec3;)V", at = @At(value = "RETURN"))
|
||||
public void init(int entityId, Vec3 motion, CallbackInfo ci) {
|
||||
ClientLevel level = Minecraft.getInstance().level;
|
||||
if (level != null) {
|
||||
Entity entity = level.getEntity(entityId);
|
||||
if (entity instanceof FastProjectile) {
|
||||
this.xa = (int) (motion.x * 8000.0D);
|
||||
this.ya = (int) (motion.y * 8000.0D);
|
||||
this.za = (int) (motion.z * 8000.0D);
|
||||
}
|
||||
}
|
||||
this.xa = (int) (motion.x * 8000.0D);
|
||||
this.ya = (int) (motion.y * 8000.0D);
|
||||
this.za = (int) (motion.z * 8000.0D);
|
||||
}
|
||||
|
||||
@Redirect(method = "<init>(Lnet/minecraft/network/FriendlyByteBuf;)V",
|
||||
|
|
Loading…
Add table
Reference in a new issue