use of gregtech.api.block.ICustomParticleBlock in project GregTech by GregTechCE.
the class NetworkHandler method initClient.
@SideOnly(Side.CLIENT)
private static void initClient() {
registerClientExecutor(PacketUIOpen.class, (packet, handler) -> {
UIFactory<?> uiFactory = UIFactory.FACTORY_REGISTRY.getObjectById(packet.uiFactoryId);
if (uiFactory == null) {
GTLog.logger.warn("Couldn't find UI Factory with id '{}'", packet.uiFactoryId);
} else {
uiFactory.initClientUI(packet.serializedHolder, packet.windowId, packet.initialWidgetUpdates);
}
});
registerClientExecutor(PacketUIWidgetUpdate.class, (packet, handler) -> {
GuiScreen currentScreen = Minecraft.getMinecraft().currentScreen;
if (currentScreen instanceof ModularUIGui) {
((ModularUIGui) currentScreen).handleWidgetUpdate(packet);
}
});
registerClientExecutor(PacketBlockParticle.class, (packet, handler) -> {
World world = Minecraft.getMinecraft().world;
IBlockState blockState = world.getBlockState(packet.blockPos);
ParticleManager particleManager = Minecraft.getMinecraft().effectRenderer;
((ICustomParticleBlock) blockState.getBlock()).handleCustomParticle(world, packet.blockPos, particleManager, packet.entityPos, packet.particlesAmount);
});
registerClientExecutor(PacketClipboard.class, (packet, handler) -> {
ClipboardUtil.copyToClipboard(packet.text);
});
}
Aggregations