net.minecraftforge.event.RegistryEvent Java Examples

The following examples show how to use net.minecraftforge.event.RegistryEvent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CommonProxy.java    From TofuCraftReload with MIT License 6 votes vote down vote up
@SubscribeEvent
   public static void registerRecipes(RegistryEvent.Register<IRecipe> event) {
	//boildEdamame
	GameRegistry.addSmelting( new ItemStack(ItemLoader.material,1,3), new ItemStack(ItemLoader.foodset,16,22), 0.25f);
	//SoyBeenParched
	GameRegistry.addSmelting( new ItemStack(ItemLoader.soybeans,1), new ItemStack(ItemLoader.material,1,6), 0.2f);

	GameRegistry.addSmelting( new ItemStack(ItemLoader.material,1,13), new ItemStack(ItemLoader.material,1,14), 0.2f);
	
	RecipesUtil.addOreDictionarySmelting("listAlltofu", new ItemStack(ItemLoader.tofu_food,1,3), 0.2f);
	
	GameRegistry.addSmelting(new ItemStack(ItemLoader.tofu_food,1,2), new ItemStack(ItemLoader.foodset,1,16), 0.2f);
	GameRegistry.addSmelting(new ItemStack(ItemLoader.material,1,20), new ItemStack(ItemLoader.foodset,1,8), 0.2f);
	GameRegistry.addSmelting(new ItemStack(ItemLoader.foodset,1,11), new ItemStack(ItemLoader.foodset,1,12), 0.2f);
	
	RecipesUtil.addOreDictionarySmelting("listAlltofuBlock", new ItemStack(BlockLoader.GRILD), 0.6f);
}
 
Example #2
Source File: ItemBookCode.java    From Minecoprocessors with GNU General Public License v3.0 6 votes vote down vote up
@SubscribeEvent
public static void registerRecipes(final RegistryEvent.Register<IRecipe> event) {
  NonNullList<Ingredient> lst = NonNullList.create();
  lst.add(Ingredient.fromItem(Items.WRITABLE_BOOK));
  lst.add(Ingredient.fromItem(BlockMinecoprocessor.ITEM_INSTANCE));
  event.getRegistry().register(new ShapelessRecipes("", new ItemStack(ItemBookCode.INSTANCE), lst) {
    @Override
    public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv) {
      NonNullList<ItemStack> l = NonNullList.withSize(inv.getSizeInventory(), ItemStack.EMPTY);

      for (int i = 0; i < l.size(); ++i) {
        ItemStack stack = inv.getStackInSlot(i);

        if (stack.getItem() == BlockMinecoprocessor.ITEM_INSTANCE) {
          ItemStack returnStack = stack.copy();
          returnStack.setCount(1);
          l.set(i, returnStack);
          return l;
        }
      }

      throw new RuntimeException("Item to return not found in inventory");
    }
  }.setRegistryName(ItemBookCode.REGISTRY_NAME));
}
 
Example #3
Source File: ValkyrienSkiesMod.java    From Valkyrien-Skies with Apache License 2.0 6 votes vote down vote up
void registerBlocks(RegistryEvent.Register<Block> event) {
    physicsInfuser = new BlockPhysicsInfuser(Material.ROCK).setHardness(8f)
        .setTranslationKey("physics_infuser")
        .setRegistryName(MOD_ID, "physics_infuser")
        .setCreativeTab(VS_CREATIVE_TAB);
    physicsInfuserCreative = new BlockPhysicsInfuserCreative(Material.ROCK).setHardness(12f)
        .setTranslationKey("creative_physics_infuser")
        .setRegistryName(MOD_ID, "creative_physics_infuser")
        .setCreativeTab(VS_CREATIVE_TAB);
    // // Do not put the VS_CREATIVE_TAB block into the creative tab
    physicsInfuserDummy = new BlockPhysicsInfuserDummy(Material.ROCK).setHardness(12f)
        .setTranslationKey("dummy_physics_infuser")
        .setRegistryName(MOD_ID, "dummy_physics_infuser")
        .setCreativeTab(VS_CREATIVE_TAB);

    event.getRegistry().register(physicsInfuser);
    event.getRegistry().register(physicsInfuserCreative);
    event.getRegistry().register(physicsInfuserDummy);

    registerTileEntities();
}
 
Example #4
Source File: MissingMappingEventHandler.java    From enderutilities with GNU Lesser General Public License v3.0 6 votes vote down vote up
@SubscribeEvent
public static void onMissingMappingEventBlocks(RegistryEvent.MissingMappings<Block> event)
{
    List<Mapping<Block>> list = event.getMappings();
    Map<String, String> renameMap = TileEntityID.getMap();

    for (Mapping<Block> mapping : list)
    {
        ResourceLocation oldLoc = mapping.key;
        String newName = renameMap.get(oldLoc.toString());

        if (newName != null)
        {
            Block block = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(newName));

            if (block != null && block != Blocks.AIR)
            {
                mapping.remap(block);
                EnderUtilities.logger.info("Re-mapped block '{}' => '{}'", oldLoc, newName);
            }
        }
    }
}
 
