mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 23:28:35 +01:00
Crusher, Coffee Machine & Reconstructor Sounds!
This commit is contained in:
parent
4282329699
commit
6fe1948d0d
7 changed files with 24 additions and 1 deletions
|
@ -18,6 +18,7 @@ import ellpeck.actuallyadditions.items.lens.Lens;
|
||||||
import ellpeck.actuallyadditions.items.lens.Lenses;
|
import ellpeck.actuallyadditions.items.lens.Lenses;
|
||||||
import ellpeck.actuallyadditions.network.PacketHandler;
|
import ellpeck.actuallyadditions.network.PacketHandler;
|
||||||
import ellpeck.actuallyadditions.network.PacketParticle;
|
import ellpeck.actuallyadditions.network.PacketParticle;
|
||||||
|
import ellpeck.actuallyadditions.util.ModUtil;
|
||||||
import ellpeck.actuallyadditions.util.WorldPos;
|
import ellpeck.actuallyadditions.util.WorldPos;
|
||||||
import ellpeck.actuallyadditions.util.WorldUtil;
|
import ellpeck.actuallyadditions.util.WorldUtil;
|
||||||
import net.minecraft.item.ItemStack;
|
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){
|
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));
|
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));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ import ellpeck.actuallyadditions.items.InitItems;
|
||||||
import ellpeck.actuallyadditions.items.ItemCoffee;
|
import ellpeck.actuallyadditions.items.ItemCoffee;
|
||||||
import ellpeck.actuallyadditions.items.metalists.TheMiscItems;
|
import ellpeck.actuallyadditions.items.metalists.TheMiscItems;
|
||||||
import ellpeck.actuallyadditions.network.gui.IButtonReactor;
|
import ellpeck.actuallyadditions.network.gui.IButtonReactor;
|
||||||
|
import ellpeck.actuallyadditions.util.ModUtil;
|
||||||
import ellpeck.actuallyadditions.util.WorldUtil;
|
import ellpeck.actuallyadditions.util.WorldUtil;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -126,6 +127,10 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements
|
||||||
if(!worldObj.isRemote){
|
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.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.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.brewTime++;
|
||||||
this.storage.extractEnergy(ENERGY_USED, false);
|
this.storage.extractEnergy(ENERGY_USED, false);
|
||||||
if(this.brewTime >= TIME_USED){
|
if(this.brewTime >= TIME_USED){
|
||||||
|
|
|
@ -16,6 +16,7 @@ import cofh.api.energy.IEnergyReceiver;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import ellpeck.actuallyadditions.recipe.CrusherRecipeRegistry;
|
import ellpeck.actuallyadditions.recipe.CrusherRecipeRegistry;
|
||||||
|
import ellpeck.actuallyadditions.util.ModUtil;
|
||||||
import ellpeck.actuallyadditions.util.Util;
|
import ellpeck.actuallyadditions.util.Util;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
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);
|
canCrushOnSecond = this.canCrushOn(SLOT_INPUT_2, SLOT_OUTPUT_2_1, SLOT_OUTPUT_2_2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean shouldPlaySound = false;
|
||||||
|
|
||||||
if(canCrushOnFirst){
|
if(canCrushOnFirst){
|
||||||
if(this.storage.getEnergyStored() >= getEnergyUse(this.isDouble)){
|
if(this.storage.getEnergyStored() >= getEnergyUse(this.isDouble)){
|
||||||
|
if(this.firstCrushTime%30 == 0){
|
||||||
|
shouldPlaySound = true;
|
||||||
|
}
|
||||||
this.firstCrushTime++;
|
this.firstCrushTime++;
|
||||||
if(this.firstCrushTime >= getMaxCrushTime()){
|
if(this.firstCrushTime >= getMaxCrushTime()){
|
||||||
this.finishCrushing(SLOT_INPUT_1, SLOT_OUTPUT_1_1, SLOT_OUTPUT_1_2);
|
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(this.isDouble){
|
||||||
if(canCrushOnSecond){
|
if(canCrushOnSecond){
|
||||||
if(this.storage.getEnergyStored() >= getEnergyUse(this.isDouble)){
|
if(this.storage.getEnergyStored() >= getEnergyUse(this.isDouble)){
|
||||||
|
if(this.secondCrushTime%30 == 0){
|
||||||
|
shouldPlaySound = true;
|
||||||
|
}
|
||||||
this.secondCrushTime++;
|
this.secondCrushTime++;
|
||||||
if(this.secondCrushTime >= getMaxCrushTime()){
|
if(this.secondCrushTime >= getMaxCrushTime()){
|
||||||
this.finishCrushing(SLOT_INPUT_2, SLOT_OUTPUT_2_1, SLOT_OUTPUT_2_2);
|
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.lastFirstCrush = this.firstCrushTime;
|
||||||
this.lastSecondCrush = this.secondCrushTime;
|
this.lastSecondCrush = this.secondCrushTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(shouldPlaySound){
|
||||||
|
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, ModUtil.MOD_ID_LOWER+":crusher", 0.25F, 1.0F);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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"] }
|
||||||
}
|
}
|
Binary file not shown.
BIN
src/main/resources/assets/actuallyadditions/sounds/crusher.ogg
Normal file
BIN
src/main/resources/assets/actuallyadditions/sounds/crusher.ogg
Normal file
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue