當前位置: 首頁>>代碼示例>>Java>>正文


Java GameRegistry類代碼示例

本文整理匯總了Java中cpw.mods.fml.common.registry.GameRegistry的典型用法代碼示例。如果您正苦於以下問題:Java GameRegistry類的具體用法?Java GameRegistry怎麽用?Java GameRegistry使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


GameRegistry類屬於cpw.mods.fml.common.registry包,在下文中一共展示了GameRegistry類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: init

import cpw.mods.fml.common.registry.GameRegistry; //導入依賴的package包/類
@EventHandler
public void init(FMLInitializationEvent evt) {
	INSTANCE.registerMessage(LobbyPlayerOpenedGuiPacketHandler.class, LobbyPlayerOpenedGuiPacket.class, 0,
			Side.SERVER);

	INSTANCE.registerMessage(LobbyBeginGamePacketHandler.class, LobbyBeginGamePacket.class, 1, Side.SERVER);
	INSTANCE.registerMessage(PacketSyncPlayerPropertiesClientHandler.class, PacketSyncPlayerPropertiesClient.class,
			2, Side.CLIENT);
	INSTANCE.registerMessage(PacketSyncPlayerPropertiesServerHandler.class, PacketSyncPlayerPropertiesServer.class,
			3, Side.SERVER);

	INSTANCE.registerMessage(PacketSyncTileEntityServerHandler.class, PacketSyncTileEntityServer.class, 4,
			Side.SERVER);
	INSTANCE.registerMessage(PacketSyncTileEntityClientHandler.class, PacketSyncTileEntityClient.class, 5,
			Side.CLIENT);

	NetworkRegistry.INSTANCE.registerGuiHandler(PAYDAY.instance, new MGuiHandler());
	GameRegistry.registerBlock(lobbyBlock, "Lobby");
	GameRegistry.registerTileEntity(LobbyTileEntity.class, "lobby_tile_entity");

	FMLCommonHandler.instance().bus().register(eventHandler);
	MinecraftForge.EVENT_BUS.register(eventHandler);
}
 
開發者ID:TominoCZ,項目名稱:PAYDAY,代碼行數:24,代碼來源:PAYDAY.java

示例2: init

import cpw.mods.fml.common.registry.GameRegistry; //導入依賴的package包/類
@Mod.EventHandler
public void init(FMLInitializationEvent event) {
    Configurator.configure(new File("config/" + MODID + ".cfg"));
    GameRegistry.registerWorldGenerator(new Decorator(), 4096);
    FMLCommonHandler.instance().bus().register(this);
    MinecraftForge.EVENT_BUS.register(this);
}
 
開發者ID:ternsip,項目名稱:StructPro,代碼行數:8,代碼來源:Structpro.java

示例3: init

import cpw.mods.fml.common.registry.GameRegistry; //導入依賴的package包/類
@EventHandler
public void init(FMLInitializationEvent event) {
	NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);

	ModRecipes.init();

	proxy.registerEvents();
	proxy.registerEntities();
	proxy.registerRenderers();

	if (ModEntityList.hasEntitiesWithEggs()) {
		ModEntityList.entity_egg = new ItemEntityEgg();
		GameRegistry.registerItem(ModEntityList.entity_egg, "entity_egg");
		OreDictionary.registerOre("mobEgg", ModEntityList.entity_egg);
	}

	isTinkersConstructLoaded = Loader.isModLoaded("TConstruct");
}
 
開發者ID:jm-organization,項目名稱:connor41-etfuturum2,代碼行數:19,代碼來源:EtFuturum.java

示例4: init

import cpw.mods.fml.common.registry.GameRegistry; //導入依賴的package包/類
public static final void init() {

copperingot = new CopperIngot();
aluminiumingot = new AluminiumIngot();
leadingot = new LeadIngot();
nickelingot = new NickelIngot();
tiningot = new TinIngot();
uraniumingot = new UraniumIngot();
ruby = new Ruby();
sulfurdust = new SulfurDust();
glassbottomtank = new GlassBottomTank();

GameRegistry.registerItem(copperingot, "copper_ingot");
GameRegistry.registerItem(aluminiumingot, "aluminium_ingot");
GameRegistry.registerItem(leadingot, "lead_ingot");
GameRegistry.registerItem(nickelingot, "nickel_ingot");
GameRegistry.registerItem(tiningot, "tin_ingot");
GameRegistry.registerItem(uraniumingot, "uranium_ingot");
GameRegistry.registerItem(ruby, "ruby");
GameRegistry.registerItem(sulfurdust, "sulfur_dust");
GameRegistry.registerItem(glassbottomtank, "glass_bottom_tank");

  }
 
