shadowmage4513 Posted February 18, 2014 Posted February 18, 2014 Hi all, I am looking into an Explosion Event -- if one exists? (I sure couldn't fine one in any relases from 1.5.x -> 1.7.2) If not, is anyone aware of a (clean) method to intercept TNT explosions (preferably ALL explosions)? My goal is to have blocks/entities that offer limited 'protection' or 'reinforcement' of other blocks in their range (as part of a Siege based PVP system). I have the system working exceptionally well with the use of block-break events....but I cannot find how/where to intercept explosions? The closest I've come is a tick-handler / onUpdate method to examine all nearby entities and see if there is a TNT or creeper about to explode and cancel / kill / remove it if it would effect the reinforced area at all. Neither a clean solution, nor quite what I'm looking for. Ideally the explosion would still have normal effects outside of the reinforced area, whereas this solution entirely kills the explosion. The other solution that I thought of would be constantly scanning/validating all of the blocks that are supposed to be 'reinforced' and replacing them if they were not removed via a block-break event -- but this can cause all sorts of headaches with non-loaded chunks, other mods replacing blocks outside of the events, and is terribly inefficient. Any ideas? Thanks in advance, Shadowmage Quote
GotoLink Posted February 18, 2014 Posted February 18, 2014 Explosions are passed to the block affected in 1.7.2. Quote
Draco18s Posted February 18, 2014 Posted February 18, 2014 Yes, but that's not useful in his case. He wants a block at (0,70,0) to protect blocks in a 16 block range from being damaged by explosions. So the block at (0,70,0) needs to know when an explosion goes off over at (12,70,0) so that the blocks at (10,70,0), (10,70,1), (10,70,-1), etc. don't get destroyed. Quote 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.
sequituri Posted February 18, 2014 Posted February 18, 2014 I'd modify (make a new) explosion method - so it can allow subscribers to all explosions. Then the event sent to subscriber would include the source and target of the blast, and be cancellable. You just have to make sure your explosion method gets called instead of the original. Quote -S- (if I helped, please click Thank and applaud) http://6upnqa.dm2301.livefilestore.com/y2mtf-vG7Tqq1TiiVpIm53KWj7294NDPoHfSHHb4PzZiMAUfRCfK0UY0MwOu7Q3zTBNVTKqWjr2-xgBfFRpQT5p-QivtvknPpoABMNUw9br9WuZcBFkjePhnAbW500gVm-P/sequiturian.png[/img]
shadowmage4513 Posted February 19, 2014 Author Posted February 19, 2014 Yes, Draco18s, that is pretty much exactly what I would be doing Perhaps I will investigate doing a core-mod for this (its about time to learn), or maybe even see how hard making an event for it for Forge would be. I seemed to remember an explosion event mentioned in the github issues tracker quite awhile back, but apparently it didn't make it in. Quote
strumshot Posted September 22, 2014 Posted September 22, 2014 Im coming across this same issue. Im curious as to what your final solution ended up being; did you manage to avoid a core mod? Quote I'll need help, and I'll give help. Just ask, you know I will!
larsgerrits Posted September 22, 2014 Posted September 22, 2014 Don't hijack dead threads please. Make your own post. Quote Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
shadowmage4513 Posted September 22, 2014 Author Posted September 22, 2014 Still unsolved. Have not been able to implement the desired features because of it. Moved on to other things =\ There have been a couple of pull-requests for forge/FML to add such an event, but I haven't seen any of them get actually pulled/merged. Would do a PR of my own, but no much use if the two existing ones are just sitting there =\ Quote
strumshot Posted September 22, 2014 Posted September 22, 2014 I will let you know if I find anything, as my approach is slightly different. I want to interrupt any explosions in an area that is marked as locked. The locked Boolean in this case is calculated based on the map coordinates. I don't want the block to determine if the explosion happens or not because I want tnt outside of the locked area to still explode blocks inside the locked area. This will thus disable cannons firing into locked zones but allow for perimeter breaching! I just want to interrupt exploding in a locked area without overriding base TNT. maybe I will get lucky and find something. Quote I'll need help, and I'll give help. Just ask, you know I will!
strumshot Posted September 22, 2014 Posted September 22, 2014 On 9/22/2014 at 4:17 PM, larsgerrits said: Don't hijack dead threads please. Make your own post. No problem. I thought that was the better decision, for organizational purposes, as the issue was not resolved. I see it was not. edit: http://www.minecraftforge.net/forum/index.php/topic,23706.0.html Quote I'll need help, and I'll give help. Just ask, you know I will!
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.