Example #5
Source File: RpcCallDispatcher.java    From OpenModsLib with MIT License 6 votes vote down vote up
@SubscribeEvent
public static void registerRegistry(RegistryEvent.NewRegistry e) {
	final IForgeRegistry<MethodEntry> methodRegistry = new RegistryBuilder<MethodEntry>()
			.setIDRange(0, 0x0FFFFF)
			.setName(OpenMods.location("rpc_methods"))
			.setType(MethodEntry.class)
			.disableSaving()
			.addCallback(new MethodsCallbacks())
			.create();

	final IForgeRegistry<TargetTypeProvider> targetRegistry = new RegistryBuilder<TargetTypeProvider>()
			.setIDRange(0, 0xFF)
			.setName(OpenMods.location("rpc_targets"))
			.setType(TargetTypeProvider.class)
			.disableSaving()
			.addCallback(new TargetTypeCallbacks())
			.create();

	INSTANCE = new RpcCallDispatcher(methodRegistry, targetRegistry);
}
 
Example #6
Source File: ValkyrienSkiesControl.java    From Valkyrien-Skies with Apache License 2.0 6 votes vote down vote up
@SubscribeEvent
public static void registerItems(RegistryEvent.Register<Item> event) {
    INSTANCE.relayWire = new ItemRelayWire().setTranslationKey("relay_wire")
        .setRegistryName(MOD_ID, "relay_wire")
        .setCreativeTab(ValkyrienSkiesMod.VS_CREATIVE_TAB);
    INSTANCE.multiBlockWrench = new ItemWrench().setTranslationKey("vs_wrench")
        .setRegistryName(MOD_ID, "vs_wrench")
        .setCreativeTab(ValkyrienSkiesMod.VS_CREATIVE_TAB);

    event.getRegistry()
        .register(INSTANCE.relayWire);
    event.getRegistry()
        .register(INSTANCE.multiBlockWrench);

    INSTANCE.vsControlBlocks.registerBlockItems(event);
    // This doesn't really belong here, but whatever.
    MultiblockRegistry
        .registerAllPossibleSchematicVariants(ValkyriumEngineMultiblockSchematic.class);
    MultiblockRegistry
        .registerAllPossibleSchematicVariants(ValkyriumCompressorMultiblockSchematic.class);
    MultiblockRegistry
        .registerAllPossibleSchematicVariants(RudderAxleMultiblockSchematic.class);
    MultiblockRegistry
        .registerAllPossibleSchematicVariants(GiantPropellerMultiblockSchematic.class);
}
 
Example #7
Source File: ItemRoyalArmor.java    From ToroQuest with GNU General Public License v3.0 6 votes vote down vote up
@SubscribeEvent
public static void init(final RegistryEvent.Register<Item> event) {
	bootsItem = new ItemRoyalArmor(NAME + "_boots", 1, EntityEquipmentSlot.FEET);
	leggingsItem = new ItemRoyalArmor(NAME + "_leggings", 2, EntityEquipmentSlot.LEGS);
	helmetItem = new ItemRoyalArmor(NAME + "_helmet", 1, EntityEquipmentSlot.HEAD);
	chestplateItem = new ItemRoyalArmor(NAME + "_chestplate", 1, EntityEquipmentSlot.CHEST);

	bootsItem.setRegistryName(new ResourceLocation(ToroQuest.MODID, NAME + "_boots"));
	event.getRegistry().register(bootsItem);

	leggingsItem.setRegistryName(new ResourceLocation(ToroQuest.MODID, NAME + "_leggings"));
	event.getRegistry().register(leggingsItem);

	helmetItem.setRegistryName(new ResourceLocation(ToroQuest.MODID, NAME + "_helmet"));
	event.getRegistry().register(helmetItem);

	chestplateItem.setRegistryName(new ResourceLocation(ToroQuest.MODID, NAME + "_chestplate"));
	event.getRegistry().register(chestplateItem);
}
 
