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.

Featured Replies

Posted

So my light just won't show up. Through the

System.out.println()

s I know that the event IS being called, the addLight IS being called and the light value IS NOT over 15 (its 9). What am I doing wrong?

 

@SubscribeEvent
public void onTick(TickEvent.PlayerTickEvent evt){
	if(!evt.player.worldObj.isRemote){
		if(evt.player.inventory.getCurrentItem() != null && evt.player.inventory.getCurrentItem().getItem() instanceof ItemWand){
			ItemStack wand = evt.player.inventory.getCurrentItem();
			System.out.println(wand.stackTagCompound.getBoolean("lumos"));
			if(wand.stackTagCompound != null && wand.stackTagCompound.getBoolean("lumos") == true){
					evt.player.worldObj.updateLightByType(EnumSkyBlock.Block, prevposX, prevposY, prevposZ);
					this.addLight(evt.player.worldObj, evt.player);
					System.out.println("add light");

			}
			else if(wand.stackTagCompound != null && wand.stackTagCompound.getBoolean("lumos") == false){
				evt.player.worldObj.updateLightByType(EnumSkyBlock.Block, prevposX, prevposY, prevposZ);
				this.deleteLight(evt.player.worldObj, evt.player);
				evt.player.worldObj.updateLightByType(EnumSkyBlock.Block, prevposX, prevposY, prevposZ);

			}
		}
	}
}
private void addLight(World world, EntityPlayer player) {
	MagiSkills ext = MagiSkills.get(player);
	world.setLightValue(EnumSkyBlock.Block, (int) player.posX,

			(int) player.posY, (int) player.posZ, 9+ext.getCurrentSkillLevel(SpellLib.LUMOS));
	System.out.println(9+ext.getCurrentSkillLevel(SpellLib.LUMOS));
	prevposX = (int)player.posX;
	prevposY = (int)player.posY;
	prevposZ = (int)player.posZ;
	world.markBlockRangeForRenderUpdate((int) player.posX,
			(int) player.posY, (int) player.posX, 12, 12, 12);
	world.markBlockForUpdate((int) player.posX, (int) player.posY,
			(int) player.posZ);
//		for(int i = 1; i < 6; i++){
//			for(int j = 1; j < 6; j++){
//				for(int k = 1; k < 4; k++){
//					world.updateLightByType(EnumSkyBlock.Block, (int) player.posX - 3 + j, (int) player.posY - 2 + k, (int) player.posZ - 3 + i);
//				}
//			}
		world.updateLightByType(EnumSkyBlock.Block, (int) player.posX, (int) player.posY - 1, (int) player.posZ);
		world.updateLightByType(EnumSkyBlock.Block, (int) player.posX + 1, (int) player.posY - 1, (int) player.posZ + 1);
		world.updateLightByType(EnumSkyBlock.Block, (int) player.posX, (int) player.posY - 1, (int) player.posZ + 1);
		world.updateLightByType(EnumSkyBlock.Block, (int) player.posX - 1, (int) player.posY - 1, (int) player.posZ + 1);
		world.updateLightByType(EnumSkyBlock.Block, (int) player.posX + 1, (int) player.posY - 1, (int) player.posZ);
		world.updateLightByType(EnumSkyBlock.Block, (int) player.posX - 1, (int) player.posY - 1, (int) player.posZ);
		world.updateLightByType(EnumSkyBlock.Block, (int) player.posX + 1, (int) player.posY - 1, (int) player.posZ-1);
		world.updateLightByType(EnumSkyBlock.Block, (int) player.posX, (int) player.posY - 1, (int) player.posZ-1);
		world.updateLightByType(EnumSkyBlock.Block, (int) player.posX - 1, (int) player.posY - 1, (int) player.posZ - 1);

		world.updateLightByType(EnumSkyBlock.Block, (int) player.posX + 1, (int) player.posY + 1, (int) player.posZ + 1);
		world.updateLightByType(EnumSkyBlock.Block, (int) player.posX, (int) player.posY + 1, (int) player.posZ + 1);
		world.updateLightByType(EnumSkyBlock.Block, (int) player.posX - 1, (int) player.posY + 1, (int) player.posZ + 1);
		world.updateLightByType(EnumSkyBlock.Block, (int) player.posX + 1, (int) player.posY + 1, (int) player.posZ);
		world.updateLightByType(EnumSkyBlock.Block, (int) player.posX, (int) player.posY + 1, (int) player.posZ);
		world.updateLightByType(EnumSkyBlock.Block, (int) player.posX - 1, (int) player.posY + 1, (int) player.posZ);
		world.updateLightByType(EnumSkyBlock.Block, (int) player.posX + 1, (int) player.posY + 1, (int) player.posZ - 1);
		world.updateLightByType(EnumSkyBlock.Block, (int) player.posX, (int) player.posY + 1, (int) player.posZ - 1);
		world.updateLightByType(EnumSkyBlock.Block, (int) player.posX - 1, (int) player.posY + 1, (int) player.posZ - 1);

		world.updateLightByType(EnumSkyBlock.Block, (int) player.posX + 1, (int) player.posY, (int) player.posZ + 1);
		world.updateLightByType(EnumSkyBlock.Block, (int) player.posX, (int) player.posY, (int) player.posZ + 1);
		world.updateLightByType(EnumSkyBlock.Block, (int) player.posX - 1, (int) player.posY, (int) player.posZ + 1);
		world.updateLightByType(EnumSkyBlock.Block, (int) player.posX - 1, (int) player.posY, (int) player.posZ);
		world.updateLightByType(EnumSkyBlock.Block, (int) player.posX + 1, (int) player.posY, (int) player.posZ);
		world.updateLightByType(EnumSkyBlock.Block, (int) player.posX + 1, (int) player.posY, (int) player.posZ - 1);
		world.updateLightByType(EnumSkyBlock.Block, (int) player.posX, (int) player.posY, (int) player.posZ - 1);
		world.updateLightByType(EnumSkyBlock.Block, (int) player.posX - 1, (int) player.posY, (int) player.posZ - 1);




//		}
}

Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.

Does this line: System.out.println(9+ext.getCurrentSkillLevel(SpellLib.LUMOS)) always gives value over 9?

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

  • Author

Yeah

Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.

  • Author

No.. It was working a few days ago

Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.

No.. It was working a few days ago

 

I think diesieben07's point is that until a block update happens it may appear to work temporarily.  If you saw it working before, it was probably due to no block update being triggered.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

  • Author

No wait it actually worked yesterday and it was full time, like the player was constantly a light source

Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.

  • Author

I fixed it. All I had to do was remove the if(!world.isRemote)

Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.

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.