Skip to content

Commit

Permalink
Add config option to disable entity particles, Closes #77
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Feb 25, 2018
1 parent 25cbd0f commit c776ed5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ public class GeneralConfig extends DummyConfig {
@ConfigurableProperty(category = ConfigurableTypeCategory.GENERAL, comment = "If players should have particle effects for the abilities they carry.", isCommandable = true)
public static boolean showPlayerParticles = false;

/**
* If non-player entities should have particle effects for the abilities they carry.
*/
@ConfigurableProperty(category = ConfigurableTypeCategory.GENERAL, comment = "If on-player entities should have particle effects for the abilities they carry.", isCommandable = true)
public static boolean showEntityParticles = true;

/**
* The maximum amount of abilities a player can have, -1 is infinite.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public ModBase getMod() {
@SubscribeEvent
public void onRenderLiving(RenderLivingEvent.Post event) {
EntityLivingBase entity = event.getEntity();
if ((entity instanceof IAnimals || (GeneralConfig.showPlayerParticles && entity instanceof EntityPlayer))
if (((GeneralConfig.showEntityParticles && entity instanceof IAnimals)
|| (GeneralConfig.showPlayerParticles && entity instanceof EntityPlayer))
&& !Minecraft.getMinecraft().isGamePaused()
&& entity.world.getTotalWorldTime() % 10 == 0
&& entity.hasCapability(MutableAbilityStoreConfig.CAPABILITY, null)) {
Expand Down

0 comments on commit c776ed5

Please sign in to comment.