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) {