New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't convert back and forth between Explosion objects and their unpacked data. #1368
Don't convert back and forth between Explosion objects and their unpacked data. #1368
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some cause tracking details are missing in my opinion.
// Sponge End | ||
// Sponge start - move this behavior to another method to allow precreated explosions to be used | ||
// All of the original behavior is in triggerExplosion(). | ||
triggerExplosion((org.spongepowered.api.world.explosion.Explosion) explosion, Cause.of(NamedCause.source(entityIn == null ? this : entityIn))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather use the CauseTracker to define what Cause
to use for the explosion source. Since the source passed in as Entity
is usually an entity ticking, or in some cases a TileEntity
passing null for explosions. You may also want to verify the explosion optimization (not really optimization, it's an optimization for clients on the server due to the unperformant explosion packets and what they entail) still functions as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Although pretty much the entire PR changed - you may need to re-review it.
149d94f
to
100a236
Compare
100a236
to
f57951d
Compare
@@ -48,21 +50,23 @@ | |||
@Mixin(value = WorldServer.class, priority = 1111) | |||
public abstract class MixinWorldServer_Explosion extends MixinWorld { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like it's separate because it's a configurable optimization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Zidane because it's altering the mechanics of multiple explosions occurring at the same time. This goes about removing the point of sending explosion packets (reducing lag on clients), this was meddled with @amaranth a while back but I haven't verified whether it should be enabled by default now or not.
f57951d
to
0717cce
Compare
0717cce
to
1fe0d7d
Compare
1fe0d7d
to
46397a7
Compare
Can this be merged? |
import org.spongepowered.common.event.tracking.phase.TrackingPhase; | ||
import org.spongepowered.common.event.tracking.phase.general.ExplosionContext; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra import?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops :P I will revert that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this was intended. It now uses this class instead of the previous ExplosionContext
class that was in this package.
@@ -29,7 +29,7 @@ | |||
import org.spongepowered.common.event.tracking.phase.TrackingPhase; | |||
import org.spongepowered.common.event.tracking.phase.TrackingPhases; | |||
|
|||
public abstract class PluginPhaseState<P extends PluginPhaseContext<P>> implements IPhaseState<P> { | |||
public abstract class PluginPhaseState<P extends PhaseContext<P>> implements IPhaseState<P> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was to allow CustomExplosionState
to use the same context class as ExplosionState
(of GeneralPhase
); there's pretty much no difference between the two types.
ce3eb47
to
d563de7
Compare
@liach I found a way to make this work without messing with the |
d563de7
to
a36842d
Compare
@ryantheleach status? |
I know that I said previously that I was going to make a test plugin, but at this stage I have no idea if I did that or not, I've been somewhat MIA over the last few months. At present anything that's blocked on me should be considered up for fair game until I can find the time to invest back into Sponge. |
a36842d
to
688b8a5
Compare
Updated (after asking @JBYoshi about it). Note: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Just may need to add explosion event ShouldFire
checks to reduce potential stack frame creation unnecessarily.
688b8a5
to
ab7b6d8
Compare
Conflicts fixed and rebased. A note (In case some plugins complain about this being a breaking change): the default value of |
This PR:
newExplosion()
inMixinWorld.triggerExplosion()
MixinWorldServer
fromtriggerExplosion()
andnewExplosion()
totriggerExplosionInternal()
SpongeExplosionBuilder
that badly messed up my testingFixes #1367.