-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip sprinting particle creation server side
- Loading branch information
Showing
5 changed files
with
36 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
26 changes: 26 additions & 0 deletions
26
src/main/java/me/jellysquid/mods/lithium/mixin/entity/sprinting_particles/EntityMixin.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,26 @@ | ||
package me.jellysquid.mods.lithium.mixin.entity.sprinting_particles; | ||
|
||
import net.minecraft.entity.Entity; | ||
import net.minecraft.world.World; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Mixin(Entity.class) | ||
public abstract class EntityMixin { | ||
|
||
@Shadow | ||
public abstract World getWorld(); | ||
|
||
@Redirect( | ||
method = "baseTick", | ||
at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;shouldSpawnSprintingParticles()Z") | ||
) | ||
private boolean skipParticlesOnServerSide(Entity instance) { | ||
if (instance.getWorld().isClient()) { | ||
return instance.shouldSpawnSprintingParticles(); | ||
} | ||
return false; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/me/jellysquid/mods/lithium/mixin/entity/sprinting_particles/package-info.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,4 @@ | ||
@MixinConfigOption(description = "Skips trying to create sprinting particles for all entities on the server side.") | ||
package me.jellysquid.mods.lithium.mixin.entity.sprinting_particles; | ||
|
||
import net.caffeinemc.gradle.MixinConfigOption; |
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