Posted March 31, 201510 yr 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.
March 31, 201510 yr 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.
March 31, 201510 yr Author Yeah Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.
March 31, 201510 yr Author No.. It was working a few days ago Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.
March 31, 201510 yr 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/
March 31, 201510 yr 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.
April 1, 201510 yr 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.