mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-16 18:55:06 +00:00
Custom particles respect the particles setting in the vanilla options menu (Fixes #240)
This commit is contained in:
1 parent
b23ce4ded0
commit
d093235f6a
2 files changed
+19
-19
No files matched your search
@@ -1,5 +1,17 @@
|
||||
package com.cricketcraft.chisel.client;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityPlayerSP;
|
||||
import net.minecraft.client.particle.EffectRenderer;
|
||||
import net.minecraft.client.particle.EntityDiggingFX;
|
||||
import net.minecraft.client.particle.EntityLavaFX;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.cricketcraft.chisel.block.BlockGrimstone;
|
||||
import com.cricketcraft.chisel.block.BlockHolystone;
|
||||
import com.cricketcraft.chisel.block.BlockLavastone;
|
||||
@@ -12,17 +24,6 @@ import com.cricketcraft.chisel.entity.fx.EntityGrimstoneFX;
|
||||
import com.cricketcraft.chisel.entity.fx.EntityHolystoneFX;
|
||||
import com.cricketcraft.chisel.entity.fx.EntitySnakestoneObsidianFX;
|
||||
import com.cricketcraft.chisel.utils.GeneralClient;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityPlayerSP;
|
||||
import net.minecraft.client.particle.EffectRenderer;
|
||||
import net.minecraft.client.particle.EntityDiggingFX;
|
||||
import net.minecraft.client.particle.EntityLavaFX;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class GeneralChiselClient {
|
||||
|
||||
@@ -30,7 +31,7 @@ public class GeneralChiselClient {
|
||||
public static int tick = 0;
|
||||
|
||||
public static void spawnLavastoneFX(World world, BlockLavastone block, int x, int y, int z) {
|
||||
if (Configurations.particlesTickrate != 0 && tick++ % Configurations.particlesTickrate != 0)
|
||||
if (Configurations.particlesTickrate != 0 && tick++ % Configurations.particlesTickrate != 0 || Minecraft.getMinecraft().gameSettings.particleSetting != 0)
|
||||
return;
|
||||
|
||||
float f = 0.15F;
|
||||
@@ -78,7 +79,7 @@ public class GeneralChiselClient {
|
||||
}
|
||||
|
||||
public static void spawnHolystoneFX(World world, BlockHolystone block, int x, int y, int z) {
|
||||
if (Configurations.particlesTickrate != 0 && tick++ % Configurations.particlesTickrate != 0)
|
||||
if (Configurations.particlesTickrate != 0 && tick++ % Configurations.particlesTickrate != 0 || Minecraft.getMinecraft().gameSettings.particleSetting != 0)
|
||||
return;
|
||||
|
||||
float f = 0.15F;
|
||||
@@ -164,14 +165,14 @@ public class GeneralChiselClient {
|
||||
}
|
||||
|
||||
public static void spawnSnakestoneObsidianFX(World world, BlockSnakestoneObsidian block, int x, int y, int z) {
|
||||
if (Configurations.particlesTickrate != 0 || tick++ % Configurations.particlesTickrate != 0) {
|
||||
if (Configurations.particlesTickrate != 0 || tick++ % Configurations.particlesTickrate != 0 || Minecraft.getMinecraft().gameSettings.particleSetting != 0) {
|
||||
EntitySnakestoneObsidianFX res = new EntitySnakestoneObsidianFX(world, block, x, y, z);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(res);
|
||||
}
|
||||
}
|
||||
|
||||
public static void spawnBallOMossFX(World world, double x, double y, double z) {
|
||||
if (Configurations.particlesTickrate == 0 || tick++ % Configurations.particlesTickrate == 0) {
|
||||
if (Configurations.particlesTickrate == 0 || tick++ % Configurations.particlesTickrate == 0 || Minecraft.getMinecraft().gameSettings.particleSetting != 0) {
|
||||
EntityBallOMossFX res = new EntityBallOMossFX(world, x, y, z);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(res);
|
||||
}
|
||||
@@ -179,7 +180,7 @@ public class GeneralChiselClient {
|
||||
|
||||
public static EntityDiggingFX addBlockHitEffects(World world, int x, int y, int z, int side) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
if (block.isAir(world, x, y, z))
|
||||
if (block.isAir(world, x, y, z) || Minecraft.getMinecraft().gameSettings.particleSetting != 0)
|
||||
return null;
|
||||
|
||||
EffectRenderer renderer = Minecraft.getMinecraft().effectRenderer;
|
||||
@@ -256,7 +257,7 @@ public class GeneralChiselClient {
|
||||
}
|
||||
|
||||
public static void spawnAutoChiselFX(TileEntityAutoChisel te, ItemStack base) {
|
||||
if (base != null) {
|
||||
if (base != null && Minecraft.getMinecraft().gameSettings.particleSetting == 0) {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
EntityDiggingFX particle = new EntityDiggingFX(te.getWorldObj(), te.xCoord + 0.5, te.yCoord + 0.95, te.zCoord + 0.5, 0, 0, 0, Block.getBlockFromItem(base.getItem()),
|
||||
base.getItemDamage());
|
||||
|
||||
@@ -20,7 +20,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
public class ClientProxy extends CommonProxy {
|
||||
|
||||
@@ -62,7 +61,7 @@ public class ClientProxy extends CommonProxy {
|
||||
|
||||
MinecraftForgeClient.registerItemRenderer(ChiselItems.chisel, renderer);
|
||||
MinecraftForgeClient.registerItemRenderer(ChiselItems.diamondChisel, renderer);
|
||||
|
||||
|
||||
PlayerSpecials.init();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user