Skip to content

Commit

Permalink
Fixed carpet fake player not responding to knockback from player mele…
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed Apr 15, 2021
1 parent 95ca1b3 commit 2615a67
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,7 @@ Rule [microTiming](#microTiming) is required to be true for dispatching these ev
- Added `/spawn tracking restart` for lazy man
- Cancelled player action pack (triggered by `/player` command) ticking during `/tick freeze`
- Added OP permission check to cheaty command `/player <someone> mount anything`
- Fixed carpet fake player not responding to knockback from player melee attack (https://github.com/gnembon/fabric-carpet/issues/745)

-----------

Expand Down
1 change: 1 addition & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,7 @@
- 添加 `/spawn tracking restart`
- 取消玩家动作包(由 `/player` 指令触发的 PlayerActionPack)在 `/tick freeze` 时的更新
- 为有作弊嫌疑的 `/player <someone> mount anything` 指令添加 OP 权限检查
- 修复地毯假人不响应玩家近战攻击的击退的bug(https://github.com/gnembon/fabric-carpet/issues/745)

-----------

Expand Down
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);
}
}
1 change: 1 addition & 0 deletions src/main/resources/carpet-tis-addition.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"compatibilityLevel": "JAVA_8",
"plugin": "carpettisaddition.CarpetTISAdditionMixinPlugin",
"mixins": [
"carpet.bugfixes.fakePlayerNoKnockBack.PlayerEntityMixin",
"carpet.commands.noPlayerMountAbuse.EntityPlayerActionPackMixin",
"carpet.commands.randomlyTriggerAction.EntityPlayerActionPackActionMixin",
"carpet.commands.randomlyTriggerAction.PlayerCommandMixin",
Expand Down

0 comments on commit 2615a67

Please sign in to comment.