use of net.minecraft.network.PacketByteBuf in project MCDoom by AzureDoom.
the class HeavyCannon method inventoryTick.
@Override
public void inventoryTick(ItemStack stack, World world, Entity entity, int slot, boolean selected) {
if (world.isClient) {
if (((PlayerEntity) entity).getMainHandStack().getItem() instanceof HeavyCannon && ClientInit.reload.isPressed() && selected) {
PacketByteBuf passedData = new PacketByteBuf(Unpooled.buffer());
passedData.writeBoolean(true);
ClientPlayNetworking.send(DoomMod.HEAVYCANNON, passedData);
}
}
}
use of net.minecraft.network.PacketByteBuf in project MCDoom by AzureDoom.
the class BFG method inventoryTick.
@Override
public void inventoryTick(ItemStack stack, World world, Entity entity, int slot, boolean selected) {
if (world.isClient) {
if (((PlayerEntity) entity).getMainHandStack().getItem() instanceof BFG && ClientInit.reload.isPressed() && selected) {
PacketByteBuf passedData = new PacketByteBuf(Unpooled.buffer());
passedData.writeBoolean(true);
ClientPlayNetworking.send(DoomMod.BFG, passedData);
}
}
}
use of net.minecraft.network.PacketByteBuf in project MCDoom by AzureDoom.
the class BFG9000 method inventoryTick.
@Override
public void inventoryTick(ItemStack stack, World world, Entity entity, int slot, boolean selected) {
if (world.isClient) {
if (((PlayerEntity) entity).getMainHandStack().getItem() instanceof BFG9000 && ClientInit.reload.isPressed() && selected) {
PacketByteBuf passedData = new PacketByteBuf(Unpooled.buffer());
passedData.writeBoolean(true);
ClientPlayNetworking.send(DoomMod.BFG9000, passedData);
}
}
}
use of net.minecraft.network.PacketByteBuf in project MasaGadget by plusls.
the class BborProtocol method bborInitializeHandler.
private static void bborInitializeHandler(ClientPlayNetworkHandler clientPlayNetworkHandler, PacketByteBuf data) {
long seed = data.readLong();
int spawnX = data.readInt();
int spawnZ = data.readInt();
BborProtocol.seedCache = seed;
BborProtocol.spawnPos = new BlockPos(spawnX, 0, spawnZ);
// 因此无需对是否加载 MiniHUD 进行特判
if (!BborProtocol.carpetOrServux) {
BborProtocol.enable = true;
if (Configs.Minihud.COMPACT_BBOR_PROTOCOL.getBooleanValue()) {
initMetaData();
}
ModInfo.LOGGER.info("init seed: {}", BborProtocol.seedCache);
if (!ModInfo.isModLoaded(ModInfo.BBOR_MOD_ID)) {
ModInfo.LOGGER.debug("SUBSCRIBE BBOR.");
clientPlayNetworkHandler.sendPacket(new CustomPayloadC2SPacket(SUBSCRIBE, new PacketByteBuf(Unpooled.buffer())));
}
}
}
use of net.minecraft.network.PacketByteBuf in project Polymorph by TheIllusiveC4.
the class PolymorphPacketDistributorImpl method sendPersistentRecipeSelectionC2S.
@Override
public void sendPersistentRecipeSelectionC2S(Identifier pIdentifier) {
PacketByteBuf buf = PacketByteBufs.create();
buf.writeIdentifier(pIdentifier);
ClientPlayNetworking.send(PolymorphPackets.PERSISTENT_SELECT, buf);
}
Aggregations