-
Posts
85 -
Joined
-
Last visited
Posts posted by sorash67
-
-
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
-
i thought you had said you were using the latest version...
-sorash67 || Skorpio
-
LOOOOL its ok dude, chillax, take a joke! no need to be so grumpy all the time! x)
-sorash67 || Skorpio
-
you may have to change EntityLiving to EntityLivingBase now! it seems to be solving many of my problems!
-sorash67 || Skorpio
-
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...
-sorash67 || Skorpio
-
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
-
he's right, he showed me his code, nothing seems to budge for him... i dont understand why either...
-sorash67 || Skorpio
-
"back at you"... we sound so childish, we can stop now! anyways, i have been trying to help even though my problem has been fixed.
-sorash67 || Skorpio
-
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
-
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
-
I tried that and it gave me this "Illegal object for naming null"
again, youre putting the name registry before you actually declare your block or item!
-sorash67 || Skorpio
-
You said you got it working by changing your code but did not give it to us.
yes i did explain that i declared my blocks and items in preInit and also put their names in the preInit as well! i don't think that explanation needs any code to show what it means...
-sorash67 || Skorpio
-
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
-
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
-
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
-
I have my textures working in 758, and I don't have func_111022 in my block declaration. I simply put the textures where lex said to, then changed the declarations to preInitialization, as well as updating the registerIcon functions.
pretty much what i did! but i didnt have to change anything in the icon registering!
-sorash67 || Skorpio
-
try looking in Block.class and you can find as many examples as you want! however Lex never said that this function is needed to put in for the textures to work!
and yes, people make mistakes, i forgot the "_".
-sorash67 || Skorpio
-
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
-
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
-
that is odd! pm me and explain exactly what you did and how your files and the code look like and i will try to help you!
-sorash67 || Skorpio
Who is this directed to?
my bad, it was directed to the ones with texture problems!
-sorash67 || Skorpio
-
that is odd! pm me and explain exactly what you did and how your files and the code look like and i will try to help you!
-sorash67 || Skorpio
-
your texture folder should now be:
assets/yourModName/textures/blocks|items/###.png
rather than:
mods/yourModName/textures/blocks|items/###.png
-sorash67 || Skorpio
-
yes yes, we should keep reading and researching more to understand better!
and updating to the latest might be a good idea! x)
-sorash67 || Skorpio
-
i was also wondering if that may be true!
-sorash67 || Skorpio
1.6.1 sounds register, but wont play
in Modder Support
Posted
i'm looking for a way to add custom sounds as well! if you figure anything out, PLEASE tell me! thanks!
-sorash67 || Skorpio