Search in sources :

Example 36 with SideOnly

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;
}
Also used : IBlockState(net.minecraft.block.state.IBlockState) Nonnull(javax.annotation.Nonnull) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 37 with SideOnly

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));
            }
        }
    }
}
Also used : GuiManual(com.miningmark48.pearcelmod.gui.manual.GuiManual) EntityPlayer(net.minecraft.entity.player.EntityPlayer) World(net.minecraft.world.World) ItemStack(net.minecraft.item.ItemStack) Minecraft(net.minecraft.client.Minecraft) TextComponentString(net.minecraft.util.text.TextComponentString) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 38 with SideOnly

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);
}
Also used : ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) CustomModelMeshAdventurersPickaxe(convenientadditions.item.tools.adventurersPickaxe.CustomModelMeshAdventurersPickaxe) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 39 with SideOnly

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);
}
Also used : ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 40 with SideOnly

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));
}
Also used : ItemStack(net.minecraft.item.ItemStack) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

SideOnly (net.minecraftforge.fml.relauncher.SideOnly)271 ItemStack (net.minecraft.item.ItemStack)47 ModelResourceLocation (net.minecraft.client.renderer.block.model.ModelResourceLocation)44 ResourceLocation (net.minecraft.util.ResourceLocation)35 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)34 IBlockState (net.minecraft.block.state.IBlockState)28 Block (net.minecraft.block.Block)26 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)26 TileEntity (net.minecraft.tileentity.TileEntity)17 EntityPlayer (net.minecraft.entity.player.EntityPlayer)13 BlockPos (net.minecraft.util.math.BlockPos)12 Vec3d (net.minecraft.util.math.Vec3d)11 Tessellator (net.minecraft.client.renderer.Tessellator)10 EnumFacing (net.minecraft.util.EnumFacing)9 AxisAlignedBB (net.minecraft.util.math.AxisAlignedBB)9 World (net.minecraft.world.World)9 Minecraft (net.minecraft.client.Minecraft)8 IOException (java.io.IOException)7 TextureManager (net.minecraft.client.renderer.texture.TextureManager)7 Item (net.minecraft.item.Item)7