Make mapped entity names configurable

This commit is contained in:
Nassim Jahnke 2021-11-13 11:06:59 +01:00
parent 95bc340b06
commit becba6498e
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
25 changed files with 171 additions and 57 deletions

View File

@ -36,6 +36,7 @@ public class BackwardsMappings extends MappingDataBase {
private final Class<? extends Protocol> vvProtocolClass;
private Int2ObjectMap<MappedItem> backwardsItemMappings;
private Map<String, String> backwardsSoundMappings;
private Map<String, String> entityNames;
public BackwardsMappings(String oldVersion, String newVersion, @Nullable Class<? extends Protocol> vvProtocolClass) {
this(oldVersion, newVersion, vvProtocolClass, false);
@ -60,7 +61,12 @@ public class BackwardsMappings extends MappingDataBase {
JsonObject diffSounds = diffMappings.getAsJsonObject("sounds");
if (diffSounds != null) {
backwardsSoundMappings = VBMappingDataLoader.objectToMap(diffSounds);
backwardsSoundMappings = VBMappingDataLoader.objectToNamespacedMap(diffSounds);
}
JsonObject diffEntityNames = diffMappings.getAsJsonObject("entitynames");
if (diffEntityNames != null) {
entityNames = VBMappingDataLoader.objectToMap(diffEntityNames);
}
}
@ -145,6 +151,10 @@ public class BackwardsMappings extends MappingDataBase {
return backwardsSoundMappings.get(id);
}
public @Nullable String mappedEntityName(String entityName) {
return entityNames.get(entityName);
}
public @Nullable Int2ObjectMap<MappedItem> getBackwardsItemMappings() {
return backwardsItemMappings;
}

View File

@ -73,7 +73,7 @@ public class VBMappingDataLoader {
}
public static void mapIdentifiers(int[] output, JsonObject oldIdentifiers, JsonObject newIdentifiers, JsonObject diffIdentifiers, boolean warnOnMissing) {
Object2IntMap newIdentifierMap = MappingDataLoader.indexedObjectToMap(newIdentifiers);
Object2IntMap<String> newIdentifierMap = MappingDataLoader.indexedObjectToMap(newIdentifiers);
for (Map.Entry<String, JsonElement> entry : oldIdentifiers.entrySet()) {
String key = entry.getValue().getAsString();
int mappedId = newIdentifierMap.getInt(key);
@ -113,8 +113,8 @@ public class VBMappingDataLoader {
}
}
public static Map<String, String> objectToMap(JsonObject object) {
Map<String, String> mappings = new HashMap<>();
public static Map<String, String> objectToNamespacedMap(JsonObject object) {
Map<String, String> mappings = new HashMap<>(object.size());
for (Map.Entry<String, JsonElement> entry : object.entrySet()) {
String key = entry.getKey();
if (key.indexOf(':') == -1) {
@ -129,6 +129,14 @@ public class VBMappingDataLoader {
return mappings;
}
public static Map<String, String> objectToMap(JsonObject object) {
Map<String, String> mappings = new HashMap<>(object.size());
for (Map.Entry<String, JsonElement> entry : object.entrySet()) {
mappings.put(entry.getKey(), entry.getValue().getAsString());
}
return mappings;
}
public static Int2ObjectMap<MappedItem> loadItemMappings(JsonObject oldMapping, JsonObject newMapping, JsonObject diffMapping) {
return loadItemMappings(oldMapping, newMapping, diffMapping, false);
}

View File

@ -18,27 +18,40 @@
package com.viaversion.viabackwards.api.entities.storage;
import com.viaversion.viabackwards.ViaBackwards;
import com.viaversion.viabackwards.api.BackwardsProtocol;
import com.viaversion.viaversion.api.minecraft.entities.EntityType;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.ChatRewriter;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.Locale;
public class EntityData {
private final BackwardsProtocol<?, ?, ?, ?> protocol;
private final int id;
private final int replacementId;
private Object mobName;
private final String key;
private NameVisibility nameVisibility = NameVisibility.NONE;
private MetaCreator defaultMeta;
public EntityData(int id, int replacementId) {
this.id = id;
this.replacementId = replacementId;
public EntityData(BackwardsProtocol<?, ?, ?, ?> protocol, EntityType type, int replacementId) {
this(protocol, type.name(), type.getId(), replacementId);
}
public EntityData jsonName(String name) {
this.mobName = ChatRewriter.legacyTextToJson(name);
public EntityData(BackwardsProtocol<?, ?, ?, ?> protocol, String key, int id, int replacementId) {
this.protocol = protocol;
this.id = id;
this.replacementId = replacementId;
this.key = key.toLowerCase(Locale.ROOT);
}
public EntityData jsonName() {
this.nameVisibility = NameVisibility.JSON;
return this;
}
public EntityData mobName(String name) {
this.mobName = name;
public EntityData plainName() {
this.nameVisibility = NameVisibility.PLAIN;
return this;
}
@ -59,7 +72,16 @@ public class EntityData {
* @return custom mobname, can be either a String or a JsonElement
*/
public @Nullable Object mobName() {
return mobName;
if (nameVisibility == NameVisibility.NONE) {
return null;
}
String name = protocol.getMappingData().mappedEntityName(key);
if (name == null) {
ViaBackwards.getPlatform().getLogger().warning("Entity name for " + key + " not found in protocol " + protocol.getClass().getSimpleName());
name = key;
}
return nameVisibility == NameVisibility.JSON ? ChatRewriter.legacyTextToJson(name) : name;
}
public int replacementId() {
@ -82,7 +104,7 @@ public class EntityData {
public String toString() {
return "EntityData{" +
"id=" + id +
", mobName='" + mobName + '\'' +
", mobName='" + key + '\'' +
", replacementId=" + replacementId +
", defaultMeta=" + defaultMeta +
'}';
@ -93,4 +115,10 @@ public class EntityData {
void createMeta(WrappedMetadata storage);
}
private enum NameVisibility {
PLAIN,
JSON,
NONE
}
}

View File

@ -17,19 +17,19 @@
*/
package com.viaversion.viabackwards.api.entities.storage;
import com.viaversion.viabackwards.api.BackwardsProtocol;
public class EntityObjectData extends EntityData {
private final boolean isObject;
private final int objectData;
public EntityObjectData(int id, boolean isObject, int replacementId, int objectData) {
super(id, replacementId);
this.isObject = isObject;
public EntityObjectData(BackwardsProtocol<?, ?, ?, ?> protocol, String key, int id, int replacementId, int objectData) {
super(protocol, key, id, replacementId);
this.objectData = objectData;
}
@Override
public boolean isObjectType() {
return isObject;
return true;
}
@Override

View File

@ -131,7 +131,7 @@ public abstract class EntityRewriterBase<T extends BackwardsProtocol> extends En
// Already rewrite the id here
int mappedReplacementId = newEntityId(mappedType.getId());
EntityData data = new EntityData(type.getId(), mappedReplacementId);
EntityData data = new EntityData(protocol, type, mappedReplacementId);
mapEntityType(type.getId(), mappedReplacementId);
entityDataMappings.put(type.getId(), data);
return data;

View File

@ -52,7 +52,7 @@ public abstract class LegacyEntityRewriter<T extends BackwardsProtocol> extends
}
protected EntityObjectData mapObjectType(ObjectType oldObjectType, ObjectType replacement, int data) {
EntityObjectData entData = new EntityObjectData(oldObjectType.getId(), true, replacement.getId(), data);
EntityObjectData entData = new EntityObjectData(protocol, oldObjectType.getType().name(), oldObjectType.getId(), replacement.getId(), data);
objectTypes.put(oldObjectType, entData);
return entData;
}

View File

@ -215,10 +215,10 @@ public class EntityPackets1_11 extends LegacyEntityRewriter<Protocol1_10To1_11>
// Guardian
mapEntityTypeWithData(Entity1_11Types.EntityType.ELDER_GUARDIAN, Entity1_11Types.EntityType.GUARDIAN);
// Skeletons
mapEntityTypeWithData(Entity1_11Types.EntityType.WITHER_SKELETON, Entity1_11Types.EntityType.SKELETON).mobName("Wither Skeleton").spawnMetadata(storage -> storage.add(getSkeletonTypeMeta(1)));
mapEntityTypeWithData(Entity1_11Types.EntityType.STRAY, Entity1_11Types.EntityType.SKELETON).mobName("Stray").spawnMetadata(storage -> storage.add(getSkeletonTypeMeta(2)));
mapEntityTypeWithData(Entity1_11Types.EntityType.WITHER_SKELETON, Entity1_11Types.EntityType.SKELETON).plainName().spawnMetadata(storage -> storage.add(getSkeletonTypeMeta(1)));
mapEntityTypeWithData(Entity1_11Types.EntityType.STRAY, Entity1_11Types.EntityType.SKELETON).plainName().spawnMetadata(storage -> storage.add(getSkeletonTypeMeta(2)));
// Zombies
mapEntityTypeWithData(Entity1_11Types.EntityType.HUSK, Entity1_11Types.EntityType.ZOMBIE).mobName("Husk").spawnMetadata(storage -> handleZombieType(storage, 6));
mapEntityTypeWithData(Entity1_11Types.EntityType.HUSK, Entity1_11Types.EntityType.ZOMBIE).plainName().spawnMetadata(storage -> handleZombieType(storage, 6));
mapEntityTypeWithData(Entity1_11Types.EntityType.ZOMBIE_VILLAGER, Entity1_11Types.EntityType.ZOMBIE).spawnMetadata(storage -> handleZombieType(storage, 1));
// Horses
mapEntityTypeWithData(Entity1_11Types.EntityType.HORSE, Entity1_11Types.EntityType.HORSE).spawnMetadata(storage -> storage.add(getHorseMetaType(0))); // Nob able to ride the horse without having the MetaType sent.
@ -228,10 +228,10 @@ public class EntityPackets1_11 extends LegacyEntityRewriter<Protocol1_10To1_11>
mapEntityTypeWithData(Entity1_11Types.EntityType.ZOMBIE_HORSE, Entity1_11Types.EntityType.HORSE).spawnMetadata(storage -> storage.add(getHorseMetaType(3)));
// New mobs
mapEntityTypeWithData(Entity1_11Types.EntityType.EVOCATION_FANGS, Entity1_11Types.EntityType.SHULKER);
mapEntityTypeWithData(Entity1_11Types.EntityType.EVOCATION_ILLAGER, Entity1_11Types.EntityType.VILLAGER).mobName("Evoker");
mapEntityTypeWithData(Entity1_11Types.EntityType.VEX, Entity1_11Types.EntityType.BAT).mobName("Vex");
mapEntityTypeWithData(Entity1_11Types.EntityType.VINDICATION_ILLAGER, Entity1_11Types.EntityType.VILLAGER).mobName("Vindicator").spawnMetadata(storage -> storage.add(new Metadata(13, MetaType1_9.VarInt, 4))); // Base Profession
mapEntityTypeWithData(Entity1_11Types.EntityType.LIAMA, Entity1_11Types.EntityType.HORSE).mobName("Llama").spawnMetadata(storage -> storage.add(getHorseMetaType(1)));
mapEntityTypeWithData(Entity1_11Types.EntityType.EVOCATION_ILLAGER, Entity1_11Types.EntityType.VILLAGER).plainName();
mapEntityTypeWithData(Entity1_11Types.EntityType.VEX, Entity1_11Types.EntityType.BAT).plainName();
mapEntityTypeWithData(Entity1_11Types.EntityType.VINDICATION_ILLAGER, Entity1_11Types.EntityType.VILLAGER).plainName().spawnMetadata(storage -> storage.add(new Metadata(13, MetaType1_9.VarInt, 4))); // Base Profession
mapEntityTypeWithData(Entity1_11Types.EntityType.LIAMA, Entity1_11Types.EntityType.HORSE).plainName().spawnMetadata(storage -> storage.add(getHorseMetaType(1)));
mapEntityTypeWithData(Entity1_11Types.EntityType.LIAMA_SPIT, Entity1_11Types.EntityType.SNOWBALL);
mapObjectType(Entity1_11Types.ObjectType.LIAMA_SPIT, Entity1_11Types.ObjectType.SNOWBALL, -1);

View File

@ -19,6 +19,7 @@
package com.viaversion.viabackwards.protocol.protocol1_11_1to1_12;
import com.viaversion.viabackwards.api.BackwardsProtocol;
import com.viaversion.viabackwards.api.data.BackwardsMappings;
import com.viaversion.viabackwards.protocol.protocol1_11_1to1_12.data.ShoulderTracker;
import com.viaversion.viabackwards.protocol.protocol1_11_1to1_12.packets.BlockItemPackets1_12;
import com.viaversion.viabackwards.protocol.protocol1_11_1to1_12.packets.ChatPackets1_12;
@ -39,6 +40,12 @@ import com.viaversion.viaversion.protocols.protocol1_9to1_8.Protocol1_9To1_8;
public class Protocol1_11_1To1_12 extends BackwardsProtocol<ClientboundPackets1_12, ClientboundPackets1_9_3, ServerboundPackets1_12, ServerboundPackets1_9_3> {
private static final BackwardsMappings MAPPINGS = new BackwardsMappings("1.12", "1.11", null, true) {
@Override
protected boolean shouldWarnOnMissing(final String key) {
return super.shouldWarnOnMissing(key) && !key.equals("sounds");
}
};
private final EntityPackets1_12 entityPackets = new EntityPackets1_12(this);
private final BlockItemPackets1_12 blockItemPackets = new BlockItemPackets1_12(this);
@ -83,6 +90,11 @@ public class Protocol1_11_1To1_12 extends BackwardsProtocol<ClientboundPackets1_
user.put(new ShoulderTracker(user));
}
@Override
public BackwardsMappings getMappingData() {
return MAPPINGS;
}
@Override
public EntityPackets1_12 getEntityRewriter() {
return entityPackets;
@ -92,4 +104,9 @@ public class Protocol1_11_1To1_12 extends BackwardsProtocol<ClientboundPackets1_
public BlockItemPackets1_12 getItemRewriter() {
return blockItemPackets;
}
@Override
public boolean hasMappingDataToLoad() {
return true;
}
}

View File

@ -212,8 +212,8 @@ public class EntityPackets1_12 extends LegacyEntityRewriter<Protocol1_11_1To1_12
@Override
protected void registerRewrites() {
mapEntityTypeWithData(Entity1_12Types.EntityType.PARROT, Entity1_12Types.EntityType.BAT).mobName("Parrot").spawnMetadata(storage -> storage.add(new Metadata(12, MetaType1_12.Byte, (byte) 0x00)));
mapEntityTypeWithData(Entity1_12Types.EntityType.ILLUSION_ILLAGER, Entity1_12Types.EntityType.EVOCATION_ILLAGER).mobName("Illusioner");
mapEntityTypeWithData(Entity1_12Types.EntityType.PARROT, Entity1_12Types.EntityType.BAT).plainName().spawnMetadata(storage -> storage.add(new Metadata(12, MetaType1_12.Byte, (byte) 0x00)));
mapEntityTypeWithData(Entity1_12Types.EntityType.ILLUSION_ILLAGER, Entity1_12Types.EntityType.EVOCATION_ILLAGER).plainName();
// Handle Illager
filter().filterFamily(Entity1_12Types.EntityType.EVOCATION_ILLAGER).cancel(12);

View File

@ -281,25 +281,25 @@ public class EntityPackets1_13 extends LegacyEntityRewriter<Protocol1_12_2To1_13
@Override
protected void registerRewrites() {
// Rewrite new Entity 'drowned'
mapEntityTypeWithData(Entity1_13Types.EntityType.DROWNED, Entity1_13Types.EntityType.ZOMBIE_VILLAGER).mobName("Drowned");
mapEntityTypeWithData(Entity1_13Types.EntityType.DROWNED, Entity1_13Types.EntityType.ZOMBIE_VILLAGER).plainName();
// Fishy
mapEntityTypeWithData(Entity1_13Types.EntityType.COD, Entity1_13Types.EntityType.SQUID).mobName("Cod");
mapEntityTypeWithData(Entity1_13Types.EntityType.SALMON, Entity1_13Types.EntityType.SQUID).mobName("Salmon");
mapEntityTypeWithData(Entity1_13Types.EntityType.PUFFERFISH, Entity1_13Types.EntityType.SQUID).mobName("Puffer Fish");
mapEntityTypeWithData(Entity1_13Types.EntityType.TROPICAL_FISH, Entity1_13Types.EntityType.SQUID).mobName("Tropical Fish");
mapEntityTypeWithData(Entity1_13Types.EntityType.COD, Entity1_13Types.EntityType.SQUID).plainName();
mapEntityTypeWithData(Entity1_13Types.EntityType.SALMON, Entity1_13Types.EntityType.SQUID).plainName();
mapEntityTypeWithData(Entity1_13Types.EntityType.PUFFERFISH, Entity1_13Types.EntityType.SQUID).plainName();
mapEntityTypeWithData(Entity1_13Types.EntityType.TROPICAL_FISH, Entity1_13Types.EntityType.SQUID).plainName();
// Phantom
mapEntityTypeWithData(Entity1_13Types.EntityType.PHANTOM, Entity1_13Types.EntityType.PARROT).mobName("Phantom").spawnMetadata(storage -> {
mapEntityTypeWithData(Entity1_13Types.EntityType.PHANTOM, Entity1_13Types.EntityType.PARROT).plainName().spawnMetadata(storage -> {
// The phantom is grey/blue so let's do yellow/blue
storage.add(new Metadata(15, MetaType1_12.VarInt, 3));
});
// Dolphin
mapEntityTypeWithData(Entity1_13Types.EntityType.DOLPHIN, Entity1_13Types.EntityType.SQUID).mobName("Dolphin");
mapEntityTypeWithData(Entity1_13Types.EntityType.DOLPHIN, Entity1_13Types.EntityType.SQUID).plainName();
// Turtle
mapEntityTypeWithData(Entity1_13Types.EntityType.TURTLE, Entity1_13Types.EntityType.OCELOT).mobName("Turtle");
mapEntityTypeWithData(Entity1_13Types.EntityType.TURTLE, Entity1_13Types.EntityType.OCELOT).plainName();
// Rewrite Meta types
filter().handler((event, meta) -> {

View File

@ -352,13 +352,13 @@ public class EntityPackets1_14 extends LegacyEntityRewriter<Protocol1_13_2To1_14
protected void registerRewrites() {
mapTypes(Entity1_14Types.values(), Entity1_13Types.EntityType.class);
mapEntityTypeWithData(Entity1_14Types.CAT, Entity1_14Types.OCELOT).jsonName("Cat");
mapEntityTypeWithData(Entity1_14Types.TRADER_LLAMA, Entity1_14Types.LLAMA).jsonName("Trader Llama");
mapEntityTypeWithData(Entity1_14Types.FOX, Entity1_14Types.WOLF).jsonName("Fox");
mapEntityTypeWithData(Entity1_14Types.PANDA, Entity1_14Types.POLAR_BEAR).jsonName("Panda");
mapEntityTypeWithData(Entity1_14Types.PILLAGER, Entity1_14Types.VILLAGER).jsonName("Pillager");
mapEntityTypeWithData(Entity1_14Types.WANDERING_TRADER, Entity1_14Types.VILLAGER).jsonName("Wandering Trader");
mapEntityTypeWithData(Entity1_14Types.RAVAGER, Entity1_14Types.COW).jsonName("Ravager");
mapEntityTypeWithData(Entity1_14Types.CAT, Entity1_14Types.OCELOT).jsonName();
mapEntityTypeWithData(Entity1_14Types.TRADER_LLAMA, Entity1_14Types.LLAMA).jsonName();
mapEntityTypeWithData(Entity1_14Types.FOX, Entity1_14Types.WOLF).jsonName();
mapEntityTypeWithData(Entity1_14Types.PANDA, Entity1_14Types.POLAR_BEAR).jsonName();
mapEntityTypeWithData(Entity1_14Types.PILLAGER, Entity1_14Types.VILLAGER).jsonName();
mapEntityTypeWithData(Entity1_14Types.WANDERING_TRADER, Entity1_14Types.VILLAGER).jsonName();
mapEntityTypeWithData(Entity1_14Types.RAVAGER, Entity1_14Types.COW).jsonName();
filter().handler((event, meta) -> {
int typeId = meta.metaType().typeId();

View File

@ -205,7 +205,7 @@ public class EntityPackets1_15 extends EntityRewriter<Protocol1_14_4To1_15> {
filter().type(Entity1_15Types.BEE).cancel(15);
filter().type(Entity1_15Types.BEE).cancel(16);
mapEntityTypeWithData(Entity1_15Types.BEE, Entity1_15Types.PUFFERFISH).jsonName("Bee").spawnMetadata(storage -> {
mapEntityTypeWithData(Entity1_15Types.BEE, Entity1_15Types.PUFFERFISH).jsonName().spawnMetadata(storage -> {
storage.add(new Metadata(14, Types1_14.META_TYPES.booleanType, false));
storage.add(new Metadata(15, Types1_14.META_TYPES.varIntType, 2));
});

View File

@ -270,10 +270,10 @@ public class EntityPackets1_16 extends EntityRewriter<Protocol1_15_2To1_16> {
mapEntityType(Entity1_16Types.ZOMBIFIED_PIGLIN, Entity1_15Types.ZOMBIE_PIGMAN);
mapTypes(Entity1_16Types.values(), Entity1_15Types.class);
mapEntityTypeWithData(Entity1_16Types.HOGLIN, Entity1_16Types.COW).jsonName("Hoglin");
mapEntityTypeWithData(Entity1_16Types.ZOGLIN, Entity1_16Types.COW).jsonName("Zoglin");
mapEntityTypeWithData(Entity1_16Types.PIGLIN, Entity1_16Types.ZOMBIFIED_PIGLIN).jsonName("Piglin");
mapEntityTypeWithData(Entity1_16Types.STRIDER, Entity1_16Types.MAGMA_CUBE).jsonName("Strider");
mapEntityTypeWithData(Entity1_16Types.HOGLIN, Entity1_16Types.COW).jsonName();
mapEntityTypeWithData(Entity1_16Types.ZOGLIN, Entity1_16Types.COW).jsonName();
mapEntityTypeWithData(Entity1_16Types.PIGLIN, Entity1_16Types.ZOMBIFIED_PIGLIN).jsonName();
mapEntityTypeWithData(Entity1_16Types.STRIDER, Entity1_16Types.MAGMA_CUBE).jsonName();
filter().type(Entity1_16Types.ZOGLIN).cancel(16);
filter().type(Entity1_16Types.HOGLIN).cancel(15);

View File

@ -107,7 +107,7 @@ public class EntityPackets1_16_2 extends EntityRewriter<Protocol1_16_1To1_16_2>
Types1_16.META_TYPES.particleType, Types1_16.META_TYPES.optionalComponentType);
mapTypes(Entity1_16_2Types.values(), Entity1_16Types.class);
mapEntityTypeWithData(Entity1_16_2Types.PIGLIN_BRUTE, Entity1_16_2Types.PIGLIN).jsonName("Piglin Brute");
mapEntityTypeWithData(Entity1_16_2Types.PIGLIN_BRUTE, Entity1_16_2Types.PIGLIN).jsonName();
filter().filterFamily(Entity1_16_2Types.ABSTRACT_PIGLIN).index(15).toIndex(16);
filter().filterFamily(Entity1_16_2Types.ABSTRACT_PIGLIN).index(16).toIndex(15);

View File

@ -193,10 +193,10 @@ public final class EntityPackets1_17 extends EntityRewriter<Protocol1_16_4To1_17
filter().type(Entity1_17Types.GOAT).cancel(17);
mapEntityTypeWithData(Entity1_17Types.AXOLOTL, Entity1_17Types.TROPICAL_FISH).jsonName("Axolotl");
mapEntityTypeWithData(Entity1_17Types.GOAT, Entity1_17Types.SHEEP).jsonName("Goat");
mapEntityTypeWithData(Entity1_17Types.AXOLOTL, Entity1_17Types.TROPICAL_FISH).jsonName();
mapEntityTypeWithData(Entity1_17Types.GOAT, Entity1_17Types.SHEEP).jsonName();
mapEntityTypeWithData(Entity1_17Types.GLOW_SQUID, Entity1_17Types.SQUID).jsonName("Glow Squid");
mapEntityTypeWithData(Entity1_17Types.GLOW_SQUID, Entity1_17Types.SQUID).jsonName();
mapEntityTypeWithData(Entity1_17Types.GLOW_ITEM_FRAME, Entity1_17Types.ITEM_FRAME);
filter().type(Entity1_17Types.SHULKER).addIndex(17); // TODO Handle attachment pos?

View File

@ -157,7 +157,7 @@ public class EntityPackets1_10 extends LegacyEntityRewriter<Protocol1_9_4To1_10>
@Override
protected void registerRewrites() {
mapEntityTypeWithData(Entity1_10Types.EntityType.POLAR_BEAR, Entity1_10Types.EntityType.SHEEP).mobName("Polar Bear");
mapEntityTypeWithData(Entity1_10Types.EntityType.POLAR_BEAR, Entity1_10Types.EntityType.SHEEP).plainName();
// Change the sheep color when the polar bear is standing up (index 13 -> Standing up)
filter().type(Entity1_10Types.EntityType.POLAR_BEAR).index(13).handler((event, meta) -> {

View File

@ -31,5 +31,14 @@
"item.armor.equip_elytra": "item.armor.equip_generic",
"item.bottle.empty": "item.bottle.fill",
"item.totem.use": "block.anvil.destroy"
},
"entitynames": {
"wither_skeleton": "Polar Bear",
"stray": "Stray",
"husk": "Husk",
"evocation_illager": "Evoker",
"vex": "Vex",
"vindication_illager": "Vindicator",
"liama": "Llama"
}
}

View File

@ -48,5 +48,9 @@
"entity.parrot.step": "entity.chicken.step",
"entity.player.hurt_drown": "entity.player.hurt",
"entity.player.hurt_on_fire": "entity.player.hurt"
},
"entitynames": {
"parrot": "Parrot",
"illusion_illager": "Illusioner"
}
}

View File

@ -5960,5 +5960,15 @@
"item.trident.throw": "entity.skeleton.shoot",
"item.trident.thunder": "entity.lightning_bolt.thunder",
"music.under_water": "music.creative"
},
"entitynames": {
"drowned": "Drowned",
"cod": "Cod",
"salmon": "Salmon",
"pufferfish": "Pufferfish",
"tropical_fish": "Tropical Fish",
"phantom": "Phantom",
"dolphin": "Dolphin",
"turtle": "Turtle"
}
}

View File

@ -1008,5 +1008,14 @@
"sneeze": "spit",
"campfire_cosy_smoke": "cloud",
"campfire_signal_smoke": "cloud"
},
"entitynames": {
"cat": "Cat",
"trader_llama": "Trader Llama",
"fox": "Fox",
"panda": "Panda",
"pillager": "Pillager",
"wandering_trader": "Wandering Trader",
"ravager": "Ravager"
}
}

View File

@ -94,5 +94,8 @@
"falling_honey": "falling_lava",
"landing_honey": "landing_lava",
"falling_nectar": "falling_water"
},
"entitynames": {
"bee": "Bee"
}
}

View File

@ -6242,5 +6242,11 @@
"landing_obsidian_tear": "landing_lava",
"reverse_portal": "portal",
"white_ash": "mycelium"
},
"entitynames": {
"hoglin": "Hoglin",
"zoglin": "Zoglin",
"piglin": "Piglin",
"strider": "Strider"
}
}

View File

@ -1177,7 +1177,6 @@
"id": "minecraft:silverfish_spawn_egg",
"name": "1.17 Goat Spawn Egg"
},
"minecraft:raw_iron_block": {
"id": "minecraft:iron_block",
"name": "1.17 Raw Iron Block"
@ -1411,5 +1410,10 @@
"electric_spark": "happy_villager",
"scrape": "happy_villager",
"light": "barrier"
},
"entitynames": {
"axolotl": "Axolotl",
"goat": "Goat",
"glow_squid": "Glow Squid"
}
}

View File

@ -29,5 +29,8 @@
"entity.piglin_brute.hurt": "entity.piglin.hurt",
"entity.piglin_brute.step": "entity.piglin.step",
"entity.piglin_brute.converted_to_zombified": "entity.piglin.converted_to_zombified"
},
"entitynames": {
"piglin_brute": "Piglin Brute"
}
}

View File

@ -19,5 +19,8 @@
"entity.wither_skeleton.death": "entity.skeleton.death",
"entity.wither_skeleton.hurt": "entity.skeleton.hurt",
"entity.wither_skeleton.step": "entity.skeleton.step"
},
"entitynames": {
"polar_bear": "Polar Bear"
}
}