use of net.minecraftforge.fml.relauncher.SideOnly in project AgriCraft by AgriCraft.
the class CustomWoodType method getIcon.
@SideOnly(Side.CLIENT)
@Nonnull
public TextureAtlasSprite getIcon() {
if (texture == null) {
try {
IBlockState state = block.getStateFromMeta(meta);
texture = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getTexture(state);
} catch (Exception e) {
AgriCore.getLogger("agricraft").debug("Unable to load texture for custom wood block {0}!", block.getLocalizedName());
AgriCore.getLogger("agricraft").trace(e);
texture = Minecraft.getMinecraft().getTextureMapBlocks().getMissingSprite();
}
}
return texture;
}
use of net.minecraftforge.fml.relauncher.SideOnly in project Pearcel-Mod by MiningMark48.
the class KeyHandler method onEvent.
@SideOnly(Side.CLIENT)
@SubscribeEvent(priority = EventPriority.NORMAL, receiveCanceled = true)
public void onEvent(TickEvent.PlayerTickEvent event) {
if (event.side == Side.SERVER) {
return;
}
if (event.phase == TickEvent.Phase.START) {
Minecraft mc = Minecraft.getMinecraft();
EntityPlayer player = event.player;
World world = player.getEntityWorld();
int x = (int) event.player.posX;
int y = (int) event.player.posY;
int z = (int) event.player.posZ;
//PCP GUI
if (item_pcp.isPressed()) {
if (player.inventory.hasItemStack(new ItemStack(ModItems.pcp))) {
player.sendMessage(new TextComponentString("This is a WIP, Coming Soon™!"));
//player.openGui(PearcelMod.instance, GUIs.gui_id_pcp, world, x, y, z);
}
}
//PEPC GUI
if (item_pepc.isPressed()) {
if (player.inventory.hasItemStack(new ItemStack(ModItems.pepc))) {
player.sendMessage(new TextComponentString("This is a WIP, Coming Soon™!"));
//player.displayGUIChest(player.getInventoryEnderChest());
}
}
//Manual Gui
if (gui_manual.isPressed()) {
if (player.inventory.hasItemStack(new ItemStack(ModItems.pearcel_manual))) {
Minecraft.getMinecraft().displayGuiScreen(new GuiManual(0));
}
}
}
}
use of net.minecraftforge.fml.relauncher.SideOnly in project ConvenientAdditions by Necr0.
the class ModItems method initModelLoader.
@SideOnly(Side.CLIENT)
public static void initModelLoader() {
CustomModelMeshAdventurersPickaxe.initVariants();
ModelLoader.setCustomMeshDefinition(itemAdventurersPickaxe, new CustomModelMeshAdventurersPickaxe());
ItemMobCatcher.initModels();
//
registerModelLocation(itemDirtChunk);
registerModelLocation(itemObsidianPlate);
registerModelLocation(itemCreeperKit);
registerModelLocation(itemBlastKit);
registerModelLocation(itemSlimeKit);
registerModelLocation(itemDislocationCore);
registerModelLocation(itemSpikes);
//tools
registerModelLocation(itemIronWrench);
//misc
registerModelLocation(itemFertilizer);
registerModelLocation(itemSunstone, 0, new ModelResourceLocation(itemSunstone.getRegistryName().toString().toLowerCase() + "_inactive"));
registerModelLocation(itemSunstone, 1, new ModelResourceLocation(itemSunstone.getRegistryName().toString().toLowerCase() + "_active"));
registerIndependentModelLocation(itemCompost, new ModelResourceLocation(itemCompost.getRegistryName().toString().toLowerCase(), "inventory"));
registerModelLocation(itemBlazingRock);
registerModelLocation(itemEnderPlate, 0, new ModelResourceLocation(itemEnderPlate.getRegistryName().toString().toLowerCase() + "_inactive", "inventory"));
registerModelLocation(itemEnderPlate, 1, new ModelResourceLocation(itemEnderPlate.getRegistryName().toString().toLowerCase() + "_active", "inventory"));
registerVariants(itemLaunchingArrow, itemLaunchingArrow.getModelResourceLocations());
registerModelLocation(itemTransmutationTome);
registerVariants(itemSapBottle, itemSapBottle.getModelResourceLocations());
registerModelLocation(itemAntidote);
registerModelLocation(itemBandage);
registerModelLocation(itemSoulGem);
registerModelLocation(itemCheese);
registerModelLocation(itemCheeseBucket);
registerModelLocation(itemCheeseSandwich);
registerModelLocation(itemBackpack);
registerModelLocation(itemPortableEnderRift);
registerModelLocation(itemPotionLumbering);
registerModelLocation(itemPotionThorns);
//modules
registerModelLocation(itemModulePlayer);
registerModelLocation(itemModuleColor);
registerModelLocation(itemModuleLocation);
registerModelLocation(itemModuleText);
//trinkets
registerModelLocation(itemSunlightRing);
registerModelLocation(itemSaturationRing);
registerModelLocation(itemBreathAmulet);
registerModelLocation(itemFlippers);
registerModelLocation(itemFlowingWaterRune);
registerModelLocation(itemTideAmulet);
registerModelLocation(itemCloudJar);
registerModelLocation(itemSlimeBalloon);
registerModelLocation(itemCloudBalloon);
registerModelLocation(itemEnderCloudBalloon);
registerModelLocation(itemWindGem);
registerModelLocation(itemGlider);
registerModelLocation(itemValkyrieWings);
registerModelLocation(itemFireproofCloak);
registerModelLocation(itemNetherTalisman);
registerModelLocation(itemNetherCloak);
registerModelLocation(itemRocketPack);
registerModelLocation(itemClimbingClaws);
registerModelLocation(itemSpikedSole);
registerModelLocation(itemClimbingGear);
registerModelLocation(itemMinersBracelet);
}
use of net.minecraftforge.fml.relauncher.SideOnly in project ConvenientAdditions by Necr0.
the class ModBlocks method initModelLoader.
@SideOnly(Side.CLIENT)
public static void initModelLoader() {
ModItems.registerItemBlockModel(composterBlock);
ModItems.registerItemBlockModel(powderKegBlock);
ModItems.registerItemBlockModel(playerInterfaceBlock);
ModItems.registerItemBlockModel(proximitySensorBlock);
ModItems.registerItemBlockModel(seedBoxBlock);
ModItems.registerItemBlockModel(setProviderBlock);
ModItems.registerItemBlockModel(itemTransmitterBlock);
ModItems.registerItemBlockModel(itemReceiverBlock);
ModItems.registerItemBlockModel(inventoryProxyBlock);
ModItems.registerItemBlockModel(inventoryProxySidedBlock);
ModItems.registerItemBlockModel(inventoryProxyFilteredBlock);
ModItems.registerItemBlockModel(treetap);
ModItems.registerItemBlockModel(phantomPlatformBlock);
ModItems.registerItemBlockModel(hoverPad);
ModItems.registerItemBlockModel(blastPad);
ModItems.registerItemBlockModel(jumpPad);
ModelLoader.setCustomMeshDefinition(ItemBlock.getItemFromBlock(platform), stack -> new ModelResourceLocation(platform.getRegistryName(), BlockPlatform.COLOR.getName() + "=" + EnumDyeColor.byMetadata(stack.getItemDamage()).getName()));
ModelLoader.setCustomMeshDefinition(ItemBlock.getItemFromBlock(semiSolidBlock), stack -> new ModelResourceLocation(semiSolidBlock.getRegistryName(), BlockSemiSolid.COLOR.getName() + "=" + EnumDyeColor.byMetadata(stack.getItemDamage()).getName()));
ModItems.registerItemBlockModel(storageMatrix);
ModItems.registerIndependentModelLocation(ItemBlock.getItemFromBlock(compostSoilBlock), new ModelResourceLocation(compostSoilBlock.getRegistryName(), "inventory"));
ModItems.registerIndependentModelLocation(ItemBlock.getItemFromBlock(compostSoilTilledBlock), new ModelResourceLocation(compostSoilBlock.getRegistryName(), "inventory"));
ModItems.registerItemBlockModel(machineBlock);
ModItems.registerItemBlockModel(displayCase);
ModItems.registerItemBlockModel(remoteInventoryProxy);
ModItems.registerItemBlockModel(enderProofBlock);
ModItems.registerItemBlockModel(enderProofGlass);
ModItems.registerItemBlockModel(ironFarm);
ModItems.registerItemBlockModel(ironGolemBlock);
ModItems.registerItemBlockModel(workStation);
ModItems.registerItemBlockModel(autoWorkStation);
ModItems.registerItemBlockModel(cheeseBlock);
ModItems.registerItemBlockModel(punjiSticks);
ModItems.registerItemBlockModel(storageCrate);
ModItems.registerItemBlockModel(woodenTile);
}
use of net.minecraftforge.fml.relauncher.SideOnly in project ConvenientAdditions by Necr0.
the class ItemCompost method getSubItems.
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item i, CreativeTabs c, NonNullList<ItemStack> l) {
l.add(new ItemStack(i, 1, 0));
l.add(new ItemStack(i, 1, 1));
}
Aggregations