開發者ID:grand-mine-inc,項目名稱:Steam-and-Steel,代碼行數:24,代碼來源:GrandItem.java

示例5: addRecipe

import cpw.mods.fml.common.registry.GameRegistry; //導入依賴的package包/類
public static void addRecipe() {
	
	GameRegistry.addRecipe( new ItemStack(GrandBlocks.aluminiumblock), new Object[] { "###", "###", "###", '#', GrandItem.aluminiumingot});
	GameRegistry.addRecipe( new ItemStack(GrandItem.aluminiumingot, 9), new Object[] { "#", '#', GrandBlocks.aluminiumblock});
	GameRegistry.addRecipe( new ItemStack(GrandBlocks.copperblock), new Object[] { "###", "###", "###", '#', GrandItem.copperingot});
	GameRegistry.addRecipe( new ItemStack(GrandItem.copperingot, 9), new Object[] { "#", '#', GrandBlocks.copperblock});
	GameRegistry.addRecipe( new ItemStack(GrandBlocks.leadblock), new Object[] { "###", "###", "###", '#', GrandItem.leadingot});
	GameRegistry.addRecipe( new ItemStack(GrandItem.leadingot, 9), new Object[] { "#", '#', GrandBlocks.leadblock});
	GameRegistry.addRecipe( new ItemStack(GrandBlocks.nickelblock), new Object[] { "###", "###", "###", '#', GrandItem.nickelingot});
	GameRegistry.addRecipe( new ItemStack(GrandItem.nickelingot, 9), new Object[] { "#", '#', GrandBlocks.nickelblock});
	GameRegistry.addRecipe( new ItemStack(GrandBlocks.rubyblock), new Object[] { "###", "###", "###", '#', GrandItem.ruby});
	GameRegistry.addRecipe( new ItemStack(GrandItem.ruby, 9), new Object[] { "#", '#', GrandBlocks.rubyblock});
	GameRegistry.addRecipe( new ItemStack(GrandBlocks.tinblock), new Object[] { "###", "###", "###", '#', GrandItem.tiningot});
	GameRegistry.addRecipe( new ItemStack(GrandItem.tiningot, 9), new Object[] { "#", '#', GrandBlocks.tinblock});
	GameRegistry.addRecipe( new ItemStack(GrandBlocks.uraniumblock), new Object[] { "###", "###", "###", '#', GrandItem.uraniumingot});
	GameRegistry.addRecipe( new ItemStack(GrandItem.uraniumingot, 9), new Object[] { "#", '#', GrandBlocks.uraniumblock});
	GameRegistry.addRecipe( new ItemStack(GrandFluidTank.glassfluidtank), new Object[] { "###", "# #", "111", '#', Blocks.glass, '1', GrandItem.glassbottomtank});
	GameRegistry.addRecipe( new ItemStack(GrandItem.glassbottomtank, 3), new Object[] { "###", '#', Blocks.glass_pane});
	
}
 
開發者ID:grand-mine-inc,項目名稱:Steam-and-Steel,代碼行數:21,代碼來源:BaseCraft.java

示例6: addWeapon

import cpw.mods.fml.common.registry.GameRegistry; //導入依賴的package包/類
private void addWeapon(_WeaponBase weapon, ModelBase model, String weaponName, boolean isClient, String handedness)
{
	if (Main.weapons == null) { Main.weapons = new ArrayList<_WeaponBase>(); }
	
	Main.weapons.add(weapon);
	
	GameRegistry.registerItem(weapon, "weaponchevsky_" + weaponName);	// And register it
	
	weapon.setUniqueName(weaponName);
	
	if (isClient && useModels && model != null)	// Do we care about models? And if we do, do we got a custom weapon model? :O
	{
		if (Main.models == null) { Main.models = new ArrayList<ModelBase>(); }	// Init
		
		Main.models.add(model);								// Keeping track of it
		proxy.registerWeaponRenderer(weapon, (byte) Main.models.indexOf(model));	// And registering its renderer
	}
}
 
開發者ID:Domochevsky,項目名稱:minecraft-quiverbow,代碼行數:19,代碼來源:Main.java

示例7: addRecipes

import cpw.mods.fml.common.registry.GameRegistry; //導入依賴的package包/類
@Override
public void addRecipes() 
{ 
	// A bundle of ice-laced iron ingots (4), merged with a slime ball
       GameRegistry.addShapelessRecipe(new ItemStack(this),
               Items.iron_ingot,
               Items.iron_ingot,
               Items.iron_ingot,
               Items.iron_ingot,
               Blocks.ice,
               Blocks.ice,
               Blocks.ice,
               Blocks.ice,
               Items.slime_ball
       );
}
 
開發者ID:Domochevsky,項目名稱:minecraft-quiverbow,代碼行數:17,代碼來源:ColdIronClip.java

示例8: addRecipes

import cpw.mods.fml.common.registry.GameRegistry; //導入依賴的package包/類
@Override
public void addRecipes() 
{ 
	// A box of flint dust (4 dust per flint, meaning 32 per box), merged with wooden planks
       GameRegistry.addShapelessRecipe(new ItemStack(this),
               Items.flint,
               Items.flint,
               Items.flint,
               Items.flint,
               Items.flint,
               Items.flint,
               Items.flint,
               Items.flint,
               Blocks.planks
       ); 
}
 
開發者ID:Domochevsky,項目名稱:minecraft-quiverbow,代碼行數:17,代碼來源:BoxOfFlintDust.java

示例9: addRecipes

import cpw.mods.fml.common.registry.GameRegistry; //導入依賴的package包/類
@Override
public void addRecipes()
{
	if (this.Enabled)
	{
		// One redstone sprayer (empty)
		GameRegistry.addRecipe(new ItemStack(this, 1 , this.getMaxDamage()), "zxz", "zbz", "cya",
				'x', Blocks.piston,
				'y', Blocks.tripwire_hook,
				'z', Blocks.obsidian,
				'a', Items.repeater,
				'b', Blocks.sticky_piston,
				'c', Items.flint_and_steel
				);
	}
	else if (Main.noCreative) { this.setCreativeTab(null); }	// Not enabled and not allowed to be in the creative menu

	Helper.registerAmmoRecipe(LargeNetherrackMagazine.class, this);
}
 
開發者ID:Domochevsky,項目名稱:minecraft-quiverbow,代碼行數:20,代碼來源:NetherBellows.java

示例10: addRecipes

import cpw.mods.fml.common.registry.GameRegistry; //導入依賴的package包/類
@Override
public void addRecipes()
{
	if (this.Enabled)
	{
		// One Sugar Gatling (empty)
		GameRegistry.addRecipe(new ItemStack(this, 1 , this.getMaxDamage()), "b b", "b b", " m ",
				'b', Helper.getAmmoStack(Part_GatlingBarrel.class, 0),
				'm', Helper.getAmmoStack(Part_GatlingBody.class, 0)
				);
	}
	else if (Main.noCreative) { this.setCreativeTab(null); }	// Not enabled and not allowed to be in the creative menu

	// Reloading with gatling ammo, setting its clip metadata as ours (Need to be empty for that)
	Helper.registerAmmoRecipe(GatlingAmmo.class, this);
}
 
開發者ID:Domochevsky,項目名稱:minecraft-quiverbow,代碼行數:17,代碼來源:SugarEngine.java

示例11: addRecipes

import cpw.mods.fml.common.registry.GameRegistry; //導入依賴的package包/類
@Override
public void addRecipes()
{
	if (this.Enabled)
	{
		// One auto-crossbow (empty)
		GameRegistry.addRecipe(new ItemStack(this, 1 , this.getMaxDamage()), "iii", "scs", " i ",
				'i', Items.iron_ingot,
				's', Blocks.sticky_piston,
				'c', Helper.getWeaponStackByClass(Crossbow_Auto.class, true)
				);
	}
	else if (Main.noCreative) { this.setCreativeTab(null); }	// Not enabled and not allowed to be in the creative menu

	ItemStack ammo = Helper.getAmmoStack(ArrowBundle.class, 0);

	// Fill what can be filled. One arrow bundle for 8 shots, for up to 2 bundles
	Helper.makeAmmoRecipe(ammo, 1, 8, this.getMaxDamage(), this);
	Helper.makeAmmoRecipe(ammo, 2, 16, this.getMaxDamage(), this);
}
 
開發者ID:Domochevsky,項目名稱:minecraft-quiverbow,代碼行數:21,代碼來源:Crossbow_AutoImp.java

示例12: init

import cpw.mods.fml.common.registry.GameRegistry; //導入依賴的package包/類
@EventHandler
public void init(FMLInitializationEvent event) {
	GameRegistry.registerWorldGenerator(new ProspectingWorldGen(), 1000);

	GameRegistry.addRecipe(new ItemStack(ProspectingItems.prospecting_pan), new Object[] {"s s", " s ", 's', Blocks.stone_slab});
	GameRegistry.addRecipe(new ItemStack(ProspectingItems.prospecting_pick), new Object[] {"iis", "  s", 'i', Items.iron_ingot, 's', Items.stick});
	GameRegistry.addRecipe(new ItemStack(ProspectingItems.sifting_pan), new Object[] {"s s", "s#s", "s#s", 's', Items.stick, '#', Items.string});
}
 
開發者ID:azacock,項目名稱:Prospecting,代碼行數:9,代碼來源:Prospecting.java

示例13: addRecipes

import cpw.mods.fml.common.registry.GameRegistry; //導入依賴的package包/類
@Override
public void addRecipes()
{
	if (this.Enabled)
	{
		// One Obsidian Splinter
		GameRegistry.addRecipe(new ItemStack(this, 1 , this.getMaxDamage()), " io", "ipi", "oft",
				'o', Blocks.obsidian,
				'i', Items.iron_ingot,
				'p', Blocks.piston,
				'f', Items.flint_and_steel,
				't', Blocks.tripwire_hook
				);
	}
	else if (Main.noCreative) { this.setCreativeTab(null); }	// Not enabled and not allowed to be in the creative menu

	// Reloading with obsidian magazine, setting its ammo metadata as ours (Need to be empty for that)
	Helper.registerAmmoRecipe(ObsidianMagazine.class, this);
}
 
開發者ID:Domochevsky,項目名稱:minecraft-quiverbow,代碼行數:20,代碼來源:OSP.java

示例14: addRecipes

import cpw.mods.fml.common.registry.GameRegistry; //導入依賴的package包/類
@Override
public void addRecipes()
{
	if (this.Enabled)
	{
		// One Firework Rocket Launcher (empty)
		GameRegistry.addRecipe(new ItemStack(this, 1 , this.getMaxDamage()), "x  ", "yx ", "zyx",
				'x', Blocks.planks,
				'y', Items.iron_ingot,
				'z', Items.flint_and_steel
				);
	}
	else if (Main.noCreative) { this.setCreativeTab(null); }	// Not enabled and not allowed to be in the creative menu

	// Fill the RPG with 1 rocket
	GameRegistry.addRecipe(new ItemStack(this), " ab", "zya", " x ",
			'x', new ItemStack(this, 1 , this.getMaxDamage()),
			'y', Blocks.tnt,
			'z', Blocks.planks,
			'a', Items.paper,
			'b', Items.string
			);
}
 
開發者ID:Domochevsky,項目名稱:minecraft-quiverbow,代碼行數:24,代碼來源:RPG.java

示例15: addRecipes

import cpw.mods.fml.common.registry.GameRegistry; //導入依賴的package包/類
@Override
public void addRecipes()
{
	if (this.Enabled)
	{
		// One wither rifle (empty)
		GameRegistry.addRecipe(new ItemStack(this, 1 , this.getMaxDamage()), "odo", "owo", "oso",
				'o', Blocks.obsidian,
				'd', Items.diamond,
				's', Items.nether_star,
				'w', Helper.getWeaponStackByClass(OSR.class, true)
				);
	}
	else if (Main.noCreative) { this.setCreativeTab(null); }	// Not enabled and not allowed to be in the creative menu

	// Reloading with obsidian magazine, setting its ammo metadata as ours (Need to be empty for that)
	Helper.registerAmmoRecipe(ObsidianMagazine.class, this);
}
 
開發者ID:Domochevsky,項目名稱:minecraft-quiverbow,代碼行數:19,代碼來源:OWR.java


注:本文中的cpw.mods.fml.common.registry.GameRegistry類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。