use of net.minecraft.network.packet.c2s.play.CustomPayloadC2SPacket in project SpeedRunIGT by RedLime.
the class TimerPacketHandler method sendCompleteC2S.
/*
Timer complete packets
*/
public static void sendCompleteC2S(InGameTimer timer) {
if (!SpeedRunOption.getOption(SpeedRunOptions.AUTOMATIC_COOP_MODE))
return;
PacketByteBuf passedData = new PacketByteBuf(Unpooled.buffer());
passedData.writeLong(timer.endTime);
if (client.getNetworkHandler() != null)
client.getNetworkHandler().getConnection().send(new CustomPayloadC2SPacket(PACKET_TIMER_COMPLETE_ID, passedData));
}
use of net.minecraft.network.packet.c2s.play.CustomPayloadC2SPacket in project FallingAttackFabric by hamusuke0323.
the class ClientPlayerEntityMixin method sendFallingAttackPacket.
public void sendFallingAttackPacket(boolean start) {
PacketByteBuf packetByteBuf = PacketByteBufs.create();
packetByteBuf.writeBoolean(start);
this.networkHandler.sendPacket(new CustomPayloadC2SPacket(NetworkManager.FALLING_ATTACK_C2S_PACKET_ID, packetByteBuf));
}
use of net.minecraft.network.packet.c2s.play.CustomPayloadC2SPacket in project Paradise-Lost by devs-immortal.
the class PoisonDartEntity method onHit.
@Override
protected void onHit(LivingEntity entityIn) {
super.onHit(entityIn);
if (entityIn instanceof ServerPlayerEntity) {
// AetherAPI.get((PlayerEntity) entityIn).inflictPoison(500);
PacketByteBuf byteBuf = new PacketByteBuf(Unpooled.buffer());
byteBuf.writeInt(500);
((ServerPlayerEntity) entityIn).networkHandler.sendPacket(new CustomPayloadC2SPacket(Aether.locate("poison"), byteBuf));
} else {
this.victim = entityIn;
this.poison = new AetherPoisonMovement(this.victim);
this.poison.inflictPoison(500);
this.removed = false;
}
}
use of net.minecraft.network.packet.c2s.play.CustomPayloadC2SPacket 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.packet.c2s.play.CustomPayloadC2SPacket in project SpeedRunIGT by RedLime.
the class TimerPacketHandler method sendInitC2S.
public static void sendInitC2S(long time, RunCategory category) {
if (!SpeedRunOption.getOption(SpeedRunOptions.AUTOMATIC_COOP_MODE))
return;
PacketByteBuf passedData = new PacketByteBuf(Unpooled.buffer());
passedData.writeLong(time);
passedData.writeString(category.getID());
if (client.getNetworkHandler() != null)
client.getNetworkHandler().getConnection().send(new CustomPayloadC2SPacket(PACKET_TIMER_INIT_ID, passedData));
}
Aggregations