Jump to content

KittenKoder

Members
  • Posts

    77
  • Joined

  • Last visited

Everything posted by KittenKoder

  1. Did you not read my post? I stated that the obj loading is working because it renders correctly when held in hand or inventory. The model is loaded, it is just not associating the texture with it as a block so it renders as "nothing." As for your #4 thing, this is a WIP class at this time and I am not progressing further into it if I cannot get the block to render correctly. I repeat: The texture and model are loading, they are just not rendering in the world. When I apply the texture using a custom renderer, it appears as if the coordinates are scaled down. The problem with most changes to Forge during this transition is the lack of documentation and Google's inability to fish this site's format as that post you linked never once came up in Google's listing.
  2. have search everywhere, and all the information I find is outdated, most of it so outdated that it actually says you need a custom loader for OBJ files still. But even the newest example that people often cite, the debug loader test on github, uses a bunch of deprecated methods and objects. So here's the problem, I can get the items to render correctly, but when I try to use an obj file for a block it only renders in the item form. When placed it renders nothing. I created a temporary custom renderer but all I can get is the two block tall block to render using only a small part of the texture. Like the coordinates for the block are being shrunk into a much smaller portion of the texture. So here's the Java class for the object: public class MagitechStorageBinTall extends BlockContainer implements IMagitechBlock, ITileEntityProvider { protected String NAME = null; protected String MAGITECHID = null; public MagitechStorageBinTall(String unlocalizedName, String name, Material material, float hardness, float resistance, SoundType sound, int opacity, float lightlevel, String harvest, int harvestlevel) { super(material); this.NAME = name; this.MAGITECHID = unlocalizedName; this.setCreativeTab(CreativeTabs.BUILDING_BLOCKS); this.setHardness(hardness); this.setResistance(resistance); this.setSoundType(sound); this.setLightOpacity(opacity); this.setLightLevel(lightlevel); this.setHarvestLevel(harvest, harvestlevel); this.setRegistryName(Magitech.MODID, unlocalizedName); this.setUnlocalizedName(unlocalizedName); } @Override @Nullable public TileEntity createNewTileEntity(World worldIn, int meta) { return new MagitechTileEntityStorageBinTall(); } @Override @Nullable public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos) { return MagitechTileEntityStorageBinTall.BOUNDINGBOX; } @Override @SideOnly(Side.CLIENT) public BlockRenderLayer getBlockLayer() { return BlockRenderLayer.SOLID; } @Override public boolean isFullCube(IBlockState state) { return false; } @Override public boolean isOpaqueCube(IBlockState state) { return false; } @Override public String getMagitechName() { return this.NAME; } @Override public String getMagitechID() { return this.MAGITECHID; } @Override public Block getBlock() { return this; } @Override public void registerModel(ItemBlock item) { ModelResourceLocation itemModelResourceLocation = new ModelResourceLocation(Magitech.MODID + ":" + this.MAGITECHID, "normal"); ModelLoader.setCustomModelResourceLocation(item, 0, itemModelResourceLocation); } @Override public void registerItemBlock(IForgeRegistry<Item> event) { final ItemBlock item = new ItemBlock(this.getBlock()); item.setRegistryName(Magitech.MODID, this.getMagitechID()); event.register(item); RegistrationHandler.BLOCKS.add(item); } @Override public void registerBlock(Register<Block> event) { event.getRegistry().register(this); } } The JSON file: { "forge_marker": 1, "defaults": { "textures": { "Material": "magitech:entity/storage_bin_tall" }, "model": "magitech:storage_bin_tall.obj" }, "variants": { "normal": [{ }], "inventory": [{ "transform": "forge:default-block" }] } }
×
×
  • Create New...

Important Information

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