Update MCPL and MCAuthLib (#4645)

* Update MCPL and MCAuthLib

* Bump MCPL
This commit is contained in:
AJ Ferguson 2024-05-06 21:40:32 -04:00 committed by GitHub
parent 8addcadb71
commit 0a261f1d9d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 12 additions and 8 deletions

View file

@ -25,11 +25,11 @@
package org.geysermc.geyser.inventory.item; package org.geysermc.geyser.inventory.item;
import it.unimi.dsi.fastutil.ints.Int2ObjectMaps;
import lombok.Getter; import lombok.Getter;
import org.checkerframework.checker.nullness.qual.Nullable; import org.checkerframework.checker.nullness.qual.Nullable;
import org.geysermc.mcprotocollib.protocol.data.game.item.component.PotionContents; import org.geysermc.mcprotocollib.protocol.data.game.item.component.PotionContents;
import java.util.Collections;
import java.util.Locale; import java.util.Locale;
@Getter @Getter
@ -88,7 +88,7 @@ public enum Potion {
} }
public PotionContents toComponent() { public PotionContents toComponent() {
return new PotionContents(this.ordinal(), -1, Int2ObjectMaps.emptyMap()); return new PotionContents(this.ordinal(), -1, Collections.emptyList());
} }
public static @Nullable Potion getByJavaId(int javaId) { public static @Nullable Potion getByJavaId(int javaId) {

View file

@ -95,8 +95,11 @@ public enum TippedArrowPotion {
this.javaColor = arrowParticleColor.getColor(); this.javaColor = arrowParticleColor.getColor();
} }
public static TippedArrowPotion of(int id) { public static @Nullable TippedArrowPotion of(int id) {
return VALUES[id]; if (id >= 0 && id < VALUES.length) {
return VALUES[id];
}
return null;
} }
public static @Nullable TippedArrowPotion getByBedrockId(int bedrockId) { public static @Nullable TippedArrowPotion getByBedrockId(int bedrockId) {

View file

@ -25,7 +25,6 @@
package org.geysermc.geyser.item.type; package org.geysermc.geyser.item.type;
import it.unimi.dsi.fastutil.ints.Int2ObjectMaps;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import org.cloudburstmc.protocol.bedrock.data.inventory.ItemData; import org.cloudburstmc.protocol.bedrock.data.inventory.ItemData;
import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.inventory.GeyserItemStack;
@ -36,6 +35,8 @@ import org.geysermc.geyser.registry.type.ItemMappings;
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.PotionContents; import org.geysermc.mcprotocollib.protocol.data.game.item.component.PotionContents;
import java.util.Collections;
public class ArrowItem extends Item { public class ArrowItem extends Item {
public ArrowItem(String javaIdentifier, Builder builder) { public ArrowItem(String javaIdentifier, Builder builder) {
super(javaIdentifier, builder); super(javaIdentifier, builder);
@ -47,7 +48,7 @@ public class ArrowItem extends Item {
GeyserItemStack itemStack = super.translateToJava(itemData, mapping, mappings); GeyserItemStack itemStack = super.translateToJava(itemData, mapping, mappings);
if (tippedArrowPotion != null) { if (tippedArrowPotion != null) {
itemStack = Items.TIPPED_ARROW.newItemStack(itemStack.getAmount(), itemStack.getComponents()); itemStack = Items.TIPPED_ARROW.newItemStack(itemStack.getAmount(), itemStack.getComponents());
PotionContents contents = new PotionContents(tippedArrowPotion.ordinal(), -1, Int2ObjectMaps.emptyMap()); PotionContents contents = new PotionContents(tippedArrowPotion.ordinal(), -1, Collections.emptyList());
itemStack.getOrCreateComponents().put(DataComponentType.POTION_CONTENTS, contents); itemStack.getOrCreateComponents().put(DataComponentType.POTION_CONTENTS, contents);
} }
return itemStack; return itemStack;

View file

@ -14,8 +14,8 @@ protocol = "3.0.0.Beta1-20240411.165033-129"
protocol-connection = "3.0.0.Beta1-20240411.165033-128" protocol-connection = "3.0.0.Beta1-20240411.165033-128"
raknet = "1.0.0.CR3-20240416.144209-1" raknet = "1.0.0.CR3-20240416.144209-1"
blockstateupdater="1.20.80-20240411.142413-1" blockstateupdater="1.20.80-20240411.142413-1"
mcauthlib = "d9d773e" mcauthlib = "e5b0bcc"
mcprotocollib = "1234962" # Revert from jitpack after release mcprotocollib = "42ea4a4" # Revert from jitpack after release
adventure = "4.14.0" adventure = "4.14.0"
adventure-platform = "4.3.0" adventure-platform = "4.3.0"
junit = "5.9.2" junit = "5.9.2"