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.

[1.10.2] Problem with light from a block

Featured Replies

Posted

Hello.

 

I've created a bunch of simple blocks. But the light dosen't work. I don't know why because everthing seems to be correct.

 

	public Blockbridgeblack1180(String unlocalizedName, String registryName) {
		super(Material.ROCK);
		this.setUnlocalizedName(unlocalizedName);
		this.setRegistryName(new ResourceLocation(References.MODID, registryName));
		this.setLightLevel(1.0F);
		this.setHardness(20); //Sets how hard the block is to break
		this.setResistance(20); //Sets the blocks blast resistance to explosions
	}

 

And there is my ModBlock class :

 

public class ModBlocks {
	
		public static Block bridgeblack1176;
		public static Block bridgeblack1178;
		public static Block bridgeblack1180;
		
		public static void init() {
			bridgeblack1176  = new Blockbridgeblack1176("bridgeblack1176", "bridgeblack1176");
			bridgeblack1178 = new Blockbridgeblack1178("bridgeblack1178", "bridgeblack1178");
			bridgeblack1180 = new Blockbridgeblack1178("bridgeblack1180", "bridgeblack1180");
		}
		
		public static void register() {
			registerBlock(bridgeblack1176);
			registerBlock(bridgeblack1178);
			registerBlock(bridgeblack1180);
		}
		
		public static void registerRenders() {
			registerRender(bridgeblack1176);
			registerRender(bridgeblack1178);
			registerRender(bridgeblack1180);
		}
		
		public static void registerBlock(Block block) {
			block.setCreativeTab(MainClass.TabB);
			GameRegistry.register(block);
			GameRegistry.register(new ItemBlock(block).setRegistryName(block.getRegistryName()));
			Utools.getLogger().info("Register block for" + block.getUnlocalizedName().substring(5));
		}
		
		public static void registerRender(Block block) {
			ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(new ResourceLocation(References.MODID, block.getUnlocalizedName().substring(5)), "inventory"));
			Utools.getLogger().info("Register render for" + block.getUnlocalizedName().substring(5));;
		}
	}

 

Where is the problem ? I don't find anything wrong.

 

Thanks for the help

1 minute ago, themistik said:

bridgeblack1180 = new Blockbridgeblack1178

1180 != 1178. That's one of the reasons to use descriptive class names.

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...

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.