Skip to content

Commit

Permalink
Remove some generics which may be confusing jenkins
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Nov 21, 2016
1 parent e03ad19 commit cb3c32a
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import net.minecraft.server.v1_11_R1.MinecraftKey;
import net.minecraft.server.v1_11_R1.RegistryMaterials;

public class CustomEntityRegistry extends RegistryMaterials<MinecraftKey, Class<? extends Entity>> {
public class CustomEntityRegistry extends RegistryMaterials {
private final BiMap<MinecraftKey, Class<? extends Entity>> entities = HashBiMap.create();
private final BiMap<Class<? extends Entity>, MinecraftKey> entityClasses = this.entities.inverse();
private final Map<Class<? extends Entity>, Integer> entityIds = Maps.newHashMap();
Expand All @@ -21,38 +21,38 @@ public CustomEntityRegistry(RegistryMaterials<MinecraftKey, Class<? extends Enti
}

@Override
public int a(Class<? extends Entity> key) {
public int a(Object key) {
if (this.entityIds.containsKey(key)) {
return this.entityIds.get(key);
}

return this.wrapped.a(key);
return this.wrapped.a((Class<? extends Entity>) key);
}

@Override
public MinecraftKey b(Class<? extends Entity> value) {
public MinecraftKey b(Object value) {
if (entityClasses.containsKey(value)) {
return entityClasses.get(value);
}

return wrapped.b(value);
return wrapped.b((Class<? extends Entity>) value);
}

@Override
public Class<? extends Entity> get(MinecraftKey key) {
public Class<? extends Entity> get(Object key) {
if (entities.containsKey(key)) {
return entities.get(key);
}

return wrapped.get(key);
return wrapped.get((MinecraftKey) key);
}

public RegistryMaterials<MinecraftKey, Class<? extends Entity>> getWrapped() {
return wrapped;
}

public void put(int entityId, MinecraftKey key, Class<? extends Entity> entityClass) {
this.entities.put(key, entityClass);
this.entityIds.put(entityClass, entityId);
entities.put(key, entityClass);
entityIds.put(entityClass, entityId);
}
}

0 comments on commit cb3c32a

Please sign in to comment.