本文整理了Java中net.minecraft.block.Block.setLightOpacity()
方法的一些代码示例,展示了Block.setLightOpacity()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Block.setLightOpacity()
方法的具体详情如下:
包路径:net.minecraft.block.Block
类名称:Block
方法名:setLightOpacity
暂无
代码示例来源:origin: CyclopsMC/IntegratedDynamics
@Override
protected ConfigurableBlockLeaves initSubInstance() {
return (ConfigurableBlockLeaves) new ConfigurableBlockLeaves(this) {
@Override
public Item getItemDropped(IBlockState iBlockState, Random random, int i) {
return Item.getItemFromBlock(BlockMenrilSaplingConfig._instance.getBlockInstance());
}
@Override
public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
super.getDrops(drops, world, pos, state, fortune);
if(world instanceof World && !((World) world).isRemote) {
if(((World) world).rand.nextInt(berriesDropChance) == 0) {
drops.add(new ItemStack(ItemMenrilBerriesConfig._instance.getItemInstance()));
}
}
}
@SuppressWarnings("deprecation")
@Override
public SoundType getSoundType() {
return SoundType.GROUND;
}
@Override
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
return new ItemStack(this);
}
}.setHardness(0.2F).setLightLevel(0.65F).setLightOpacity(1);
}
代码示例来源:origin: Chisel-Team/Chisel
@Override
void addBlocks(ChiselBlockFactory factory) {
IBlockState carpet = Blocks.CARPET.getDefaultState();
IProperty<EnumDyeColor> prop = BlockCarpet.COLOR;
for(int c = 0; c < dyeColors.length; c++)
{
Carving.chisel.addVariation("carpet_" + (dyeColors[c].toLowerCase()), CarvingUtils.variationFor(carpet.withProperty(prop, EnumDyeColor.byDyeDamage(c)), -1));
factory.newBlock(Material.CARPET, "carpet_" + (dyeColors[c].toLowerCase()), new ChiselBlockProvider<>(BlockCarvableCarpet::new, BlockCarvableCarpet.class)).opaque(false)
.setParentFolder("carpet")
.newVariation("legacy_"+(dyeColors[c].toLowerCase()))
.next("llama_"+(dyeColors[c].toLowerCase()))
.build(b -> b.setSoundType(SoundType.CLOTH).setHardness(0.1F).setLightOpacity(0));
}
}
},
代码示例来源:origin: Chisel-Team/Chisel
.addOreDict("ice")
.addOreDict("blockIce")
.build(b -> b.setHardness(0.5F).setLightOpacity(3).setSoundType(SoundType.GLASS));
.addOreDict("ice")
.addOreDict("blockIce")
.build(b -> b.setHardness(0.5F).setLightOpacity(3).setSoundType(SoundType.GLASS));
代码示例来源:origin: SonarSonic/Calculator
gas_lantern_off = SonarRegister.addBlock(CalculatorConstants.MODID, tab, "GasLanternOff", new GasLantern(false).setHardness(0.1F).setLightOpacity(100));
gas_lantern_on = new GasLantern(true).setHardness(0.1F).setLightLevel(0.9375F).setUnlocalizedName("GasLanternOn").setRegistryName(CalculatorConstants.MODID, "GasLanternOn");
ForgeRegistries.BLOCKS.register(gas_lantern_on);
ForgeRegistries.ITEMS.register(new SonarBlockTip(gas_lantern_on).setRegistryName(CalculatorConstants.MODID, "GasLanternOn"));
basic_lantern = SonarRegister.addBlock(CalculatorConstants.MODID, tab, "Lantern", new BasicLantern().setHardness(0.1F).setLightLevel(0.9375F).setLightOpacity(100));
SonarRegister.registerTileEntity(TileEntityGasLantern.class, CalculatorConstants.MODID, "Lantern");
内容来源于网络,如有侵权,请联系作者删除!