Skip to content

Commit

Permalink
Merge branch 'feature-multi' into nyan-work/dev
Browse files Browse the repository at this point in the history
Signed-off-by: Hendrix-Shen <[email protected]>
  • Loading branch information
Hendrix-Shen committed Jul 30, 2023
2 parents ce1635c + 0d9cc16 commit 56ccc7d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ English | [中文](./README_ZH_CN.md)

❗Before reporting a problem, be sure to try the latest [beta version](https://github.com/Nyan-Work/plusls-carpet-addition/releases) to check if the problem still exists.

📌If you only want the PCA sync protocol and are not interested in other features, I recommend the lightweight [pca-protocol](https://github.com/Fallen-Breath/pca-protocol).

This is a [Carpet mod](https://github.com/gnembon/fabric-carpet) extension mod, a collection of carpet mod style useful tools and interesting features.

Operation command: `/pca`
Expand Down
2 changes: 2 additions & 0 deletions README_ZH_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

❗在报告问题前,请务必尝试最新[测试版](https://github.com/Nyan-Work/plusls-carpet-addition/releases),检查问题是否依然存在。

📌如果你只想要 PCA同步协议 而对其他功能不感兴趣,我推荐你使用轻量化的 [pca-protocol](https://github.com/Fallen-Breath/pca-protocol).

这是一个 [Carpet mod](https://github.com/gnembon/fabric-carpet) (fabric-carpet) 的扩展 mod,包含了不少~~NotVanilla的~~有意思的功能以及特性。

管理命令: `/pca`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@
import net.minecraft.Util;
import net.minecraft.core.BlockPos;
import net.minecraft.network.protocol.game.ClientboundSetEntityDataPacket;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.server.network.ServerGamePacketListenerImpl;
import net.minecraft.world.entity.decoration.ArmorStand;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level;
import org.spongepowered.asm.mixin.Intrinsic;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.*;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import top.hendrixshen.magiclib.util.MessageUtil;

//#if MC > 11802 && MC < 11903
//$$ import net.minecraft.world.entity.player.ProfilePublicKey;
Expand Down Expand Up @@ -46,6 +45,7 @@ public MixinServerPlayer(Level level, BlockPos blockPos, float f, GameProfile ga

@Shadow
public ServerGamePacketListenerImpl connection;
@Shadow @Final public MinecraftServer server;
@Unique
private int pca$sneakTimes = 0;
@Unique
Expand All @@ -70,7 +70,8 @@ public void setShiftKeyDown(boolean sneaking) {
cancellable = true
)
private void customSetShiftKeyDownCheck(boolean sneaking, CallbackInfo ci) {
if (!PluslsCarpetAdditionSettings.playerSit) {
// Not handled when sneak state doesn't change
if (!PluslsCarpetAdditionSettings.playerSit || (sneaking && this.isShiftKeyDown())) {
return;
}

Expand Down

0 comments on commit 56ccc7d

Please sign in to comment.