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.

BrasilianEngineer

Members
  • Joined

  • Last visited

  1. For full source code see: https://github.com/BrasilianEngineer/WarehouseMod/tree/master/src/main/java/com/brasilianengineer/tbewarehouse https://github.com/BrasilianEngineer/WarehouseMod/tree/master/src/main/resources/assets/tbewarehouse I'm currently trying to work with: 1 item 1 simple block 2 metadata blocks w/ 2 versions each. The blocks render correctly when I place them in world, but don't in my hand or my inventory. If I can figure out the item and the simple block, I can hopefully figure out the rest from there. Block Registration: @GameRegistry.ObjectHolder(Reference.MOD_ID) public class ModBlocks { public static final BlockTWM machineFrame = new BlockWarehouseFrame(); public static final BlockTWM machineWall = new BlockWarehouseWall(); public static void init() { // called from common proxy preInit GameRegistry.registerBlock(machineFrame, ItemBlockTWMWarehouseFrameVariants.class, Names.Blocks.BLOCK_WAREHOUSE_FRAME); GameRegistry.registerBlock(machineWall, ItemBlockTWMWarehouseFrameVariants.class, Names.Blocks.BLOCK_WAREHOUSE_WALL); LogHelper.info("Block Registry Init Complete"); } } Block Render Registry: public final class BlockRenderRegister { public static void init() { registerBlockVariant(ModBlocks.warehouseFrame); registerBlockVariant(ModBlocks.warehouseWall); registerBlock(ModBlocks.warehouseBuffer); LogHelper.info("Block Render Registry Init Complete"); } private static void registerBlock(Block block) { Item item = GameRegistry.findItem(Reference.MOD_ID, block.getUnlocalizedName().substring(5)); ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(Reference.RESOURCE_PREFIX + block.getUnlocalizedName().substring(5), "inventory")); } private static void registerBlockVariant(Block block) { String baseName = block.getUnlocalizedName().substring(5); Item item = GameRegistry.findItem(Reference.MOD_ID, baseName); for(BlockWarehouseFrameComponent.EnumType type : BlockWarehouseFrameComponent.EnumType.values()) { ModelResourceLocation itemModelResourceLocation = new ModelResourceLocation(Reference.RESOURCE_PREFIX + baseName + "_" + type.getName(), "inventory"); ModelLoader.setCustomModelResourceLocation(item, type.getMetadata(), itemModelResourceLocation); } } } Simple Block Class (they are all almost the same) public class BlockWarehouseBuffer extends BlockWarehouseInternalComponent { public BlockWarehouseBuffer() { super(); this.setUnlocalizedName(Names.Blocks.BLOCK_WAREHOUSE_BUFFER); } } Block Base Class public class BlockWarehouseInternalComponent extends BlockTWM { public BlockWarehouseInternalComponent() { super(Material.iron); setHardness(5.0f); setResistance(25.0f); setHardness(1f); setStepSound(SoundType.METAL); } } public class BlockTWM extends Block { public BlockTWM(Material material) { super(material); setCreativeTab(CreativeTabTWM.TWM_TAB); } } Item json { "parent": "builtin/generated", "textures": { "layer0":"tbewarehouse:items/multi_tool" }, "display": { "thirdperson": { "rotation": [ -90, 0, 0 ], "translation": [ 0, 1, -3 ], "scale": [ 0.55, 0.55, 0.55 ] }, "firstperson": { "rotation": [ 0, -135, 25 ], "translation": [ 0, 4, 2 ], "scale": [ 1.7, 1.7, 1.7 ] } } } Simple Block Blockstate { "variants": { "normal": { "model": "tbewarehouse:warehouse_buffer" } } } Simple Block Model { "parent": "block/cube_all", "textures": { "all": "tbewarehouse:blocks/warehouse_buffer_all" } } Simple Block Item Model { "parent": "tbewarehouse:block/warehouse_buffer", "display": { "thirdperson": { "rotation": [ 10, -45, 170 ], "translation": [ 0, 1.5, -2.75 ], "scale": [ 0.375, 0.375, 0.375 ] } } } Forge Log

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.