Example #8
Source File: ItemReinforcedDiamondArmor.java    From ToroQuest with GNU General Public License v3.0 6 votes vote down vote up
@SubscribeEvent
public static void init(final RegistryEvent.Register<Item> event) {
	bootsItem = new ItemReinforcedDiamondArmor(NAME + "_boots", 1, EntityEquipmentSlot.FEET);
	leggingsItem = new ItemReinforcedDiamondArmor(NAME + "_leggings", 2, EntityEquipmentSlot.LEGS);
	helmetItem = new ItemReinforcedDiamondArmor(NAME + "_helmet", 1, EntityEquipmentSlot.HEAD);
	chestplateItem = new ItemReinforcedDiamondArmor(NAME + "_chestplate", 1, EntityEquipmentSlot.CHEST);

	bootsItem.setRegistryName(new ResourceLocation(ToroQuest.MODID, NAME + "_boots"));
	event.getRegistry().register(bootsItem);

	leggingsItem.setRegistryName(new ResourceLocation(ToroQuest.MODID, NAME + "_leggings"));
	event.getRegistry().register(leggingsItem);

	helmetItem.setRegistryName(new ResourceLocation(ToroQuest.MODID, NAME + "_helmet"));
	event.getRegistry().register(helmetItem);

	chestplateItem.setRegistryName(new ResourceLocation(ToroQuest.MODID, NAME + "_chestplate"));
	event.getRegistry().register(chestplateItem);
}
 
Example #9
Source File: TraverseWorld.java    From CommunityMod with GNU Lesser General Public License v2.1 6 votes vote down vote up
public static void register(Version versionAdded,
                            Biome biome,
                            BiomeType type,
                            String name,
                            int weight,
                            boolean disabled,
                            boolean canSpawn,
                            VillageReplacements villageReplacements,
                            RegistryEvent.Register<Biome> event,
                            BiomeDictionary.Type... biomeDictTypes) {
    if (!disabled) {
        biome.setRegistryName(new ResourceLocation(TraverseConstants.MOD_ID, name));
        event.getRegistry().register(biome);
        for (BiomeDictionary.Type biomeDictType : biomeDictTypes) {
            BiomeDictionary.addTypes(biome, biomeDictType);
        }
        biomeList.add(new TraverseBiomeEntry(biome, type, weight, canSpawn, !TraverseConfig.disallowVillages && villageReplacements != NO_VILLAGES, versionAdded));
        if (!TraverseConfig.disallowVillages && villageReplacements != NO_VILLAGES && villageReplacements != NO_REPLACEMENTS) {
            villageReplacementBiomes.put(biome, villageReplacements);
        }
    }
}
 
Example #10
Source File: EnderUtilitiesBlocks.java    From enderutilities with GNU Lesser General Public License v3.0 6 votes vote down vote up
@SubscribeEvent
public static void registerItemBlocks(RegistryEvent.Register<Item> event)
{
    IForgeRegistry<Item> registry = event.getRegistry();

    // Register ItemBlocks
    registerItemBlock(registry, ASU,                    Configs.disableBlockASU);
    registerItemBlock(registry, BARREL,                 Configs.disableBlockBarrel);
    registerItemBlock(registry, DRAWBRIDGE,             Configs.disableBlockDrawbridge);
    registerItemBlock(registry, ELEVATOR,               Configs.disableBlockEnderElevator);
    registerItemBlock(registry, ELEVATOR_SLAB,          Configs.disableBlockEnderElevator);
    registerItemBlock(registry, ELEVATOR_LAYER,         Configs.disableBlockEnderElevator);
    registerItemBlock(registry, INSERTER,               Configs.disableBlockInserter);
    registerItemBlock(registry, FLOOR,                  Configs.disableBlockFloor);
    registerItemBlock(registry, ENERGY_BRIDGE,          Configs.disableBlockEnergyBridge);
    registerItemBlock(registry, ENDER_FURNACE,          Configs.disableBlockMachine_0);
    registerItemBlock(registry, MACHINE_1,              Configs.disableBlockMachine_1);
    registerItemBlock(registry, MOLECULAR_EXCITER,      Configs.disableBlockMolecularExciter, false);
    registerItemBlock(registry, MSU,                    Configs.disableBlockMSU);
    registerItemBlock(registry, PHASING,                Configs.disableBlockPhasing);
    // No ItemBlock for PORTAL
    registerItemBlock(registry, PORTAL_FRAME,           Configs.disableBlockPortalFrame, false);
    registerItemBlock(registry, PORTAL_PANEL,           Configs.disableBlockPortalPanel, false);
    registerItemBlock(registry, SOUND_BLOCK,            Configs.disableBlockSoundBlock);
    registerItemBlock(registry, STORAGE_0,              Configs.disableBlockStorage_0);
}
 
