aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/net/GT_Packet_Sound.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/api/net/GT_Packet_Sound.java')
-rw-r--r--src/main/java/gregtech/api/net/GT_Packet_Sound.java16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/main/java/gregtech/api/net/GT_Packet_Sound.java b/src/main/java/gregtech/api/net/GT_Packet_Sound.java
index f742c39dba..fdaf5b3979 100644
--- a/src/main/java/gregtech/api/net/GT_Packet_Sound.java
+++ b/src/main/java/gregtech/api/net/GT_Packet_Sound.java
@@ -1,6 +1,5 @@
package gregtech.api.net;
-import java.io.DataOutput;
import java.io.IOException;
import net.minecraft.world.IBlockAccess;
@@ -35,14 +34,13 @@ public class GT_Packet_Sound extends GT_Packet_New {
@Override
public void encode(ByteBuf aOut) {
- DataOutput tOut = new ByteBufOutputStream(aOut);
- try {
- tOut.writeUTF(mSoundName);
- tOut.writeFloat(mSoundStrength);
- tOut.writeFloat(mSoundPitch);
- tOut.writeInt(mX);
- tOut.writeShort(mY);
- tOut.writeInt(mZ);
+ try (ByteBufOutputStream byteOutputStream = new ByteBufOutputStream(aOut)) {
+ byteOutputStream.writeUTF(mSoundName);
+ byteOutputStream.writeFloat(mSoundStrength);
+ byteOutputStream.writeFloat(mSoundPitch);
+ byteOutputStream.writeInt(mX);
+ byteOutputStream.writeShort(mY);
+ byteOutputStream.writeInt(mZ);
} catch (IOException e) {
// this really shouldn't happen, but whatever
e.printStackTrace(GT_Log.err);