3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-27 08:30:09 +01:00

Fix typos of entity

Dieser Commit ist enthalten in:
Nassim Jahnke 2023-10-08 19:03:14 +10:00
Ursprung bebdc34b4b
Commit 67ba0e9566
3 geänderte Dateien mit 10 neuen und 10 gelöschten Zeilen

Datei anzeigen

@ -87,7 +87,7 @@ public interface EntityTracker {
* *
* @param id entity id * @param id entity id
* @return stored entity data if an entity with the id is tracked, else null * @return stored entity data if an entity with the id is tracked, else null
* @throws IllegalArgumentException if entitiy data storage has not been enabled via the implementation * @throws IllegalArgumentException if entity data storage has not been enabled via the implementation
*/ */
@Nullable StoredEntityData entityData(int id); @Nullable StoredEntityData entityData(int id);
@ -96,7 +96,7 @@ public interface EntityTracker {
* *
* @param id entity id * @param id entity id
* @return stored entity data if it has previously been initialized by {@link #entityData(int)} * @return stored entity data if it has previously been initialized by {@link #entityData(int)}
* @throws IllegalArgumentException if entitiy data storage has not been enabled via the implementation * @throws IllegalArgumentException if entity data storage has not been enabled via the implementation
*/ */
@Nullable StoredEntityData entityDataIfPresent(int id); @Nullable StoredEntityData entityDataIfPresent(int id);

Datei anzeigen

@ -51,7 +51,7 @@ public interface EntityRewriter<T extends Protocol> extends Rewriter<T> {
} }
/** /**
* Returns the mapped entitiy (or the same if it has not changed). * Returns the mapped entity (or the same if it has not changed).
* *
* @param id unmapped entity id * @param id unmapped entity id
* @return mapped entity id * @return mapped entity id

Datei anzeigen

@ -30,8 +30,8 @@ import java.util.Map;
public class ItemRewriter { public class ItemRewriter {
public static final Map<String, Integer> ENTTIY_NAME_TO_ID = new HashMap<>(); public static final Map<String, Integer> ENTITY_NAME_TO_ID = new HashMap<>();
public static final Map<Integer, String> ENTTIY_ID_TO_NAME = new HashMap<>(); public static final Map<Integer, String> ENTITY_ID_TO_NAME = new HashMap<>();
public static final Map<String, Integer> POTION_NAME_TO_ID = new HashMap<>(); public static final Map<String, Integer> POTION_NAME_TO_ID = new HashMap<>();
public static final Map<Integer, String> POTION_ID_TO_NAME = new HashMap<>(); public static final Map<Integer, String> POTION_ID_TO_NAME = new HashMap<>();
@ -164,8 +164,8 @@ public class ItemRewriter {
CompoundTag entityTag = tag.get("EntityTag"); CompoundTag entityTag = tag.get("EntityTag");
if (entityTag.get("id") instanceof StringTag) { if (entityTag.get("id") instanceof StringTag) {
StringTag id = entityTag.get("id"); StringTag id = entityTag.get("id");
if (ENTTIY_NAME_TO_ID.containsKey(id.getValue())) if (ENTITY_NAME_TO_ID.containsKey(id.getValue()))
data = ENTTIY_NAME_TO_ID.get(id.getValue()); data = ENTITY_NAME_TO_ID.get(id.getValue());
} }
tag.remove("EntityTag"); tag.remove("EntityTag");
} }
@ -256,7 +256,7 @@ public class ItemRewriter {
tag = new CompoundTag(); tag = new CompoundTag();
} }
CompoundTag entityTag = new CompoundTag(); CompoundTag entityTag = new CompoundTag();
String entityName = ENTTIY_ID_TO_NAME.get((int) item.data()); String entityName = ENTITY_ID_TO_NAME.get((int) item.data());
if (entityName != null) { if (entityName != null) {
StringTag id = new StringTag(entityName); StringTag id = new StringTag(entityName);
entityTag.put("id", id); entityTag.put("id", id);
@ -417,8 +417,8 @@ public class ItemRewriter {
} }
private static void registerEntity(int id, String name) { private static void registerEntity(int id, String name) {
ENTTIY_ID_TO_NAME.put(id, name); ENTITY_ID_TO_NAME.put(id, name);
ENTTIY_NAME_TO_ID.put(name, id); ENTITY_NAME_TO_ID.put(name, id);
} }
private static void registerPotion(int id, String name) { private static void registerPotion(int id, String name) {