Skip to content

Commit

Permalink
Fix some bogus math in MixinEffectRenderer
Browse files Browse the repository at this point in the history
  • Loading branch information
Roadhog360 committed Aug 17, 2023
1 parent 5533a34 commit 089a50c
Showing 1 changed file with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
package ganymedes01.etfuturum.mixins.boundedparticles.client;

import java.util.ArrayList;
import java.util.List;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;

import net.minecraft.block.Block;
import net.minecraft.client.particle.EffectRenderer;
import net.minecraft.client.particle.EntityDiggingFX;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;

import java.util.ArrayList;
import java.util.List;

@Mixin(EffectRenderer.class)
public class MixinEffectRenderer {
Expand Down Expand Up @@ -60,15 +59,15 @@ public void addBlockDestroyEffects(int x, int y, int z, Block block, int p_14721
double d = Math.min(1.0, box.maxX - box.minX);
double e = Math.min(1.0, box.maxY - box.minY);
double f = Math.min(1.0, box.maxZ - box.minZ);
int i = Math.max(2, MathHelper.ceiling_double_int(d / 0.25));
int j = Math.max(2, MathHelper.ceiling_double_int(e / 0.25));
int k = Math.max(2, MathHelper.ceiling_double_int(f / 0.25));
int i = Math.max(2, MathHelper.ceiling_double_int(d * 4));
int j = Math.max(2, MathHelper.ceiling_double_int(e * 4));
int k = Math.max(2, MathHelper.ceiling_double_int(f * 4));
for (int l = 0; l < i; ++l) {
for (int m = 0; m < j; ++m) {
for (int n = 0; n < k; ++n) {
double g = ((double) l + 0.5) / (double) i;
double h = ((double) m + 0.5) / (double) j;
double o = ((double) n + 0.5) / (double) k;
double g = ((double) l + 0.5D) / (double) i;
double h = ((double) m + 0.5D) / (double) j;
double o = ((double) n + 0.5D) / (double) k;
double p = g * d + box.minX;
double q = h * e + box.minY;
double r = o * f + box.minZ;
Expand Down

0 comments on commit 089a50c

Please sign in to comment.