Cleaning up unused stuff and 3-space tabs (?)

This commit is contained in:
Ben Spiers 2014-08-27 23:55:35 +01:00
parent da6cbeb46d
commit 896c943758
19 changed files with 95 additions and 305 deletions

View file

@ -200,33 +200,6 @@ public class ClientProxy extends CommonProxy
return RenderingRegistry.addNewArmourRendererPrefix(string);
}
@Override
public void registerSound(TileEntity tileEntity)
{
if(client.enableSounds && MekanismClient.audioHandler != null)
{
synchronized(MekanismClient.audioHandler.soundMaps)
{
MekanismClient.audioHandler.registerTileSound(tileEntity);
}
}
}
@Override
public void unregisterSound(TileEntity tileEntity)
{
if(client.enableSounds && MekanismClient.audioHandler != null)
{
synchronized(MekanismClient.audioHandler.soundMaps)
{
if(MekanismClient.audioHandler.getMap(tileEntity) != null)
{
MekanismClient.audioHandler.getMap(tileEntity).kill();
}
}
}
}
@Override
public void openElectricChest(EntityPlayer entityplayer, int id, int windowId, boolean isBlock, int x, int y, int z)
{

View file

@ -7,8 +7,11 @@ import net.minecraft.client.audio.ISound;
import net.minecraft.util.ResourceLocation;
/**
* Generic ISound class with lots of constructor functionality. Required because - of course - Mojang has no generic that lets you specify *any* arguments for
* this. Taken from CoFHLib
* Generic ISound class with lots of constructor functionality.
* Required because - of course - Mojang has no generic that
* lets you specify *any* arguments for this.
*
* Taken from CoFHLib
*
* @author skyboy
*

View file

@ -274,19 +274,6 @@ public class SoundHandler
return soundMaps.get(ref).getSound(channel);
}
/**
* Create and return an instance of a Sound.
* @param tileEntity - the holder of this sound.
* @return Sound instance
*/
public void registerTileSound(TileEntity tile)
{
if(!(tile instanceof IHasSound))
{
return;
}
}
/**
* Get a unique identifier for a sound effect instance by combining the mod's name,
* Mekanism, the new sound's unique position on the 'sounds' ArrayList, and a random

View file

@ -1,36 +0,0 @@
package mekanism.client.sound;
import net.minecraft.client.audio.ITickableSound;
import net.minecraft.client.audio.PositionedSound;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class TestSound extends PositionedSound implements ITickableSound
{
public boolean finished = true;
public TestSound(ISoundSource source)
{
super(source.getSoundLocation());
this.volume = getVolume();
this.field_147663_c = getPitch();
this.xPosF = (float)source.getSoundPosition().xPos;
this.yPosF = (float)source.getSoundPosition().yPos;
this.zPosF = (float)source.getSoundPosition().zPos;
this.repeat = source.shouldRepeat();
this.field_147665_h = source.getRepeatDelay();
this.field_147666_i = source.getAttenuation();
}
@Override
public boolean isDonePlaying()
{
return finished;
}
@Override
public void update()
{
}
}

View file

@ -1,84 +0,0 @@
package mekanism.client.sound;
import mekanism.api.Pos3D;
import mekanism.client.HolidayManager;
import mekanism.common.base.IActiveState;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
/**
* Sound -- an object that is created in SoundHandler. A 'Sound' object runs off of
* PaulsCode's SoundSystem. It has several methods; play(), for looping the clip,
* stop(), for stopping the loop, remove(), for removing the sound from PaulsCode,
* and updateVolume() for updating the volume based on where the player is.
* @author AidanBrady
*
*/
@SideOnly(Side.CLIENT)
public class TileSound extends Sound
{
/** The TileEntity this sound is associated with. */
public TileEntity tileEntity;
/**
* A sound that runs off of the PaulsCode sound system.
* @param id - unique identifier
* @param sound - bundled path to the sound
* @param tileentity - the tile this sound is playing from.
*/
public TileSound(String id, String sound, String chan, TileEntity tileentity)
{
super(id, sound, chan, tileentity, new Pos3D(tileentity));
tileEntity = tileentity;
}
@Override
public Pos3D getLocation()
{
return new Pos3D(tileEntity);
}
@Override
public boolean update(World world)
{/*
if(!super.update(world))
{
return false;
}
else if(!(tileEntity instanceof IHasSound))
{
return false;
}
else if(world.getTileEntity(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord) != tileEntity)
{
return false;
}
else if(!HolidayManager.filterSound(((IHasSound)tileEntity).getSoundPath()).equals(prevSoundPath))
{
return false;
}
else if(tileEntity instanceof IActiveState)
{
if(((IActiveState)tileEntity).getActive() != isPlaying)
{
if(((IActiveState)tileEntity).getActive())
{
play();
}
else {
stopLoop();
}
}
}
if(isPlaying)
{
ticksSincePlay++;
}
*/
return true;
}
}

View file

@ -149,12 +149,6 @@ public class CommonProxy
GameRegistry.registerTileEntity(TileEntityLaserAmplifier.class, "LaserAmplifier");
}
/**
* Registers a client-side sound, assigned to a TileEntity.
* @param tileEntity - TileEntity who is registering the sound
*/
public void registerSound(TileEntity tileEntity) {}
/**
* Unregisters a client-side sound, assigned to a TileEntity;
* @param tileEntity - TileEntity who is unregistering the sound

View file

@ -97,19 +97,14 @@ public abstract class TileEntityBasicMachine extends TileEntityNoisyElectricBloc
{
super.onUpdate();
if(worldObj.isRemote)
if(worldObj.isRemote && updateDelay > 0)
{
Mekanism.proxy.registerSound(this);
updateDelay--;
if(updateDelay > 0)
if(updateDelay == 0 && clientActive != isActive)
{
updateDelay--;
if(updateDelay == 0 && clientActive != isActive)
{
isActive = clientActive;
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
}
isActive = clientActive;
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
}
}

View file

@ -51,7 +51,7 @@ public class TileEntityChargepad extends TileEntityNoisyElectricBlock
if(!worldObj.isRemote)
{
isActive = false;
List<EntityLivingBase> entities = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord+1, yCoord+0.2, zCoord+1));
List<EntityLivingBase> entities = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 0.2, zCoord + 1));
for(EntityLivingBase entity : entities)
{
@ -64,17 +64,16 @@ public class TileEntityChargepad extends TileEntityNoisyElectricBlock
{
if(entity instanceof EntityRobit)
{
EntityRobit robit = (EntityRobit)entity;
EntityRobit robit = (EntityRobit) entity;
double canGive = Math.min(getEnergy(), 1000);
double toGive = Math.min(robit.MAX_ELECTRICITY-robit.getEnergy(), canGive);
double toGive = Math.min(robit.MAX_ELECTRICITY - robit.getEnergy(), canGive);
robit.setEnergy(robit.getEnergy() + toGive);
setEnergy(getEnergy() - toGive);
}
else if(entity instanceof EntityPlayer)
} else if(entity instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer)entity;
EntityPlayer player = (EntityPlayer) entity;
double prevEnergy = getEnergy();
@ -107,13 +106,9 @@ public class TileEntityChargepad extends TileEntityNoisyElectricBlock
setActive(isActive);
}
}
else {
Mekanism.proxy.registerSound(this);
if(isActive)
{
worldObj.spawnParticle("reddust", xCoord+random.nextDouble(), yCoord+0.15, zCoord+random.nextDouble(), 0, 0, 0);
}
else if(isActive)
{
worldObj.spawnParticle("reddust", xCoord+random.nextDouble(), yCoord+0.15, zCoord+random.nextDouble(), 0, 0, 0);
}
}

View file

@ -96,19 +96,14 @@ public class TileEntityChemicalCrystallizer extends TileEntityNoisyElectricBlock
@Override
public void onUpdate()
{
if(worldObj.isRemote)
if(worldObj.isRemote && updateDelay > 0)
{
Mekanism.proxy.registerSound(this);
updateDelay--;
if(updateDelay > 0)
if(updateDelay == 0 && clientActive != isActive)
{
updateDelay--;
if(updateDelay == 0 && clientActive != isActive)
{
isActive = clientActive;
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
}
isActive = clientActive;
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
}
}

View file

@ -72,19 +72,14 @@ public class TileEntityChemicalDissolutionChamber extends TileEntityNoisyElectri
@Override
public void onUpdate()
{
if(worldObj.isRemote)
if(worldObj.isRemote && updateDelay > 0)
{
Mekanism.proxy.registerSound(this);
updateDelay--;
if(updateDelay > 0)
if(updateDelay == 0 && clientActive != isActive)
{
updateDelay--;
if(updateDelay == 0 && clientActive != isActive)
{
isActive = clientActive;
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
}
isActive = clientActive;
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
}
}

View file

@ -65,19 +65,14 @@ public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock impl
@Override
public void onUpdate()
{
if(worldObj.isRemote)
if(worldObj.isRemote && updateDelay > 0)
{
Mekanism.proxy.registerSound(this);
updateDelay--;
if(updateDelay > 0)
if(updateDelay == 0 && clientActive != isActive)
{
updateDelay--;
if(updateDelay == 0 && clientActive != isActive)
{
isActive = clientActive;
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
}
isActive = clientActive;
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
}
}

View file

@ -68,19 +68,14 @@ public class TileEntityChemicalOxidizer extends TileEntityNoisyElectricBlock imp
@Override
public void onUpdate()
{
if(worldObj.isRemote)
if(worldObj.isRemote && updateDelay > 0)
{
Mekanism.proxy.registerSound(this);
updateDelay--;
if(updateDelay > 0)
if(updateDelay == 0 && clientActive != isActive)
{
updateDelay--;
if(updateDelay == 0 && clientActive != isActive)
{
isActive = clientActive;
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
}
isActive = clientActive;
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
}
}

View file

@ -78,19 +78,14 @@ public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock imple
@Override
public void onUpdate()
{
if(worldObj.isRemote)
if(worldObj.isRemote && updateDelay > 0)
{
Mekanism.proxy.registerSound(this);
updateDelay--;
if(updateDelay > 0)
if(updateDelay == 0 && clientActive != isActive)
{
updateDelay--;
if(updateDelay == 0 && clientActive != isActive)
{
isActive = clientActive;
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
}
isActive = clientActive;
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
}
}

View file

@ -130,19 +130,14 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
{
super.onUpdate();
if(worldObj.isRemote)
if(worldObj.isRemote && updateDelay > 0)
{
Mekanism.proxy.registerSound(this);
updateDelay--;
if(updateDelay > 0)
if(updateDelay == 0 && clientActive != isActive)
{
updateDelay--;
if(updateDelay == 0 && clientActive != isActive)
{
isActive = clientActive;
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
}
isActive = clientActive;
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
}
}

View file

@ -106,19 +106,14 @@ public class TileEntityMetallurgicInfuser extends TileEntityNoisyElectricBlock i
{
super.onUpdate();
if(worldObj.isRemote)
if(worldObj.isRemote && updateDelay > 0)
{
Mekanism.proxy.registerSound(this);
updateDelay--;
if(updateDelay > 0)
if(updateDelay == 0 && clientActive != isActive)
{
updateDelay--;
if(updateDelay == 0 && clientActive != isActive)
{
isActive = clientActive;
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
}
isActive = clientActive;
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
}
}

View file

@ -608,7 +608,7 @@ public final class MekanismUtils
*/
public static int getTicks(IUpgradeTile mgmt, int def)
{
return (int)(def * Math.pow(general.maxUpgradeMultiplier, (float)-mgmt.getComponent().getUpgrades(Upgrade.SPEED)/(float)Upgrade.SPEED.getMax()));
return def * (int)Math.pow(general.maxUpgradeMultiplier, (float)-mgmt.getComponent().getUpgrades(Upgrade.SPEED)/(float)Upgrade.SPEED.getMax());
}
/**

View file

@ -6,7 +6,6 @@ import java.util.ArrayList;
import java.util.EnumSet;
import mekanism.api.MekanismConfig.generators;
import mekanism.client.sound.TileSound;
import mekanism.common.FluidSlot;
import mekanism.common.Mekanism;
import mekanism.common.MekanismItems;
@ -23,8 +22,7 @@ import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import cpw.mods.fml.common.Optional.Method;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import dan200.computercraft.api.lua.ILuaContext;
import dan200.computercraft.api.peripheral.IComputerAccess;

View file

@ -76,19 +76,14 @@ public abstract class TileEntityGenerator extends TileEntityNoisyElectricBlock i
{
super.onUpdate();
if(worldObj.isRemote)
if(worldObj.isRemote && updateDelay > 0)
{
Mekanism.proxy.registerSound(this);
updateDelay--;
if(updateDelay > 0)
if(updateDelay == 0 && clientActive != isActive)
{
updateDelay--;
if(updateDelay == 0 && clientActive != isActive)
{
isActive = clientActive;
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
}
isActive = clientActive;
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
}
}

View file

@ -1,33 +1,38 @@
{
"etc.Beep": {"category": "master","sounds": [{"name": "etc/Beep","stream": false}]},
"etc.Click": {"category": "master","sounds": [{"name": "etc/Click","stream": false}]},
"etc.Ding": {"category": "master","sounds": [{"name": "etc/Ding","stream": false}]},
"etc.Error": {"category": "master","sounds": [{"name": "etc/Error","stream": false}]},
"etc.GasMask": {"category": "master","sounds": [{"name": "etc/GasMask","stream": false}]},
"etc.Hydraulic": {"category": "master","sounds": [{"name": "etc/Hydraulic","stream": false}]},
"etc.Pop": {"category": "master","sounds": [{"name": "etc/Pop","stream": false}]},
"etc.Success": {"category": "master","sounds": [{"name": "etc/Success","stream": false}]},
"etc.Beep": {"category": "master","sounds": [{"name": "etc/Beep","stream": false}]},
"etc.Click": {"category": "master","sounds": [{"name": "etc/Click","stream": false}]},
"etc.Ding": {"category": "master","sounds": [{"name": "etc/Ding","stream": false}]},
"etc.Error": {"category": "master","sounds": [{"name": "etc/Error","stream": false}]},
"etc.GasMask": {"category": "master","sounds": [{"name": "etc/GasMask","stream": false}]},
"etc.Hydraulic": {"category": "master","sounds": [{"name": "etc/Hydraulic","stream": false}]},
"etc.Pop": {"category": "master","sounds": [{"name": "etc/Pop","stream": false}]},
"etc.Success": {"category": "master","sounds": [{"name": "etc/Success","stream": false}]},
"tile.machine.chargepad": {"category": "block", "sounds": [{"name": "Chargepad","stream": false}]},
"tile.machine.crystallizer": {"category": "block", "sounds": [{"name": "ChemicalCrystallizer","stream": false}]},
"tile.machine.dissolution": {"category": "block", "sounds": [{"name": "ChemicalDissolutionChamber","stream": false}]},
"tile.machine.cheminfuser": {"category": "block", "sounds": [{"name": "ChemicalInfuser","stream": false}]},
"tile.machine.injection": {"category": "block", "sounds": [{"name": "ChemicalInjectionChamber","stream": false}]},
"tile.machine.oxidizer": {"category": "block", "sounds": [{"name": "ChemicalOxidizer","stream": false}]},
"tile.machine.washer": {"category": "block", "sounds": [{"name": "ChemicalWasher","stream": false}]},
"tile.machine.combiner": {"category": "block", "sounds": [{"name": "Combiner","stream": false}]},
"tile.machine.compressor": {"category": "block", "sounds": [{"name": "Compressor","stream": false}]},
"tile.machine.crusher": {"category": "block", "sounds": [{"name": "Crusher","stream": false}]},
"tile.machine.enrichment": {"category": "block", "sounds": [{"name": "EnrichmentChamber","stream": false}]},
"tile.machine.metalinfuser": {"category": "block", "sounds": [{"name": "MetallurgicInfuser","stream": false}]},
"tile.machine.sawmill": {"category": "block", "sounds": [{"name": "PrecisionSawmill","stream": false}]},
"tile.machine.prc": {"category": "block", "sounds": [{"name": "PressurizedReactionChamber","stream": false}]},
"tile.machine.purification": {"category": "block", "sounds": [{"name": "PurificationChamber","stream": false}]},
"tile.machine.smelter": {"category": "block", "sounds": [{"name": "Smelter","stream": false}]},
"tile.machine.chargepad": {"category": "block", "sounds": [{"name": "Chargepad","stream": false}]},
"tile.machine.crystallizer": {"category": "block", "sounds": [{"name": "ChemicalCrystallizer","stream": false}]},
"tile.machine.dissolution": {"category": "block", "sounds": [{"name": "ChemicalDissolutionChamber","stream": false}]},
"tile.machine.cheminfuser": {"category": "block", "sounds": [{"name": "ChemicalInfuser","stream": false}]},
"tile.machine.injection": {"category": "block", "sounds": [{"name": "ChemicalInjectionChamber","stream": false}]},
"tile.machine.oxidizer": {"category": "block", "sounds": [{"name": "ChemicalOxidizer","stream": false}]},
"tile.machine.washer": {"category": "block", "sounds": [{"name": "ChemicalWasher","stream": false}]},
"tile.machine.combiner": {"category": "block", "sounds": [{"name": "Combiner","stream": false}]},
"tile.machine.compressor": {"category": "block", "sounds": [{"name": "Compressor","stream": false}]},
"tile.machine.crusher": {"category": "block", "sounds": [{"name": "Crusher","stream": false}]},
"tile.machine.enrichment": {"category": "block", "sounds": [{"name": "EnrichmentChamber","stream": false}]},
"tile.machine.metalinfuser": {"category": "block", "sounds": [{"name": "MetallurgicInfuser","stream": false}]},
"tile.machine.sawmill": {"category": "block", "sounds": [{"name": "PrecisionSawmill","stream": false}]},
"tile.machine.prc": {"category": "block", "sounds": [{"name": "PressurizedReactionChamber","stream": false}]},
"tile.machine.purification": {"category": "block", "sounds": [{"name": "PurificationChamber","stream": false}]},
"tile.machine.smelter": {"category": "block", "sounds": [{"name": "Smelter","stream": false}]},
"tile.gen.bio": {"category": "block", "sounds": [{"name": "BioGenerator","stream": false}]},
"tile.gen.gas": {"category": "block", "sounds": [{"name": "GasGenerator","stream": false}]},
"tile.gen.heat": {"category": "block", "sounds": [{"name": "HeatGenerator","stream": false}]},
"tile.gen.solar": {"category": "block", "sounds": [{"name": "SolarGenerator","stream": false}]},
"tile.gen.wind": {"category": "block", "sounds": [{"name": "WindTurbine","stream": false}]}
"tile.gen.bio": {"category": "block", "sounds": [{"name": "BioGenerator","stream": false}]},
"tile.gen.gas": {"category": "block", "sounds": [{"name": "GasGenerator","stream": false}]},
"tile.gen.heat": {"category": "block", "sounds": [{"name": "HeatGenerator","stream": false}]},
"tile.gen.solar": {"category": "block", "sounds": [{"name": "SolarGenerator","stream": false}]},
"tile.gen.wind": {"category": "block", "sounds": [{"name": "WindTurbine","stream": false}]},
"item.flamethrower.idle": {"category": "player", "sounds": [{"name": "FlamethrowerIdle","stream": false}]},
"item.flamethrower.active": {"category": "player", "sounds": [{"name": "FlamethrowerActive","stream": false}]},
"item.gasmask": {"category": "player", "sounds": [{"name": "GasMask","stream": false}]}
"item.jetpack": {"category": "player", "sounds": [{"name": "Jetpack","stream": false}]}
}