This commit is contained in:
Fallen_Breath committed 2021-04-16 11:06:40 +08:00
1 parent 14263203c5
commit 0f051cb4f7
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);
}
}
+1
View File
@@ -61,6 +61,7 @@
"Brain_Mixin",
"Memory_scarpetMixin",
"PlayerEntity_fakePlayersMixin",
"ServerWorld_fakePlayersMixin",
"ThrownEnderpearlEntity_fakePlayersMixin",