Jump to content

sorash67

Members
  • Posts

    85
  • Joined

  • Last visited

Posts posted by sorash67

  1. try making your tickHandler look like this:

    package yourMod;
    
    
    public class TickHandlerYourMod implements ITickHandler {
    
    private void onPlayerTick(EntityPlayer player) {
    
    
    	if(player.getCurrentItemOrArmor(2) != null){
    		ItemStack leggings = player.getCurrentItemOrArmor(1);
    		if(leggings.getItem() == yourMod.yourLeggings){
    			player.addPotionEffect((new PotionEffect(Potion.moveSpeed.getId(), 60, 0)));
    		}
    	}
    
    }
    
    @Override
    public void tickStart(EnumSet<TickType> type, Object... tickData) {
    
    	if (type.equals(EnumSet.of(TickType.PLAYER)))
    	{
    		onPlayerTick((EntityPlayer)tickData[0]);
    	}
    
    }
    
    @Override
    public void tickEnd(EnumSet<TickType> type, Object... tickData) {
    }
    
    @Override
    public EnumSet<TickType> ticks() {
    	return EnumSet.of(TickType.PLAYER, TickType.SERVER);
    }
    
    @Override
    public String getLabel() {
    	return null;
    }
    
    }
    

     

    and then tweak it for the enchantment part

     

    hope this helped! :)

     

    -sorash67 || Skorpio

  2. Not sure what you did, but I put the code in, and then the textures in, and everything worked fine. Cool mod btw. Anyways, the only thing I can think of is that you put the textures in the wrong place. To try to make things easier, the destination of invisible.png is at forge/mcp/src/minecraft/assets/traps/textures/blocks/invisible.png. Hope I helped.

     

    if you look at his assets folder, you can see he already did that... O.o

     

    -sorash67 || Skorpio

  3. Interestingly enough, it appears that loading the block/items inside of your Init method will not initialize the textures/localizations. If you move them to the PreInit method, everything works perfectly fine. It appears that on the texture side of things, if you place them inside of your Init method then registerIcons(IconRegister) is never called.

     

    seems like this is what's happening! but we've kinda figured that out since a while ago! x)

     

    -sorash67 || Skorpio

  4. I just said, I declared my blocks and items and it still gave me the error.

     

    EDIT: Never mind, I got it.  The only thing that I can't figure out is that when I put on my mod's armor, it doesn't show up on my body.

     

    having the same problem, looking for a fix!

     

    if i have to mention this again, i will! i am COMPLETELY AWARE of this. the reason for me saying that is to reduce confusion.

     

    You don't seem like it:

     

    Him: "This is my preinit function"

    You: "It's named wrong!!!!"

     

    public void load(FMLPreInitializationEvent event) {}

     

        It is still the FMLPreInitializationEvent, but this goes inside @EventHandler.

     

    i don't think FMLPreInitializationEvent is the load method... the FMLInitialization is!

     

    it would be really nice if you stopped talking about irrelevant topics and helped solve the problems that we all have instead.

     

    -sorash67 || Skorpio

  5. i don't think FMLPreInitializationEvent is the load method... the FMLInitialization is!

     

    You would be correct.

     

    But guess what, we're talking PRE init, not init.

     

    he called his preInit method load, that's all  i meant! jeez.

     

    He can call his preInit method Ooh_Eeh_Ooh_Ah_Aah_Ting_Tang_Walla_Walla_Bing_Bang and have absolutely ZERO impact on the outcome.

     

    As I mentioned before:

    Function names and variable names are entirely irrelevant.

     

    if i have to mention this again, i will! i am COMPLETELY AWARE of this. the reason for me saying that is to reduce confusion.

     

    -sorash67 || Skorpio

  6. i don't think FMLPreInitializationEvent is the load method... the FMLInitialization is!

     

    You would be correct.

     

    But guess what, we're talking PRE init, not init.

     

    he called his preInit method load, that's all  i meant! jeez.

     

    you're probably putting languageregistry before you declare your block!

    What do you mean before I declared the block.  Shouldn't block declaration still be in Init?

     

     

    the block should always be registered before its name, and now that the name is in preInit, then the block goes in preInit as well! anyways, the textures seem to be only working when the block is declared in preInit!

     

    -sorash67 || Skorpio

  7. Nothing, actually. I thought I did change something, but I can't find it after comparing my 1.5.2 code with 758. Also, put everything in preInit, but remember that preInit is no longer called that. Instead, it should be:

    @EventHandler
    public void load(FMLPreInitializationEvent event) {}

    It is still the FMLPreInitializationEvent, but this goes inside @EventHandler.

     

    i don't think FMLPreInitializationEvent is the load method... the FMLInitialization is!

     

    -sorash67 || Skorpio

  8. Also, when I put my language registry in the pre-unit I get an error that I can't use language registry in pre-init

     

    you're probably putting languageregistry before you declare your block!

     

    So far this topic has been no help at all because we are not get the full code changes to get textures working.

     

    this topic was made to gather help and find the right code to solve the problem, not provide you with it.

     

    -sorash67 || Skorpio

  9. are you putting the .func111022_d() when you declare your block as well as this?

     

    Good sir, this function has not been mentioned in any thread related to this topic.

     

    How have you come to this conclusion and why has it not been mentioned heretofore?

     

    i mentioned this because this is what minecraft uses to get the textures. and maybe if you looked at the changelog, you'd see that Lex made this function public rather than protected.

     

    -sorash67 || Skorpio

  10. Icon and textures on the wiki.

     

    Funny.  Because I updated that tutorial for 1.5 and I can't get my existing code to work with 1.6

     

     

    Make sure the names for your image's folder is lowercase in the directory and code. Worked for me

     

    Did.  No dice.

     

    2013-07-03 10:08:21 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: traps:textures/blocks/iron_spikes.png

     

    File is at:

    mcp\src\minecraft\assets\traps\textures\blocks\iron_spikes.png

     

    Register function:

    public void registerIcons(IconRegister par1IconRegister)
        {
            this.blockIcon = par1IconRegister.registerIcon("traps:iron_spikes");
        }

     

    are you putting the .func111022_d() when you declare your block as well as this?

     

    -sorash67 || Skorpio

×
×
  • Create New...

Important Information

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