some GT_Utility polishing. unfinished.
This commit is contained in:
parent
434b5139ee
commit
7568a1d454
3 changed files with 257 additions and 495 deletions
|
@ -816,7 +816,12 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
|
|||
|
||||
@Override
|
||||
public byte getStrongestRedstone() {
|
||||
return (byte) Math.max(getInternalInputRedstoneSignal((byte) 0), Math.max(getInternalInputRedstoneSignal((byte) 1), Math.max(getInternalInputRedstoneSignal((byte) 2), Math.max(getInternalInputRedstoneSignal((byte) 3), Math.max(getInternalInputRedstoneSignal((byte) 4), getInternalInputRedstoneSignal((byte) 5))))));
|
||||
byte strongest = 0;
|
||||
for(EnumFacing side : EnumFacing.VALUES) {
|
||||
byte signal = getInternalInputRedstoneSignal(side);
|
||||
if(signal > strongest) strongest = signal;
|
||||
}
|
||||
return strongest;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2,25 +2,24 @@ package gregtech.api.net;
|
|||
|
||||
import gregtech.api.util.GT_Utility;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.network.ByteBufUtils;
|
||||
|
||||
public class GT_Packet_Sound extends GT_Packet {
|
||||
|
||||
private int mX, mZ, mY;
|
||||
private Vec3d mPosition;
|
||||
private String mSoundName;
|
||||
private float mSoundStrength, mSoundPitch;
|
||||
|
||||
public GT_Packet_Sound() {}
|
||||
|
||||
public GT_Packet_Sound(String aSoundName, float aSoundStrength, float aSoundPitch, int aX, short aY, int aZ) {
|
||||
mX = aX;
|
||||
mY = aY;
|
||||
mZ = aZ;
|
||||
mSoundName = aSoundName;
|
||||
mSoundStrength = aSoundStrength;
|
||||
mSoundPitch = aSoundPitch;
|
||||
public GT_Packet_Sound(String soundName, float soundStrength, float soundPitch, Vec3d soundPosition) {
|
||||
this.mPosition = soundPosition;
|
||||
this.mSoundName = soundName;
|
||||
this.mSoundStrength = soundStrength;
|
||||
this.mSoundPitch = soundPitch;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -28,9 +27,9 @@ public class GT_Packet_Sound extends GT_Packet {
|
|||
ByteBufUtils.writeUTF8String(buf, mSoundName);
|
||||
buf.writeFloat(mSoundStrength);
|
||||
buf.writeFloat(mSoundPitch);
|
||||
buf.writeInt(mX);
|
||||
buf.writeShort(mY);
|
||||
buf.writeInt(mZ);
|
||||
buf.writeDouble(mPosition.xCoord);
|
||||
buf.writeDouble(mPosition.yCoord);
|
||||
buf.writeDouble(mPosition.zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -38,9 +37,7 @@ public class GT_Packet_Sound extends GT_Packet {
|
|||
mSoundName = ByteBufUtils.readUTF8String(buf);
|
||||
mSoundStrength = buf.readFloat();
|
||||
mSoundPitch = buf.readFloat();
|
||||
mX = buf.readInt();
|
||||
mY = buf.readShort();
|
||||
mZ = buf.readInt();
|
||||
mPosition = new Vec3d(buf.readDouble(), buf.readDouble(), buf.readDouble());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue