-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Override Mohist's crappy explosion handling
- Loading branch information
Showing
10 changed files
with
90 additions
and
3 deletions.
There are no files selected for viewing
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
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
30 changes: 30 additions & 0 deletions
30
...ain/java/io/wdsj/hybridfix/mixin/bridge/explosion/mohist/ExplosionDetonateEventMixin.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,30 @@ | ||
package io.wdsj.hybridfix.mixin.bridge.explosion.mohist; | ||
|
||
import net.minecraft.world.Explosion; | ||
import net.minecraft.world.World; | ||
import net.minecraftforge.event.world.ExplosionEvent; | ||
import org.bukkit.event.Event; | ||
import org.bukkit.plugin.PluginManager; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Mixin(ExplosionEvent.Detonate.class) | ||
public abstract class ExplosionDetonateEventMixin extends ExplosionEvent { | ||
public ExplosionDetonateEventMixin(World world, Explosion explosion) { | ||
super(world, explosion); | ||
} | ||
|
||
|
||
@Redirect( | ||
method = "<init>", | ||
at = @At( | ||
value = "INVOKE", | ||
target = "Lorg/bukkit/plugin/PluginManager;callEvent(Lorg/bukkit/event/Event;)V" | ||
), | ||
remap = false | ||
) | ||
public void swallowEvent(PluginManager instance, Event event) { | ||
// no-op | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/io/wdsj/hybridfix/mixin/bridge/explosion/mohist/ExplosionStartEventMixin.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,30 @@ | ||
package io.wdsj.hybridfix.mixin.bridge.explosion.mohist; | ||
|
||
import net.minecraft.world.Explosion; | ||
import net.minecraft.world.World; | ||
import net.minecraftforge.event.world.ExplosionEvent; | ||
import org.bukkit.event.Event; | ||
import org.bukkit.plugin.PluginManager; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Mixin(ExplosionEvent.Start.class) | ||
public abstract class ExplosionStartEventMixin extends ExplosionEvent { | ||
public ExplosionStartEventMixin(World world, Explosion explosion) { | ||
super(world, explosion); | ||
} | ||
|
||
|
||
@Redirect( | ||
method = "<init>", | ||
at = @At( | ||
value = "INVOKE", | ||
target = "Lorg/bukkit/plugin/PluginManager;callEvent(Lorg/bukkit/event/Event;)V" | ||
), | ||
remap = false | ||
) | ||
public void swallowEvent(PluginManager instance, Event event) { | ||
// no-op | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"package": "io.wdsj.hybridfix.mixin.bridge.explosion.mohist", | ||
"required": true, | ||
"refmap": "${mixin_refmap}", | ||
"target": "@env(DEFAULT)", | ||
"minVersion": "0.8", | ||
"compatibilityLevel": "JAVA_8", | ||
"mixins": [ | ||
"ExplosionStartEventMixin", | ||
"ExplosionDetonateEventMixin" | ||
] | ||
} |