More cleanup.

This commit is contained in:
LexManos committed 2016-03-22 02:14:16 -07:00
1 parent edbc56b2ff
commit eb5e5b4b42
4 files changed
+7 -9

No files matched your search

@@ -30,7 +30,7 @@ import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.fml.common.functions.GenericIterableFactory;
import net.minecraftforge.fml.common.registry.RegistryDelegate.Delegate;
public class FMLControlledNamespacedRegistry<I extends IForgeRegistryEntry> extends RegistryNamespacedDefaultedByKey<ResourceLocation, I> implements IForgeRegistry<I>
public class FMLControlledNamespacedRegistry<I extends IForgeRegistryEntry<I>> extends RegistryNamespacedDefaultedByKey<ResourceLocation, I> implements IForgeRegistry<I>
{
public static final boolean DEBUG = Boolean.parseBoolean(System.getProperty("fml.debugRegistryEntries", "false"));
private final Class<I> superType;
@@ -675,7 +675,7 @@ public class FMLControlledNamespacedRegistry<I extends IForgeRegistryEntry> exte
}
@SuppressWarnings("unchecked")
public <T extends IForgeRegistryEntry> FMLControlledNamespacedRegistry<T> asType(Class<? extends T> type)
public <T extends IForgeRegistryEntry<T>> FMLControlledNamespacedRegistry<T> asType(Class<? extends T> type)
{
return (FMLControlledNamespacedRegistry<T>)this;
}
@@ -6,7 +6,7 @@ import java.util.Set;
import net.minecraft.util.ResourceLocation;
public interface IForgeRegistry<V extends IForgeRegistryEntry> extends Iterable<V>
public interface IForgeRegistry<V extends IForgeRegistryEntry<V>> extends Iterable<V>
{
void register(V value);
@@ -55,12 +55,12 @@ public class PersistentRegistryManager
}
@SuppressWarnings("unchecked")
private <T extends IForgeRegistryEntry<?>> FMLControlledNamespacedRegistry<T> getRegistry(ResourceLocation key, Class<T> regType)
private <T extends IForgeRegistryEntry<T>> FMLControlledNamespacedRegistry<T> getRegistry(ResourceLocation key, Class<T> regType)
{
return (FMLControlledNamespacedRegistry<T>)registries.get(key);
}
private <T extends IForgeRegistryEntry<?>> FMLControlledNamespacedRegistry<T> getOrShallowCopyRegistry(ResourceLocation key, Class<T> regType, FMLControlledNamespacedRegistry<T> other)
private <T extends IForgeRegistryEntry<T>> FMLControlledNamespacedRegistry<T> getOrShallowCopyRegistry(ResourceLocation key, Class<T> regType, FMLControlledNamespacedRegistry<T> other)
{
if (!registries.containsKey(key))
{
@@ -250,7 +250,7 @@ public class VillagerRegistry
}
}
public static class VillagerProfession extends IForgeRegistryEntry.Impl
public static class VillagerProfession extends IForgeRegistryEntry.Impl<VillagerProfession>
{
private ResourceLocation name;
private ResourceLocation texture;
@@ -316,9 +316,7 @@ public class VillagerRegistry
public static void setRandomProfession(EntityVillager entity, Random rand)
{
Set<ResourceLocation> entries = INSTANCE.professions.getKeys();
int prof = rand.nextInt(entries.size());
//TODO: Grab id range from internal registry
entity.setProfession(rand.nextInt(5));
entity.setProfession(rand.nextInt(entries.size()));
}
//TODO: Figure out a good generic system for this. Put on hold for Patches.