本文整理汇总了Java中net.minecraft.item.ItemCloth类的典型用法代码示例。如果您正苦于以下问题:Java ItemCloth类的具体用法?Java ItemCloth怎么用?Java ItemCloth使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ItemCloth类属于net.minecraft.item包,在下文中一共展示了ItemCloth类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createBlocksAndItems
import net.minecraft.item.ItemCloth; //导入依赖的package包/类
private void createBlocksAndItems()
{
materialFloater = new Material(MapColor.clothColor);
blockMarkShip = (BlockHelm) new BlockHelm().setCreativeTab(CreativeTabs.tabTransport);
blockMarkShip.setStepSound(Block.soundTypeWood).setHardness(1F).setResistance(1F);
registerBlock("marker", blockMarkShip);
blockFloater = new BlockAS(materialFloater).setCreativeTab(CreativeTabs.tabTransport);
blockFloater.setStepSound(Block.soundTypeWood).setHardness(1F).setResistance(1F);
registerBlock("floater", blockFloater);
blockBalloon = new BlockColored(Material.cloth).setCreativeTab(CreativeTabs.tabTransport);
blockBalloon.setStepSound(Block.soundTypeCloth).setHardness(0.35F).setResistance(1F);
registerBlock("balloon", blockBalloon, ItemCloth.class);
blockGauge = (BlockGauge) new BlockGauge().setCreativeTab(CreativeTabs.tabTransport);
blockGauge.setStepSound(Block.soundTypeMetal).setHardness(1F).setResistance(1F);
registerBlock("gauge", blockGauge, ItemGaugeBlock.class);
blockSeat = (BlockSeat) new BlockSeat().setHardness(1F).setResistance(1F).setCreativeTab(CreativeTabs.tabTransport);
blockSeat.setStepSound(Block.soundTypeCloth);
registerBlock("seat", blockSeat);
blockBuffer = new BlockAS(Material.cloth).setHardness(1F).setResistance(1F).setCreativeTab(CreativeTabs.tabTransport);
blockBuffer.setStepSound(Block.soundTypeWood);
registerBlock("buffer", blockBuffer);
blockEngine = new BlockEngine(Material.iron, 1f, 10).setHardness(2F).setResistance(3F).setCreativeTab(CreativeTabs.tabTransport);
blockEngine.setStepSound(Block.soundTypeMetal);
registerBlock("engine", blockEngine);
blockCrateWood = new BlockCrate(Material.wood).setHardness(1f).setResistance(1f).setCreativeTab(CreativeTabs.tabTransport);
blockCrateWood.setStepSound(Block.soundTypeWood);
registerBlock("crate_wood", blockCrateWood);
}
示例2: preInit
import net.minecraft.item.ItemCloth; //导入依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
clayDrawer = new BlockClayDrawer();
stainedClayDrawer = new BlockStainedClayDrawer();
PandorasChest = new BlockPandorasChest();
fluorecentSpot = new BlockFluorecentSpot();
fluorecentTube = new BlockFluorecentTube();
GameRegistry.registerBlock(clayDrawer, "Clay Drawer");
GameRegistry.registerTileEntityWithAlternatives(
TileEntityClayDrawer.class, "tileentity.claydrawer",
"tileentity.decorativechest");
GameRegistry.addRecipe(new ItemStack(clayDrawer), "xxx", "x x", "xxx",
'x', new ItemStack(Blocks.hardened_clay));
GameRegistry.registerBlock(stainedClayDrawer, ItemCloth.class,
"Stained Clay Drawer");
for (int i = 0; i < 16; i++) {
ItemStack stack = new ItemStack(stainedClayDrawer, 1, i);
GameRegistry.addRecipe(stack, "xxx", "x x", "xxx", 'x',
new ItemStack(Blocks.stained_hardened_clay, 1, i));
}
GameRegistry.registerBlock(PandorasChest, "Pandora's Chest");
GameRegistry.registerTileEntity(TileEntityPandorasChest.class,
"tileentity.pandoraschest");
GameRegistry
.addRecipe(new ItemStack(PandorasChest), "xyx", "yzy", "yxy",
'x', new ItemStack(Items.iron_ingot), 'y',
new ItemStack(Blocks.chest), 'z', new ItemStack(
Items.redstone));
GameRegistry.registerBlock(fluorecentSpot, "Fluorecent Spot");
GameRegistry.registerTileEntity(TileEntityFluorecentBlock.class,
"tileentity.fluorecentspot");
GameRegistry.addRecipe(new ItemStack(fluorecentSpot), "x", "y", "z",
'x', new ItemStack(Items.iron_ingot), 'y', new ItemStack(
Items.glowstone_dust), 'z', new ItemStack(
Blocks.glass_pane));
GameRegistry.registerBlock(fluorecentTube, ItemFluorecentTube.class,
"Fluorecent Tube");
GameRegistry.registerTileEntity(TileEntityFluorecentTubeBlock.class,
"tileentity.fluorecenttube");
GameRegistry.addRecipe(new ItemStack(fluorecentTube), "xxx", "yyy",
"zzz", 'x', new ItemStack(Items.iron_ingot), 'y',
new ItemStack(Items.glowstone_dust), 'z', new ItemStack(
Blocks.glass_pane));
Configuration cfg = new Configuration(
event.getSuggestedConfigurationFile());
try {
cfg.load();
//
// PandorasChest = new
// BlockPandorasChest(cfg.getBlock("PandorasChest",
// 700).getInt(700));
} catch (Exception e) {
FMLLog.log(Level.FATAL, e,
"Pandora's Chest configuration failed to load.");
} finally {
cfg.save();
}
}