本文整理汇总了Java中net.minecraft.block.Block.SoundType类的典型用法代码示例。如果您正苦于以下问题:Java SoundType类的具体用法?Java SoundType怎么用?Java SoundType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SoundType类属于net.minecraft.block.Block包,在下文中一共展示了SoundType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DigSiteLocale
import net.minecraft.block.Block.SoundType; //导入依赖的package包/类
public DigSiteLocale(String name, String base, String maskname, Material mat, SoundType sound, String shapename1, String shapename2, String shapename3, int colour1, int colour2, int colour3) {
this.name = name;
this.base = base;
this.maskname = maskname;
this.material = mat;
this.sounds = sound;
this.shapename1 = shapename1;
this.shapename2 = shapename2;
this.shapename3 = shapename3;
this.icons = new HashMap<String,IIcon[]>();
int[] c = {colour1, colour2, colour3};
this.colours = c;
}
示例2: playBlockSound
import net.minecraft.block.Block.SoundType; //导入依赖的package包/类
/**
* Plays block sound.
* Reduced volume is for damaging a block, versus full volume for placement or destruction.
*/
public static void playBlockSound(World world, ItemStack itemStack, int x, int y, int z, boolean reducedVolume)
{
if (itemStack != null) {
Block block;
if (itemStack.getItem() instanceof ItemBlock) {
block = toBlock(itemStack);
} else {
block = Blocks.sand;
}
SoundType soundType = block.stepSound;
float volume = (soundType.getVolume() + 1.0F) / (reducedVolume ? 8.0F : 2.0F);
float pitch = soundType.getPitch() * 0.8F;
world.playSoundEffect(x + 0.5F, y + 0.5F, z + 0.5F, soundType.func_150496_b(), volume, pitch);
}
}
示例3: CreateOre
import net.minecraft.block.Block.SoundType; //导入依赖的package包/类
/**
* Creates a ore from the specs provided.
*/
public static Block CreateOre(Material material, boolean isOpaqueCube, float Hardness, float Resistence, int LightOpacity, String HarvestTool, int HarvestLevel, SoundType StepSound, String BlockName, CreativeTabs CreativeTab, int LightValue, boolean NeedsRandomTick, boolean UseNeighborBrightness, String TextureName)
{
Block ore;
ore = new AutoBlock(material, UseNeighborBrightness, Resistence, Resistence, LightValue, TextureName, LightValue, StepSound, TextureName, CreativeTab, LightValue, UseNeighborBrightness, UseNeighborBrightness, TextureName);
return ore;
}
示例4: CoatingClass
import net.minecraft.block.Block.SoundType; //导入依赖的package包/类
public CoatingClass(String name, Class<? extends Block> blockclass, Class<? extends ItemBlock> itemclass, float hardness, SoundType stepsound, String harvesLevelTool, int harvestLevel) {
this.name = name;
this.blockclass = blockclass;
this.itemclass = itemclass;
this.hardness = hardness;
this.stepsound = stepsound;
this.harvesttool = harvesLevelTool;
this.harvestlevel = harvestLevel;
}
示例5: TreeClass
import net.minecraft.block.Block.SoundType; //导入依赖的package包/类
public TreeClass(String name, Class<? extends Block> blockclass, Class<? extends ItemBlock> itemclass, float hardness, SoundType stepsound, String harvesLevelTool, int harvestLevel) {
this.name = name;
this.blockclass = blockclass;
this.itemclass = itemclass;
this.hardness = hardness;
this.stepsound = stepsound;
this.harvesttool = harvesLevelTool;
this.harvestlevel = harvestLevel;
}
示例6: RockClass
import net.minecraft.block.Block.SoundType; //导入依赖的package包/类
public RockClass(String name, Class<? extends Block> blockclass, Class<? extends ItemBlock> itemclass, float hardness, SoundType stepsound, String harvesLevelTool, int harvestLevel) {
this.name = name;
this.blockclass = blockclass;
this.itemclass = itemclass;
this.hardness = hardness;
this.stepsound = stepsound;
this.harvesttool = harvesLevelTool;
this.harvestlevel = harvestLevel;
}
示例7: getSoundFromMaterial
import net.minecraft.block.Block.SoundType; //导入依赖的package包/类
public static SoundType getSoundFromMaterial(Material material) {
if(material == Material.rock) {
return Block.soundTypeStone;
} else if(material == Material.iron) {
return Block.soundTypeMetal;
} else if(material == Material.leaves || material == Material.grass || material == Material.plants) {
return Block.soundTypeGrass;
} else if(material == Material.wood) {
return Block.soundTypeWood;
}
return Block.soundTypeStone;
}
示例8: setStepSound
import net.minecraft.block.Block.SoundType; //导入依赖的package包/类
public RegBlock setStepSound(String Sound)
{
SoundType soundType = null;
switch(Sound)
{
case "Anvil":
soundType = Block.soundTypeAnvil;
case "Cloth":
soundType = Block.soundTypeCloth;
case "Glass":
soundType = Block.soundTypeGlass;
case "Grass":
soundType = Block.soundTypeGrass;
case "Gravel":
soundType = Block.soundTypeGravel;
case "Ladder":
soundType = Block.soundTypeLadder;
case "Metal":
soundType = Block.soundTypeMetal;
case "Piston":
soundType = Block.soundTypePiston;
case "Sand":
soundType = Block.soundTypeSand;
case "Snow":
soundType = Block.soundTypeSnow;
case "Stone":
soundType = Block.soundTypeStone;
case "Wood":
soundType = Block.soundTypeWood;
}
theBlock.setStepSound(soundType);
return this;
}
示例9: SoilRockClass
import net.minecraft.block.Block.SoundType; //导入依赖的package包/类
public SoilRockClass(String name, Class<? extends Block> blockclass, Class<? extends ItemBlock> itemclass, float hardness, SoundType stepsound, String harvesLevelTool, int harvestLevel) {
super(name, blockclass, itemclass, hardness, stepsound, harvesLevelTool, harvestLevel);
}
示例10: registerNewBlock
import net.minecraft.block.Block.SoundType; //导入依赖的package包/类
/**
* Registers new Content Block. Do not use.
*
* @deprecated Not Fully Implemented
* @param blockMaterial Material of Block
* @param blockName Unlocalized Name of Block
* @param stepSound Blocks step sound
* @return instance of the block
*/
public static EABlock registerNewBlock(Material blockMaterial, String blockName, SoundType stepSound)
{
EABlock blockInstance = new EABlock(blockMaterial, blockName, stepSound);
GameRegistry.registerBlock(blockInstance, blockName);
return blockInstance;
}
示例11: getStepSound
import net.minecraft.block.Block.SoundType; //导入依赖的package包/类
/**
* The sound this block will make if any entity walks over it
*
* @return
*/
public SoundType getStepSound();
示例12: BlockBasic
import net.minecraft.block.Block.SoundType; //导入依赖的package包/类
/**
* Define a new Basic Block.
* @param name
* @param material
* @param tab
* @param harvest
* @param hard
* @param sounds
*/
public BlockBasic(String name, Material material, CreativeTabs tab, int harvest, int hard, SoundType sound) {
this(name, material, tab, harvest, hard);
this.setStepSound(sound);
}
示例13: getStepSound
import net.minecraft.block.Block.SoundType; //导入依赖的package包/类
SoundType getStepSound() { return Block.soundTypeStone; }
示例14: getStepSound
import net.minecraft.block.Block.SoundType; //导入依赖的package包/类
SoundType getStepSound() { return stepsound; }
示例15: getStepSound
import net.minecraft.block.Block.SoundType; //导入依赖的package包/类
SoundType getStepSound() { return Block.soundTypeGrass; }