Example #11
Source File: ItemSamuraiArmor.java    From ToroQuest with GNU General Public License v3.0 6 votes vote down vote up
@SubscribeEvent
public static void init(final RegistryEvent.Register<Item> event) {
	bootsItem = new ItemSamuraiArmor(NAME + "_boots", 1, EntityEquipmentSlot.FEET);
	leggingsItem = new ItemSamuraiArmor(NAME + "_leggings", 2, EntityEquipmentSlot.LEGS);
	helmetItem = new ItemSamuraiArmor(NAME + "_helmet", 1, EntityEquipmentSlot.HEAD);
	chestplateItem = new ItemSamuraiArmor(NAME + "_chestplate", 1, EntityEquipmentSlot.CHEST);

	bootsItem.setRegistryName(new ResourceLocation(ToroQuest.MODID, NAME + "_boots"));
	event.getRegistry().register(bootsItem);

	leggingsItem.setRegistryName(new ResourceLocation(ToroQuest.MODID, NAME + "_leggings"));
	event.getRegistry().register(leggingsItem);

	helmetItem.setRegistryName(new ResourceLocation(ToroQuest.MODID, NAME + "_helmet"));
	event.getRegistry().register(helmetItem);

	chestplateItem.setRegistryName(new ResourceLocation(ToroQuest.MODID, NAME + "_chestplate"));
	event.getRegistry().register(chestplateItem);
}
 
Example #12
Source File: CommonProxy.java    From GregTech with GNU Lesser General Public License v3.0 6 votes vote down vote up
@SubscribeEvent
public static void registerRecipes(RegistryEvent.Register<IRecipe> event) {
    GTLog.logger.info("Registering ore dictionary...");

    MetaItems.registerOreDict();
    MetaBlocks.registerOreDict();
    OreDictionaryLoader.init();
    MaterialInfoLoader.init();

    GTLog.logger.info("Registering recipes...");

    MetaItems.registerRecipes();
    MachineRecipeLoader.init();
    CraftingRecipeLoader.init();
    MetaTileEntityLoader.init();
    RecipeHandlerList.register();
}
 
Example #13
Source File: RoutiductBlocks.java    From CommunityMod with GNU Lesser General Public License v2.1 5 votes vote down vote up
public static void register(Block block, RegistryEvent.Register<Block> event, String... oreNames) {
    block.setCreativeTab(CommunityGlobals.TAB);
    event.getRegistry().register(block);
    ItemBlock itemBlock = new ItemBlock(block);
    ShootingStar.registerModel(new ModelCompound(RoutiductConstants.MOD_ID, itemBlock));
    itemBlock.setRegistryName(block.getRegistryName());
    ForgeRegistries.ITEMS.register(itemBlock);
    for (String oreName : oreNames) {
        OreDictionary.registerOre(oreName, block);
    }
}
 
Example #14
Source File: BlocksValkyrienSkiesControl.java    From Valkyrien-Skies with Apache License 2.0 5 votes vote down vote up
public void registerBlocks(RegistryEvent.Register<Block> event) {
    event.getRegistry().register(basicEngine);
    event.getRegistry().register(advancedEngine);
    event.getRegistry().register(eliteEngine);
    event.getRegistry().register(ultimateEngine);
    event.getRegistry().register(redstoneEngine);

    event.getRegistry().register(compactedValkyrium);
    event.getRegistry().register(captainsChair);
    event.getRegistry().register(passengerChair);

    event.getRegistry().register(shipHelm);
    event.getRegistry().register(shipWheel);
    event.getRegistry().register(speedTelegraph);
    event.getRegistry().register(dummyTelegraph);
    event.getRegistry().register(networkRelay);

    event.getRegistry().register(liftValve);
    event.getRegistry().register(liftLever);
    event.getRegistry().register(networkDisplay);
    event.getRegistry().register(gyroscopeStabilizer);
    event.getRegistry().register(gyroscopeDampener);

    event.getRegistry().register(valkyriumCompressorPart);
    event.getRegistry().register(valkyriumEnginePart);
    event.getRegistry().register(rudderPart);
    event.getRegistry().register(giantPropellerPart);
    event.getRegistry().register(gearbox);
    event.getRegistry().register(rotationAxle);
}
 
Example #15
Source File: ValkyrienSkiesOpenComputers.java    From Valkyrien-Skies with Apache License 2.0 5 votes vote down vote up
@SubscribeEvent
public void registerBlocks(RegistryEvent.Register<Block> event) {
    gpsBlock = new GPSBlock().setTranslationKey("gpsblock")
        .setRegistryName(MOD_ID, "gpsblock")
        .setCreativeTab(ValkyrienSkiesMod.VS_CREATIVE_TAB);

    event.getRegistry().register(gpsBlock);
}
 
Example #16
Source File: ShootingStar.java    From CommunityMod with GNU Lesser General Public License v2.1 5 votes vote down vote up
public static void registerBlocks(String modid, RegistryEvent.Register<Block> event) {
    for (BlockCompound compound : blockList) {
        if (compound.getModid().equals(modid)) {
            event.getRegistry().register(compound.getBlock());
        }
    }
}
 
