mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-29 03:49:21 +00:00
Add Leaf Commands (WIP)
* Added Leaf Commands base * Added WIP /leaf reload * Added /leaf version * Change /gale permission to OP as default
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: TheFloodDragon <1610105206@qq.com>
|
||||
Date: Fri, 7 Feb 2025 18:41:55 +0800
|
||||
Subject: [PATCH] Hide specified item components
|
||||
|
||||
|
||||
diff --git a/net/minecraft/network/protocol/game/ClientboundContainerSetContentPacket.java b/net/minecraft/network/protocol/game/ClientboundContainerSetContentPacket.java
|
||||
index 828fbe03e7beb860cd0816c7ac8adbffe196533b..f602c4c55483a189f973929b982f1834ca7e9952 100644
|
||||
--- a/net/minecraft/network/protocol/game/ClientboundContainerSetContentPacket.java
|
||||
+++ b/net/minecraft/network/protocol/game/ClientboundContainerSetContentPacket.java
|
||||
@@ -53,8 +53,8 @@ public class ClientboundContainerSetContentPacket implements Packet<ClientGamePa
|
||||
private void write(RegistryFriendlyByteBuf buffer) {
|
||||
buffer.writeContainerId(this.containerId);
|
||||
buffer.writeVarInt(this.stateId);
|
||||
- ItemStack.OPTIONAL_LIST_STREAM_CODEC.encode(buffer, this.items);
|
||||
- ItemStack.OPTIONAL_STREAM_CODEC.encode(buffer, this.carriedItem);
|
||||
+ ItemStack.OPTIONAL_LIST_STREAM_CODEC.encode(buffer, org.dreeam.leaf.util.item.ItemStackStripper.strip(this.items, true)); // Leaf - Hide specified item components
|
||||
+ ItemStack.OPTIONAL_STREAM_CODEC.encode(buffer, org.dreeam.leaf.util.item.ItemStackStripper.strip(this.carriedItem, true)); // Leaf - Hide specified item components
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/net/minecraft/network/protocol/game/ClientboundContainerSetSlotPacket.java b/net/minecraft/network/protocol/game/ClientboundContainerSetSlotPacket.java
|
||||
index c1130f596cf3443eeb62eb1b12587172fe0859ee..18590e0b1d94ee3266637c5f3ab65ead4f8fb394 100644
|
||||
--- a/net/minecraft/network/protocol/game/ClientboundContainerSetSlotPacket.java
|
||||
+++ b/net/minecraft/network/protocol/game/ClientboundContainerSetSlotPacket.java
|
||||
@@ -33,7 +33,7 @@ public class ClientboundContainerSetSlotPacket implements Packet<ClientGamePacke
|
||||
buffer.writeContainerId(this.containerId);
|
||||
buffer.writeVarInt(this.stateId);
|
||||
buffer.writeShort(this.slot);
|
||||
- ItemStack.OPTIONAL_STREAM_CODEC.encode(buffer, this.itemStack);
|
||||
+ ItemStack.OPTIONAL_STREAM_CODEC.encode(buffer, org.dreeam.leaf.util.item.ItemStackStripper.strip(this.itemStack, true)); // Leaf - Hide specified item components
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/net/minecraft/world/inventory/AbstractContainerMenu.java b/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
index 3dcd8df0b395a8fed8bc0cbe0ff78f4ae0056fd3..6033f629ac457472ad10f8e346732a596aea52d9 100644
|
||||
--- a/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
+++ b/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
@@ -306,7 +306,7 @@ public abstract class AbstractContainerMenu {
|
||||
|
||||
private void synchronizeCarriedToRemote() {
|
||||
if (!this.suppressRemoteUpdates) {
|
||||
- if (!ItemStack.matches(this.getCarried(), this.remoteCarried)) {
|
||||
+ if (!org.dreeam.leaf.util.item.ItemStackStripper.matchesStripped(this.getCarried(), this.remoteCarried)) { // Leaf - Hide specified item components - Avoid some frequent client animations
|
||||
this.remoteCarried = this.getCarried().copy();
|
||||
if (this.synchronizer != null) {
|
||||
this.synchronizer.sendCarriedChange(this, this.remoteCarried);
|
||||
Reference in New Issue
Block a user