-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e3e2d52
commit ec8b32a
Showing
5 changed files
with
79 additions
and
1 deletion.
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
36 changes: 36 additions & 0 deletions
36
src/main/java/github/kasuminova/stellarcore/mixin/techguns/MixinBioGunProjectile.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,36 @@ | ||
package github.kasuminova.stellarcore.mixin.techguns; | ||
|
||
import github.kasuminova.stellarcore.common.config.StellarCoreConfig; | ||
import net.minecraft.entity.Entity; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
import techguns.client.ClientProxy; | ||
import techguns.entities.projectiles.BioGunProjectile; | ||
|
||
@Mixin(BioGunProjectile.class) | ||
@SuppressWarnings("MethodMayBeStatic") | ||
public abstract class MixinBioGunProjectile extends Entity { | ||
|
||
@SuppressWarnings("DataFlowIssue") | ||
public MixinBioGunProjectile() { | ||
super(null); | ||
} | ||
|
||
@Redirect(method = "<init>(Lnet/minecraft/world/World;)V", at = @At(value = "INVOKE", target = "Ltechguns/client/ClientProxy;get()Ltechguns/client/ClientProxy;")) | ||
private ClientProxy injectInitGetProxy() { | ||
if (world.isRemote || !StellarCoreConfig.BUG_FIXES.techguns.serverSideEntityCrashFixes) { | ||
return ClientProxy.get(); | ||
} | ||
return null; | ||
} | ||
|
||
@Redirect(method = "<init>(Lnet/minecraft/world/World;)V", at = @At(value = "INVOKE", target = "Ltechguns/client/ClientProxy;createFXOnEntity(Ljava/lang/String;Lnet/minecraft/entity/Entity;)V")) | ||
private void injectInitCreateFX(final ClientProxy instance, final String name, final Entity ent) { | ||
if (instance != null || !StellarCoreConfig.BUG_FIXES.techguns.serverSideEntityCrashFixes) { | ||
assert instance != null; | ||
instance.createFXOnEntity(name, ent); | ||
} | ||
} | ||
|
||
} |
36 changes: 36 additions & 0 deletions
36
src/main/java/github/kasuminova/stellarcore/mixin/techguns/MixinFlamethrowerProjectile.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,36 @@ | ||
package github.kasuminova.stellarcore.mixin.techguns; | ||
|
||
import github.kasuminova.stellarcore.common.config.StellarCoreConfig; | ||
import net.minecraft.entity.Entity; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
import techguns.client.ClientProxy; | ||
import techguns.entities.projectiles.FlamethrowerProjectile; | ||
|
||
@Mixin(FlamethrowerProjectile.class) | ||
@SuppressWarnings("MethodMayBeStatic") | ||
public abstract class MixinFlamethrowerProjectile extends Entity { | ||
|
||
@SuppressWarnings("DataFlowIssue") | ||
public MixinFlamethrowerProjectile() { | ||
super(null); | ||
} | ||
|
||
@Redirect(method = "<init>(Lnet/minecraft/world/World;)V", at = @At(value = "INVOKE", target = "Ltechguns/client/ClientProxy;get()Ltechguns/client/ClientProxy;")) | ||
private ClientProxy injectInitGetProxy() { | ||
if (world.isRemote || !StellarCoreConfig.BUG_FIXES.techguns.serverSideEntityCrashFixes) { | ||
return ClientProxy.get(); | ||
} | ||
return null; | ||
} | ||
|
||
@Redirect(method = "<init>(Lnet/minecraft/world/World;)V", at = @At(value = "INVOKE", target = "Ltechguns/client/ClientProxy;createFXOnEntity(Ljava/lang/String;Lnet/minecraft/entity/Entity;)V")) | ||
private void injectInitCreateFX(final ClientProxy instance, final String name, final Entity ent) { | ||
if (instance != null || !StellarCoreConfig.BUG_FIXES.techguns.serverSideEntityCrashFixes) { | ||
assert instance != null; | ||
instance.createFXOnEntity(name, ent); | ||
} | ||
} | ||
|
||
} |
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