Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/09/18 in all areas

  1. "I want to make a block that works like the log works..." Normal person: "Let me go look at the log class, oh hey, BlockLogNew extends BlockLogBase!"
    2 points
  2. I see. Thank you for being understanding and your input. I apologize for my noobiness.
    1 point
  3. Don't call TileEntity#writeToNBT unless you actually need to serialise the TileEntity to NBT (e.g. to store the data in an ItemStack). Minecraft automatically calls it when the chunk is written to disk. Your TileEntity's data should be stored in regular fields and only written to NBT when necessary.
    1 point
  4. Your facing value from getStateFromMeta doesn't take account of the Y axis. Do this @Override public IBlockState getStateFromMeta(int meta) { EnumFacing enumFacing = EnumFacing.getFront(meta); if (enumFacing.getAxis() == EnumFacing.Axis.Y) { enumFacing = EnumFacing.NORTH; } return this.getDefaultState().withProperty(FACING, enumFacing); } Also you should set default blockstate when a block gets added onto the world. @Override public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { this.setDefaultFacing(worldIn, pos, state); }
    1 point
  5. Although there are ways of generating structures from NBT files Minecraft uses min and max x, y, and z coordinates to decide which blocks go where. The StructureVillagePieces class is an example of this. In order to create a new village component (building) create a class that extends StructureVillagePieces.Village which will be your code for the building itself. An example of this can be found here. You will also need to create a handler the implements IVillageCreationHandler in which you will refer to your new village component class. In your main class preInit you will then need to use VillagerRegistry.instance().registerVillageCreationHandler(); to register your handler and MapGenStructureIO.registerStructureComponent(); to register the component itself. If you want to create an entirely new village instead of single buildings I recommend looking at Galacticraft's code for Moon Villages. Although I haven't look into them much I imagine End Cities and Woodlands are similar to this.
    1 point
×
×
  • Create New...

Important Information

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