Example #17
Source File: OpenMods.java    From OpenModsLib with MIT License 5 votes vote down vote up
@SubscribeEvent
public static void registerTargets(RegistryEvent.Register<TargetTypeProvider> evt) {
	RpcCallDispatcher.startTargetRegistration(evt.getRegistry())
			.registerTargetWrapper(EntityRpcTarget.class)
			.registerTargetWrapper(TileEntityRpcTarget.class)
			.registerTargetWrapper(SyncRpcTarget.SyncEntityRpcTarget.class)
			.registerTargetWrapper(SyncRpcTarget.SyncTileEntityRpcTarget.class);
}
 
Example #18
Source File: SurvivalistMod.java    From Survivalist with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private void registerRecipeSerializers(RegistryEvent.Register<IRecipeSerializer<?>> event)
{
    CraftingHelper.register(ConfigurationCondition.Serializer.INSTANCE);
    CraftingHelper.register(ConfigToggledIngredientSerializer.NAME, ConfigToggledIngredientSerializer.INSTANCE);

    event.getRegistry().registerAll(
            new DryingRecipe.Serializer().setRegistryName("drying"),
            new ChoppingRecipe.Serializer().setRegistryName("chopping")
    );
}
 
Example #19
Source File: ValkyrienSkiesWorld.java    From Valkyrien-Skies with Apache License 2.0 5 votes vote down vote up
@SubscribeEvent
public static void registerBlocks(RegistryEvent.Register<Block> event) {
    log.debug("Registering blocks...");

    INSTANCE.valkyriumOre = new BlockValkyriumOre(Material.ROCK).setHardness(3f)
        .setTranslationKey("valkyrium_ore")
        .setRegistryName(MOD_ID, "valkyrium_ore")
        .setCreativeTab(ValkyrienSkiesMod.VS_CREATIVE_TAB);

    event.getRegistry()
        .register(INSTANCE.valkyriumOre);

}
 
Example #20
Source File: TraverseWorld.java    From CommunityMod with GNU Lesser General Public License v2.1 5 votes vote down vote up
@SubscribeEvent
public static void registerBiomes(RegistryEvent.Register<Biome> event) {
    register(V0, autumnalWoodsBiome, BiomeType.COOL, "autumnal_woods", 8, TraverseConfig.disableAutumnalWoods, true, event, FOREST);
    register(V0, woodlandsBiome, BiomeType.WARM, "woodlands", 9, TraverseConfig.disableWoodlands, true, NO_REPLACEMENTS, event, PLAINS);
    register(V0, miniJungleBiome, BiomeType.WARM, "mini_jungle", 3, TraverseConfig.disableMiniJungle, true, event, DENSE, JUNGLE, HOT, WET);
    register(V0, meadowBiome, BiomeType.COOL, "meadow", 7, TraverseConfig.disableMeadow, true, NO_REPLACEMENTS, event, PLAINS, LUSH, WET);
    register(V0, lushSwampBiome, BiomeType.WARM, "green_swamp", 6, TraverseConfig.disableLushSwamp, false, event, LUSH, WET, SWAMP);
    register(V0, redDesertBiome, BiomeType.DESERT, "red_desert", 6, TraverseConfig.disableRedDesert, false, RED_DESERT_REPLACEMENTS, event, HOT, DRY, SANDY);
    register(V0, temperateRainforestBiome, BiomeType.COOL, "temperate_rainforest", 8, TraverseConfig.disableTemperateRainforest, true, event, FOREST, CONIFEROUS);
    register(V1, badlandsBiome, BiomeType.WARM, "badlands", 5, TraverseConfig.disableBadlands, false, NO_REPLACEMENTS, event, PLAINS, DRY, HOT, SPARSE);
    register(V1, mountainousDesertBiome, BiomeType.DESERT, "mountainous_desert", 2, TraverseConfig.disableMountainousDesert, false, event, MOUNTAIN, DRY, HOT, SANDY);
    register(V1, rockyPlateauBiome, BiomeType.WARM, "rocky_plateau", 4, TraverseConfig.disableRockyPlateau, false, NO_REPLACEMENTS, event, HOT, MOUNTAIN);
    register(V1, forestedHillsBiome, BiomeType.COOL, "forested_hills", 6, TraverseConfig.disableForestedHills, true, event, FOREST, HILLS);
    register(V1, birchForestedHillsBiome, BiomeType.COOL, "birch_forested_hills", 2, TraverseConfig.disableBirchForestedHills, true, event, FOREST, HILLS);
    register(V1, autumnalWoodedHillsBiome, BiomeType.COOL, "autumnal_wooded_hills", 1, TraverseConfig.disableAutumnalWoodedHills, true, event, FOREST, HILLS);
    register(V2, cliffsBiome, BiomeType.COOL, "cliffs", 2, TraverseConfig.disableCliffs, false, event, MOUNTAIN, COLD, HILLS);
    register(V2, glacierBiome, BiomeType.ICY, "glacier", 6, TraverseConfig.disableGlacier, false, event, MOUNTAIN, COLD, SNOWY);
    register(V2, glacierSpikesBiome, BiomeType.ICY, "glacier_spikes", 2, TraverseConfig.disableGlacierSpikes, false, event, MOUNTAIN, COLD, SNOWY);
    register(V2, snowyConiferousForestBiome, BiomeType.ICY, "snowy_coniferous_forest", 5, TraverseConfig.disableSnowyConiferousForest, true, event, COLD, SNOWY, FOREST, CONIFEROUS);
    register(V3, lushHillsBiome, BiomeType.COOL, "lush_hills", 6, TraverseConfig.disableLushHills, true, NO_REPLACEMENTS, event, LUSH, HILLS, SPARSE, WET);
    register(V3, canyonBiome, BiomeType.DESERT, "canyon", 5, TraverseConfig.disableCanyon, false, event, DRY, DEAD);
    register(V3, cragCliffsBiome, BiomeType.COOL, "crag_cliffs", 4, TraverseConfig.disableCragCliffs, false, event, COLD, DEAD);
    register(V4, desertShrublandBiome, BiomeType.DESERT, "desert_shrubland", 5, TraverseConfig.disableDesertShrubland, false, DESERT_REPLACEMENTS, event, HOT, DRY, SANDY, DEAD);
    register(V5, thicketBiome, BiomeType.WARM, "thicket", 6, TraverseConfig.disableThicket, true, event, DENSE, FOREST);
    register(V5, aridHighlandBiome, BiomeType.DESERT, "arid_highland", 4, TraverseConfig.disableAridHighland, false, DESERT_REPLACEMENTS, event, HOT, DRY, SPARSE, MOUNTAIN, HILLS);
    register(V5, rockyPlainsBiome, BiomeType.COOL, "rocky_plains", 4, TraverseConfig.disableRockyPlains, true, NO_REPLACEMENTS, event, PLAINS, HILLS, SPARSE);
}
 
