Jump to content

winnetrie

Members
  • Posts

    408
  • Joined

  • Last visited

Everything posted by winnetrie

  1. I made it cleaner now (i think ) List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList(); Iterator<IRecipe> Leash = recipes.iterator(); while (Leash.hasNext()) { ItemStack is = Leash.next().getRecipeOutput(); if (is !=null){ if (is.getItem() == Item.getItemFromBlock(Blocks.SANDSTONE_STAIRS)) Leash.remove(); if (is.getItem() == Item.getItemFromBlock(Blocks.RED_SANDSTONE_STAIRS)) Leash.remove(); if (is.getItem() == Item.getItemFromBlock(Blocks.BRICK_BLOCK)) Leash.remove(); if (is.getItem() == Item.getItemFromBlock(Blocks.STONEBRICK)) Leash.remove(); if (is.getItem() == Item.getItemFromBlock(Blocks.STONE_BRICK_STAIRS)) Leash.remove(); if (is.getItem() == Item.getItemFromBlock(Blocks.STONE_SLAB) && is.getMetadata()==5){ Leash.remove(); } } }; and: public class TemStairsTab extends CreativeTabs { public TemStairsTab(String label) { super(label); //this.setBackgroundImageName("teleport.png"); } @Override public Item getTabIconItem() { return new ItemStack(ModBlocks.bricksstairwhite).getItem(); } @Override @SideOnly(Side.CLIENT) public int getIconItemDamage(){ return 3; } }
  2. Oh right, it looks like i did it wrong before. @Draco You mean because i make variables for it while it isn't needed? I know this, i change it later. I do it for testing purpose only. Also for the creative tabs i still can't get it working. This is what i have now: public class TemStairsTab extends CreativeTabs { public TemStairsTab(String label) { super(label); //this.setBackgroundImageName("teleport.png"); } @Override public Item getTabIconItem() { ItemStack stack= new ItemStack(ModBlocks.bricksstairwhite); Item item = stack.getItem(); return item; } @Override @SideOnly(Side.CLIENT) public int getIconItemDamage(){ return 3; } } I looked into the creativetabs class and found this getIconItemDamage() method wich i hoped it would do what i needed, but insetad i now have a black/purple square icon in my creative tab.
  3. I'm trying to get an item from a stack but with the metadata. If i do this: ItemStack stack= new ItemStack(ModBlocks.bricksstairwhite,1,3); Item item= stack.getItem(); It does not give me the item with metadata 3, but instead give me always the 0. Here an example why i need this: @Override public Item getTabIconItem() { ItemStack stack= new ItemStack(ModBlocks.bricksstairwhite,1,3); Item item= stack.getItem(); return item; } And here another example why i need this: List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList(); Iterator<IRecipe> Leash = recipes.iterator(); while (Leash.hasNext()) { ItemStack is = Leash.next().getRecipeOutput(); if (is != null && is.getItem() == Item.getItemFromBlock(Blocks.SANDSTONE_STAIRS)) Leash.remove(); if (is != null && is.getItem() == Item.getItemFromBlock(Blocks.RED_SANDSTONE_STAIRS)) Leash.remove(); if (is != null && is.getItem() == Item.getItemFromBlock(Blocks.BRICK_BLOCK)) Leash.remove(); if (is != null && is.getItem() == Item.getItemFromBlock(Blocks.STONEBRICK)) Leash.remove(); if (is != null && is.getItem() == Item.getItemFromBlock(Blocks.STONE_BRICK_STAIRS)) Leash.remove(); ItemStack stack = new ItemStack(Blocks.STONE_SLAB,1,5); Item item = stack.getItem(); if (is != null && is.getItem() == item){ Leash.remove(); } }; I want in the recipe remover only removing that subblock, but it removes them all. So how do i get the right item for it?
  4. I also gave a 100% working slabs example! There is no need to use ItemSlab and those VARIANTS are no "bs". Stop giving people bad advice and please stop being stubborn.
  5. Yeah i was already aware that this could be the reason, but i didn't know an alternative or an improvement! I don't know how to use the thing you say, but i will look into that later. As i said before it isn't yet important, because it works. Improvements are for later when everything is finished. Thank you very much for the info!
  6. Now it doesn't generate at all. I don't find anything.
  7. You can also make multiple types of the same method like this: private static void registerRender(Block block, int meta, String variant){ ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), meta, new ModelResourceLocation(block.getRegistryName(),variant)); } private static void registerRender(Block block, String variant){ ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(),variant)); } private static void registerRender(Block block){ ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(),"inventory")); } Because this method is used for the same purpose you can keep the same naming for it. That way you don't need to invent multiple names for multiple tasks that slightly differs. Sometimes you only want to pass a block, sometimes you want meta, sometimes you want to define an exact variant. You only register the render for your halfslab. You still need the blockstate for both.
  8. I also think you do not need itemslab. I have also fully functional slabs. I have 3 classes for it: - a class that extends BlockSlab (CustomBlockSlab for example) - a class for halfslabs that extends CustomBlockSlab (CustomHalfSlab) - a class for doubleslabs that extends CustomBlockSlab (CustomDoubleSlab) the only difference half and double have is this: @Override public boolean isDouble() { // TODO Auto-generated method stub return true; } the half has it set to false and the double to true I tried before the pass this boolean variable directly as an argument to CustomBlockSlab, because in this way i would only need 1 file. For some reason this doesn't work and i do not know why. So i used 3 files for each set of slabs. You can define up to 8 different types in your slabs I'll give you an example of my slabs. BlockChalkstoneBlockSlab.class: BlockChalkstoneHalfSlab.class: BlockChalkstoneDoubleSlab.class: i create it like this: chalkstoneslab = new BlockChalkstoneHalfSlab(References.temBlocks.CHALKSTONEHALFSLAB.getUnlocalizedName(), References.temBlocks.CHALKSTONEHALFSLAB.getRegistryName()); chalkstonedoubleslab = new BlockChalkstoneDoubleSlab(References.temBlocks.CHALKSTONEDOUBLESLAB.getUnlocalizedName(), References.temBlocks.CHALKSTONEDOUBLESLAB.getRegistryName()); register it like this: registerBlockSlab(chalkstoneslab, chalkstonedoubleslab); I have created a special method to register it it looks like this: private static void registerBlockSlab(Block slab, Block doubleslab){ GameRegistry.register(slab); GameRegistry.register(doubleslab); ItemSlab item = new ItemSlab(slab, (BlockSlab) slab, (BlockSlab) doubleslab); item.setRegistryName(slab.getRegistryName()); GameRegistry.register(item); } Now try not to copy paste this all. Try to understand how it works. The way i did it is maybe not the best way at all. I'm not an expert at all, but maybe i can help you! As far i know it all works fine for me. You can figure out by yourself how the rendering works. If not we will hear from you soon.
  9. setLightOpacity is not what you want, as it is meant how much light you want to let pass through the block. 0 means you let all the light get through. Try it out in the dark place a glowstone block for example on the ground and surround it with your slabs in such a way the glowstone is not visible anymore. You will see light passing through. The darkness *glitch* you see, can be fixed with this: useNeighborBrightness = true; In this way the block will use the lightvalue of the block(s) next to it , whatever position that is (left, right, in front, up, etc etc) So when do you use setLightOpacity? For example glass blocks or in your case maybe glass slabs or glass stairs or what ever block that is transparent.
  10. While my worldgen is working, i have the feeling something is not right. I think the way i get the coordinates is wrong. Why? Because i have a block that needs to be generated in river biomes, now when i dig down in a river i mostly do not find my block, but i do find my block generating the biome next to the river. It isn't a big deal, people will still find it after all,but when i do something wrong i like to know what and how to improve it. Here is my worldgen code:
  11. I'm not sure this will work, but maybe you can try to pas arguments to it like you with models. Like for example in a wall: "submodel": {"wall_north": {"model": "wall_side","uvlock": true}} So i would try this: "submodel": {"wall_north": {"model": "wall_side","uvlock": true},"var1":0, "var2":1} If i check this with the jsonlint it doesn't give errors so that's alright. Don't know if it will work. I would try it like this.
  12. when playing i don't feel something has changed. I get an half heart damage sometimes when wearing a full diamond armor. I can't see how a new armor can be better then diamond, yet not OP. What are those points doing? Does this means that other armors do not prevent damage? Also a full diamond armor show 20 half armor icons on the UI. Can this also be increased? Or even better can it be changed into something else. For example a percentage bar or just a bar with numbers inside like : [ 10000 Armor ]
  13. While there are many mods there that adds various types of metals/ores i never found them ever usefull. Especially because the armor has only 20 "units" and diamond armor gives you already the full armor. So adding a metal that would be better than diamond would make you immune. So it doesn't make sense. Adding metals that are lesser than diamond are pretty useless too, because you don't have much space between all 4 armor types armorvalue. So the question is. Is it posseble to increase the max armor and max health? This looks more like a gamedesign question i know, so if this thread isn't here at the right place, i'm sorry.
  14. Yes i have 2 sets of types. 1 is for the block and the other is for the item (inventory). I'm not sure what the best way is to do this, but for me this works fine. the second set wich is called (type=raw) for example does not need to be the same as the first set. It could be for example (myitem=rough). Those are only references to be used in the renderRegistry: registerMetaRender(chalkstonewall,0,"type=raw"); registerMetaRender(chalkstonewall,1,"type=smooth"); registerMetaRender(chalkstonewall,2,"type=bricked"); the method is this: private static void registerMetaRender(Block block, int meta, String variant){ ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), meta, new ModelResourceLocation(block.getRegistryName(),variant)); } Getting the inventory item was never a problem, i only had this untextured glitch in the blocks particle effect.
  15. Thank you so much, i already came up with the idea to make a custom empty model, but i had no json code inside it. I tried your approach and yes that works fine now. here is what i have now: The particle is now a defined texture, but can it be variable too or does this not matter? The 3 stone types are almost the same so you won't notice a different color,but what if you have a wall in 16 colors? Would the default particle for example white, be in every other block? I don't know if it is working like this, just wondering. Maybe i can use an empty texture for it?
  16. I have the feeling people do not understand what the problem is i have! My inventory works fine, my walls are working fine. Look at the pictures i posted. This is my blockstate file again: I have a working item for my wall I have a fully working wall I have a small untextured particle issue. Just a few are untextured. I can't find out why this happens. I have still this error too: [Client thread/ERROR] [FML]: MultiModel minecraft:builtin/missing is empty (no base model or parts were provided/resolved) If i have to provide a base model in the default section, wich do i use? Is there even a base model for walls? I tried these already: -builtin/generated --> with this all the particles are untextured -wall_inventory --> all placed walls looks like the inventory model -wall_post --> all placed walls have a wallpost inside it -wall_side --> all placed walls are equipped with a side piece -cube_all --> yes i was so desperate i tried it.....but ofc black purple squares I really don't know what to do anymore.
  17. The piece you show is to create my item models wich are working fine. If this isn't the proper way how to do it then? How do i specify my main model in the default section? What is the main model anyway? EDIT: I tried many things now and it only makes it worse. If i set a main model in my default section all my walls look like that. I also need it 3 times because i need 3 different textures for the items.
  18. this: [Client thread/ERROR] [FML]: MultiModel minecraft:builtin/missing is empty (no base model or parts were provided/resolved) comes up 6 times. If i provide a model in the default section of the blockstate file this error is gone, but the problem persists
  19. I managed to get a better screenshot of the problem i have: You can see i have "normal" particles and untextured particles. this is my blockstate file: I hope someone can help me with this.
  20. Most of the particles are normal, just a few (1-3) are not correct. Does your solution still applies for this? How would i add this in the json file. here a screenshot It was hard to capture it, but you see the wrong particles
  21. Removing the entry from default gives me the best option for now, but it's not good enough for me. I still see some wrong particles (black/pink). I have no clue why. Does anyone know how to solve this?
  22. number 2 is wrong, you need to do it in the preInit. So it seems Diesieben07 was right about that:
  23. Post again in spoilers all the things you have now. Perhaps you have changed some stuff. Describe what is not working. How does your item look like in game in the inventory and held in your hand? Does it look like a big black/pink square? Post these files again plz: -your main class -your client proxy -your ModItems class -the item model
  24. @Jeffreyfisher I tried that approach first too with the multiparts, but i found out it was completely ignored (i think so) It gave me those variant exception errors, so i tried another way. Like i posted in the first post. This was working fine for except a small issue with the black/purple particles. I don't mind if you post your problem with your walls here too, but a moderator could see this as a thread hijack You have helped me alot already with other things, so np for me. @Matryoshika My first thoughts was also using wall_post, but that creates now a wall post in every wall piece. That's not how it should look like. I found some small documentation about forge blockstates, there in a small example too they use submodels. So i also believe we need to make use of submodels and not multiparts. @trollworkout It is only confusing if you don't understand it. It becomes more clear if you dig deeper in it. Perhaps you are right and only a few people know about this 100%, but isn't the purpose of this forum to share information and help others? That's not true, in my opinion it takes less work. The example you give is just the same as i did The forge team is working very hard to give us all these things, yet you recommend people not to use an improvement? The forge blockstates json is a great improvement and you better start learning how to use it.
  25. I disagree with this. I have set up my mod also more or less like this and it doesn't crash. It doesn't crash because it is never called on the server side. How i know this for sure? Because i tested this myself on a server (yes i rent a server) and it does not crash. The server runs smooth without any problems.
×
×
  • Create New...

Important Information

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