Skip to content

Commit

Permalink
Fix cleanview and block particles... again
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyvest committed Jun 22, 2024
1 parent 9ff7a1d commit 56ee085
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import org.polyfrost.overflowparticles.config.ModConfig;
import org.polyfrost.overflowparticles.config.ParticleConfig;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.*;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

Expand All @@ -22,20 +21,18 @@ public EntityLivingBaseMixin(World worldIn) {
super(worldIn);
}

@Shadow public abstract boolean isServerWorld();

@SuppressWarnings({"ConstantConditions"})
@Inject(method = "updatePotionEffects", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;spawnParticle(Lnet/minecraft/util/EnumParticleTypes;DDDDDD[I)V"), cancellable = true)
private void cleanView(CallbackInfo ci) {
if (worldObj != null && isServerWorld()) return;
if (worldObj != null && !worldObj.isRemote) return;
if (MainConfig.INSTANCE.getSettings().getCleanView() && (Object) this == UMinecraft.getPlayer()) {
ci.cancel();
}
}

@Redirect(method = "updateFallState", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/Block;getMaterial()Lnet/minecraft/block/material/Material;"))
private Material fall(Block instance) {
if (worldObj != null && isServerWorld()) return instance.getMaterial();
if (worldObj != null && !worldObj.isRemote) return instance.getMaterial();
ParticleConfig config = OverflowParticles.INSTANCE.getConfigs().get(37);
if (!config.enabled) return Material.air;
BlockParticleEntry entry = ModConfig.INSTANCE.getBlockSetting();
Expand Down

0 comments on commit 56ee085

Please sign in to comment.