Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MCPL and MCAuthLib #4645

Merged
merged 2 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@

package org.geysermc.geyser.inventory.item;

import it.unimi.dsi.fastutil.ints.Int2ObjectMaps;
import lombok.Getter;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.geysermc.mcprotocollib.protocol.data.game.item.component.PotionContents;

import java.util.Collections;
import java.util.Locale;

@Getter
Expand Down Expand Up @@ -88,7 +88,7 @@ public enum Potion {
}

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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,11 @@ public enum TippedArrowPotion {
this.javaColor = arrowParticleColor.getColor();
}

public static TippedArrowPotion of(int id) {
return VALUES[id];
public static @Nullable TippedArrowPotion of(int id) {
if (id >= 0 && id < VALUES.length) {
return VALUES[id];
}
return null;
}

public static @Nullable TippedArrowPotion getByBedrockId(int bedrockId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

package org.geysermc.geyser.item.type;

import it.unimi.dsi.fastutil.ints.Int2ObjectMaps;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.cloudburstmc.protocol.bedrock.data.inventory.ItemData;
import org.geysermc.geyser.inventory.GeyserItemStack;
Expand All @@ -36,6 +35,8 @@
import org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponentType;
import org.geysermc.mcprotocollib.protocol.data.game.item.component.PotionContents;

import java.util.Collections;

public class ArrowItem extends Item {
public ArrowItem(String javaIdentifier, Builder builder) {
super(javaIdentifier, builder);
Expand All @@ -47,7 +48,7 @@ public ArrowItem(String javaIdentifier, Builder builder) {
GeyserItemStack itemStack = super.translateToJava(itemData, mapping, mappings);
if (tippedArrowPotion != null) {
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);
}
return itemStack;
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ protocol = "3.0.0.Beta1-20240411.165033-129"
protocol-connection = "3.0.0.Beta1-20240411.165033-128"
raknet = "1.0.0.CR3-20240416.144209-1"
blockstateupdater="1.20.80-20240411.142413-1"
mcauthlib = "d9d773e"
mcprotocollib = "1234962" # Revert from jitpack after release
mcauthlib = "e5b0bcc"
mcprotocollib = "906da4a" # Revert from jitpack after release
adventure = "4.14.0"
adventure-platform = "4.3.0"
junit = "5.9.2"
Expand Down