mirror of
https://github.com/GeyserMC/Geyser.git
synced 2026-01-03 22:16:31 +00:00
Fix tags and attributes
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user