Everything posted by Moritz
-
Questin about Strings
Ok now i have to explain what i want to do. I have no name for the mod. But it has something todo with blood: When you are rightclick the item. The player get Hurt (half heart damage) and the item got the username. Then the item checks what letter it starts and choose from that which bloodgroup the player has. and with that you can make potions and whatever
-
Questin about Strings
So can someone teach me a little bit in enums?
-
Questin about Strings
I do not want to make my own games. I want learn how to understand learning things i mean (I use now google): I want to understand how you have to look at the stuff in the programming and understand even what I do. .
-
Questin about Strings
I am a little bit new. I want to use minecraft to learn how things work. (The understanding) I know that i can not learn java from minecraft. But now to the answer you mean it like this: public class ItemTest extends Item { String[] letters = new String[5] {"A", "X", "Y", "G", "T"}; String username; String var1; //I will not tell what this parameter do public ItemTest(int id) { super(id); setHasSubtypes(true); } public ItemStack onRightClickItem(ItemStack par1, World par2, EntityPlayer par3) { if(username == null) { username = par3.username; } return par1; } public void onUpdate(ItemStack par1, World par2, Entity par3, int par4, boolean par5) { if(par5) { for(int i = 0; i < 5; i++) { if(var1 == null) { if(username.startsWith(letters) { var1 = "This"; } else { var1 = "That"; } } else { //Do nothing } } } } } Does this work?
-
Questin about Strings
Hello. I got an idea for a mod and want to start with it. I make the whole mod mobile (the writing thing) because i like to look how much i know and how much i do not know. But these informations are not needed here. Now informations what i think they are important: I want to make items and these work with Strings: Like this: String Username = "Null"; String par1 = ""; String par2 = ""; Now the problem: i want to make a String Checking lib like this: if(Username.startsWith("C") { than do this this and this; } else if(Username.startsWith("G") { than do this but not that } else { do nothing } now all letters together are 26 My Problem is i do not want to do 26 if states. How can make a (maybe) enum for ever letter or something which stores the letters and i can say: enumname: 0 = "A", "G", "Z", "K", "D", "I", "Q" if(username.startswith(enumname.0) { than do that } else { do this } So who can help me?
-
help with metadata
I made my own tool class and it the events to damage items are these: public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving) { par1ItemStack.damageItem(2, par3EntityLiving); return true; } public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLiving par7EntityLiving) { par1ItemStack.damageItem(1, par7EntityLiving); return true; } you can change it to this and the tools will not break: public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving) { if(par1ItemStack.getMaxDamage() == par1ItemStack.getItemDamage()) { return true; } else { par1ItemStack.damageItem(2, par3EntityLiving); return true; } } public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLiving par7EntityLiving) { if(par1ItemStack.getItemDamage() == par1ItemStack.getMaxDamage()) { return true; } else { par1ItemStack.damageItem(1, par7EntityLiving); return true; } } hope it helps
- [UN-SOLVED]New Machine Tutorial
-
[Unsolved] BlockMeta && BlockTile > 15
You do not need to answer i know now how it works. crazy? Jup. But i only need a push in the right way and the rest i get from alone! Thanks for helping.
-
[Unsolved] BlockMeta && BlockTile > 15
I know i have her source (1.2.5) but for me make it at the moment no sense. She make it differend. I also read the ic2 source and this is a little bit easier for me. But things like rotation or metatiles are extremly hard for me. I have to learn other things bevor i do something with it. I am a try and error type. If something makes errors i try to find the piece of it.
-
[UN-SOLVED]New Machine Tutorial
Kore i know how to make a furnace and a chest and i could explain it but my pc time is limited. By my family (F...k off)
-
[Unsolved] BlockMeta && BlockTile > 15
Kore i know what a tile does. But i do not know how i can use a tile like eloraam use it for multiblocks. Thats my trouble. And my knowledge about english are limited. So i have to troubles.
-
[Unsolved] BlockMeta && BlockTile > 15
ok i did understand (half a way(i have to test it myself)) it. But how can i combine it with a container block?
-
Make smelting in furnace have a bi-product?
Yup i meant it. I saw it on railcraft codes he is useing the crafting the carts back .
-
[Unsolved] BlockMeta && BlockTile > 15
I understand what you are writing. But that is not the problem. I do not understand how the block talk to the tile. Because the i do not see that the tile is connectet to the block. But the block is connected to the tile. I also want to make a basic abstract tile and the tiny chesttile should look like this: public Tinychestoneslot extends TileEntityBasicTinyChest { public Tinychestoneslot() { super(inventoryname, slots); } } I read now the forgetutorials.
-
Make smelting in furnace have a bi-product?
Just use this: player.inventory.addItemStackToInventory(new ItemStack(Block.stone, item.stackSize)); It will give you as many items as you smelted CraftingHandlers can do that too, just add multiple if statements. Also if you want to give multiple items, just use the player.inventory.addItemStackToInventory function multiple times with different items. I also think that making a custom furnace is better, but as a temporary solution the CraftingHandler should work fine. first of all can you make it like this? if(furnacerecipes == ironore) { additemstack(stone) } elseif(furnacerecipes == mixedmetallingot) { additemstack(bronzeingot) } and i mean you can only one drop per item (like this) if(item == ironingot) { give stone } but you can not make an elseif with iron ingot. Because you can not detect which recipe was the last he used. when the same is the output but the drops are differend.
-
A question about metadata blocks/items?
why the sad face? do you really think that many players will reach the limit of 32000 item IDs? I think 100 IDs are not the world he could make it with metadata. I give him a way he can use . (My way was for items with about 100K IDs) So that you can make tools with metadata and have maybe 10 Item instead of 100000
-
[Unsolved] BlockMeta && BlockTile > 15
Ok. But you know that i have no clue wha this code doing! I can copy paste it. But no thanks. I want to understand/know what i am doing. And i read the code of the enderstorage mod (it was an opensource mod) And i didn't understand it. I need someone who explain me what the code is doing. Step by Step. I have no packethandler because i do not understand what it is doing. or how i can use it or what the code is saying. So please explain it.
-
Make smelting in furnace have a bi-product?
Slagfurnace vs craftinghandler I think make your own furnace would be better because with craftinghandler you can only per 1 item 1 extra drop. But with a slagfurnace (i know the name is out of factorisation.) you can make for every recipe a extra drop. like: Iron ore = iron ingot + stone iron dust = iron ingot + whatever mixed metall ingot (my version) = iron ingot + bronze ingot. That is the difference between make your own furnace and craftinghandler. If you only want add stone to ores the craftinghandler is the best way. but if you want like differend extra outputs on the same output than the extra furnace is better!
-
[Unsolved] BlockMeta && BlockTile > 15
I am working on a mod called Tiny Chest. Its a Technic mod and would help people which do not like logistic pipes but want bufferchests. Problem is i have 27 (maybe 36) differend chests and i do not want to add a 3 (maybe 4) blockids. What does happen when i add more then 15 tiny chests to 1 blockid? How can i add more than 15 Blocks to 1 id? I read another thread but i do not really understand what they talking about. Thanks for reading. @Speiger
-
Make smelting in furnace have a bi-product?
This is not easy. First understand how a furnace work. Then the explaining will be easier. Its a thing with an arraylist with 3 ItemStacks (1 input, 2 output) and then you have to extrackt them in the furnace. The rest is esay! But the Extracktion of the arraylist is not so easy! I have no clue how this work (at the moment. And i do not working with that.) But now you have a clue how this work. My Hints: Read the FurnaceTileEntity Try to understand how the smelting thing works. Look in opensource Mods which have furnaces in it. Because this will help a lot. Sources that helped me: IC2, RP2, Forestry(alot), Obsidian Ingots(Alot with multitile), Universal Electicty Addons. Try to build yourself a furnace. Than make try and error that is a good way to learn things. I know that does not help a lot at the moment but this is what i think will help. @Speiger
-
A question about metadata blocks/items?
Hi. I got the same problem but found a way to around this. But the thing is these tools have to be the same max uses. If not then its not possible. I work with integer. You can combine integer with metadata. Meta = Differend items Integer = Tool uses But this make remove the entchantment (unbreaking) So that entchantment will no longer work! Hope that helps.
-
Redstone Tutorial
Hi. Can someone explain me how i can add redstone creation/reciving on a block? I read the files but no clue how this works. And i didn't find any good tutorial!
-
Metadata Blocks
You need an itemBlock (Your item oreclass) That class stores the metainformation. public class OreMetaItem extends ItemBlock { public OreMetaItem(int par1) { super(par1); setHasSubtypes(true); } public int getMetadata(int par1) { return par1; } } Than you have to add this to your BaseModfile GameRegistry.registerBlock(block, ItemBlock.class);
-
Bug in Register Item!
I explain it. When a modwriter adds items woth register item the item will be saved in the world as string. That is a perfect idea but have bugs! When a modwriter decides to override the item with an other name the world will be courrupted! You have to Create a new world to can use the world! This is not the perfect thing! FML have to change something that you can choose if you want to use this function. Here: public boolean RegisterItemsInWorld() { while true do { startregisterItems } else { do nothing! } } i think that will help to solve much curruption in much worlds. I know that the register item function good is but it is not good enought to implement it totaly!
-
Register Item?
But when a modder remove a itemid then the game crashes without ending and this is SILLY STUPID whatever!
IPS spam blocked by CleanTalk.