Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-27 00:22:51 +01:00
Merge pull request #816 from creeper123123321/dev
Fix last pull request
Dieser Commit ist enthalten in:
Commit
5801cd1e0f
@ -198,13 +198,14 @@ public class InventoryPackets {
|
|||||||
|
|
||||||
public static void toClient(Item item) {
|
public static void toClient(Item item) {
|
||||||
if (item == null) return;
|
if (item == null) return;
|
||||||
int rawId = (item.getId() << 16 | item.getData() & 0xFFFF);
|
int rawId = (item.getId() << 4 | item.getData() & 0xF);
|
||||||
int originalId = rawId;
|
int originalId = (item.getId() << 16 | item.getData() & 0xFFFF);
|
||||||
// Save original id
|
// Save original id
|
||||||
CompoundTag tag = item.getTag();
|
CompoundTag tag = item.getTag();
|
||||||
if (tag == null) {
|
if (tag == null) {
|
||||||
item.setTag(tag = new CompoundTag("tag"));
|
item.setTag(tag = new CompoundTag("tag"));
|
||||||
}
|
}
|
||||||
|
item.getTag().put(new IntTag(NBT_TAG_NAME, originalId));
|
||||||
if (!MappingData.oldToNewItems.containsKey(rawId)) {
|
if (!MappingData.oldToNewItems.containsKey(rawId)) {
|
||||||
if (MappingData.oldToNewItems.containsKey(item.getId() << 4)) {
|
if (MappingData.oldToNewItems.containsKey(item.getId() << 4)) {
|
||||||
rawId = item.getId() << 4;
|
rawId = item.getId() << 4;
|
||||||
@ -231,7 +232,6 @@ public class InventoryPackets {
|
|||||||
// todo spawn egg
|
// todo spawn egg
|
||||||
item.setId(MappingData.oldToNewItems.get(rawId).shortValue());
|
item.setId(MappingData.oldToNewItems.get(rawId).shortValue());
|
||||||
item.setData((short) 0);
|
item.setData((short) 0);
|
||||||
item.getTag().put(new IntTag(NBT_TAG_NAME, originalId));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void toServer(Item item) {
|
public static void toServer(Item item) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren