Fixed #745
This commit is contained in:
2 files changed
+29
No files matched your search
@@ -0,0 +1,28 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import carpet.patches.EntityPlayerMPFake;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(PlayerEntity.class)
|
||||
public abstract class PlayerEntity_fakePlayersMixin
|
||||
{
|
||||
/**
|
||||
* To make sure player attacks are able to knockback fake players
|
||||
*/
|
||||
@Redirect(
|
||||
method = "attack",
|
||||
at = @At(
|
||||
value = "FIELD",
|
||||
target = "Lnet/minecraft/entity/Entity;velocityModified:Z",
|
||||
ordinal = 0
|
||||
)
|
||||
)
|
||||
private boolean velocityModifiedAndNotCarpetFakePlayer(Entity target)
|
||||
{
|
||||
return target.velocityModified && !(target instanceof EntityPlayerMPFake);
|
||||
}
|
||||
}
|
||||
@@ -61,6 +61,7 @@
|
||||
"Brain_Mixin",
|
||||
"Memory_scarpetMixin",
|
||||
|
||||
"PlayerEntity_fakePlayersMixin",
|
||||
"ServerWorld_fakePlayersMixin",
|
||||
"ThrownEnderpearlEntity_fakePlayersMixin",
|
||||
|
||||
|
||||
Reference in new issue
Block a user