Everything posted by Erfurt
-
[Solved][1.9.4] Updating my custom walls from 1.8 to 1.9.4
Hey guys, I'm having some difficulty updating my custom walls, and i was hoping that someone could help me. Here's the code for my base wall class ( this worked in 1.8 ), I use this because I have different types of wall that have different properties, for example some of my walls emits light. I extend my other classes from the base class. public abstract class BaseBlockWall extends BlockWall { public BaseBlockWall(Block block) { super(block); } public int damageDropped(int meta) { return meta; } public boolean canPlaceTorchOnTop(IBlockAccess world, BlockPos pos) { return true; } public boolean canConnectTo(IBlockAccess world, BlockPos pos) { IBlockState state = world.getBlockState(pos); Block block = state.getBlock(); return block == Blocks.BARRIER ? false : (((block != this && !(block instanceof BlockFenceGate) && !(block instanceof BlockWall))) ? (block.getMaterial(state).isOpaque() && state.isFullCube() ? block.getMaterial(state) != Material.GOURD : false) : true); } } At first glans everything seems to work. But none of my walls want to connect to each other. It only want to connect to itself. I want to have all of the different classes connecting to eachother. A second thing that isn't working is that I can't place torches on top of the walls. This is the code for my basic walls class. public class EadoreWall extends BaseBlockWall { public EadoreWall(Block block, String name) { super(block); this.setUnlocalizedName(name); this.setRegistryName(name); } @Override @SideOnly(Side.CLIENT) public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> list) { list.add(new ItemStack(item, 1, 0)); } } To my knowledge this should work. However it does not, maybe someone can see something I can't.
-
[1.9] SubBlocks not rendering when placed
Okay, so I've done some changes now, but it doesn't seem to work. Just to be sure that I have got this right. This is how my blockstate files should look like, when I use ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(item.getRegistryName() + "_" + name, "normal")) in my block class, right? { "variants": { "normal": { "model": "em:planks_maple" } } } BTW how do I specify a variant like "normal" for logs and walls, as their json files are somewhat different. Vanilla json for acacia log { "variants": { "axis=y": { "model": "acacia_log" }, "axis=z": { "model": "acacia_log", "x": 90 }, "axis=x": { "model": "acacia_log", "x": 90, "y": 90 }, "axis=none": { "model": "acacia_bark" } } } Vanilla json for cobblestone wall { "multipart": [ { "when": { "up": "true" }, "apply": { "model": "cobblestone_wall_post" } }, { "when": { "north": "true" }, "apply": { "model": "cobblestone_wall_side", "uvlock": true } }, { "when": { "east": "true" }, "apply": { "model": "cobblestone_wall_side", "y": 90, "uvlock": true } }, { "when": { "south": "true" }, "apply": { "model": "cobblestone_wall_side", "y": 180, "uvlock": true } }, { "when": { "west": "true" }, "apply": { "model": "cobblestone_wall_side", "y": 270, "uvlock": true } } ] }
-
[1.9] SubBlocks not rendering when placed
I have just made a github for the code. (I hope it works) https://github.com/Erfurt92/src EDIT: BTW I know that some of the json files never will work at this point in time, still working on those
-
[1.9] SubBlocks not rendering when placed
I got that working now. Just one last thing, it doesn't want to render the blocks... I don't understand why that is, as I have done everything you told me to. Most be something I do with my json files, only thing I can think might be the problem
-
[1.9] SubBlocks not rendering when placed
Well I have a few issues right now. First is that my subBlocks, seem to have the same name, so my lang file doesn't work anymore. Second is that the subBlocks still doesn't render when placed, but is rendered as items, in the inventory. I use the methods I mentioned above for the registering, I believe that I need to do something with the unlocalized names. Not sure how to do it at this time, but I will be working on that. I know you most be frustrated with me at this point, at least I would be... But I am learning a lot from this, so thank you
-
[1.9] SubBlocks not rendering when placed
I just thought it looked cleaner that way, but I have chanced it to be two different methods now, still doesn't work with the subBlocks. These are my current methods in my block class public static void registerBlock(Block block) { GameRegistry.register(block); GameRegistry.register(new ItemBlock(block).setRegistryName(block.getRegistryName())); } public static void registerRender(Block block) { Item item = Item.getItemFromBlock(block); ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory")); } public static void registerSubBlocksRender(Block block, int meta, String name) { Item item = Item.getItemFromBlock(block); ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(item.getRegistryName() + "_" + name, "inventory")); } And this is how my client-proxy class looks like public class ClientProxy extends CommonProxy { @Override public void preInit() { myItems.init(); myItems.register(); myBlocks.init(); myBlocks.register(); registerRenders(); } @Override public void init() { } @Override public void registerRenders() { myItems.registerRenders(); myBlocks.registerRenders(); }
-
[1.9] SubBlocks not rendering when placed
I have made this method that creates the ItemBlock, as well as giving it the resourcelocation. public static void registerBlock(Block block) { GameRegistry.register(block); GameRegistry.register(new ItemBlock(block).setRegistryName(block.getRegistryName())); Item item = Item.getItemFromBlock(block); ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory")); } Now I kinda want to know how I can make similarly method for subBlocks? What I have worked on, but it doesn't seem to work. public static void registerSubBlock(Block block, int meta, String name) { GameRegistry.register(block); GameRegistry.register(new ItemBlock(block).setRegistryName(block.getRegistryName())); Item item = Item.getItemFromBlock(block); ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(item.getRegistryName() + "_" + name, "inventory")); }
-
[1.9] SubBlocks not rendering when placed
Okay, so I have managed to get this to work with all my items. But for some reason the game crashes when I do it with my blocks. Is there something special that I need to do for blocks? Here's the crash report I use this code for registering render public static void registerRender(Block block) { Item item = Item.getItemFromBlock(block); ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory")); }
-
[1.9] SubBlocks not rendering when placed
This might be a silly question, but can the unlocalized name and the registry name be the same? Or do they have to be different?
-
[1.9] SubBlocks not rendering when placed
I believe I got it now, but I will have to do it tomorrow. But once again thanks for your help, I hope I can get it to work now
-
[1.9] SubBlocks not rendering when placed
I just tried to do what you suggested, and now everything is fucked None of my block have any textures, should I be using .setRegistryName() instead of .setUnlocalizedName() on my blocks aswell. Sorry for being such a huge noob, right now. It's just that the other way have always worked for me without any problems, and most tutorials I have seen seems to be doing the same thing. So I have actually never used .getRegistryName()
-
[1.9] SubBlocks not rendering when placed
I appreciate your help, but I just can't get this to work. I strongly believe that I'm doing something wrong, but I have been working with this problem most of the day. So I can't really concentrate any more, so I will get back to it tomorrow, maybe the issue will just pop up. But after looking at it a bit closer, I can see that the code is looking a lot like the code I use for registering. public static void registerSubBlocksRender(Block block, int meta, String name) { Item item = Item.getItemFromBlock(block); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, meta, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5) + "_" + name, "inventory")); } Maybe they do the same thing? I really don't know at this point.
-
[1.9] SubBlocks not rendering when placed
Okay, so just to be sure. I should replace the registerItemVariants with this? ModelLoader.setCustomModelResourceLocation(leaf, 0, new ModelResourceLocation("em:leaves_maple")); ModelLoader.setCustomModelResourceLocation(leaf, 1, new ModelResourceLocation("em:leaves_poplar")); And is that all? I can't seem to get this to work at all
-
[1.9] SubBlocks not rendering when placed
Hey guys, I'm having some problems getting some subBlocks to work properly. At them moment I have everything working texture and render-wise for when the blocks is in the inventory. But as soon as I place them, they just show up as the purple/black blocks. I use this code to set a resource location for each subBlock Item leaf = Item.getItemFromBlock(myBlocks.leaves); ModelBakery.registerItemVariants(leaf, new ResourceLocation("em:leaves_maple"), new ResourceLocation("em:leaves_poplar")); But I think that only adds a resource location for the item. And the block itself still doesn't know where to look for it's resource. I'm having a hard time figuring out how to fix this, maybe someone here knows what to do, and can help me.
-
[1.9] [Solved] How to add custom planks to crafting?
I see, and how would I go about doing that, if I may ask? Call OreDictionary.registerOre in init. Forge registers vanilla planks as "plankWood" and uses this as a replacement ingredient for planks when it replaces vanilla recipes with ore recipes; so register your planks as "plankWood" as well. Awesome thanks alot, that did the trick
-
[1.9] [Solved] How to add custom planks to crafting?
I see, and how would I go about doing that, if I may ask?
-
[1.9] [Solved] How to add custom planks to crafting?
Hey guys, So I just wanted to know if there's a easy way to add my custom planks to crafting recipes like, beds, chests, and stuff like that, so that they will work if I'm using my custom planks with vanilla planks. I know I can do something like this. GameRegistry.addRecipe(new ItemStack(Blocks.crafting_table, 1), "ww", "ww", 'w', new ItemStack(myBlocks.planks, 1, OreDictionary.WILDCARD_VALUE)); But that will only allow me to use my own custom planks in the crafting recipe, if I use any vanilla planks, the recipe won't work. I know this is a newbi question, but you know
-
[1.9] [Solved SubBlocks/metadata .json
Nevermind, I got it working
-
[1.9] [Solved SubBlocks/metadata .json
I feel stupid, but I can't get this to work. Could you maybe give me an example of this in use?
-
[1.9] [Solved SubBlocks/metadata .json
I have a hard time understanding blockstate fully, without trying it ☺️ I will try your suggestion, when I get home from work
-
[1.9] [Solved SubBlocks/metadata .json
Hey guys, so I'm working on some new trees, and now I have a problem. I'm adding trees as subblocks, and I can't get the .json files to work. Here's my code My main problem is that the logs look for a .json file with the name log.json. Whereas I want the maple log to look for either maple_log.json or log_maple.json, and the poplar log to look for either poplar_log.json or log_poplar.json. I don't know how to use .json files with subBlocks/metadata, but I want to learn, that's why I haven't just added two new blocks instead of subBlocks/metadata. I hope someone here with better understanding of .json files or subBlocks/metadata can help me out.
-
[1.8.9] Is it possible to make Mob Spawners drop?
I'll give it a try, and see if I can make it work.
-
[1.8.9] Is it possible to make Mob Spawners drop?
Would it be easier to make 'custom' blocks and replace the orignal mobspawner? Or should I just forget about this?
-
[1.8.9] Is it possible to make Mob Spawners drop?
I have been able to change the spawner that is dropped, using the example code you linked. Now I just need to get the tag from the block that is being mined. At the moment all spawners drop a Zombie spawner in stead of a Pig spawner
-
[1.8.9] Is it possible to make Mob Spawners drop?
Hey guys, So as the title says, I want to know if it's possible to make vanilla mob spawners drop, with the correct mob inside. I believe that mob spawners use NBT tags, but I'm not sure. And I have no idea if it's possible to make blocks drop with NBT tags, or whatever else mob spawners use to determin what kind of mob spawner it is. I haven't tried to code this yet, because I would like to know if it's possible or if I have to make custom spawners.
IPS spam blocked by CleanTalk.