Jump to content

SOLVED | [1.15]Block texture and model are not displayed


Zemelua

Recommended Posts

Since I am using a translator, my English may be unnatural. sorry.

This may be a rudimentary and ridiculous mistake, but the texture and model of the block will appear as black and purple blocks. Also, the name of the block item is displayed as Air.

public class TestBlock extends Block{
	public TestBlock() {
		super(Properties.create(Material.WEB, MaterialColor.WOOL).hardnessAndResistance(2.0F, 3.0F).sound(SoundType.CLOTH));
		setRegistryName("test_block");
	}
}
public class TestBlockItem extends BlockItem{
	public TestBlockItem() {
		super(new TestBlock(), new Item.Properties().group(DepressionMod.DEPRESSIONMOD_TAB));
		this.setRegistryName(new TestBlock().getRegistryName());
	}
}
@ObjectHolder(DepressionMod.MOD_ID)
public class DepressionModRegistry {
	@Mod.EventBusSubscriber(modid = DepressionMod.MOD_ID, bus = Bus.MOD)
	public static class Register {
		//Blocks
		public static final Block TEST_BLOCK = new TestBlock();

		//BlockItems
		public static final BlockItem _TEST_BLOCK = new TestBlockItem();

		//TileEntities
		//public static final TileEntityType<RedstoneCapacitorTileEntity> CHARGED_CAPACITY_TILEENTITY = TileEntityType.Builder.create(RedstoneCapacitorTileEntity::new, REDSTONE_CAPACITOR_BLOCK).build(null);

		//ItemRegistry
/*		@SubscribeEvent
		public static void registerItems(RegistryEvent.Register<Item> event) {
			final Item[] items = {
				new SilverIngotItem()
			};
			event.getRegistry().registerAll(items);
		}
		*/

		//BlockRegistry
		@SubscribeEvent
		public static void registarBlocks(RegistryEvent.Register<Block> event) {
			final Block[] blocks = {
					TEST_BLOCK
			};
			event.getRegistry().registerAll(blocks);
		}

		//BlockItemRegistry
		@SubscribeEvent
		public static void registarBlockItems(RegistryEvent.Register<Item> event) {
			final BlockItem[] blockitems = {
					_TEST_BLOCK
			};
			event.getRegistry().registerAll(blockitems);
		}
	}
}

ย 

Link to comment
Share on other sites

  • Zemelua changed the title to SOLVED | [1.15]Block texture and model are not displayed

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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