Code cleanup

This commit is contained in:
LemADEC 2017-02-11 18:21:45 +01:00
parent 7a7024c5bb
commit 154ea3f6b5
2 changed files with 15 additions and 11 deletions

View file

@ -2,7 +2,7 @@ package cr0s.warpdrive.block.detection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import cr0s.warpdrive.SirenSound;
import cr0s.warpdrive.client.SirenSound;
import cr0s.warpdrive.WarpDrive;
import cr0s.warpdrive.block.TileEntityAbstractBase;
import net.minecraft.client.Minecraft;

View file

@ -1,10 +1,13 @@
package cr0s.warpdrive;
package cr0s.warpdrive.client;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.MovingSound;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
@SideOnly(Side.CLIENT)
public class SirenSound extends MovingSound {
ResourceLocation resource;
float range;
@ -34,6 +37,7 @@ public class SirenSound extends MovingSound {
this.zPosF = z;
}
@Override
public void update() {
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
@ -49,7 +53,7 @@ public class SirenSound extends MovingSound {
}
}
private float scaleTo(float num, float oldMin, float oldMax, float newMin, float newMax) {
private float scaleTo(final float num, final float oldMin, final float oldMax, final float newMin, final float newMax) {
return ((newMax - newMin)*(num - oldMin)) / (oldMax - oldMin) + newMin;
}
}