Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Erfurt

Members
  • Joined

  • Last visited

Everything posted by Erfurt

  1. slab_half_maple.json { "variants": { "half=bottom": { "model": "em:slab_half_maple" }, "half=top": { "model": "em:slab_upper_maple" } } } slab_double_maple.json { "variants": { "normal": { "model": "em:planks_maple" } } } I'm using the traditional way, mostly to test if everything works, and after that's all good, I mostly try and convert it over to the forge version. Before, in this case, making more slabs.
  2. I still haven't solved this, any help would be great
  3. Just the way I have learned to do it. Anything wrong with doing it that way?
  4. Could it be the way I register the render that's the problem? How do you register the renderer ModelLoader.serCustomModelResourceLocation(...) in preInit? I use this method to register my renders and yes it's in preInit public static void registerRender(Block block) { Item item = Item.getItemFromBlock(block); ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(block.getRegistryName(), "normal")); } What I find somewhat wierd is that the item is rendering fine in hand, but not when I place it, so I would think that I'm doing something wrong, I just can't figure out what it is
  5. Could it be the way I register the render that's the problem?
  6. I just noticed some of the naming was a bit wrong, but after fixing that, the model still isn't rendering correctly. Still checking all of the naming right now. But I do believe I've gotten all of them
  7. Is block/half_slab a block json? Yes it is, the vanilla slabs use it as well Is the json in modid:block/json Should it have to be in my mods assets folder, if I reference it from it's vanilla location, because that makes no sense to me, as I have done this with other models that worked fine I meant yours not the vanilla i should have specified. Well I haven't made a copy of it into my own folder, if that's what you mean. Should I try that?
  8. Is block/half_slab a block json? Yes it is, the vanilla slabs use it as well Is the json in modid:block/json Should it have to be in my mods assets folder, if I reference it from it's vanilla location, because that makes no sense to me, as I have done this with other models that worked fine
  9. Is block/half_slab a block json? Yes it is, the vanilla slabs use it as well
  10. Could still use a little help here
  11. Believe it or not, I actually had this almost done the same way as you, at a previous time, where it didn't work, but I was missing the CustomStateMapper. And it seems to have done the trick, so I thank you very much for your help
  12. If I ignore decay and check decay, doesn't that mean, that my custom leaves wouldn't behave as the vanilla leaves?
  13. Well... What seems obvious to you, might not be to someone who have never done it before... However, I'm not sure what to add. As I can see, I need to add something like this { public static final PropertyEnum<BlockPlanks.EnumType> VARIANT = PropertyEnum.<BlockPlanks.EnumType>create("variant", BlockPlanks.EnumType.class, new Predicate<BlockPlanks.EnumType>() { public boolean apply(@Nullable BlockPlanks.EnumType p_apply_1_) { return p_apply_1_.getMetadata() >= 4; } }); public BlockNewLeaf() { this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockPlanks.EnumType.ACACIA).withProperty(CHECK_DECAY, Boolean.valueOf(true)).withProperty(DECAYABLE, Boolean.valueOf(true))); } public IBlockState getStateFromMeta(int meta) { return this.getDefaultState().withProperty(VARIANT, this.getWoodType(meta)).withProperty(DECAYABLE, Boolean.valueOf((meta & 4) == 0)).withProperty(CHECK_DECAY, Boolean.valueOf((meta & > 0)); } /** * Convert the BlockState into the correct metadata value */ public int getMetaFromState(IBlockState state) { int i = 0; i = i | ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata() - 4; if (!((Boolean)state.getValue(DECAYABLE)).booleanValue()) { i |= 4; } if (((Boolean)state.getValue(CHECK_DECAY)).booleanValue()) { i |= 8; } return i; } protected BlockStateContainer createBlockState() { return new BlockStateContainer(this, new IProperty[] {VARIANT, CHECK_DECAY, DECAYABLE}); } } However, this is from BlockNewLeaf class, and I can see that it uses an EnumType from BlockPlanks. Can I do it without an EnumType? Or do I have to make my own? I'm not adding my custom leaves as subBlocks, does that make a difference? I know I'm a noob right now, but as I mentioned in OP, this is my first try at adding leaves, and I'm still learning.
  14. Hey guys, I have a problem with some custom leaves that causes a server crash shortly after being placed by a player. This is my first attempt at adding in custom trees, so most likely it's a mistake in my class. At the moment I'm not done making all the components for my custom trees, like saplings, gen and other stuff, so I'm not sure if the leaves will cause a crash when the game adds the trees, or if it's only a problem when a player places the leaves. Here's the crash report I would think that you guys would like to see the leaves class aswell.
  15. I don't understand how there can be an error in that, but I digress. Here's the file. { "parent": "block/half_slab", "textures": { "bottom": "em:blocks/planks_maple", "top": "em:blocks/planks_maple", "side": "em:blocks/planks_maple" } } I should mention that em:blocks/planks_maple is the exact same I use for a block and it's texture works fine, just so we can rule that out
  16. [16:53:21] [Client thread/ERROR] [FML]: Could not load vanilla model parent 'em:block/slab_half_maple' for 'net.minecraft.client.renderer.block.model.ModelBlock@6e767943 net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model em:block/slab_half_maple with loader VanillaLoader.INSTANCE, skipping at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?] at net.minecraftforge.client.model.ModelLoaderRegistry.getModelOrLogError(ModelLoaderRegistry.java:203) [ModelLoaderRegistry.class:?] at net.minecraftforge.client.model.ModelLoader$VanillaModelWrapper.getTextures(ModelLoader.java:478) [ModelLoader$VanillaModelWrapper.class:?] at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:163) [ModelLoaderRegistry.class:?] at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:317) [ModelLoader.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:170) [ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:147) [ModelLoader.class:?] at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:122) [simpleReloadableResourceManager.class:?] at net.minecraft.client.Minecraft.startGame(Minecraft.java:540) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_77] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_77] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_77] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_77] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_77] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_77] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_77] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_77] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:26) [start/:?] Caused by: java.io.FileNotFoundException: em:models/block/slab_half_maple.json at net.minecraft.client.resources.FallbackResourceManager.getResource(FallbackResourceManager.java:68) ~[FallbackResourceManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:65) ~[simpleReloadableResourceManager.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadModel(ModelBakery.java:311) ~[ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.access$1100(ModelLoader.java:118) ~[ModelLoader.class:?] at net.minecraftforge.client.model.ModelLoader$VanillaLoader.loadModel(ModelLoader.java:868) ~[ModelLoader$VanillaLoader.class:?] at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?] ... 23 more
  17. Hey guys, I have a problem with my slabs not rendering, other than the rendering issue it seems like everything else is working. They seem to stack correctly, but it's a bit hard to tell as the half slab is rendering as a full block in the standard black and purple texture. Not sure if it's something in my classes, or if it's something in my .json naming(highly doubt this one) and I doubt that it's something in the .json files, as the are 'copied' from how the vanilla slabs .json files is. I have added most of my classes in the spoiler and the names of my .json files, maybe someone can see the error I have made. Cause I sure can't at the moment I should mention that I have many blocks in my mod that works, however I can't seem to get these slabs to work.
  18. As I mentioned, it was a very dumb question Thank for your help, it did the trick
  19. Hey guys, this is just a rather small question, and I'm going to look like a noob. But whatever So I have been following an older guide (from 1.8.9) to make some custom slabs for my mod. But the guide used GameRegistry.registerBlock(block, itemClass, string), which I know is outdated. So my rather dumb question is, how do I register my slabs? Do I use some variant of GameRegistry.register(), or something completely different? Maybe there's a new way to add custom slabs, without using an itemclass in 1.10.2, that I don't know of?
  20. I fixed it now. Because canConnectTo is a private boolean in the BlockWall class, I need to add and override the IBlockState getActualState, for it to work. So my final class looks like this. public abstract class BaseBlockWall extends BlockWall { public BaseBlockWall(Block block) { super(block); } public int damageDropped(int meta) { return meta; } @Override public boolean canPlaceTorchOnTop(IBlockState state, 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); } @Override public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) { boolean flag = this.canConnectTo(worldIn, pos.north()); boolean flag1 = this.canConnectTo(worldIn, pos.east()); boolean flag2 = this.canConnectTo(worldIn, pos.south()); boolean flag3 = this.canConnectTo(worldIn, pos.west()); boolean flag4 = flag && !flag1 && flag2 && !flag3 || !flag && flag1 && !flag2 && flag3; return state.withProperty(UP, Boolean.valueOf(!flag4 || !worldIn.isAirBlock(pos.up()))).withProperty(NORTH, Boolean.valueOf(flag)).withProperty(EAST, Boolean.valueOf(flag1)).withProperty(SOUTH, Boolean.valueOf(flag2)).withProperty(WEST, Boolean.valueOf(flag3)); } } And this works. I know that some of the methods I use in the canConnectTo boolean is deprecated, like block.getMaterial(state).isOpaque() and I will see if I can use some updated code for it instead. But at least it works now, thanks for the help guys
  21. Post your updated BaseBlockWall and EadoreBlockWall. I all did was to change from public boolean canPlaceTorchOnTop(IBlockAccess world, BlockPos pos) { return true; } to @Override public boolean canPlaceTorchOnTop(IBlockState state, IBlockAccess world, BlockPos pos) { return true; } I have otherwise, tried all of your suggestions, regarding the walls not connecting to each other, but without any success, and that was when I noticed that the canConnectTo method inside BlockWall had been changed from public to private, and I don't know if that's why my code from 1.8 doesn't work in 1.9.4, as I mentioned in my original post, I had everything working in 1.8.
  22. I have fixed the torch thing, the method had been changed a bit from 1.8 to 1.9. Still haven't been able to get my walls to connect, any help would be lovely ☺️
  23. BTW what do you mean by optimize the expression? Personally I can't see how this can be done otherwise. It's pretty much the same way that vanilla code does it.
  24. I tried that, sadly it didn't make a difference. I have been looking at vanilla code, from 1.8.9 and 1.9.4 and it seems that the vanilla method was changed from public to private, could this be the reason for my problem? If so, can I even fix? How?

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.