-
-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start moving some simpler things to new tracker package.
- Loading branch information
Showing
5 changed files
with
50 additions
and
175 deletions.
There are no files selected for viewing
167 changes: 0 additions & 167 deletions
167
src/main/java/org/spongepowered/common/mixin/core/world/end/DragonFightManagerMixin.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...ava/org/spongepowered/common/mixin/tracker/world/end/DragonFightManagerMixin_Tracker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package org.spongepowered.common.mixin.tracker.world.end; | ||
|
||
import net.minecraft.entity.item.EnderCrystalEntity; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.end.DragonFightManager; | ||
import net.minecraft.world.end.DragonSpawnState; | ||
import net.minecraft.world.server.ServerWorld; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
import org.spongepowered.common.event.tracking.PhaseTracker; | ||
import org.spongepowered.common.event.tracking.context.GeneralizedContext; | ||
import org.spongepowered.common.event.tracking.phase.world.dragon.DragonPhase; | ||
|
||
import java.util.List; | ||
|
||
@Mixin(DragonFightManager.class) | ||
public abstract class DragonFightManagerMixin_Tracker { | ||
|
||
/** | ||
* @author i509vcb - February 6th 2020 | ||
* @reason Add sponge necessary phase state switches | ||
* | ||
* @param dragonSpawnState The dragon spawn state. | ||
* @param worldIn The world this respawnState is occuring in. | ||
* @param manager The current DragonFightManager. | ||
* @param crystals List of all currently present end crystals. | ||
* @param respawnStateTicks The amount of this this respawn state has been running for. | ||
* @param exitPortalLocation The position of the exit portal. | ||
*/ | ||
@Redirect(method = "tick()V", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/end/DragonSpawnState;process(Lnet/minecraft/world/server/ServerWorld;Lnet/minecraft/world/end/DragonFightManager;Ljava/util/List;ILnet/minecraft/util/math/BlockPos;)V")) | ||
private void trackDragonRespawn(DragonSpawnState dragonSpawnState, ServerWorld worldIn, DragonFightManager manager, List<EnderCrystalEntity> crystals, int respawnStateTicks, BlockPos exitPortalLocation) { | ||
try (final GeneralizedContext context = DragonPhase.State.RESPAWN_DRAGON.createPhaseContext(PhaseTracker.SERVER)) { | ||
context.buildAndSwitch(); | ||
++respawnStateTicks; | ||
dragonSpawnState.process(worldIn, manager, crystals, respawnStateTicks, exitPortalLocation); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters