本文整理匯總了Java中net.minecraft.block.BlockPlanks.EnumType方法的典型用法代碼示例。如果您正苦於以下問題:Java BlockPlanks.EnumType方法的具體用法?Java BlockPlanks.EnumType怎麽用?Java BlockPlanks.EnumType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.block.BlockPlanks
的用法示例。
在下文中一共展示了BlockPlanks.EnumType方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: readCustomNBT
import net.minecraft.block.BlockPlanks; //導入方法依賴的package包/類
@Override
public void readCustomNBT(NBTTagCompound nbt){
super.readCustomNBT(nbt);
for(EnumFacing facing : EnumFacing.HORIZONTALS){
if(nbt.hasKey(facing.getName().toLowerCase())){
NBTTagCompound nbtFace = nbt.getCompoundTag(facing.getName().toLowerCase());
if(nbtFace.hasKey("BaseType")){
int type = nbtFace.getInteger("BaseType");
BlockPlanks.EnumType base = BlockPlanks.EnumType.byMetadata(type);
setBase(facing, base);
}
else if(nbtFace.hasKey("HasBase")){
setBase(facing, BlockPlanks.EnumType.OAK);
}
else {
setBase(facing, null);
}
//setBase(facing, nbtFace.getBoolean("HasBase"));
setPost(facing, 0, nbtFace.getBoolean("HasLeftPost"));
setPost(facing, 1, nbtFace.getBoolean("HasRightPost"));
setPost(facing, 2, nbtFace.getBoolean("HasTopPost"));
}
}
}
示例2: onSaplingGrow
import net.minecraft.block.BlockPlanks; //導入方法依賴的package包/類
@SubscribeEvent
public void onSaplingGrow(SaplingGrowTreeEvent ev)
{
IBlockState state = ev.getWorld().getBlockState(ev.getPos());
Block block = state.getBlock();
if (block == Blocks.sapling)
{
BlockPlanks.EnumType type = state.getValue(BlockSapling.TYPE);
switch (type)
{
case OAK:
ev.setResult(Event.Result.DENY);
new BirchTreeGenerator().generateTreeAt(ev.getWorld(), ev.getPos(), ev.getRand());
break;
}
}
}
示例3: setBase
import net.minecraft.block.BlockPlanks; //導入方法依賴的package包/類
public void setBase(EnumFacing side, BlockPlanks.EnumType type){
if(type == null){
bases.remove(side);
} else{
bases.put(side, type);
}
}
示例4: getWoodType
import net.minecraft.block.BlockPlanks; //導入方法依賴的package包/類
@Override
@Nullable
public BlockPlanks.EnumType getWoodType(int meta)
{
//Required, but the list is too restrictive, need to override getMetaFromState to work around.
return null;
}
示例5: getType
import net.minecraft.block.BlockPlanks; //導入方法依賴的package包/類
private static BlockPlanks.EnumType getType(Wood type){
switch(type){
case OAK: return BlockPlanks.EnumType.OAK;
case SPRUCE: return BlockPlanks.EnumType.SPRUCE;
case BIRCH: return BlockPlanks.EnumType.BIRCH;
case JUNGLE: return BlockPlanks.EnumType.JUNGLE;
case ACACIA: return BlockPlanks.EnumType.ACACIA;
case DARKOAK: return BlockPlanks.EnumType.DARK_OAK;
default: return BlockPlanks.EnumType.OAK;
}
}
示例6: getWoodType
import net.minecraft.block.BlockPlanks; //導入方法依賴的package包/類
@Override
public BlockPlanks.EnumType getWoodType(int meta) {
return null;
}
示例7: getWoodType
import net.minecraft.block.BlockPlanks; //導入方法依賴的package包/類
@Override
public BlockPlanks.EnumType getWoodType(int meta) {
return null;
}
示例8: init
import net.minecraft.block.BlockPlanks; //導入方法依賴的package包/類
@Override
public void init() {
if(SOFT_WOODS)
{
StumpingHandler.addSoftWood(Blocks.LOG,BlockPlanks.EnumType.SPRUCE.getMetadata(),1.3f);
StumpingHandler.addSoftWood(Blocks.LOG,BlockPlanks.EnumType.JUNGLE.getMetadata(),1.0f);
StumpingHandler.addSoftWood(Blocks.LOG2,BlockPlanks.EnumType.DARK_OAK.getMetadata() - 4,1.3f);
}
if(ASH_FERTILIZER) {
HCBonemeal.registerFertilzier(ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.POTASH));
HCBonemeal.registerFertilzier(ModItems.materialTweak.getMaterial("ash"));
}
GameRegistry.addRecipe(new ShapelessOreRecipe(ModItems.materialTweak.getMaterial("ink_and_quill"),new ItemStack(Items.GLASS_BOTTLE),new ItemStack(Items.DYE,1,EnumDyeColor.BLACK.getDyeDamage()),"feather"));
if(REPLACE_WRITABLE_BOOK_RECIPE)
{
BetterWithAddons.removeCraftingRecipe(new ItemStack(Items.WRITABLE_BOOK));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.WRITABLE_BOOK),new ItemStack(Items.BOOK),ModItems.materialTweak.getMaterial("ink_and_quill")));
}
if(WOOL_RECYCLING && InteractionBWM.HARDCORE_SHEARING)
{
for (EnumDyeColor color: EnumDyeColor.values()) {
StokedCauldronManager.getInstance().addRecipe(new ItemStack(BWMBlocks.AESTHETIC,1,BlockAesthetic.EnumType.WICKER.getMeta()), ModItems.wool.getByColor(color,4), new Object[]{ new ItemStack(Blocks.WOOL,1,color.getMetadata()) });
}
}
if(SAW_RECYCLING)
{
SawManager.INSTANCE.addRecipe(Blocks.BOOKSHELF,0,new ItemStack(BWMBlocks.WOOD_SIDING, 4, BlockPlanks.EnumType.OAK.getMetadata()),new ItemStack(Items.BOOK,3));
SawManager.INSTANCE.addRecipe(Blocks.CHEST,0,new ItemStack(BWMBlocks.WOOD_SIDING, 6, BlockPlanks.EnumType.OAK.getMetadata()));
SawManager.INSTANCE.addRecipe(Blocks.JUKEBOX,0,new ItemStack(BWMBlocks.WOOD_SIDING, 6, BlockPlanks.EnumType.OAK.getMetadata()),new ItemStack(Items.DIAMOND,1));
SawManager.INSTANCE.addRecipe(Blocks.LADDER,0,new ItemStack(Items.STICK,2));
SawManager.INSTANCE.addRecipe(Blocks.NOTEBLOCK,0,new ItemStack(BWMBlocks.WOOD_SIDING, 6, BlockPlanks.EnumType.OAK.getMetadata()),new ItemStack(Items.REDSTONE,1));
SawManager.INSTANCE.addRecipe(Blocks.TRAPDOOR,0,new ItemStack(BWMBlocks.WOOD_SIDING, 2, BlockPlanks.EnumType.OAK.getMetadata()));
SawManager.INSTANCE.addRecipe(BWMBlocks.AXLE,0,new ItemStack(BWMBlocks.WOOD_CORNER, 2, BlockPlanks.EnumType.OAK.getMetadata()),new ItemStack(BWMBlocks.ROPE,1));
SawManager.INSTANCE.addRecipe(BWMBlocks.BELLOWS,0,new ItemStack(BWMBlocks.WOOD_SIDING, 2, BlockPlanks.EnumType.OAK.getMetadata()), ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.LEATHER_BELT), ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.GEAR), ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.TANNED_LEATHER_CUT,3));
SawManager.INSTANCE.addRecipe(BWMBlocks.GEARBOX,0,new ItemStack(BWMBlocks.WOOD_SIDING, 3, BlockPlanks.EnumType.OAK.getMetadata()), ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.GEAR,3), ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.REDSTONE_LATCH));
SawManager.INSTANCE.addRecipe(BWMBlocks.SINGLE_MACHINES, BlockMechMachines.EnumType.HOPPER.getMeta() << 1,new ItemStack(BWMBlocks.WOOD_MOULDING, 3, BlockPlanks.EnumType.OAK.getMetadata()), ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.GEAR,1), new ItemStack(Blocks.WOODEN_PRESSURE_PLATE,1));
SawManager.INSTANCE.addRecipe(BWMBlocks.PLATFORM,0,new ItemStack(BWMBlocks.WOOD_MOULDING, 3, BlockPlanks.EnumType.OAK.getMetadata()), new ItemStack(BWMBlocks.PANE,2,2));
SawManager.INSTANCE.addRecipe(BWMBlocks.SINGLE_MACHINES, BlockMechMachines.EnumType.PULLEY.getMeta() << 1,new ItemStack(BWMBlocks.WOOD_SIDING, 3, BlockPlanks.EnumType.OAK.getMetadata()), new ItemStack(Items.IRON_INGOT), ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.GEAR), ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.REDSTONE_LATCH));
SawManager.INSTANCE.addRecipe(BWMBlocks.SAW,0,new ItemStack(BWMBlocks.WOOD_SIDING, 1, BlockPlanks.EnumType.OAK.getMetadata()), ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.LEATHER_BELT), ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.GEAR), new ItemStack(Items.IRON_INGOT, 2));
SawManager.INSTANCE.addRecipe(BWMBlocks.PUMP,0,new ItemStack(BWMBlocks.WOOD_SIDING, 3, BlockPlanks.EnumType.OAK.getMetadata()), ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.SCREW), new ItemStack(BWMBlocks.GRATE, 1, BlockPlanks.EnumType.OAK.getMetadata()));
BlockPlanks.EnumType[] woodtypes = BlockPlanks.EnumType.values();
int len = woodtypes.length;
for(int i = 0; i < len; ++i) {
BlockPlanks.EnumType woodtype = woodtypes[i];
SawManager.INSTANCE.addRecipe(BWMBlocks.WOOD_BENCH,woodtype.getMetadata(),new ItemStack(BWMBlocks.WOOD_CORNER, 2, woodtype.getMetadata()));
SawManager.INSTANCE.addRecipe(BWMBlocks.WOOD_TABLE,woodtype.getMetadata(),new ItemStack(BWMBlocks.WOOD_CORNER, 3, woodtype.getMetadata()));
}
SawManager.INSTANCE.addRecipe(new DisplaySawRecipe(Blocks.OAK_DOOR,0,Arrays.asList(new ItemStack(BWMBlocks.WOOD_SIDING, 4, BlockPlanks.EnumType.OAK.getMetadata())),new ItemStack(Items.OAK_DOOR)));
SawManager.INSTANCE.addRecipe(new DisplaySawRecipe(Blocks.BIRCH_DOOR,0,Arrays.asList(new ItemStack(BWMBlocks.WOOD_SIDING, 4, BlockPlanks.EnumType.BIRCH.getMetadata())),new ItemStack(Items.BIRCH_DOOR)));
SawManager.INSTANCE.addRecipe(new DisplaySawRecipe(Blocks.SPRUCE_DOOR,0,Arrays.asList(new ItemStack(BWMBlocks.WOOD_SIDING, 4, BlockPlanks.EnumType.SPRUCE.getMetadata())),new ItemStack(Items.SPRUCE_DOOR)));
SawManager.INSTANCE.addRecipe(new DisplaySawRecipe(Blocks.JUNGLE_DOOR,0,Arrays.asList(new ItemStack(BWMBlocks.WOOD_SIDING, 4, BlockPlanks.EnumType.JUNGLE.getMetadata())),new ItemStack(Items.JUNGLE_DOOR)));
SawManager.INSTANCE.addRecipe(new DisplaySawRecipe(Blocks.ACACIA_DOOR,0,Arrays.asList(new ItemStack(BWMBlocks.WOOD_SIDING, 4, BlockPlanks.EnumType.ACACIA.getMetadata())),new ItemStack(Items.ACACIA_DOOR)));
SawManager.INSTANCE.addRecipe(new DisplaySawRecipe(Blocks.DARK_OAK_DOOR,0,Arrays.asList(new ItemStack(BWMBlocks.WOOD_SIDING, 4, BlockPlanks.EnumType.DARK_OAK.getMetadata())),new ItemStack(Items.DARK_OAK_DOOR)));
SawManager.INSTANCE.addRecipe(Blocks.OAK_FENCE_GATE,0,new ItemStack(BWMBlocks.WOOD_MOULDING, 3, BlockPlanks.EnumType.OAK.getMetadata()));
SawManager.INSTANCE.addRecipe(Blocks.BIRCH_FENCE_GATE,0,new ItemStack(BWMBlocks.WOOD_MOULDING, 3, BlockPlanks.EnumType.BIRCH.getMetadata()));
SawManager.INSTANCE.addRecipe(Blocks.SPRUCE_FENCE_GATE,0,new ItemStack(BWMBlocks.WOOD_MOULDING, 3, BlockPlanks.EnumType.SPRUCE.getMetadata()));
SawManager.INSTANCE.addRecipe(Blocks.JUNGLE_FENCE_GATE,0,new ItemStack(BWMBlocks.WOOD_MOULDING, 3, BlockPlanks.EnumType.JUNGLE.getMetadata()));
SawManager.INSTANCE.addRecipe(Blocks.ACACIA_FENCE_GATE,0,new ItemStack(BWMBlocks.WOOD_MOULDING, 3, BlockPlanks.EnumType.ACACIA.getMetadata()));
SawManager.INSTANCE.addRecipe(Blocks.DARK_OAK_FENCE_GATE,0,new ItemStack(BWMBlocks.WOOD_MOULDING, 3, BlockPlanks.EnumType.DARK_OAK.getMetadata()));
}
}
示例9: getBase
import net.minecraft.block.BlockPlanks; //導入方法依賴的package包/類
public BlockPlanks.EnumType getBase(EnumFacing side){
return bases.getOrDefault(side, null);
}
示例10: getLogSprite
import net.minecraft.block.BlockPlanks; //導入方法依賴的package包/類
public TextureAtlasSprite getLogSprite(BlockPlanks.EnumType type, boolean top){
if(type == null)return RenderUtil.getMissingSprite();
if(top)return RenderUtil.getSprite("minecraft:blocks/log_"+type.getUnlocalizedName().toLowerCase()+"_top");
return RenderUtil.getSprite("minecraft:blocks/log_"+type.getUnlocalizedName().toLowerCase());
}
示例11: getWoodType
import net.minecraft.block.BlockPlanks; //導入方法依賴的package包/類
@Override
public BlockPlanks.EnumType getWoodType(int meta) {
return BlockPlanks.EnumType.OAK;
}
示例12: apply
import net.minecraft.block.BlockPlanks; //導入方法依賴的package包/類
public boolean apply(BlockPlanks.EnumType type)
{
return type.getMetadata() >= 4;
}
示例13: apply
import net.minecraft.block.BlockPlanks; //導入方法依賴的package包/類
public boolean apply(BlockPlanks.EnumType type)
{
return type.getMetadata() < 4;
}
示例14: BlockPaintedFenceGate
import net.minecraft.block.BlockPlanks; //導入方法依賴的package包/類
protected BlockPaintedFenceGate(@Nonnull IModObject modObject, BlockPlanks.EnumType material) {
super(material);
Prep.setNoCreativeTab(this);
modObject.apply(this);
setSoundType(SoundType.WOOD);
}