Jump to content

jordan30001

Members
  • Posts

    157
  • Joined

  • Last visited

Everything posted by jordan30001

  1. ok so i added a overide function for getLocalizedName @Override public String getLocalizedName(ItemStack par1ItemStack) { return getIconFileName(par1ItemStack.getItemDamage(), true); } but stepping trough teh debugger the override i have made gets thrown out the window when Item.getItemDisplayName() calls it by using this thus it is registered as "" public String getItemDisplayName(ItemStack par1ItemStack) { return ("" + StringTranslate.getInstance().translateNamedKey(this.getLocalizedName(par1ItemStack))).trim(); } I have tried a few methods but they have all failed so I am wondering how i would set a unlocalisedName for all of my sub items. or better yet a page with an explanation on how it works so that if i run into the problem again i know why its doing what it is doing note: typing this on my phone there may be bad spellings
  2. Here is my loop in my preInit() for(int i = 0; i < ItemGems.getIconLength(); i++) { LanguageRegistry.addName(new ItemStack(Main.gemItems, 1, i), ItemGems.getIconFileName(i, true)); } ItemGems.getIconLength() public static int getIconLength() { return iconLength;//always returns 13 } ItemGems.getIconFileName() public static String getIconFileName(int index) { return getIconFileName(index, false); } public static String getIconFileName(int index, boolean getSplitName) { String i = index == 12 ? "Topaz" : index == 11 ? "Smoked Topaz" : index == 10 ? "Ruby" : index == 9 ? "Pad Paradsha" : index == 8 ? "Mint Alabaster" : index == 7 ? "Indicolite" : index == 6 ? "Hyasinth" : index == 5 ? "Garnet" : index == 4 ? "Fire Opal" : index == 3 ? "Carribean Blue Opal" : index == 2 ? "Blue Sapphire" : index == 1 ? "Black Jet" : index == 0 ? "Black Diamond" : "you broke somthing"; if(getSplitName == false && i != "you broke somthing") i = i.replaceAll(" ", ""); return i; } getSplitName when false returns the behind the scenes name and true returns the item name the user will see for some reason it will always name the item Topaz. first of all I thought it was my ternary statement but if this was the case the icons themselves would not register. also it cant be the true/false removing white-space because the items would still be named differently they would just be named with their white-space removed.
  3. setBlockMetadataWithNotify(x, y, z, BlockID, metaData, notify, 2) setBlockWithNotify(see above)
  4. code? compilable example? what have you tried? error logs? something that helps us help you?
  5. What have you tried? I am not 100% sure on what the code would be so I cannot give code but this is what I think is needed but someone is welcome to correct me. a) get entities in X radius of your block b) iterate over the list of entities c) check that its an XP entity d) if it is a XP entity start moving it closer to the block e) when it is within x distance of your block get the nbttag your saving the xp to add xp to this and then write it back to nbt
  6. The reason why "a" obj does not work is that "a" is a string the object requires a character/char 'a' so in short "a" = string 'a' = character
  7. I checked the change logs for the Block class to find out where setRequiresSelfNotify() went but found nothing on the removal of this. Also I checked the two unnamed func_s's but they are not the same I also checked all the vanilla block registrations and there is nothing that I can see that would be equivalent to setRequiresSelfNotify. So what I am wondering is that all blocks now get notified regardless?
  8. that's exactly what I am using? in the latest forge RenderEngine.BindTexture() is a private field thus not accesible
  9. Why is it private now? was it a change or has it just not been updated to replace it with public?
  10. http://www.minecraftforge.net/wiki/Event_Reference#LivingDeathEvent
  11. How do you know this guys main language is English?
  12. have you tried running it trough the debugger line by line? are they being registered? maybe they are just staying null?
  13. I love how your signature says "Odds are good I've been programming since before you were born. Yeah. I'm OLD school." yet you think System.out.printf() not working is somehow forge's problem? Just tested the following code in my mod System.out.printf( "%-15s %10s %n", "Exam_Name", "Exam_Grade"); System.out.printf( "%-15s %10s %n", "English", "A"); System.out.printf( "%-15s %10s %n", "French", "F"); System.out.printf( "%-15s %10s %n", "Science", "C"); System.out.printf( "%-15s %10s %n", "Geography", "FAIL");[/code] and my output was 2013-03-22 05:53:26 [iNFO] [sTDOUT] Exam_Name Exam_Grade 2013-03-22 05:53:26 [iNFO] [sTDOUT] English A 2013-03-22 05:53:26 [iNFO] [sTDOUT] French F 2013-03-22 05:53:26 [iNFO] [sTDOUT] Science C 2013-03-22 05:53:26 [iNFO] [sTDOUT] Geography FAIL You must have either done something wrong as you have posted no code I don't know that. or you found a bug in the Java SDK thus your on the wrong forums.
  14. http://www.minecraftforum.net/topic/1722368-15-icons-and-block-textures/
  15. in 1.4.7+ can textures sheets be bigger than 16^2 and still load without using optifine or HD patcher? and 1.5 can the textures be more than 16x16 in size The reason why I ask is because I heard that forge or FML changed the texture loading so that it can use up to 256x textures?
  16. http://www.minecraftforum.net/topic/1452051-15-wip-again-deverions-forge-modding-tutorials-updated-16-03-2013-15-tutorials-1/ subsection: Creating blocks with metadata
  17. why not just make a block with meta data?
  18. By ticking the items do you mean ticking them from the main thread or the secondary thread? I chose 100 stacks as a over shoot because I have to take into account the "stupid" people that take advantage of the config settings. by default its only around 5-6 stacks but if the end user really wanted to they could they could change it to drop a trillion stacks (if they have enough ram) From an end user point of view that's totally up to them what they change their settings to. Why I created this thread was to make it the most efficient on resources as possible.
  19. because math player invent = 28 if dropping 100 stacks that's 72 stacks either lost because no room OR I still drop the 72 stacks. not a solution but thanks for taking the time to read this.
  20. Pre Note: Prepare for huge wall of text. I came across a major bottleneck when implementing certain features into my mod here is the basic gist of what I am doing and wanted some input if your a player/server owner or other inputs. Lets say on a server there are 10 players each player is queued to drop 64*100 items each so each player drops 6400 items so 10 players would drop 64,000 items I thought about dropping the items individually but obviously on single player or multiplayer would grind to a halt if all these items were drooped at once. So just to make this less of a strain it doesn't drop individual items and will do its best to drop the maximum amount of items in one stack so rather than dropping 64,000 individual items it drops 6400 itemstacks still would probably cripple most games. I then thought well if I made a list of items to drop and then for each stack of 64 items it would drop in 10 ticks from its previous player (ticks is based on player not globably) so when dropping 6400 itemstacks it would take 1000 ticks over 50 seconds obviously this is still very intensive on a server over 50 seconds but its better than dropping them all in one tick an expansion to this is that I keep a global on how many global items will drop in the next x ticks and change the tickrate (will get onto this in a second) of the items to be dropped increasing in 1 tick when certain parameters are met. I then came into yet another problem to check when an itemstack needs to tick it would have to iterate over 6400 items in a list and tick each individual item which could cause a tick to last 2 seconds so for every tick which is meant to be 1/20th of a second it would take 200/20th of a second to tick which would be bad for big servers. I then came up with threading itemdrops. when an item needs to drop it will be added to a blockingqueue to stop conncurent thread editing of variables, nasty stuff. so then in the new thread that stops itself when it has nothing more to tick until its re started later by another player wanting to drop items the main minecraft thread will add to the blocking queue and ask that the dropping thread pause until adding to the blockqueue has finished so that the main thread doesn't hang while waiting to put items into the queue the second thread runs every 1/20th of a second obviously this thread doesn't take into account the main thread so it could be running faster than the minecraft thread or slower. this second thread will peak and then grab an itemstacks to tick and when the item needs is to be ticked next tick it will add it to a different blocking queue that the main thread picks up and then drops the item on the next tick (have to pass it back to another blocking queue because I cannot drop the item directly from the other thread because of concurrency issues. so a breakdown: a) depending on how many items need to drop it will increase the amount of ticks between item drops minimum 10 ticks spacing between each item drop. b) tries to make the biggest itemstack for that player as to lower entity counts. c) ticks itemTick countdown on another thread so that the mainthread can continue to run without sticking on the iteration d) stops thread when not needed What I wish to know is whether or not there is a better solution to this that would cause the least amount of lag as possible on the main thread and maybe even decrease lag on the secondary thread. the example I use is extreme, there are config settings so the user can set it to whatever they want if they want to set it ridiculously high as these examples show then that is their stupidity for allowing it but I would still be welcome to finding a cheaper solution big wall of code over now for the big wall of code UtilsItem class when the above object has been finished with its sent to Utils.dropItem() specifically if (doTickCallBack == true) ServerTickHandler .addDropItemQueue(new DropItemQueue(maxTicks, p, itemstack)); will call in my serverTickHandler DropItemHandler class
  21. the variable muttonRaw is null and null cannot be named
  22. error logs? what's your IDE saying? I think I am going to explode if I see another post from you in the next 5 minutes
  23. [RAGE]ooooooh now you changed your mind your going to give us an error but not post the code. POST BOTH CODE AND ERRORS RAAAWR.[/ENDRAGE] At least I know what that error is from. firstly check that you have imported cpw.mods.fml.common.network.NetworkMod.SidedPacketHandler if you have already then do what is below you probably have this in your @NetworkMod() @SidedPacketHandler try changing that to @cpw.mods.fml.common.network.NetworkMod.SidedPacketHandler
  24. http://jd.minecraftforge.net/net/minecraft/world/World.html#isRemote
×
×
  • Create New...

Important Information

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