Example #21
Source File: RoutiductBlocks.java    From CommunityMod with GNU Lesser General Public License v2.1 5 votes vote down vote up
public static void init(RegistryEvent.Register<Block> event) {
    for (EnumProtocol protocol : EnumProtocol.values()) {
        BlockRoutiduct routiduct = new BlockRoutiduct(protocol);
        register(routiduct, event, "blockRoutiduct", "routiduct" + protocol.name);
        BlockPackager packager = new BlockPackager(protocol);
        register(packager, event, "blockPackager", "packager" + protocol.name);
        BlockUnpackager unpackager = new BlockUnpackager(protocol);
        register(unpackager, event, "blockUnpackager", "unpackager" + protocol.name);
        BlockRelay relay = new BlockRelay(protocol);
        register(relay, event, "blockRelay", "relay" + protocol.name);
    }
}
 
Example #22
Source File: RoutiductItems.java    From CommunityMod with GNU Lesser General Public License v2.1 5 votes vote down vote up
public static void register(Item item, RegistryEvent.Register<Item> event, String... oreNames) {
    ShootingStar.registerModel(new ModelCompound(RoutiductConstants.MOD_ID, item));
    event.getRegistry().register(item);
    for (String oreName : oreNames) {
        OreDictionary.registerOre(oreName, item);
    }
}
 
Example #23
Source File: RegistryEventDispatcher.java    From patchwork-api with GNU Lesser General Public License v2.1 5 votes vote down vote up
@SuppressWarnings("unchecked")
public static void dispatchRegistryEvents(Consumer<RegistryEvent.Register> handler) {
	List<Identifier> expectedOrder = getExpectedOrdering();

	if (registered.size() < expectedOrder.size()) {
		throw new IllegalStateException("RegistryEventDispatcher is missing " + (expectedOrder.size() - registered.size()) + " registries!");
	}

	for (IForgeRegistry registry : registered) {
		Identifier identifier = registry.getRegistryName();
		Identifier expected = expectedOrder.remove(0);

		if (!identifier.equals(expected)) {
			throw new IllegalStateException("Bad ordering of registries in RegistryEventDispatcher: expected " + expected + " but got " + identifier);
		}

		if (CHECK_SUPERS) {
			Class superType = registry.getRegistrySuperType();

			for (Map.Entry<Identifier, Object> entry : (Set<Map.Entry<Identifier, Object>>) registry.getEntries()) {
				if (!superType.isAssignableFrom(entry.getValue().getClass())) {
					throw new IllegalStateException("Bad registry type for " + identifier + " (" + entry.getKey() + ")");
				}
			}
		}

		handler.accept(new RegistryEvent.Register(registry));
	}
}
 
Example #24
Source File: ModParticles.java    From MiningGadgets with MIT License 5 votes vote down vote up
@SubscribeEvent
public static void registerParticles(RegistryEvent.Register<ParticleType<?>> evt) {
    evt.getRegistry().registerAll(
            new LaserParticleType().setRegistryName("laserparticle"),
            new PlayerParticleType().setRegistryName("playerparticle"),
            new LightParticleType().setRegistryName("light_particle")
    );
}
 
Example #25
Source File: CommonProxy.java    From GregTech with GNU Lesser General Public License v3.0 5 votes vote down vote up
@SubscribeEvent
public static void registerBlocks(RegistryEvent.Register<Block> event) {
    GTLog.logger.info("Registering Blocks...");
    IForgeRegistry<Block> registry = event.getRegistry();

    registry.register(MACHINE);
    registry.register(CABLE);
    registry.register(FLUID_PIPE);

    registry.register(FOAM);
    registry.register(REINFORCED_FOAM);
    registry.register(PETRIFIED_FOAM);
    registry.register(REINFORCED_PETRIFIED_FOAM);
    registry.register(BOILER_CASING);
    registry.register(BOILER_FIREBOX_CASING);
    registry.register(METAL_CASING);
    registry.register(TURBINE_CASING);
    registry.register(MACHINE_CASING);
    registry.register(MUTLIBLOCK_CASING);
    registry.register(WIRE_COIL);
    registry.register(WARNING_SIGN);
    registry.register(GRANITE);
    registry.register(MINERAL);
    registry.register(CONCRETE);
    registry.register(LOG);
    registry.register(LEAVES);
    registry.register(SAPLING);
    registry.register(CRUSHER_BLADE);
    registry.register(SURFACE_ROCK_NEW);

    COMPRESSED.values().stream().distinct().forEach(registry::register);
    SURFACE_ROCKS.values().stream().distinct().forEach(registry::register);
    FRAMES.values().stream().distinct().forEach(registry::register);
    ORES.forEach(registry::register);
    FLUID_BLOCKS.forEach(registry::register);
}
 
Example #26
Source File: SurvivalistMod.java    From Survivalist with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private void registerContainers(RegistryEvent.Register<ContainerType<?>> event)
{
    event.getRegistry().registerAll(
            withName(new ContainerType<>(DryingRackContainer::new), "rack"),
            withName(new ContainerType<>(SawmillContainer::new), "sawmill")
    );
}
 
Example #27
Source File: SurvivalistMod.java    From Survivalist with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private void lootModifiers(RegistryEvent.Register<GlobalLootModifierSerializer<?>> event)
{
    BlockTagCondition.BLOCK_TAG_CONDITION = LootConditionManager.func_237475_a_("survivalist:block_tag", new BlockTagCondition.Serializer());
    event.getRegistry().register(
            new AppendLootTable.Serializer().setRegistryName(location("append_loot"))
    );
}
 
Example #28
Source File: ModBlocks.java    From Wizardry with GNU Lesser General Public License v3.0 5 votes vote down vote up
@SubscribeEvent
	public static void remapFluids(RegistryEvent.MissingMappings<Block> event) {
		event.getMappings().stream()
				.filter(mapping -> mapping.key.getPath().equals("mana"))
				.forEach(mapping -> mapping.remap(ModFluids.MANA.getActualBlock()));
		event.getMappings().stream()
				.filter(mapping -> mapping.key.getPath().equals("nacre"))
				.forEach(mapping -> mapping.remap(ModFluids.NACRE.getActualBlock()));
//		event.getMappings().stream()
//				.filter(mapping -> mapping.key.getPath().equals("lethe"))
//				.forEach(mapping -> mapping.remap(ModFluids.LETHE.getActualBlock()));
	}
 
