Matryoshika Posted March 26, 2017 Share Posted March 26, 2017 (edited) So, I had an idea that I wanted to try out. I want one of my blocks, to "crack" when an anvil lands on it. When an anvil lands, (onEndFalling) it calls world#playEvent with a null EntityPlayer, event-type 1031 & the blockPos. As such, I made an IWorldEventListener, but here comes the issue. I know that the event is only fired for that world, but without a World variable to use, I cannot see a way to actually use this data to affect the world around it. How would I go about this? Is there a better way around this? Edited March 26, 2017 by Matryoshika Quote Also previously known as eAndPi. "Pi, is there a station coming up where we can board your train of thought?" -Kronnn Published Mods: Underworld Handy links: Vic_'s Forge events Own WIP Tutorials. Link to comment Share on other sites More sharing options...
Choonster Posted March 26, 2017 Share Posted March 26, 2017 (edited) Create a new instance of your IWorldEventListener for each World and store the World in a field. ServerWorldEventHandler and RenderGlobal both do this. Edited March 26, 2017 by Choonster 1 Quote Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future. Link to comment Share on other sites More sharing options...
Matryoshika Posted March 26, 2017 Author Share Posted March 26, 2017 Thank you. How I missed that simple way of doing it is beyond me =_= Well, that's what you get for coding at 6 in the morning. Quote Also previously known as eAndPi. "Pi, is there a station coming up where we can board your train of thought?" -Kronnn Published Mods: Underworld Handy links: Vic_'s Forge events Own WIP Tutorials. Link to comment Share on other sites More sharing options...
Recommended Posts
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.