Add missing NMS commit

This commit is contained in:
fullwall 2024-03-03 23:15:50 +08:00
parent ed117eac96
commit 143e642802
2 changed files with 16 additions and 1 deletions

View File

@ -663,6 +663,10 @@ public class NMS {
return BRIDGE.isOnGround(entity);
}
public static boolean isSneaking(Entity entity) {
return BRIDGE.isSneaking(entity);
}
public static boolean isSolid(Block in) {
return BRIDGE.isSolid(in);
}

View File

@ -128,6 +128,13 @@ public interface NMSBridge {
public boolean isOnGround(Entity entity);
public default boolean isSneaking(Entity entity) {
if (entity instanceof Player) {
return ((Player) entity).isSneaking();
}
return false;
}
public boolean isSolid(Block in);
public boolean isValid(Entity entity);
@ -244,7 +251,11 @@ public interface NMSBridge {
public void setSitting(Tameable tameable, boolean sitting);
public void setSneaking(Entity entity, boolean sneaking);
public default void setSneaking(Entity entity, boolean sneaking) {
if (entity instanceof Player) {
((Player) entity).setSneaking(sneaking);
}
}
public default void setSnifferState(Entity entity, SnifferState state) {
}