Example #29
Source File: TraverseWorld.java    From Traverse-Legacy-1-12-2 with MIT License 5 votes vote down vote up
@SubscribeEvent
public static void registerBiomes(RegistryEvent.Register<Biome> event) {
	register(V0, autumnalWoodsBiome, BiomeType.COOL, "autumnal_woods", 8, TraverseConfig.disableAutumnalWoods, true, event, FOREST);
	register(V0, woodlandsBiome, BiomeType.WARM, "woodlands", 9, TraverseConfig.disableWoodlands, true, NO_REPLACEMENTS, event, PLAINS);
	register(V0, miniJungleBiome, BiomeType.WARM, "mini_jungle", 3, TraverseConfig.disableMiniJungle, true, event, DENSE, JUNGLE, HOT, WET);
	register(V0, meadowBiome, BiomeType.COOL, "meadow", 7, TraverseConfig.disableMeadow, true, NO_REPLACEMENTS, event, PLAINS, LUSH, WET);
	register(V0, lushSwampBiome, BiomeType.WARM, "green_swamp", 6, TraverseConfig.disableLushSwamp, false, event, LUSH, WET, SWAMP);
	register(V0, redDesertBiome, BiomeType.DESERT, "red_desert", 6, TraverseConfig.disableRedDesert, false, RED_DESERT_REPLACEMENTS, event, HOT, DRY, SANDY);
	register(V0, temperateRainforestBiome, BiomeType.COOL, "temperate_rainforest", 8, TraverseConfig.disableTemperateRainforest, true, event, FOREST, CONIFEROUS);
	register(V1, badlandsBiome, BiomeType.WARM, "badlands", 5, TraverseConfig.disableBadlands, false, NO_REPLACEMENTS, event, PLAINS, DRY, HOT, SPARSE);
	register(V1, mountainousDesertBiome, BiomeType.DESERT, "mountainous_desert", 2, TraverseConfig.disableMountainousDesert, false, event, MOUNTAIN, DRY, HOT, SANDY);
	register(V1, rockyPlateauBiome, BiomeType.WARM, "rocky_plateau", 4, TraverseConfig.disableRockyPlateau, false, NO_REPLACEMENTS, event, HOT, MOUNTAIN);
	register(V1, forestedHillsBiome, BiomeType.COOL, "forested_hills", 6, TraverseConfig.disableForestedHills, true, event, FOREST, HILLS);
	register(V1, birchForestedHillsBiome, BiomeType.COOL, "birch_forested_hills", 2, TraverseConfig.disableBirchForestedHills, true, event, FOREST, HILLS);
	register(V1, autumnalWoodedHillsBiome, BiomeType.COOL, "autumnal_wooded_hills", 1, TraverseConfig.disableAutumnalWoodedHills, true, event, FOREST, HILLS);
	register(V2, cliffsBiome, BiomeType.COOL, "cliffs", 2, TraverseConfig.disableCliffs, false, event, MOUNTAIN, COLD, HILLS);
	register(V2, glacierBiome, BiomeType.ICY, "glacier", 6, TraverseConfig.disableGlacier, false, event, MOUNTAIN, COLD, SNOWY);
	register(V2, glacierSpikesBiome, BiomeType.ICY, "glacier_spikes", 2, TraverseConfig.disableGlacierSpikes, false, event, MOUNTAIN, COLD, SNOWY);
	register(V2, snowyConiferousForestBiome, BiomeType.ICY, "snowy_coniferous_forest", 5, TraverseConfig.disableSnowyConiferousForest, true, event, COLD, SNOWY, FOREST, CONIFEROUS);
	register(V3, lushHillsBiome, BiomeType.COOL, "lush_hills", 6, TraverseConfig.disableLushHills, true, NO_REPLACEMENTS, event, LUSH, HILLS, SPARSE, WET);
	register(V3, canyonBiome, BiomeType.DESERT, "canyon", 5, TraverseConfig.disableCanyon, false, event, DRY, DEAD);
	register(V3, cragCliffsBiome, BiomeType.COOL, "crag_cliffs", 4, TraverseConfig.disableCragCliffs, false, event, COLD, DEAD);
	register(V4, desertShrublandBiome, BiomeType.DESERT, "desert_shrubland", 5, TraverseConfig.disableDesertShrubland, false, DESERT_REPLACEMENTS, event, HOT, DRY, SANDY, DEAD);
	register(V5, thicketBiome, BiomeType.WARM, "thicket", 6, TraverseConfig.disableThicket, true, event, DENSE, FOREST);
	register(V5, aridHighlandBiome, BiomeType.DESERT, "arid_highland", 4, TraverseConfig.disableAridHighland, false, DESERT_REPLACEMENTS, event, HOT, DRY, SPARSE, MOUNTAIN, HILLS);
	register(V5, rockyPlainsBiome, BiomeType.COOL, "rocky_plains", 4, TraverseConfig.disableRockyPlains, true, NO_REPLACEMENTS, event, PLAINS, HILLS, SPARSE);
}
 
Example #30
Source File: GokiSounds.java    From GokiStats with MIT License 5 votes vote down vote up
@SubscribeEvent
public void registerSounds(RegistryEvent.Register<SoundEvent> event) {
    event.getRegistry().registerAll(
            new SoundEvent(new ResourceLocation(MODID, "treasure")),
            new SoundEvent(new ResourceLocation(MODID, "magician")),
            new SoundEvent(new ResourceLocation(MODID, "reaper"))
    );
}