Merge pull request #814 from Fallen-Breath/fix-745

Fixed #745 (Fake Players take no knockback)
This commit is contained in:
gnembon authored and GitHub committed 2021-04-16 11:50:02 -03:00
commit 0cd717023b
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",