2016-06-23 03:49:47 +00:00
|
|
|
/*
|
|
|
|
* Minecraft Forge
|
2019-02-10 22:57:03 +00:00
|
|
|
* Copyright (c) 2016-2019.
|
2016-06-23 03:49:47 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation version 2.1
|
|
|
|
* of the License.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
2018-09-06 11:39:01 +00:00
|
|
|
package net.minecraftforge.registries;
|
2016-04-10 05:33:39 +00:00
|
|
|
|
|
|
|
import net.minecraft.block.Block;
|
|
|
|
import net.minecraft.enchantment.Enchantment;
|
2018-09-14 16:30:56 +00:00
|
|
|
import net.minecraft.entity.EntityType;
|
2019-06-09 07:23:00 +00:00
|
|
|
import net.minecraft.entity.ai.brain.memory.MemoryModuleType;
|
|
|
|
import net.minecraft.entity.ai.brain.schedule.Activity;
|
|
|
|
import net.minecraft.entity.ai.brain.schedule.Schedule;
|
|
|
|
import net.minecraft.entity.ai.brain.sensor.SensorType;
|
|
|
|
import net.minecraft.entity.item.PaintingType;
|
|
|
|
import net.minecraft.entity.merchant.villager.VillagerProfession;
|
|
|
|
import net.minecraft.fluid.Fluid;
|
2019-06-09 04:19:17 +00:00
|
|
|
import net.minecraft.inventory.container.ContainerType;
|
2019-05-23 23:02:15 +00:00
|
|
|
import net.minecraft.util.registry.Bootstrap;
|
2019-06-09 07:23:00 +00:00
|
|
|
import net.minecraft.village.PointOfInterestType;
|
2016-04-10 05:33:39 +00:00
|
|
|
import net.minecraft.item.Item;
|
2019-06-09 07:23:00 +00:00
|
|
|
import net.minecraft.item.crafting.IRecipeSerializer;
|
|
|
|
import net.minecraft.particles.ParticleType;
|
2019-05-23 23:02:15 +00:00
|
|
|
import net.minecraft.potion.Effect;
|
2016-04-10 05:33:39 +00:00
|
|
|
import net.minecraft.potion.Potion;
|
2019-06-09 07:23:00 +00:00
|
|
|
import net.minecraft.stats.StatType;
|
2018-09-15 07:59:19 +00:00
|
|
|
import net.minecraft.tileentity.TileEntityType;
|
2016-04-10 05:33:39 +00:00
|
|
|
import net.minecraft.util.SoundEvent;
|
2016-05-18 10:29:10 +00:00
|
|
|
import net.minecraft.world.biome.Biome;
|
2019-06-09 07:23:00 +00:00
|
|
|
import net.minecraft.world.biome.provider.BiomeProviderType;
|
|
|
|
import net.minecraft.world.chunk.ChunkStatus;
|
|
|
|
import net.minecraft.world.gen.ChunkGeneratorType;
|
|
|
|
import net.minecraft.world.gen.carver.WorldCarver;
|
|
|
|
import net.minecraft.world.gen.feature.Feature;
|
|
|
|
import net.minecraft.world.gen.placement.Placement;
|
|
|
|
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
|
2019-02-14 23:08:53 +00:00
|
|
|
import net.minecraftforge.common.ModDimension;
|
2018-09-06 11:39:01 +00:00
|
|
|
import net.minecraftforge.fml.common.registry.GameRegistry;
|
2016-04-10 05:33:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A class that exposes static references to all vanilla and Forge registries.
|
|
|
|
* Created to have a central place to access the registries directly if modders need.
|
2016-05-29 21:05:07 +00:00
|
|
|
* It is still advised that if you are registering things to go through {@link GameRegistry} register methods, but queries and iterations can use this.
|
2016-04-10 05:33:39 +00:00
|
|
|
*/
|
|
|
|
public class ForgeRegistries
|
|
|
|
{
|
|
|
|
static { init(); } // This must be above the fields so we guarantee it's run before findRegistry is called. Yay static inializers
|
|
|
|
|
2019-06-09 07:23:00 +00:00
|
|
|
// Game objects
|
|
|
|
public static final IForgeRegistry<Block> BLOCKS = RegistryManager.ACTIVE.getRegistry(Block.class);
|
|
|
|
public static final IForgeRegistry<Fluid> FLUIDS = RegistryManager.ACTIVE.getRegistry(Fluid.class);
|
|
|
|
public static final IForgeRegistry<Item> ITEMS = RegistryManager.ACTIVE.getRegistry(Item.class);
|
|
|
|
public static final IForgeRegistry<Effect> POTIONS = RegistryManager.ACTIVE.getRegistry(Effect.class);
|
|
|
|
public static final IForgeRegistry<Biome> BIOMES = RegistryManager.ACTIVE.getRegistry(Biome.class);
|
|
|
|
public static final IForgeRegistry<SoundEvent> SOUND_EVENTS = RegistryManager.ACTIVE.getRegistry(SoundEvent.class);
|
|
|
|
public static final IForgeRegistry<Potion> POTION_TYPES = RegistryManager.ACTIVE.getRegistry(Potion.class);
|
|
|
|
public static final IForgeRegistry<Enchantment> ENCHANTMENTS = RegistryManager.ACTIVE.getRegistry(Enchantment.class);
|
|
|
|
public static final IForgeRegistry<EntityType<?>> ENTITIES = RegistryManager.ACTIVE.getRegistry(EntityType.class);
|
|
|
|
public static final IForgeRegistry<TileEntityType<?>> TILE_ENTITIES = RegistryManager.ACTIVE.getRegistry(TileEntityType.class);
|
|
|
|
public static final IForgeRegistry<ParticleType<?>> PARTICLE_TYPES = RegistryManager.ACTIVE.getRegistry(ParticleType.class);
|
|
|
|
public static final IForgeRegistry<ContainerType<?>> CONTAINERS = RegistryManager.ACTIVE.getRegistry(ContainerType.class);
|
|
|
|
public static final IForgeRegistry<PaintingType> PAINTING_TYPES = RegistryManager.ACTIVE.getRegistry(PaintingType.class);
|
|
|
|
public static final IForgeRegistry<IRecipeSerializer<?>> RECIPE_SERIALIZERS = RegistryManager.ACTIVE.getRegistry(IRecipeSerializer.class);
|
|
|
|
public static final IForgeRegistry<StatType<?>> STAT_TYPES = RegistryManager.ACTIVE.getRegistry(StatType.class);
|
|
|
|
|
|
|
|
// Villages
|
|
|
|
public static final IForgeRegistry<VillagerProfession> PROFESSIONS = RegistryManager.ACTIVE.getRegistry(VillagerProfession.class);
|
|
|
|
public static final IForgeRegistry<PointOfInterestType> POI_TYPES = RegistryManager.ACTIVE.getRegistry(PointOfInterestType.class);
|
|
|
|
public static final IForgeRegistry<MemoryModuleType<?>> MEMORY_MODULE_TYPES = RegistryManager.ACTIVE.getRegistry(MemoryModuleType.class);
|
|
|
|
public static final IForgeRegistry<SensorType<?>> SENSOR_TYPES = RegistryManager.ACTIVE.getRegistry(SensorType.class);
|
|
|
|
public static final IForgeRegistry<Schedule> SCHEDULES = RegistryManager.ACTIVE.getRegistry(Schedule.class);
|
|
|
|
public static final IForgeRegistry<Activity> ACTIVITIES = RegistryManager.ACTIVE.getRegistry(Activity.class);
|
|
|
|
|
|
|
|
// Worldgen
|
|
|
|
public static final IForgeRegistry<WorldCarver<?>> WORLD_CARVERS = RegistryManager.ACTIVE.getRegistry(WorldCarver.class);
|
|
|
|
public static final IForgeRegistry<SurfaceBuilder<?>> SURFACE_BUILDERS = RegistryManager.ACTIVE.getRegistry(SurfaceBuilder.class);
|
|
|
|
public static final IForgeRegistry<Feature<?>> FEATURES = RegistryManager.ACTIVE.getRegistry(Feature.class);
|
|
|
|
public static final IForgeRegistry<Placement<?>> DECORATORS = RegistryManager.ACTIVE.getRegistry(Placement.class);
|
|
|
|
public static final IForgeRegistry<BiomeProviderType<?, ?>> BIOME_PROVIDER_TYPES = RegistryManager.ACTIVE.getRegistry(BiomeProviderType.class);
|
|
|
|
public static final IForgeRegistry<ChunkGeneratorType<?, ?>> CHUNK_GENERATOR_TYPES = RegistryManager.ACTIVE.getRegistry(ChunkGeneratorType.class);
|
|
|
|
public static final IForgeRegistry<ChunkStatus> CHUNK_STATUS = RegistryManager.ACTIVE.getRegistry(ChunkStatus.class);
|
|
|
|
|
|
|
|
// Custom forge registries
|
|
|
|
public static final IForgeRegistry<ModDimension> MOD_DIMENSIONS = RegistryManager.ACTIVE.getRegistry(ModDimension.class);
|
2019-04-11 12:33:12 +00:00
|
|
|
public static final IForgeRegistry<DataSerializerEntry> DATA_SERIALIZERS = RegistryManager.ACTIVE.getRegistry(DataSerializerEntry.class);
|
|
|
|
|
2016-04-10 05:33:39 +00:00
|
|
|
/**
|
|
|
|
* This function is just to make sure static inializers in other classes have run and setup their registries before we query them.
|
|
|
|
*/
|
|
|
|
private static void init()
|
|
|
|
{
|
2017-06-19 22:02:18 +00:00
|
|
|
GameData.init();
|
2017-06-14 17:14:56 +00:00
|
|
|
Bootstrap.register();
|
2016-04-10 05:33:39 +00:00
|
|
|
}
|
|
|
|
}
|