Jump to content

East_Crips

Members
  • Posts

    16
  • Joined

  • Last visited

Everything posted by East_Crips

  1. just go trough the classes and u'll find what you need. For example, thats in the ItemBucket class file: (it's in onItemRightClick) if (par2World.getBlockMaterial(i, j, k) == Material.water && par2World.getBlockMetadata(i, j, k) == 0) { par2World.setBlockToAir(i, j, k); if (par3EntityPlayer.capabilities.isCreativeMode) { return par1ItemStack; } if (--par1ItemStack.stackSize <= 0) { return new ItemStack(Item.bucketWater); } if (!par3EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.bucketWater))) { par3EntityPlayer.dropPlayerItem(new ItemStack(Item.bucketWater.itemID, 1, 0)); } return par1ItemStack; } i believe that's the part when player is rightclicking on wather holding a bucket. Just customize it a lil bit.. replacing bucketwather with ur own liquid. ps: still don't know if it's like this.... jsut guessin' ^^ im quiet new Cheers, -East
  2. lets see... (not sure if im correct! ^^) here's an example, if you create a table like this one and now want to add it 2 the game and then test it. So you save your classes, start minecraft and place your new table. But whats this? you siddenly realise that you can walk trough one side of the table block. You can also place other blocks inside the other side of your table. that's because when you place blocks, they have a bounding box of 1 block. there isnt any collision data there wich would stop you from walking trough the one side of the table. Back to the pistons. when you power one, the piston block occupies the space of the block next to it in it's direction. so, this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); the 1st 3 params are X1, Y1, Z1 and the last 3 X2, Y2, Z2. X1,Y1,Z1 are the coordinates of the first angle of the block and X2,Y2,Z2 are the coordinates of the opposite angle of the block. These must be between 0 and 1. now, the piston occupies the space of two blocks. as the piston occupies only 1 block by default, it needs this Bounding box function, to add one more when powered, i believe. But that's just a theory of mine. All this could be completely wrong but maybe not idk.. if you are trying to make a block wich is for example 4 blocks big, you can let your "structure" to be placed by an item. Now you split your structure in 4 parts (as you need the space of 4 blocks), just like Mojang did with the bed, ya, the bed is a good example. They split it up in 2 blocks. Now back to the item. in the item's class (wich is placing the structure) you can make it place all the parts of your structure in the right section, to make it look as one when its placed there are a lot mroe tricks for making structures wich need more space, but i currently only know this one yeah ended up writing, gettin' off topic a lil bit i guess... but maybe it helped u somehow ps: ya, i guess the bounding box function thingy is useful for blocks, wich are by default 1x1 and when powered (for example) bigger. the bed didnt need such a thing, since it's never goin' 2 change when powered Cheers, -East
  3. it's actually not, everything coded by me. Right click it and ull get the link, it's hostet on my Server. U can use it if u like it acts like a image file, but actually is a php script. im good at PHP but back to topic, does noone know how to do this? the drinking animation isnt working... i right click, get my message, the bucket gets empty and that's it... no drinking animation -.-
  4. Hey, I want my Item only to be eaten at night, so i made my way trough the items classes and found some stuff to work with. The problem now is, that when i use it at night, it disappears after rightclicking it without the drink animation. But anything else works, can't use it when it's not nighttime here's the code public int check = 0; public ItemStack onItemRightClick(ItemStack is, World w, EntityPlayer player) { if(!w.isRemote) { int day; if(w.isDaytime()) day = 1; else day = 0; switch(day) { case 1: { if(check == 1) return is; check = 1; if(getCurrentLanguage() .equals("de_DE")) { player.addChatMessage("Geht nur nachts"); } else { player.addChatMessage("Try again tonight"); } } break; case 0: { player.setItemInUse(is, this.getMaxItemUseDuration(is)); player.addChatMessage("Success!"); check = 0; } break; } } return is; } using it at night, i get my debug message, but without the animation public EnumAction getItemUseAction(ItemStack par1ItemStack) { return EnumAction.drink; } can't undestand why it's not working.... it worked about 15 mins ago, when i wasn't checking for nighttime yet. I think I messd up somewhere ^^ but still can't figure out where btw. MaxItemUseDuration is 42 Cheers, -East
  5. Hey, me stuck again ^^ the code here protected void onFoodEaten(ItemStack ItemStack, World w, EntityPlayer player) { if(!w.isRemote) { Random rand = new Random(); switch(rand.nextInt(20)) { case 0: player.addPotionEffect((new PotionEffect(Potion.jump.getId(), 30, 1))); break; ............. should make the potioneffect last for 30 seconds, but instead of 30, it's just one and i don't know why. I took this line out of the ItemFood as an example par3EntityPlayer.addPotionEffect(new PotionEffect(this.potionId, this.potionDuration * 20, this.potionAmplifier)); after the potion id, it's potionDuration and potionAmplifier, so it should work, i set it to 30 seconds. Don't know why it's just working for one... Is something missing in my code? Cheers, -East
  6. oh, ty! i used to script samp servers (GTA SA multiplayer, maybe u've heard of it), i didnt nead a break each time, just case 2: was enough tought its like this in java too
  7. Hey, i have to generate a random value between 0 and 2 for a switch, I've done it like this at the moment: Random rand = new Random(); switch(rand.nextInt(3)) { case 0: case 1: case 2: } it should work (as far as i know) but its not ^^ It's always taking the last, the 2 Never 0 or 1 I'd like 2 know why someone knows why? Cheers, -East
  8. //EDIT: Fixed, just figured it out on my own it's return StringTranslate.getInstance().currentLanguage; instead of return this.currentLanguage; now it returned "de_DE", so it works. guess im slowly gettin' into it Hey, right now, im looking for a way to get the player's current language and save it in a string. I found lots of stuff, but that didn't really helped me... cuz it's all outdated and therefore not working anymore so im here again, askin' for help Look at my code, I tryed 2 do it.. somehow well, minecraft crashed when i hover over the item. So it seems like its wrong. public String currentLanguage; public String getCurrentLanguage() { return this.currentLanguage; } @Override public void addInformation(ItemStack is, EntityPlayer player, List l, boolean B) { if(getCurrentLanguage() .equals("de_DE")) { l.add("Tür"); } else { l.add("Door"); } } right now, getCurrentLanguage returns null. But i want it to return the player's language, like, "en_US" Im trying 2 fix this on my own since quiet a while now... but i don't get it Cheers, -East
  9. in 1.5, we use func_94581_a for Item-textures and func_94332_a for Blocks. Here's an example for an item: public void func_94581_a(IconRegister iconRegister) { iconIndex = iconRegister.func_94245_a("ModName:gs"); } "ModName:gs" -> gs is the texture file, Resources is the folder. The whole path would look like this: /mods/ModName/textures/items/gs.png and for Blocks: /mods/ModName/textures/blocks/gs.png try searching for an answer, before asking for one ^^ here's the wiki-page: http://www.minecraftforge.net/wiki/Icons_and_Textures
  10. ya, just figured it out myself, ty anyways
  11. //EDIT: just figured it out myself ".name" was missing in key. For all the people who might have the same problem and search for an answer, it should look like this: (Unlocalized name is "Soup") LanguageRegistry.addName(Soup, "Soup"); LanguageRegistry.instance().addStringLocalization("item.Soup.name", "de_DE", "Suppe"); right now, it's like this: (Unlocalized name is "Soup") LanguageRegistry.addName(Soup, "Soup"); LanguageRegistry.instance().addStringLocalization("item.Soup", "de_DE", "Suppe"); but when i run minecraft, there's no name when im hovering over it. why? i dont know this is weird.. someone help me please
  12. lol youre right, i almost forgot. u can't stack soups in minecraft, jsut the empty bowls forgot about that. ty! but what about the otehr problem? any ideas?
  13. Hey, it's me again I've got 2 questions: 1st -> im holding a stack of 5 items (new item), it's a soup. When I eat one, all others just disappear and left is only 1 bowl i jsut don't get it, i set it's stack size to 5 >.< here's the Item: public class Soup extends ItemSoup { public Soup(int id) { super(id, 6); setMaxStackSize(5); setCreativeTab(CreativeTabs.tabFood); setUnlocalizedName("Soup"); } public void func_94581_a(IconRegister iconRegister) { iconIndex = iconRegister.func_94245_a("east_crips:x-4ns"); } } and 2nd -> I want translations for my item's names. So i went out, looking wor a solution and found a forum post. I did it like this, but it's not working. it's not changing when i set the lang. to german. Is it correct like this? ... LanguageRegistry.addName(Soup, "Soup"); LanguageRegistry.instance().addStringLocalization("Soup.name", "de_DE", "Suppe"); I just can't find a solution for all this, trying to do as much as i can alone to get more into it.. but hey, everyone needs some help at the beginning of something.. i guess.. ^^ Cheers, -East
  14. FINALLY!!! YAAAY!! You really helped me there man ty! I was trying to figure it out, where to place the textures, for arround 2 hours. This is so disappointing... however, again, you really helped me ty mate!
  15. Hey, Im quiet new with all this here, just started setting everything up for modding 3 days ago. now i have a working environment, the newest forge installed ofcourse and my first "test-mod" ready. It works just fine, i tested it in Eclipse. So.... now i tought about letting some friends test it. So i ran recompile and then reobfuscate and packed everything into a zip file and placed it in my minecraft's "mods" folder. But the problem is, i don't know what to do ith the textures. So i just dragged them into the zip file and tought it'll work somehow, wich wasnt the case ^^ And so, i made my way to the log files and what i saw was disappointing 2013-03-17 19:17:55 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file mods/east_crips/textures/items/cf.png, but that file does not exist. Ignoring. the texture for that item was set as follows: public void func_94581_a(IconRegister iconRegister) { iconIndex = iconRegister.func_94245_a("east_crips:cf"); } well, not knowing how to fix that, i just created a new folder named "east_crips" and placed the textures folder with all the stuff inside it, hopting again, it'll work. But it didnt YAY! I just can't understand why it didn't work.... the path is correct, the file does exist -.- Next, i made my way 2 google, searched for answers. What i found was almost nothing, since there isnt really much about the new textures so far. And now im here, begging for your help, someone help me please the entire log file: Cheers, -East
×
×
  • Create New...

Important Information

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