3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-08 17:20:24 +01:00

IEntityType -> EntityType

Dieser Commit ist enthalten in:
Gerrygames 2019-05-13 12:04:03 +02:00
Ursprung 2442520ef3
Commit e8f8473e1c
8 geänderte Dateien mit 43 neuen und 43 gelöschten Zeilen

Datei anzeigen

@ -29,28 +29,28 @@ public class Entity1_10Types {
@AllArgsConstructor @AllArgsConstructor
@Getter @Getter
public enum EntityType implements IEntityType { public enum EntityType implements us.myles.ViaVersion.api.entities.EntityType {
ENTITY(-1), ENTITY(-1),
DROPPED_ITEM(1, EntityType.ENTITY), DROPPED_ITEM(1, ENTITY),
EXPERIENCE_ORB(2, EntityType.ENTITY), EXPERIENCE_ORB(2, ENTITY),
LEASH_HITCH(8, EntityType.ENTITY), // Actually entity hanging but it doesn't make a lot of difference for metadata LEASH_HITCH(8, ENTITY), // Actually entity hanging but it doesn't make a lot of difference for metadata
PAINTING(9, EntityType.ENTITY), // Actually entity hanging but it doesn't make a lot of difference for metadata PAINTING(9, ENTITY), // Actually entity hanging but it doesn't make a lot of difference for metadata
ARROW(10, EntityType.ENTITY), ARROW(10, ENTITY),
SNOWBALL(11, EntityType.ENTITY), // Actually EntityProjectile SNOWBALL(11, ENTITY), // Actually EntityProjectile
FIREBALL(12, EntityType.ENTITY), FIREBALL(12, ENTITY),
SMALL_FIREBALL(13, EntityType.ENTITY), SMALL_FIREBALL(13, ENTITY),
ENDER_PEARL(14, EntityType.ENTITY), // Actually EntityProjectile ENDER_PEARL(14, ENTITY), // Actually EntityProjectile
ENDER_SIGNAL(15, EntityType.ENTITY), ENDER_SIGNAL(15, ENTITY),
THROWN_EXP_BOTTLE(17, EntityType.ENTITY), THROWN_EXP_BOTTLE(17, ENTITY),
ITEM_FRAME(18, EntityType.ENTITY), // Actually EntityHanging ITEM_FRAME(18, ENTITY), // Actually EntityHanging
WITHER_SKULL(19, EntityType.ENTITY), WITHER_SKULL(19, ENTITY),
PRIMED_TNT(20, EntityType.ENTITY), PRIMED_TNT(20, ENTITY),
FALLING_BLOCK(21, EntityType.ENTITY), FALLING_BLOCK(21, ENTITY),
FIREWORK(22, EntityType.ENTITY), FIREWORK(22, ENTITY),
TIPPED_ARROW(23, EntityType.ARROW), TIPPED_ARROW(23, ARROW),
SPECTRAL_ARROW(24, EntityType.ARROW), SPECTRAL_ARROW(24, ARROW),
SHULKER_BULLET(25, EntityType.ENTITY), SHULKER_BULLET(25, ENTITY),
DRAGON_FIREBALL(26, EntityType.FIREBALL), DRAGON_FIREBALL(26, FIREBALL),
ENTITY_LIVING(-1, ENTITY), ENTITY_LIVING(-1, ENTITY),
ENTITY_INSENTIENT(-1, ENTITY_LIVING), ENTITY_INSENTIENT(-1, ENTITY_LIVING),
@ -58,7 +58,7 @@ public class Entity1_10Types {
ENTITY_TAMEABLE_ANIMAL(-1, ENTITY_AGEABLE), ENTITY_TAMEABLE_ANIMAL(-1, ENTITY_AGEABLE),
ENTITY_HUMAN(-1, ENTITY_LIVING), ENTITY_HUMAN(-1, ENTITY_LIVING),
ARMOR_STAND(30, EntityType.ENTITY_LIVING), ARMOR_STAND(30, ENTITY_LIVING),
// Vehicles // Vehicles
MINECART_ABSTRACT(-1, ENTITY), MINECART_ABSTRACT(-1, ENTITY),
@ -91,7 +91,7 @@ public class Entity1_10Types {
ENDERMITE(67, ENTITY_INSENTIENT), ENDERMITE(67, ENTITY_INSENTIENT),
GUARDIAN(68, ENTITY_INSENTIENT), GUARDIAN(68, ENTITY_INSENTIENT),
IRON_GOLEM(99, ENTITY_INSENTIENT), // moved up to avoid illegal forward references IRON_GOLEM(99, ENTITY_INSENTIENT), // moved up to avoid illegal forward references
SHULKER(69, EntityType.IRON_GOLEM), SHULKER(69, IRON_GOLEM),
PIG(90, ENTITY_AGEABLE), PIG(90, ENTITY_AGEABLE),
SHEEP(91, ENTITY_AGEABLE), SHEEP(91, ENTITY_AGEABLE),
COW(92, ENTITY_AGEABLE), COW(92, ENTITY_AGEABLE),
@ -99,7 +99,7 @@ public class Entity1_10Types {
SQUID(94, ENTITY_INSENTIENT), SQUID(94, ENTITY_INSENTIENT),
WOLF(95, ENTITY_TAMEABLE_ANIMAL), WOLF(95, ENTITY_TAMEABLE_ANIMAL),
MUSHROOM_COW(96, COW), MUSHROOM_COW(96, COW),
SNOWMAN(97, EntityType.IRON_GOLEM), SNOWMAN(97, IRON_GOLEM),
OCELOT(98, ENTITY_TAMEABLE_ANIMAL), OCELOT(98, ENTITY_TAMEABLE_ANIMAL),
HORSE(100, ENTITY_AGEABLE), HORSE(100, ENTITY_AGEABLE),
RABBIT(101, ENTITY_AGEABLE), RABBIT(101, ENTITY_AGEABLE),

Datei anzeigen

@ -28,7 +28,7 @@ public class Entity1_11Types {
@AllArgsConstructor @AllArgsConstructor
@Getter @Getter
public enum EntityType implements IEntityType { public enum EntityType implements us.myles.ViaVersion.api.entities.EntityType {
ENTITY(-1), ENTITY(-1),
DROPPED_ITEM(1, ENTITY), DROPPED_ITEM(1, ENTITY),
EXPERIENCE_ORB(2, ENTITY), EXPERIENCE_ORB(2, ENTITY),
@ -103,10 +103,10 @@ public class Entity1_11Types {
ENDERMITE(67, ENTITY_INSENTIENT), ENDERMITE(67, ENTITY_INSENTIENT),
GUARDIAN(68, ENTITY_INSENTIENT), GUARDIAN(68, ENTITY_INSENTIENT),
ELDER_GUARDIAN(4, EntityType.GUARDIAN), // Moved down to avoid illegal forward reference ELDER_GUARDIAN(4, GUARDIAN), // Moved down to avoid illegal forward reference
IRON_GOLEM(99, ENTITY_INSENTIENT), // moved up to avoid illegal forward references IRON_GOLEM(99, ENTITY_INSENTIENT), // moved up to avoid illegal forward references
SHULKER(69, EntityType.IRON_GOLEM), SHULKER(69, IRON_GOLEM),
PIG(90, ENTITY_AGEABLE), PIG(90, ENTITY_AGEABLE),
SHEEP(91, ENTITY_AGEABLE), SHEEP(91, ENTITY_AGEABLE),
COW(92, ENTITY_AGEABLE), COW(92, ENTITY_AGEABLE),
@ -114,7 +114,7 @@ public class Entity1_11Types {
SQUID(94, ENTITY_INSENTIENT), SQUID(94, ENTITY_INSENTIENT),
WOLF(95, ENTITY_TAMEABLE_ANIMAL), WOLF(95, ENTITY_TAMEABLE_ANIMAL),
MUSHROOM_COW(96, COW), MUSHROOM_COW(96, COW),
SNOWMAN(97, EntityType.IRON_GOLEM), SNOWMAN(97, IRON_GOLEM),
OCELOT(98, ENTITY_TAMEABLE_ANIMAL), OCELOT(98, ENTITY_TAMEABLE_ANIMAL),
ABSTRACT_HORSE(-1, ENTITY_AGEABLE), ABSTRACT_HORSE(-1, ENTITY_AGEABLE),

Datei anzeigen

@ -38,7 +38,7 @@ public class Entity1_12Types {
@AllArgsConstructor @AllArgsConstructor
@Getter @Getter
public enum EntityType implements IEntityType { public enum EntityType implements us.myles.ViaVersion.api.entities.EntityType {
ENTITY(-1), ENTITY(-1),
DROPPED_ITEM(1, ENTITY), DROPPED_ITEM(1, ENTITY),
EXPERIENCE_ORB(2, ENTITY), EXPERIENCE_ORB(2, ENTITY),
@ -115,10 +115,10 @@ public class Entity1_12Types {
ENDERMITE(67, ENTITY_INSENTIENT), ENDERMITE(67, ENTITY_INSENTIENT),
GUARDIAN(68, ENTITY_INSENTIENT), GUARDIAN(68, ENTITY_INSENTIENT),
ELDER_GUARDIAN(4, EntityType.GUARDIAN), // Moved down to avoid illegal forward reference ELDER_GUARDIAN(4, GUARDIAN), // Moved down to avoid illegal forward reference
IRON_GOLEM(99, ENTITY_INSENTIENT), // moved up to avoid illegal forward references IRON_GOLEM(99, ENTITY_INSENTIENT), // moved up to avoid illegal forward references
SHULKER(69, EntityType.IRON_GOLEM), SHULKER(69, IRON_GOLEM),
PIG(90, ENTITY_AGEABLE), PIG(90, ENTITY_AGEABLE),
SHEEP(91, ENTITY_AGEABLE), SHEEP(91, ENTITY_AGEABLE),
COW(92, ENTITY_AGEABLE), COW(92, ENTITY_AGEABLE),
@ -126,7 +126,7 @@ public class Entity1_12Types {
SQUID(94, ENTITY_INSENTIENT), SQUID(94, ENTITY_INSENTIENT),
WOLF(95, ENTITY_TAMEABLE_ANIMAL), WOLF(95, ENTITY_TAMEABLE_ANIMAL),
MUSHROOM_COW(96, COW), MUSHROOM_COW(96, COW),
SNOWMAN(97, EntityType.IRON_GOLEM), SNOWMAN(97, IRON_GOLEM),
OCELOT(98, ENTITY_TAMEABLE_ANIMAL), OCELOT(98, ENTITY_TAMEABLE_ANIMAL),
PARROT(105, ENTITY_TAMEABLE_ANIMAL), PARROT(105, ENTITY_TAMEABLE_ANIMAL),

Datei anzeigen

@ -29,7 +29,7 @@ public class Entity1_13Types {
@AllArgsConstructor @AllArgsConstructor
@Getter @Getter
public enum EntityType implements IEntityType { public enum EntityType implements us.myles.ViaVersion.api.entities.EntityType {
// Auto generated // Auto generated
ENTITY(-1), // abm ENTITY(-1), // abm

Datei anzeigen

@ -11,11 +11,11 @@ import java.util.Map;
public class Entity1_14Types { public class Entity1_14Types {
public static EntityType getTypeFromId(int typeID) { public static EntityType getTypeFromId(int typeID) {
Optional<EntityType> type = EntityType.findById(typeID); Optional<EntityType> type = Entity1_14Types.EntityType.findById(typeID);
if (!type.isPresent()) { if (!type.isPresent()) {
Via.getPlatform().getLogger().severe("Could not find type id " + typeID); Via.getPlatform().getLogger().severe("Could not find type id " + typeID);
return EntityType.ENTITY; // Fall back to the basic ENTITY return Entity1_14Types.EntityType.ENTITY; // Fall back to the basic ENTITY
} }
return type.get(); return type.get();
@ -23,7 +23,7 @@ public class Entity1_14Types {
@AllArgsConstructor @AllArgsConstructor
@Getter @Getter
public enum EntityType implements IEntityType { public enum EntityType implements us.myles.ViaVersion.api.entities.EntityType {
// Auto generated // Auto generated
ENTITY(-1), ENTITY(-1),
@ -210,7 +210,7 @@ public class Entity1_14Types {
} }
static { static {
for (EntityType type : EntityType.values()) { for (EntityType type : Entity1_14Types.EntityType.values()) {
TYPES.put(type.id, type); TYPES.put(type.id, type);
} }
} }

Datei anzeigen

@ -1,9 +1,9 @@
package us.myles.ViaVersion.api.entities; package us.myles.ViaVersion.api.entities;
public interface IEntityType { public interface EntityType {
int getId(); int getId();
IEntityType getParent(); EntityType getParent();
} }

Datei anzeigen

@ -2,7 +2,7 @@ package us.myles.ViaVersion.api.rewriters;
import us.myles.ViaVersion.api.Via; import us.myles.ViaVersion.api.Via;
import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.api.entities.IEntityType; import us.myles.ViaVersion.api.entities.EntityType;
import us.myles.ViaVersion.api.minecraft.metadata.Metadata; import us.myles.ViaVersion.api.minecraft.metadata.Metadata;
import java.util.ArrayList; import java.util.ArrayList;
@ -12,7 +12,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.logging.Logger; import java.util.logging.Logger;
public abstract class MetadataRewriter<T extends IEntityType> { public abstract class MetadataRewriter<T extends EntityType> {
public final void handleMetadata(int entityId, T type, List<Metadata> metadatas, UserConnection connection) { public final void handleMetadata(int entityId, T type, List<Metadata> metadatas, UserConnection connection) {
Map<Integer, Metadata> metadataMap = new HashMap<>(metadatas.size()); Map<Integer, Metadata> metadataMap = new HashMap<>(metadatas.size());

Datei anzeigen

@ -6,12 +6,12 @@ import lombok.Setter;
import us.myles.ViaVersion.api.data.ExternalJoinGameListener; import us.myles.ViaVersion.api.data.ExternalJoinGameListener;
import us.myles.ViaVersion.api.data.StoredObject; import us.myles.ViaVersion.api.data.StoredObject;
import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.api.entities.IEntityType; import us.myles.ViaVersion.api.entities.EntityType;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
public abstract class EntityTracker<T extends IEntityType> extends StoredObject implements ExternalJoinGameListener { public abstract class EntityTracker<T extends EntityType> extends StoredObject implements ExternalJoinGameListener {
private final Map<Integer, T> clientEntityTypes = new ConcurrentHashMap<>(); private final Map<Integer, T> clientEntityTypes = new ConcurrentHashMap<>();
@Getter @Getter
@Setter @Setter