Reduced amount of gear packets and new grinder sounds

This commit is contained in:
Calclavia 2014-01-24 18:48:53 +08:00
parent 89c32f1744
commit a8e275c73b
7 changed files with 3 additions and 8 deletions

View file

@ -82,11 +82,6 @@ public class BlockCrate extends BlockRI
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
{
if (super.onBlockActivated(world, x, y, z, player, side, hitX, hitY, hitZ))
{
return true;
}
if (!world.isRemote)
{
if (world.getBlockTileEntity(x, y, z) instanceof TileCrate)

View file

@ -17,7 +17,7 @@ public class SoundHandler
{
public static final SoundHandler INSTANCE = new SoundHandler();
public static final String[] SOUND_FILES = { "grinder1.ogg", "grinder2.ogg", "electricshock1.ogg", "electricshock2.ogg", "electricshock3.ogg", "electricshock4.ogg", "electricshock5.ogg", "electricshock6.ogg", "electricshock7.ogg" };
public static final String[] SOUND_FILES = { "grinder1.ogg", "grinder2.ogg", "grinder3.ogg", "grinder4.ogg", "electricshock1.ogg", "electricshock2.ogg", "electricshock3.ogg", "electricshock4.ogg", "electricshock5.ogg", "electricshock6.ogg", "electricshock7.ogg" };
@ForgeSubscribe
public void loadSoundEvents(SoundLoadEvent event)

View file

@ -75,13 +75,13 @@ public abstract class PartMechanical extends JCuboidPart implements JNormalOcclu
ticks++;
angle += angularVelocity / 20;
if (prevAngularVelocity != angularVelocity)
if (Math.abs(prevAngularVelocity - angularVelocity) > 0.1f)
{
prevAngularVelocity = angularVelocity;
markPacketUpdate = true;
}
if (!world().isRemote && markPacketUpdate && ticks % 5 == 0)
if (!world().isRemote && markPacketUpdate && ticks % 20 == 0)
{
sendRotationPacket();
markPacketUpdate = false;