Fixed block breaking effects playing as just the sound

Closes #105
This commit is contained in:
Ellpeck 2016-06-03 21:05:49 +02:00
parent e46851e789
commit eeb7592d22
13 changed files with 13 additions and 13 deletions

View file

@ -56,7 +56,7 @@ public class ItemChestToCrateUpgrade extends ItemBase{
//Set New Block
if(!ConfigValues.lessBlockBreakingEffects){
world.playBroadcastSound(2001, pos, Block.getStateId(world.getBlockState(pos)));
world.playEvent(2001, pos, Block.getStateId(world.getBlockState(pos)));
}
PosUtil.setBlock(pos, world, InitBlocks.blockGiantChest, 0, 2);

View file

@ -36,7 +36,7 @@ public class ItemFertilizer extends ItemBase{
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10){
if(ItemDye.applyBonemeal(stack, world, pos, player)){
if(!world.isRemote){
world.playBroadcastSound(2005, pos, 0);
world.playEvent(2005, pos, 0);
}
return EnumActionResult.SUCCESS;
}

View file

@ -76,7 +76,7 @@ public class ItemGrowthRing extends ItemEnergy{
//Show Particles if Metadata changed
if(PosUtil.getMetadata(pos, world) != metaBefore){
world.playBroadcastSound(2005, pos, 0);
world.playEvent(2005, pos, 0);
}
if(!player.capabilities.isCreativeMode){

View file

@ -120,7 +120,7 @@ public class ItemLeafBlower extends ItemBase{
//Plays the Breaking Sound
if(!ConfigValues.lessBlockBreakingEffects){
world.playBroadcastSound(2001, theCoord, Block.getStateId(world.getBlockState(theCoord)));
world.playEvent(2001, theCoord, Block.getStateId(world.getBlockState(theCoord)));
}
//Deletes the Block

View file

@ -31,7 +31,7 @@ public class DispenserHandlerFertilize extends BehaviorDefaultDispenseItem{
BlockPos pos = new BlockPos(x, y, z);
if(ItemDye.applyBonemeal(stack, source.getWorld(), pos)){
source.getWorld().playBroadcastSound(2005, pos, 0);
source.getWorld().playEvent(2005, pos, 0);
}
return stack;
}

View file

@ -136,7 +136,7 @@ public class MethodHandler implements IMethodHandler{
ItemStack output = outputs.get(0);
if(output.getItem() instanceof ItemBlock){
if(!ConfigValues.lessBlockBreakingEffects){
tile.getWorldObject().playBroadcastSound(2001, pos, Block.getStateId(tile.getWorldObject().getBlockState(pos)));
tile.getWorldObject().playEvent(2001, pos, Block.getStateId(tile.getWorldObject().getBlockState(pos)));
}
PosUtil.setBlock(pos, tile.getWorldObject(), Block.getBlockFromItem(output.getItem()), output.getItemDamage(), 2);
}

View file

@ -91,7 +91,7 @@ public class TileEntityBreaker extends TileEntityInventoryBase implements IRedst
if(Util.RANDOM.nextFloat() <= chance){
if(WorldUtil.addToInventory(this, drops, false, true)){
if(!ConfigValues.lessBlockBreakingEffects){
this.worldObj.playBroadcastSound(2001, coordsBlock, Block.getStateId(stateToBreak));
this.worldObj.playEvent(2001, coordsBlock, Block.getStateId(stateToBreak));
}
WorldUtil.breakBlockAtSide(sideToManipulate, this.worldObj, this.pos);
WorldUtil.addToInventory(this, drops, true, true);

View file

@ -93,7 +93,7 @@ public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implem
if(Util.RANDOM.nextFloat() <= chance){
if(WorldUtil.addToInventory(this, drops, false, true)){
if(!ConfigValues.lessBlockBreakingEffects){
this.worldObj.playBroadcastSound(2001, coordsBlock, Block.getStateId(this.worldObj.getBlockState(coordsBlock)));
this.worldObj.playEvent(2001, coordsBlock, Block.getStateId(this.worldObj.getBlockState(coordsBlock)));
}
WorldUtil.breakBlockAtSide(sideToManipulate, this.worldObj, this.getPos(), i);
WorldUtil.addToInventory(this, drops, true, true);

View file

@ -54,7 +54,7 @@ public class TileEntityGreenhouseGlass extends TileEntityBase{
PosUtil.getBlock(blockToFert, this.worldObj).updateTick(this.worldObj, blockToFert, this.worldObj.getBlockState(blockToFert), Util.RANDOM);
if(PosUtil.getMetadata(blockToFert, this.worldObj) != metaBefore){
this.worldObj.playBroadcastSound(2005, blockToFert, 0);
this.worldObj.playEvent(2005, blockToFert, 0);
}
}
}

View file

@ -83,7 +83,7 @@ public class TileEntityLeafGenerator extends TileEntityBase implements IEnergyPr
BlockPos theCoord = breakPositions.get(0);
if(!ConfigValues.lessBlockBreakingEffects){
this.worldObj.playBroadcastSound(2001, theCoord, Block.getStateId(this.worldObj.getBlockState(theCoord)));
this.worldObj.playEvent(2001, theCoord, Block.getStateId(this.worldObj.getBlockState(theCoord)));
}
this.worldObj.setBlockToAir(theCoord);

View file

@ -108,7 +108,7 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IEnergyR
if(Util.RANDOM.nextFloat() <= chance){
if(WorldUtil.addToInventory(this, drops, false, true)){
if(!ConfigValues.lessBlockBreakingEffects){
this.worldObj.playBroadcastSound(2001, pos, Block.getStateId(this.worldObj.getBlockState(pos)));
this.worldObj.playEvent(2001, pos, Block.getStateId(this.worldObj.getBlockState(pos)));
}
this.worldObj.setBlockToAir(pos);

View file

@ -131,7 +131,7 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements
if(WorldUtil.addToInventory(this, drops, false, true)){
if(!ConfigValues.lessBlockBreakingEffects){
this.worldObj.playBroadcastSound(2001, this.boundPosition, Block.getStateId(this.worldObj.getBlockState(this.boundPosition)));
this.worldObj.playEvent(2001, this.boundPosition, Block.getStateId(this.worldObj.getBlockState(this.boundPosition)));
}
this.worldObj.setBlockToAir(this.boundPosition);
WorldUtil.addToInventory(this, drops, true, true);

View file

@ -333,7 +333,7 @@ public class WorldUtil{
}
else{
//Shows the Harvest Particles and plays the Block's Sound
world.playBroadcastSound(2001, pos, Block.getStateId(state));
world.playEvent(2001, pos, Block.getStateId(state));
}
//If the Block was actually "removed", meaning it will drop an Item