Fix tags and attributes

This commit is contained in:
basaigh 2024-04-21 01:33:07 +01:00 committed by Camotoy
parent aed7f1bed7
commit 94e533ea7c
No known key found for this signature in database
GPG key ID: 7EEFB66FE798081F
5 changed files with 9 additions and 9 deletions

View file

@ -299,7 +299,7 @@ public class LivingEntity extends Entity {
case GENERIC_MOVEMENT_SPEED -> newAttributes.add(calculateAttribute(javaAttribute, GeyserAttributeType.MOVEMENT_SPEED));
case GENERIC_FOLLOW_RANGE -> newAttributes.add(calculateAttribute(javaAttribute, GeyserAttributeType.FOLLOW_RANGE));
case GENERIC_KNOCKBACK_RESISTANCE -> newAttributes.add(calculateAttribute(javaAttribute, GeyserAttributeType.KNOCKBACK_RESISTANCE));
case HORSE_JUMP_STRENGTH -> newAttributes.add(calculateAttribute(javaAttribute, GeyserAttributeType.HORSE_JUMP_STRENGTH));
case GENERIC_JUMP_STRENGTH -> newAttributes.add(calculateAttribute(javaAttribute, GeyserAttributeType.HORSE_JUMP_STRENGTH));
}
}
}

View file

@ -61,7 +61,7 @@ public class AxolotlEntity extends AnimalEntity {
@Override
public boolean canEat(Item item) {
return session.getTagCache().isAxolotlTemptItem(item);
return session.getTagCache().isAxolotlFood(item);
}
@Override

View file

@ -368,7 +368,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
/**
* All dimensions that the client could possibly connect to.
*/
private final Map<String, JavaDimension> dimensions = new Object2ObjectOpenHashMap<>(3);
private final Int2ObjectMap<JavaDimension> dimensions = new Int2ObjectOpenHashMap<>(4);
private final Int2ObjectMap<TextDecoration> chatTypes = new Int2ObjectOpenHashMap<>(7);

View file

@ -58,7 +58,7 @@ public class TagCache {
private IntList requiresDiamondTool;
/* Items */
private IntList axolotlTemptItems;
private IntList axolotlFood;
private IntList creeperIgniters;
private IntList fishes;
private IntList flowers;
@ -96,7 +96,7 @@ public class TagCache {
}
Map<String, int[]> itemTags = packet.getTags().get("minecraft:item");
this.axolotlTemptItems = IntList.of(itemTags.get("minecraft:axolotl_tempt_items"));
this.axolotlFood = IntList.of(itemTags.get("minecraft:axolotl_food"));
this.creeperIgniters = load(itemTags.get("minecraft:creeper_igniters"));
this.fishes = IntList.of(itemTags.get("minecraft:fishes"));
this.flowers = IntList.of(itemTags.get("minecraft:flowers"));
@ -133,7 +133,7 @@ public class TagCache {
this.requiresIronTool = IntLists.emptyList();
this.requiresDiamondTool = IntLists.emptyList();
this.axolotlTemptItems = IntLists.emptyList();
this.axolotlFood = IntLists.emptyList();
this.creeperIgniters = IntLists.emptyList();
this.fishes = IntLists.emptyList();
this.flowers = IntLists.emptyList();
@ -143,8 +143,8 @@ public class TagCache {
this.snifferFood = IntLists.emptyList();
}
public boolean isAxolotlTemptItem(Item item) {
return axolotlTemptItems.contains(item.javaId());
public boolean isAxolotlFood(Item item) {
return axolotlFood.contains(item.javaId());
}
public boolean isCreeperIgniter(Item item) {

View file

@ -15,7 +15,7 @@ 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 = "b2e93c520a" # Revert from jitpack after release
mcprotocollib = "897eb241b6" # Revert from jitpack after release
adventure = "4.14.0"
adventure-platform = "4.3.0"
junit = "5.9.2"