Jump to content

opssemnik

Members
  • Posts

    269
  • Joined

  • Last visited

Posts posted by opssemnik

  1. A texture is just a number ( the index of the texture in the sheet).

    You need to return a different number depending on whether there is an Item in the slot or not.

    I'm using a custom rendered item though so I have two image files (one with one without), I got it working in the ModelAltar class, but when you disconnect/reconnect the block shows up as it were empty then switches back to having a book when you right click it opening the gui.

    you need to save the texture witch the block is using (not the file, just the name) to the nbt, also to switch gui just put this on onBlockActivacted (or where u call the gui)

     

     

    Item equipped = par5Entityplayer.getCurrentEquippedItem() != null ? par5Entityplayer.getCurrentEquippedItem().getItem() : null;

    if (equipped instanceof MYITEM1){

    par5EntityPlayer.openGui(MYMOD.instance, GuiId1, par1World, par2, par3, par4);

    }

    if(equipped instanceof MYITEM2){

    par5EntityPlayer.openGui(MYMOD.instance, GuiId2, par1World, par2, par3, par4);

    }

    else {

    //more stuff

    }

     

  2. Answears

    1-

     

     

    I USE THIS FOR MY RP2 ADDON

    @PostInit

    public void modsLoaded(FMLPostInitializationEvent event) {

        if (Loader.isModLoaded("RedPowerWorld")) {

                try {

                          //do stuff

                                    }

     

                    LogHelper.log(Level.INFO, "Loaded RP2 World addon");

                }

                catch (Exception e) {

                    LogHelper.log(Level.SEVERE, "Could not load RP2 World addon");

                    e.printStackTrace(System.err);

                }

            }

     

     

    2 - Learn More java, the core module its like an engine for your mod, so anyone (99%) will not help you

     

    3 - Take a look at LoaderSorter, the unique method that i know to do that, its make you mod file starts with the last letter (like Wmymod.zip), as far i know the loader starts to load by the first letter of the mod file, but im sure there ir another way

  3. to make isFlying true try this

    @Override

        public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {

            super.onUpdate(par1ItemStack, par2World, par3Entity, par4, par5);

          if(par3Entity instanceof EntityPlayer){

            EntityPlayer player = (EntityPlayer)par3Entity;

            if (player .inventory.hasItem(24537)) {

                player .capabilities.allowFlying = true;

            }

     

            if (player.capabilities.isFlying == true) {

                this.setIconIndex(1);

            }} else {

                this.setIconIndex(0);

            }

        }

     

     

  4. its because it gens per chunk.(chunks dosent have 400 in a line), the best way, you can check if the chunk exists (there is a function inside World.java, with the given x , y ,z, if yes, checks if has you rail and the rails in a line dosent bigger than 400, and them do the generation).

    The x, y, z must be the x,y,z of you generation but with x +1, z +1 (or something like this, you may understand what i said);

  5. i dont understand you are trying to make a packet for mcpc bukkit or normal bukkit?, because the normal bukkit dont have the Packet250CustomPayload.

    Its a forge packet, and you need a packet handler to use him.

    I dont know if this will work..

     

     

    PacketRegionHandler pack = new PacketRegionHandler(MessagesPacket.messageVille);

        Packet250CustomPayload packet = (Packet250CustomPayload )pack;

        PacketDispatcher.sendPacketToPlayer(packet, (Player)par2EntityPlayer);

     

     

    if that dont work(im not good with bukkit and packet stuff), you can try

     

     

    Iterator iterator = MinecraftServer.getServer().configManager.playerEntities.iterator();

     

    while (iterator.hasNext())

    {

            Object obj = iterator.next();

            if ((obj instanceof EntityPlayer) && !((EntityPlayerMP)obj).username.isEmpty())

            {

                    EntityPlayerMP pmp = (EntityPlayerMP)obj;

                    pmp.addChatMessage(string here);

            }

    }

     

     

    as far i know entityplayer its entityhuman in bukkit (just change), but if you will make a version of this mod for vannila just use packet handler, there is some tutorials on the wiki, also a lot of things are obfuscated on bukkit, so the best way its do directly for bukkit and ask for help in the bukkit forums.

  6. in your main class you do

    @PreInit

    public void registerMyEvents(FMLPreInitializationEvent e){

    MinecraftForge.EVENT_BUS.register(new YOUREVENTCLASS());

    }

    then u create a class with the

     

     

    Use LivingDeathEvent if you want vanilla sheep to drop your item.

     

    @ForgeSubscribe
    public void playerKilledSheep(LivingDeathEvent event)
    {
    if(event.entityLiving instanceof EntitySheep)
    {
    	event.entityLiving.dropItem(Item.porkCooked.shiftedIndex, 1);
    }
    }
    

     

     

  7. public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)

        {

            if (!par1World.isRemote)

            {

                int var6 = par1World.getBlockMetadata(par2, par3, par4);

                boolean var7 = this.canPlaceBlockAt(par1World, par2, par3, par4);

     

                if (var7)

                {

                    this.updateAndPropagateCurrentStrength(par1World, par2, par3, par4);

                }

                else

                {

                    this.dropBlockAsItem(par1World, par2, par3, par4, var6, 0);

                    par1World.setBlockWithNotify(par2, par3, par4, 0);

                }

     

                super.onNeighborBlockChange(par1World, par2, par3, par4, par5);

            }

        }

     

  8. i use for RedPowerWorld Integration   

     

     

    @PostInit

        public void modsLoaded(FMLPostInitializationEvent event) {

    if (Loader.isModLoaded("RedPowerWorld")) {

                try {

                    rp2Stone = (Block) Class.forName("com.eloraam.redpower.RedPowerWorld").getField("blockStone").get(null);

     

                      //sniped the things that i do with that             

                    }

     

                    LogHelper.log(Level.INFO, "Loaded RP2 World addon");

                }

                catch (Exception e) {

                    LogHelper.log(Level.SEVERE, "Could not load RP2 World addon");

                    e.printStackTrace(System.err);

                }

            }

             

        }

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.