Crusher, Coffee Machine & Reconstructor Sounds!

This commit is contained in:
Ellpeck 2015-12-13 14:36:34 +01:00
parent 4282329699
commit 6fe1948d0d
7 changed files with 24 additions and 1 deletions

View file

@ -18,6 +18,7 @@ import ellpeck.actuallyadditions.items.lens.Lens;
import ellpeck.actuallyadditions.items.lens.Lenses;
import ellpeck.actuallyadditions.network.PacketHandler;
import ellpeck.actuallyadditions.network.PacketParticle;
import ellpeck.actuallyadditions.util.ModUtil;
import ellpeck.actuallyadditions.util.WorldPos;
import ellpeck.actuallyadditions.util.WorldUtil;
import net.minecraft.item.ItemStack;
@ -81,6 +82,7 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple
}
private void shootLaser(int endX, int endY, int endZ, Lens currentLens){
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, ModUtil.MOD_ID_LOWER+":reconstructor", 0.35F, 1.0F);
PacketHandler.theNetwork.sendToAllAround(new PacketParticle(xCoord, yCoord, zCoord, endX, endY, endZ, currentLens.getColor(), 8, 2F), new NetworkRegistry.TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 64));
}

View file

@ -18,6 +18,7 @@ import ellpeck.actuallyadditions.items.InitItems;
import ellpeck.actuallyadditions.items.ItemCoffee;
import ellpeck.actuallyadditions.items.metalists.TheMiscItems;
import ellpeck.actuallyadditions.network.gui.IButtonReactor;
import ellpeck.actuallyadditions.util.ModUtil;
import ellpeck.actuallyadditions.util.WorldUtil;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@ -126,6 +127,10 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements
if(!worldObj.isRemote){
if(this.slots[SLOT_INPUT] != null && this.slots[SLOT_INPUT].getItem() == InitItems.itemMisc && this.slots[SLOT_INPUT].getItemDamage() == TheMiscItems.CUP.ordinal() && this.slots[SLOT_OUTPUT] == null && this.coffeeCacheAmount >= CACHE_USE && this.tank.getFluid() != null && this.tank.getFluid().getFluid() == FluidRegistry.WATER && this.tank.getFluidAmount() >= WATER_USE){
if(this.storage.getEnergyStored() >= ENERGY_USED){
if(this.brewTime % 30 == 0){
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, ModUtil.MOD_ID_LOWER+":coffeeMachine", 0.35F, 1.0F);
}
this.brewTime++;
this.storage.extractEnergy(ENERGY_USED, false);
if(this.brewTime >= TIME_USED){

View file

@ -16,6 +16,7 @@ import cofh.api.energy.IEnergyReceiver;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.recipe.CrusherRecipeRegistry;
import ellpeck.actuallyadditions.util.ModUtil;
import ellpeck.actuallyadditions.util.Util;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@ -97,8 +98,13 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg
canCrushOnSecond = this.canCrushOn(SLOT_INPUT_2, SLOT_OUTPUT_2_1, SLOT_OUTPUT_2_2);
}
boolean shouldPlaySound = false;
if(canCrushOnFirst){
if(this.storage.getEnergyStored() >= getEnergyUse(this.isDouble)){
if(this.firstCrushTime%30 == 0){
shouldPlaySound = true;
}
this.firstCrushTime++;
if(this.firstCrushTime >= getMaxCrushTime()){
this.finishCrushing(SLOT_INPUT_1, SLOT_OUTPUT_1_1, SLOT_OUTPUT_1_2);
@ -113,6 +119,9 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg
if(this.isDouble){
if(canCrushOnSecond){
if(this.storage.getEnergyStored() >= getEnergyUse(this.isDouble)){
if(this.secondCrushTime%30 == 0){
shouldPlaySound = true;
}
this.secondCrushTime++;
if(this.secondCrushTime >= getMaxCrushTime()){
this.finishCrushing(SLOT_INPUT_2, SLOT_OUTPUT_2_1, SLOT_OUTPUT_2_2);
@ -147,6 +156,10 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg
this.lastFirstCrush = this.firstCrushTime;
this.lastSecondCrush = this.secondCrushTime;
}
if(shouldPlaySound){
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, ModUtil.MOD_ID_LOWER+":crusher", 0.25F, 1.0F);
}
}
}

View file

@ -1,3 +1,6 @@
{
"duhDuhDuhDuuuh": { "category": "record", "sounds":["duhDuhDuhDuuuh"] }
"duhDuhDuhDuuuh": { "category": "record", "sounds":["duhDuhDuhDuuuh"] },
"coffeeMachine": { "category": "block", "sounds":["coffeeMachine"] },
"reconstructor": { "category": "block", "sounds":["reconstructor"] },
"crusher": { "category": "block", "sounds":["crusher"] }
}