Posted March 26, 20178 yr 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, 20178 yr by Matryoshika 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.
March 26, 20178 yr 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, 20178 yr by Choonster 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.
March 26, 20178 yr Author 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. 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.
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.