Jump to content

Bektor

Forge Modder
  • Posts

    852
  • Joined

  • Last visited

Everything posted by Bektor

  1. Well, your guess is wrong. Happens also with vanilla clone command: I just don't know why. My code has nothing to do with air and stairs.
  2. Running outside of development envirnonment on a server with world edit to which a friend has access to build stuff.
  3. Debugging tools. Use 'em. A bit hard to use debug tools on a server.
  4. Hm... it seems to be a problem with this: I'm not sure why this is happening, cause my code has nothing to do with stairs... It just get's the block, blockpos and blockstate and does some sideSolid checks.
  5. Hm... weird... I have no custom stairs in my mod.
  6. Well, even if it is impossible, it just happened. The crash log is showing me that this line and the line from above are causing the crash: worldIn, pos, state, EnumFacing.NORTH (for anyone who does not want to scroll, the line from above:) state.getBlock().isSideSolid(worldIn.getBlockState(pos.down()), worldIn, pos.down(), EnumFacing.UP) Also shows me this line: if(!state.getBlock().isSideSolid(otherState, worldIn, pos, facing)) And here the full crash: I've got no idea why this is happening, just that it never happenend in a test world, only on the test server which has world edit (forge edition) installed to copy&paste stuff and easily build structures with max. speed. EDIT: Crashed again while doing a copy&paste with rotation with world edit: So what's wrong??
  7. Hi, I've got a huge problem. I'm currently checking some stuff with blocks and this code just crashes because it relies on stuff like EnumFacing.UP, but it seems to be that not all blocks have this stuff which resulted into a crash of the test server. Well, for some reason it never happened, but after copying a structure with world edit (forge edition) and rotating it and placing it, it crashed. Example crash: So how can I still check each direction if the side is solid without getting this crash and without having to add for each mod block which does not support this a check? The code which causes the problem: state.getBlock().isSideSolid(worldIn.getBlockState(pos.down()), worldIn, pos.down(), EnumFacing.UP) Thx in advance. Bektor
  8. Create your own custom Material then one that will allow you and give you what you want. Just how to make a material which is solid, but you can move through it and it has something like air, that no shadows are thrown. I have no idea how to create such a material, even after looking into the Material class.
  9. Hm, it seems to has something to do with the material. If I change the material to leaves it somehow works, but this is not what I want. The barrier material seems not to let me move in, the leaves material throws shadows and the air material does not work with my custom blocks.
  10. Does also not work.
  11. This does also not work. Still not able to walk through the block.
  12. public class BlockStructure extends Block { public BlockStructure() { super(Material.BARRIER); this.setBlockUnbreakable(); this.setResistance(5000000.f); this.setSoundType(SoundType.STONE); } @Override public BlockRenderLayer getBlockLayer() { return BlockRenderLayer.CUTOUT_MIPPED; } /*@Override public boolean isFullBlock(IBlockState state) { return false; }*/ /*@Override public int getLightOpacity(IBlockState state, IBlockAccess world, BlockPos pos) { return 0; }*/ @Override public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, Entity entityIn) { } @Override public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, World worldIn, BlockPos pos) { // return null, we don't want a collision detection for our leaves return NULL_AABB; } @Override public boolean isOpaqueCube(IBlockState state) { return false; } @Override public boolean isVisuallyOpaque() { return false; } } It also seems to be that the auto-jump does not work for my block, but I still can't move through it.
  13. Does still not work.
  14. Hi, I want to make a block through which entities can move, but for some reason it's not working like I expected it to be. So I can move into the block, but the block immediately pushes me out again on the same side. Any ideas? Thx in advance. Bektor
  15. You can do this by design, so it's a info message, not necessarily an error. Just make sure that you either provide an item model json or an inventory variant in your blockstates json. Ah, ok. Then I would consider that as fixed cause I always provide one of them (mostly blockstates). Just wondering why some textures are not loading. When doing it manually it works, but when letting my method do the heavy lifting of it, it stops working. EDIT: For anyone interested in the fix who has the same problems: easiest fix is to split the methods up, so that every special case got it's own method.
  16. Ok, I think I've found the problem with the missing textures... public static <T extends IType> Block register(Block block, String name, @Nullable Function<Block, ItemBlock> itemFactory, @Nullable T[] variants) { block.setUnlocalizedName(Constants.MOD_ID.toLowerCase() + "." + name); block.setRegistryName(name); GameRegistry.register(block); if(ModConfig.debugMode) PrimevalForest.getLogger().debug("Registering block " + block.getRegistryName()); if(itemFactory != null) { final ItemBlock itemBlock = itemFactory.apply(block); GameRegistry.register(itemBlock.setRegistryName(block.getRegistryName())); /** Register block and item block rendering */ if(FMLCommonHandler.instance().getEffectiveSide().isClient()) { Iterator<IBlockState> it = block.getBlockState().getValidStates().iterator(); while(it.hasNext()) { IBlockState state = it.next(); if(state == null || state.getPropertyNames().isEmpty()) { if(ModConfig.debugMode) PrimevalForest.getLogger().debug("Skipping block rendering registration for " + state); break; } int meta = block.getMetaFromState(state); if(variants == null) { RenderUtil.renderBlock(block, meta); RenderUtil.renderItemBlock(itemBlock, meta); } } /** Register block rendering for 'custom' PropertyEnum's */ if(variants != null) { for(T variant : variants) { RenderUtil.renderBlock(ModBlocks.getPath(name), block, name, variant.getID()); RenderUtil.renderItemBlock(ModBlocks.getPath(name), itemBlock, variant.getID(), variant.getName()); } } } } return block; } It is somewhere in this code... I just don't know where. I just found out, when I get it to work for one block it doesn't mean it's fixed for the second block (and I didn't even started to test the blocks with metadata, just tested structure block and torch)
  17. Hi... Problems: can't move into or through the block no texture in inventory Code: the blockstate.json the part of the log related to the block (just gone through the log with the search function of notepad++): Other problems: http://www.minecraftforge.net/forum/index.php?topic=42452.0 http://www.minecraftforge.net/forum/index.php?topic=42480.0 http://www.minecraftforge.net/forum/index.php?topic=42452.0 I hope someone knows how to fix all of that stuff.... I'm not going to write today here anymore, cause I'm currently not in a good mood, caused by that in the past days I just ran into problem after problem and even now there are open ones (as the links above show). It just get's annoying when you have to find every two blocks errors and all of that stuff just because again some json's seem not to work or something else.... well... most times these JSON's (whoever had the idea it would be good to implement them, not that I'm totally against them, from the point of performance they seem to be nice, but from the point of developing something with it it's just annoying and time consuming... time which could be spend on other stuff) are causing problems.... Thx in advance. Bektor
  18. It looks the same as when I place it in the world or have it in the creative inventory. A block with a nice texture.
  19. Ok, thx.
  20. Without copy&paste from Mojangs world generator, you need to know a lot about fractal world generation and math and algorythms like Simplex Noise, OpenSimplexNoise, PerlinNoise. I can just say... It's very complicated... I got it working outside of Minecraft after a lot of research, but never got it working in Minecraft... somewhere here on the forums is still the thread... still open... Maybe this helps you and maybe someone knows how to get it working: http://www.minecraftforge.net/forum/index.php?topic=41974.msg224411#msg224411
  21. This does not work. And to this MissingModelVariantException : Read the last 4 sentences of my problem. EDIT: Your edit does also not work.
  22. Hi, I'm wondering how to make an invisible block. The block should only be visible to a player who is in creative mode. I thought of doing this with a PropertyBool, but I don't know how to make the block visible to creative player's online, how to get the value from property bool and how to determine if the player is in creative mode or not (cause there could be 2 players... I first thought of something like updateTick... but when there are two player's it'll run into a problem....) Any ideas how to do this? Thx in advance. Bektor
  23. With the tags can you highlight your code. Just remove the dots "." I put in there, so I can write it without having it "converted" into the highlighted stuff. Your crash log shows you in this line that it couldn't find the Render class. This happens because the Server has nothing to do with rendering, so the server has only the logic part and all classes while the client has the Render class because the Client has to handle the Rendering for you. Just a small information: NullPointerException means that something is null when it should not be null and NoClassDefFoundError means that a class could not be found while ArrayOutOfBoundsException means that someone wants for example the number of the 10th position of the array, but the array is only 9 positions long. This are the exceptions/errors which happens in my opinion most. If you want to read more about it: https://docs.oracle.com/javase/tutorial/essential/exceptions/ http://www.tutorialspoint.com/java/java_exceptions.htm To fix this you just have to change a bit of your code: Then this has to be changed: And here is the render class, I've changed here nothing. The @SideOnly(Side.CLIENT) could eventually be removed there, I'm not quite sure. I just always put them in there since I got once a crash on a Server because I didn't put it over the Render class. If you want you can test what happens when you remove this, but the safest way is just to have it there. I hope this helps. Bektor
  24. Nope, seems not to be.
  25. Hi, I'm having a huge problem with my block: It renders perfectly fine in the world, but it does not render in inventory. It just shows a 2D plane with the missing texture texture and when holding in hand it is a cube with missing texture. My block extends the BlockTorch and just adds some custom stuff to it. Then I have this code: BlockList.torchOn = new BlockTorch(); BlockList.torchOn.setUnlocalizedName(Constants.MOD_ID.toLowerCase() + "." + "torch_on"); BlockList.torchOn.setRegistryName("torch_on"); GameRegistry.register("torch_on"); ItemBlock itemBlock = new ItemBlock(BlockList.torchOn); GameRegistry.register(itemBlock.setRegistryName(BlockList.torchOn.getRegistryName())); On the client this will also be called: /** block */ ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockList.torchOn), 0, new ModelResourceLocation(BlockList.torchOn.getRegistryName(), "inventory")); /** item block*/ ModelLoader.setCustomModelResourceLocation(itemBlock, 0, new ModelResourceLocation(itemBlock.getRegistryName(), "inventory")); I hope I posted above everything correct, cause I simplified the code, so no one has to worry about the automatic system which does exactly that from above in the background. (quite a lot of code in the background for achieving this, because I wanted it to work fine with all my blocks and subfolder stuff for the stone blocks) Here are the json files now: assets.primevalforest.blockstates.torch_on.json assets.primevalforest.models.block.normal_torch.json assets.primevalforest.models.block.normal_torch_wall.json assets.primevalforest.models.block.torch_on.json assets.primevalforest.models.item.torch_on.json There are NO errors in the fml-client-log... the torch_on name isn't even mentioned (checked multiply times, even with the search function of notepad++). Also checked multiply times the console... no errors. So, what am I doing wrong here? Thx in advance. Bektor
×
×
  • Create New...

Important Information

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