diff options
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/handlers/sbentities')
-rw-r--r-- | src/main/java/com/thatgravyboat/skyblockhud/handlers/sbentities/EntityTypeRegistry.java | 8 | ||||
-rw-r--r-- | src/main/java/com/thatgravyboat/skyblockhud/handlers/sbentities/SkyBlockEntity.java | 11 |
2 files changed, 9 insertions, 10 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/sbentities/EntityTypeRegistry.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/sbentities/EntityTypeRegistry.java index d45fa1f..40076d9 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/sbentities/EntityTypeRegistry.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/sbentities/EntityTypeRegistry.java @@ -2,11 +2,10 @@ package com.thatgravyboat.skyblockhud.handlers.sbentities; import com.google.common.collect.ImmutableList; import com.google.common.collect.Maps; -import net.minecraft.entity.Entity; -import net.minecraft.entity.monster.EntityEnderman; - import java.util.List; import java.util.Map; +import net.minecraft.entity.Entity; +import net.minecraft.entity.monster.EntityEnderman; public class EntityTypeRegistry { @@ -16,10 +15,9 @@ public class EntityTypeRegistry { entities.put(EntityEnderman.class, ImmutableList.of(SkyBlockEntity.of("zealot", EntityTypeHelper::isZealot))); } - public static String getEntityId(Entity entity){ + public static String getEntityId(Entity entity) { if (!entities.containsKey(entity.getClass())) return null; for (SkyBlockEntity skyBlockEntity : entities.get(entity.getClass())) if (skyBlockEntity.isEntity(entity)) return skyBlockEntity.getName(); return null; } - } diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/sbentities/SkyBlockEntity.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/sbentities/SkyBlockEntity.java index ca10b53..ee8c3a7 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/sbentities/SkyBlockEntity.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/sbentities/SkyBlockEntity.java @@ -1,24 +1,25 @@ package com.thatgravyboat.skyblockhud.handlers.sbentities; -import net.minecraft.entity.Entity; - import java.util.function.Predicate; +import net.minecraft.entity.Entity; public class SkyBlockEntity { private final String name; private final Predicate<Entity> predicate; - public static SkyBlockEntity of(String name, Predicate<Entity> predicate){ + public static SkyBlockEntity of(String name, Predicate<Entity> predicate) { return new SkyBlockEntity(name, predicate); } - private SkyBlockEntity(String name, Predicate<Entity> predicate){ + private SkyBlockEntity(String name, Predicate<Entity> predicate) { this.name = name; this.predicate = predicate; } - public String getName(){ return name; } + public String getName() { + return name; + } public boolean isEntity(Entity entity) { return predicate.test(entity); |