-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed carpet fake player not responding to knockback from player mele…
…e attack See gnembon/fabric-carpet#745
- Loading branch information
1 parent
95ca1b3
commit 2615a67
Showing
4 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
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
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
25 changes: 25 additions & 0 deletions
25
...ava/carpettisaddition/mixins/carpet/bugfixes/fakePlayerNoKnockBack/PlayerEntityMixin.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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package carpettisaddition.mixins.carpet.bugfixes.fakePlayerNoKnockBack; | ||
|
||
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 PlayerEntityMixin | ||
{ | ||
@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); | ||
} | ||
} |
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