Posted June 10, 20196 yr Hello. Basically I maded an item that basically is lantern. I wanna ask if you know a way to make a dynamic light, a light that follows the player only if the lantern is in the main or in the second hand. How can I do that without using the api from Dynamic Lights? Thank you Edited June 11, 20196 yr by cinsiian
June 11, 20196 yr Author Ok I tried creating a tile entity with a timer in it. When the timer is 0 the block should disappear but it doesn work. Maybe i have not coded correctly the tile entity? https://github.com/cinsiian/MiningFeelings/blob/master/src/main/java/com/cinsiian/miningFeelings/block/tileEntity/LanternLightTileEntity.java https://github.com/cinsiian/MiningFeelings/blob/master/src/main/java/com/cinsiian/miningFeelings/block/BlockLanternLight.java
June 11, 20196 yr Well, you haven't actually... you know... write the "block disappear" part. Moreover, your isTimerEnded does nothing as of now; you are not checking it at all. Besides, whether the timer has ended can be determined by a simple timer <= 0 instead of creating a new variable. Edited June 11, 20196 yr by DavidM Some tips: Spoiler Modder Support: Spoiler 1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code. 2. Always post your code. 3. Never copy and paste code. You won't learn anything from doing that. 4. Quote Programming via Eclipse's hotfixes will get you nowhere 5. Learn to use your IDE, especially the debugger. 6. Quote The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it. Support & Bug Reports: Spoiler 1. Read the EAQ before asking for help. Remember to provide the appropriate log(s). 2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.
June 11, 20196 yr Doing lighting like this is very performance intensive. About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
June 11, 20196 yr Author 6 minutes ago, Cadiboo said: Doing lighting like this is very performance intensive. I know but its the whole point of a lantern.
June 11, 20196 yr Find a better way to do it than you’re doing it now. I would try and do it with 1) OptiFine/DynamicLights integration 2) A shader 3) Placing blocks every second or half second and always having a maximum of 1 lighting block around per lantern. About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
June 11, 20196 yr Author 2 minutes ago, Cadiboo said: Placing blocks every second or half second and always having a maximum of 1 lighting block around per lantern. I am kinda doing that with my code, if a player is not moving, the game will not replace the block but i have some issues with my tile entity that i cant figure out.
June 11, 20196 yr Author 5 hours ago, DavidM said: Well, you haven't actually... you know... write the "block disappear" part. Moreover, your isTimerEnded does nothing as of now; you are not checking it at all. Besides, whether the timer has ended can be determined by a simple timer <= 0 instead of creating a new variable. Well, I removed the boolean and added the function. Keeps not working. https://github.com/cinsiian/MiningFeelings/blob/master/src/main/java/com/cinsiian/miningFeelings/block/tileEntity/LanternLightTileEntity.java
June 11, 20196 yr This is old, old code (circa 1.7.10 originally, updated to work with 1.10), but this will handle the light source, as a block, utilizing as few updates as possible. Any data stored in the ItemStack NBT should be changed to use a capability, but that's all the necessary information. https://github.com/Draco18s/Artifacts/blob/master/main/java/com/draco18s/artifacts/components/ComponentLight.java#L63-L126 "That's not an Item!" you say. "Doesn't fucking matter, its the same function signature that does exist in Item" You'll just have to figure out what that function looks like now. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
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.