Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

ShetiPhian

Members
  • Posts

    198
  • Joined

  • Last visited

Posts posted by ShetiPhian

  1. place it in your src or if you use eclipse drag and drop into a package folder. Then return the location and file name "/file/file/texture.png"

    Here is an example

    "GSM/textures/blocks/blocks.png"

    Just adding to this

     

    You also need this in your client proxy to avoid rendering glitches. (I've called mine after loading my config and before registering my blocks)

    MinecraftForgeClient.preloadTexture("GSM/textures/blocks/blocks.png");

  2. I guess it's normal to some extent that forge 4.0.0 doesn't fit for 1.2.5 anyways so if any of you (or any one else who might want to join the conversation :) ) happens to have a download link or a 3.3.8 version on their computer I would love so much if you could share it off!!!! <3<3<3 :)O

     

    The link you want can be found here: http://www.minecraftforge.net/forum/index.php/topic,5.0.html

    Hint: if you get to "Downloads Adfly:" you've gone too far  ;)

  3. Don't use hard coded numbers, if two mods use the same one bad things happen.

     

    Instead have RenderingRegistry assign you a number by running the code through your proxy.

     

    int renderAmethystArmour = proxy.addArmor("Amethyst")
    helmetAmethyst = (new WillowItemArmor(1048, 0, enumAmethystArmour, renderAmethystArmour, 0)).setItemName("amethystHelmet");
    

     

    Server Proxy

    public int addArmor(String armor)
    {
        return 0;  //server doesn't care what the number is
    }
    

     

    Client Proxy

    @Override
    public int addArmor(String armor)
    {
        return RenderingRegistry.addNewArmourRendererPrefix(armor);
    }
    

     

    Edit: dumb moment, I forgot armor sets get the same render id (I had individual parts getting their own  ::) )

  4. Well the good news is the event system was able to replace all but two parts from my PAPI code. (Just a bit of rethinking was required)

     

    The bad news is I'm apparently too dumb to understand how to use the asm library  :'(

     

    Maybe if I better explained what I'm trying to do.

     

    My Mod adds player classes, the strongman/earth class is the only one with troubles. They can punch through stone and get a small bonus to mining speed.

    To make this work I need to change the return of EntityPlayer.getCurrentPlayerStrVsBlock and EntityPlayer.canHarvestBlock

     

    EntityPlayer.canHarvestBlock mock-up

        public boolean canHarvestBlock(Block par1Block)
        {
            //return this.inventory.canHarvestBlock(par1Block);
            return ShetiPhian.proxy.canHarvestBlock(this, this.inventory.canHarvestBlock(par1Block), par1Block);
        }
    

     

    EntityPlayer.getCurrentPlayerStrVsBlock mock-up

        public float getCurrentPlayerStrVsBlock(Block par1Block, int meta)
        {
            ItemStack stack = inventory.getCurrentItem();
            float var2 = (stack == null ? 1.0F : stack.getItem().getStrVsBlock(stack, par1Block, meta));
            int var3 = EnchantmentHelper.getEfficiencyModifier(this.inventory);
    
            if (var3 > 0 && ForgeHooks.canHarvestBlock(par1Block, this, meta))
            {
                var2 += (float)(var3 * var3 + 1);
            }
    
            if (this.isPotionActive(Potion.digSpeed))
            {
                var2 *= 1.0F + (float)(this.getActivePotionEffect(Potion.digSpeed).getAmplifier() + 1) * 0.2F;
            }
    
            if (this.isPotionActive(Potion.digSlowdown))
            {
                var2 *= 1.0F - (float)(this.getActivePotionEffect(Potion.digSlowdown).getAmplifier() + 1) * 0.2F;
            }
    
            if (this.isInsideOfMaterial(Material.water) && !EnchantmentHelper.getAquaAffinityModifier(this.inventory))
            {
                var2 /= 5.0F;
            }
    
            if (!this.onGround)
            {
                var2 /= 5.0F;
            }
    
            //return var2;
            return ShetiPhian.proxy.getCurrentPlayerStrVsBlock(this, var2, par1Block, meta);
        }
    

  5. It would be nice to drop a dependency, I noticed the new Event system was able to replace a few things I needed PAPI for.

     

    Anyhow, looks like I'm off to google I've never used asm before and have no clue what to do.

    If anyone want to post any helpful info I'd be grateful  ;D

  6. I've only added a single Amulet and it was in the armor directory and didn't use IArmorTextureProvider, so I won't be of much use but;

     

    Have you tried throwing some system.out 's in to see if the textures are ever being returned, rather then returning null each time?

     

     

  7. I've ran into a snag while converting my 1.2.5 mod

     

    PlayerAPI edits on the EntityPlayerSP & MP level which works for most things but flops for canHarvestBlock

     

    ForgeHooks.canHarvestBlock calls EntityPlayer.canHarvestBlock which returns its value to ForgeHooks.canHarvestBlock

     

    My code does nothing through PlayerAPI, but doing a temp edit in EntityPlayer get everything working fine.

     

    For the life of me I just can't seem to think of a way to edit the return of a direct call to EntityPlayer.canHarvestBlock from EntityPlayerSP.canHarvestBlock

  8. ModLoader.addName also sets it to "en_US"

     

    This is untested but might work for you

    private void addName(Object objectToName, String inGameName)
    {
        LanguageRegistry.instance().addNameForObject(objectToName, "en_US", inGameName);
        LanguageRegistry.instance().addNameForObject(objectToName, "en_UK", inGameName);
    }
    

  9. I believe .setBlockName requires the first letter to be lower case, but I could be wrong.

    oreAmethyst = (new WillowBlockOre(225, 0)).setBlockName("amethystOre");

     

    NOTE: The following code enables you to remove ModLoader.addName but functions exactly the same

    If you want to remove ModLoader.addName your new code would look like:

    LanguageRegistry.instance().addNameForObject(oreAmethyst, "en_US", "Amethyst Ore");

     

    Or you can make your own addName and just remove "ModLoader."

    private void addName(Object objectToName, String inGameName)
    {
        LanguageRegistry.instance().addNameForObject(objectToName, "en_US", inGameName);
    }
    

     

     

    As for generation,

    I'll give the code to put it in its own class file, personally I find this to be less cluttered when you are generating many things.

    If you wish to have it in your main class file minimal changes are needed.

     

    First you'll need this line (after your textures but before registering your ores looks like a good spot)

    GameRegistry.registerWorldGenerator(new WorldGenerator());

     

    Next a new class file WorldGenerator.class

    public class WorldGenerator implements IWorldGenerator
    {
        @Override
        public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
        {
            switch (world.provider.worldType)
            {
                case -1:
                    generateNether(world, random, chunkX*16, chunkZ*16); //Forge provides true chunk coordinates, while ModLoader provides block coordinates and calls them chunkX & chunkZ
                    break;
                case 0:
                    generateSurface(world, random, chunkX*16, chunkZ*16); //To make these values the same as ModLoader they need to be multiplied by 16
                    break;
            }
        }
    
        public void generateSurface(World world, Random random, int blockX, int blockZ)
        {
            // TODO Your code here
        }
    
        public void generateNether(World world, Random random, int blockX, int blockZ)
        {
            // TODO Your code here
        }
    }
    

  10. I don't see any issues, but then again I'm basically doing the same thing  :)

     

     

    That reminds me, I should update that code with my findings.

     

    This can be cleaned up:

      @Override
      public EnumSet<TickType> ticks() {
        EnumSet<TickType> wantedTicks = EnumSet.of(TickType.CLIENT);
        wantedTicks.add(TickType.CLIENTGUI);
        return wantedTicks;
      }
    

     

    To look like this:

      @Override
      public EnumSet<TickType> ticks() {
        return EnumSet.of(TickType.CLIENT, TickType.CLIENTGUI);
      }
    

    I have no idea what I was thinking before.

     

    I've also tried every TickType and only Render, Client, & Player seemed to work on the client side.

  11. If your just after generateSurface & generateNether, like I was.

     

    @Override
    public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
    {
    	switch (world.provider.worldType)
    	{
    		case -1: generateNether(world, random, chunkX*16, chunkZ*16); //Forge provides true chunk coordinates, while ModLoader provides block coordinates and calls them chunkX & chunkZ
    		case 0: generateSurface(world, random, chunkX*16, chunkZ*16); //To make these values the same as ModLoader they need to be multiplied by 16
    	}
    }
    
    public void generateSurface(World world, Random random, int blockX, int blockZ)
    {
    }
    
    public void generateNether(World world, Random random, int blockX, int blockZ)
    {
    
    }
    

  12. Hey Lex I have a quick question for you.

     

    The chunkX and chunkZ values from ModLoader's generateSurface are 16x bigger then the ones from IWorldGenerator

     

    Am I correct in assuming this is intentional because it is providing chunk coordinates (as implied by the name) instead of block coordinates like mod loader?

  13. A nice system to have would be one that asks a random question from the FAQ and requires the correct answer before new accounts can post.

    That should get people reading it and maybe finding the answer themselves ;D

  14. Remove ModloaderMP

     

    Also be sure to:

    Do NOT install ModLoader.

    Do NOT install ModloaderMP (it 'might' work on the client only, but certainly not a server, bug the mod author that still uses this to update to Forge).

    Do NOT use MCPatcher.

     

    INSTALL

    For Players:

     

    1.    Install the [Minecraft Forge] Recommended Client for Minecraft 1.2.5.

    2.    Download ComputerCraft 1.4 Client from one of the links above, and place it in the "mods" folder in your minecraft directory.

    3.    You're done! You should now be able to run the game, and start crafting and placing computers.

    4.    (Optional) If you wish to view, edit or add to the programs that come installed with ComputerCraft, create a new folder called "ComputerCraft" in your mods directory, extract ComputerCraft1.4.zip there, and delete the zip.

  15. Im sorry :( I didnt mean to be mean or anything...i just wanted to see if there was a way :( Meh i guess ill tell the authors to make a forge version. Modloader was never my type anyway...FOrge is the best :)

    Best time for them to change over is now, 1.3 needs a good amount of re-coding anyway.

     

    EDIT:

    Also ForgeAPI has a better packet system, at first it isn't as easy as MLMP but as soon as you get the hang of it its far superior.

    When I converted my mod I cut my packet data down to a 3rd  of what MLMP was sending and debugging was easier.

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.