public TileCorporeaCrystalCube() { if (FMLCommonHandler.instance().getSide() == Side.CLIENT) { asm = ModelLoaderRegistry.loadASM(new ResourceLocation("botania", "asms/block/corporeacrystalcube.json"), ImmutableMap.of()); } else { asm = null; } }
public TilePump() { if (FMLCommonHandler.instance().getSide() == Side.CLIENT) { move = new TimeValues.VariableValue(0); asm = ModelLoaderRegistry.loadASM(new ResourceLocation("botania", "asms/block/pump.json"), ImmutableMap.of("move", move)); } else { move = null; asm = null; } }
@SubscribeEvent @SideOnly(Side.SERVER) public void playerLoggedIn(PlayerEvent.PlayerLoggedInEvent event) { if(event.player == null || !(event.player instanceof EntityPlayerMP) || FMLCommonHandler.instance().getSide() .isClient()) { return; } ConfigSyncPacket packet = new ConfigSyncPacket(); packet.categories.add(Config.Modules); packet.categories.add(Config.Gameplay); TinkerNetwork.sendTo(packet, (EntityPlayerMP) event.player); }
public Material(String identifier, int color, boolean hidden) { this.identifier = Util.sanitizeLocalizationString(identifier); // lowercases and removes whitespaces this.hidden = hidden; // if invisible, make it fully opaque. if(((color >> 24) & 0xFF) == 0) { color |= 0xFF << 24; } this.materialTextColor = color; if(FMLCommonHandler.instance().getSide().isClient()) { setRenderInfo(color); } }
@EventHandler private void init( final FMLInitializationEvent event ) { final Stopwatch start = Stopwatch.createStarted(); AELog.info( "Initialization ( started )" ); AppEng.proxy.init(); if( this.exportConfig.isExportingItemNamesEnabled() ) { if( FMLCommonHandler.instance().getSide().isClient() ) { final ExportProcess process = new ExportProcess( this.configDirectory, this.exportConfig ); final Thread exportProcessThread = new Thread( process ); this.startService( "AE2 CSV Export", exportProcessThread ); } else { AELog.info( "Disabling item.csv export for custom recipes, since creative tab information is only available on the client." ); } } this.registration.initialize( event, this.configDirectory ); IntegrationRegistry.INSTANCE.init(); AELog.info( "Initialization ( ended after " + start.elapsed( TimeUnit.MILLISECONDS ) + "ms )" ); }
public LPPipeIconProvider() { if(FMLCommonHandler.instance().getSide() == Side.CLIENT) { icons = new ArrayList<>(); } }
PartEnum(String name, Class<? extends PartECBase> partClass, String groupName, Integration.Mods mod) { this.unlocalizedName = "extracells.part." + name; this.name = name; this.partClass = partClass; this.groupName = groupName == null || groupName.isEmpty() ? null : "extracells." + groupName; this.mod = mod; if (FMLCommonHandler.instance().getSide().isClient()) { itemModel = Optional.of(new ModelResourceLocation("extracells:part/" + name.replace(".", "_"))); } }
public ClimateListener(Object locationProvider) { this.locationProvider = locationProvider; if (FMLCommonHandler.instance().getSide() == Side.CLIENT) { tickHelper = new TickHelper(); needsClimateUpdate = true; } }
public static long getPositionRandom( final BlockPos pos ) { if ( pos != null && FMLCommonHandler.instance().getSide() == Side.CLIENT ) { return MathHelper.getPositionRandom( pos ); } return 0; }
public static boolean removeTemplate(String name) { if (loadedTemplates.containsKey(name)) { loadedTemplates.remove(name); if (FMLCommonHandler.instance().getSide() == Side.SERVER) { NetworkHandler.sendToAllPlayers(new PacketStructureRemove(name)); } return true; } return false; }
public static Optional<StructureTemplate> getTemplate(String name) { StructureTemplate template = loadedTemplates.get(name); if (template == null && FMLCommonHandler.instance().getSide() == Side.CLIENT && allTemplateNames.contains(name)) { PacketStructure pkt = new PacketStructure(); pkt.packetData.setString(SYNC_TEMPLATE_TAG, name); NetworkHandler.sendToServer(pkt); } return Optional.ofNullable(template); }
public static void refresh() { if (FMLCommonHandler.instance().getSide().isClient()) { Minecraft.getMinecraft().addScheduledTask(() -> mappers.forEach(JEICompatMapper::refresh)); } }
@SubscribeEvent public void onWorldUnload(WorldEvent.Unload event) { if (FMLCommonHandler.instance().getSide().isClient()) { return; } final String worldName = WorldHelper.getWorldName(event.getWorld()); this.configMap.remove(worldName); this.worlds.remove(worldName); } }
@EventHandler public void init(FMLInitializationEvent e) { if (FMLCommonHandler.instance().getSide() == Side.CLIENT) { ForgeClientSparkPlatform.register(this); } }
@SubscribeEvent public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) { if (!event.getModID().equals(Constants.MOD_ID)) { return; } loadConfigCommon(FMLCommonHandler.instance().getSide()); loadConfigFluids(); }
public SlotForestry(IInventory inventory, int slotIndex, int xPos, int yPos) { super(inventory, slotIndex, xPos, yPos); if (FMLCommonHandler.instance().getSide() == Side.CLIENT) { setBackgroundLocation(TextureManagerForestry.getInstance().getGuiTextureMap()); } this.stackLimit = -1; }
@Override public IGridNode getGridNode(AEPartLocation dir) { if (FMLCommonHandler.instance().getSide().isClient() && (world == null || world.isRemote)) { return null; } if (this.isFirstGetGridNode) { this.isFirstGetGridNode = false; getActionableNode().updateState(); } return this.node; }
@Override public void packetDataHandler(ByteBuf fields) { if (FMLCommonHandler.instance().getSide().isClient()) { for (int slot = 0; slot < 5; slot++) { this.setInventorySlotContents(slot, ByteBufUtils.readItemStack(fields)); } } }
@SubscribeEvent @SideOnly(Side.SERVER) public void playerLoggedIn(PlayerEvent.PlayerLoggedInEvent event) { if(event.player instanceof EntityPlayerMP && FMLCommonHandler.instance().getSide().isServer()) { ExampleSyncPacketImpl packet = new ExampleSyncPacketImpl(); networkWrapper.network.sendTo(packet, (EntityPlayerMP) event.player); } }
@Override public void registerTileEntity() { super.registerTileEntity(); Block block = getBlock(); if (FMLCommonHandler.instance().getSide() == Side.CLIENT && renderer != null && block != null) { ClientRegistry.bindTileEntitySpecialRenderer(getTeClass(), renderer); Item item = Item.getItemFromBlock(block); if (item != Items.AIR) { ForgeHooksClient.registerTESRItemStack(item, 0, getTeClass()); } } }