mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Use axolotl tempt tag to determine axolotl food
This commit is contained in:
parent
0ca77233ed
commit
44af9da01d
2 changed files with 8 additions and 1 deletions
|
@ -56,7 +56,7 @@ public class AxolotlEntity extends AnimalEntity {
|
|||
|
||||
@Override
|
||||
public boolean canEat(String javaIdentifierStripped, ItemMapping mapping) {
|
||||
return javaIdentifierStripped.equals("tropical_fish_bucket");
|
||||
return session.getTagCache().isAxolotlTemptItem(mapping);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -53,6 +53,7 @@ public class TagCache {
|
|||
private IntList requiresDiamondTool;
|
||||
|
||||
/* Items */
|
||||
private IntList axolotlTemptItems;
|
||||
private IntList flowers;
|
||||
private IntList foxFood;
|
||||
private IntList piglinLoved;
|
||||
|
@ -77,6 +78,7 @@ public class TagCache {
|
|||
this.requiresDiamondTool = IntList.of(blockTags.get("minecraft:needs_diamond_tool"));
|
||||
|
||||
Map<String, int[]> itemTags = packet.getTags().get("minecraft:item");
|
||||
this.axolotlTemptItems = IntList.of(itemTags.get("minecraft:axolotl_tempt_items"));
|
||||
this.flowers = IntList.of(itemTags.get("minecraft:flowers"));
|
||||
this.foxFood = IntList.of(itemTags.get("minecraft:fox_food"));
|
||||
this.piglinLoved = IntList.of(itemTags.get("minecraft:piglin_loved"));
|
||||
|
@ -102,11 +104,16 @@ public class TagCache {
|
|||
this.requiresIronTool = IntLists.emptyList();
|
||||
this.requiresDiamondTool = IntLists.emptyList();
|
||||
|
||||
this.axolotlTemptItems = IntLists.emptyList();
|
||||
this.flowers = IntLists.emptyList();
|
||||
this.foxFood = IntLists.emptyList();
|
||||
this.piglinLoved = IntLists.emptyList();
|
||||
}
|
||||
|
||||
public boolean isAxolotlTemptItem(ItemMapping itemMapping) {
|
||||
return axolotlTemptItems.contains(itemMapping.getJavaId());
|
||||
}
|
||||
|
||||
public boolean isFlower(ItemMapping mapping) {
|
||||
return flowers.contains(mapping.getJavaId());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue