mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-12-31 16:41:02 +01:00
Revert a change, ensure that gathering all components works and doesn't throw due to duplicate keys
This commit is contained in:
parent
06a9b2866e
commit
8779eab5e5
2 changed files with 4 additions and 12 deletions
|
@ -128,11 +128,7 @@ public class WolfEntity extends TameableEntity {
|
||||||
public void setBody(ItemStack stack) {
|
public void setBody(ItemStack stack) {
|
||||||
super.setBody(stack);
|
super.setBody(stack);
|
||||||
isCurseOfBinding = ItemUtils.hasEffect(session, stack, EnchantmentComponent.PREVENT_ARMOR_CHANGE);
|
isCurseOfBinding = ItemUtils.hasEffect(session, stack, EnchantmentComponent.PREVENT_ARMOR_CHANGE);
|
||||||
if (stack != null && stack.getDataComponents() != null) {
|
repairableItems = GeyserItemStack.from(stack).getComponent(DataComponentType.REPAIRABLE);
|
||||||
repairableItems = stack.getDataComponents().get(DataComponentType.REPAIRABLE);
|
|
||||||
} else {
|
|
||||||
repairableItems = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -49,7 +49,6 @@ import org.geysermc.geyser.text.MinecraftLocale;
|
||||||
import org.geysermc.geyser.translator.item.BedrockItemBuilder;
|
import org.geysermc.geyser.translator.item.BedrockItemBuilder;
|
||||||
import org.geysermc.geyser.translator.text.MessageTranslator;
|
import org.geysermc.geyser.translator.text.MessageTranslator;
|
||||||
import org.geysermc.geyser.util.MinecraftKey;
|
import org.geysermc.geyser.util.MinecraftKey;
|
||||||
import org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponent;
|
|
||||||
import org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponentType;
|
import org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponentType;
|
||||||
import org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents;
|
import org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents;
|
||||||
import org.geysermc.mcprotocollib.protocol.data.game.item.component.DyedItemColor;
|
import org.geysermc.mcprotocollib.protocol.data.game.item.component.DyedItemColor;
|
||||||
|
@ -111,12 +110,9 @@ public class Item {
|
||||||
return baseComponents;
|
return baseComponents;
|
||||||
}
|
}
|
||||||
|
|
||||||
//noinspection UnstableApiUsage
|
DataComponents components = baseComponents.clone();
|
||||||
var builder = ImmutableMap.<DataComponentType<?>, DataComponent<?, ?>>builderWithExpectedSize(
|
components.getDataComponents().putAll(others.getDataComponents());
|
||||||
baseComponents.getDataComponents().size() + others.getDataComponents().size());
|
return new DataComponents(ImmutableMap.copyOf(components.getDataComponents()));
|
||||||
builder.putAll(baseComponents.getDataComponents());
|
|
||||||
builder.putAll(others.getDataComponents());
|
|
||||||
return new DataComponents(builder.build());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
|
Loading…
Reference in a new issue