Permalink
Browse files

Added halloween event setting to Settings.

  • Loading branch information...
Ri5ux committed Oct 24, 2018
1 parent f1bd43c commit 9ec6d7c0fe9b801d8aba20b165fba1aab55fb735
Showing with 13 additions and 4 deletions.
  1. +11 −0 src/main/java/org/avp/Settings.java
  2. +2 −4 src/main/java/org/avp/client/render/BiomeColorHandler.java
@@ -1,7 +1,10 @@
package org.avp;
import java.io.File;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Date;
import com.arisux.mdx.config.ConfigSetting;
import com.arisux.mdx.config.ConfigSettingBoolean;
@@ -191,4 +194,12 @@ public float globalSoundVolume()
{
return (float) ((Integer) this.globalSoundVolume.value()) / 100F;
}
public boolean isHalloweenEventEnabled()
{
Date date = new Date();
LocalDate localDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
return (localDate.getMonthValue() == 10 && localDate.getDayOfMonth() >= 28 || localDate.getMonthValue() == 11 && localDate.getDayOfMonth() <= 3);
}
}
@@ -7,6 +7,7 @@
import javax.annotation.Nullable;
import org.avp.AliensVsPredator;
import org.avp.BlockHandler;
import com.arisux.mdx.lib.game.Game;
@@ -67,10 +68,7 @@ public int colorMultiplier(ItemStack stack, int tintIndex)
Game.minecraft().getBlockColors().registerBlockColorHandler(new IBlockColor() {
public int colorMultiplier(IBlockState state, @Nullable IBlockAccess worldIn, @Nullable BlockPos pos, int tintIndex)
{
Date date = new Date();
LocalDate localDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
if ((localDate.getMonthValue() == 10 && localDate.getDayOfMonth() >= 28 || localDate.getMonthValue() == 11 && localDate.getDayOfMonth() <= 3))
if (AliensVsPredator.settings().isHalloweenEventEnabled())
{
switch (new Random(pos.getX() + pos.getY() + pos.getZ()).nextInt(5))
{

0 comments on commit 9ec6d7c

Please sign in to comment.