-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚸 Limited simultaneous quarry breaking sounds to 10 per tick.
- Loading branch information
Showing
5 changed files
with
117 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 0 additions & 37 deletions
37
src/main/java/pw/rxj/iron_quarry/network/packet/BlockPosStatePacket.java
This file was deleted.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
src/main/java/pw/rxj/iron_quarry/network/packet/BooleanBlockPosStatePacket.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package pw.rxj.iron_quarry.network.packet; | ||
|
||
import io.netty.buffer.Unpooled; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.block.BlockState; | ||
import net.minecraft.network.PacketByteBuf; | ||
import net.minecraft.util.Identifier; | ||
import net.minecraft.util.math.BlockPos; | ||
|
||
public class BooleanBlockPosStatePacket { | ||
public final Boolean bool; | ||
public final BlockPos blockPos; | ||
public final BlockState blockState; | ||
|
||
private BooleanBlockPosStatePacket(Boolean bool, BlockPos blockPos, BlockState blockState) { | ||
this.bool = bool; | ||
this.blockPos = blockPos; | ||
this.blockState = blockState; | ||
} | ||
|
||
public static BooleanBlockPosStatePacket read(PacketByteBuf buf) { | ||
try { | ||
Boolean bool = buf.readBoolean(); | ||
BlockPos blockPos = buf.readBlockPos(); | ||
BlockState blockState = Block.getStateFromRawId(buf.readInt()); | ||
|
||
return new BooleanBlockPosStatePacket(bool, blockPos, blockState); | ||
} catch(Exception ignored) { | ||
return null; | ||
} | ||
} | ||
public static PacketByteBuf write(Identifier channel, Boolean bool, BlockPos blockPos, BlockState blockState) { | ||
PacketByteBuf packet = new PacketByteBuf(Unpooled.buffer()); | ||
packet.writeIdentifier(channel); | ||
packet.writeBoolean(bool); | ||
packet.writeBlockPos(blockPos); | ||
packet.writeInt(Block.getRawIdFromState(blockState)); | ||
|
||
return packet; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters