Skip to content

Commit

Permalink
Version 1.4.6
Browse files Browse the repository at this point in the history
- Falling star volume is now configurable
- Added scythe drop chances to prevent dupes and add customizability
  • Loading branch information
democat3457 committed Apr 15, 2021
1 parent 6675fcd commit daa4adc
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 15 deletions.
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ buildscript {
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'maven'

version = "1.4.5"
version = "1.4.6"
group = "de.ellpeck.nyx"
archivesBaseName = "Nyx"

Expand All @@ -32,6 +32,9 @@ repositories {

dependencies {
deobfCompile "mezz.jei:jei_1.12.2:4.14.4.267"

// deobfCompile "slimeknights.mantle:Mantle:1.12-1.3.3.55"
// deobfCompile "knightminer:Inspirations:1.12.2-0.2.9.9"
}


Expand Down
21 changes: 17 additions & 4 deletions src/main/java/de/ellpeck/nyx/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public final class Config {
public static boolean fallingStars;
public static double fallingStarRarity;
public static double fallingStarRarityShower;
public static double fallingStarImpactVolume;
public static double fallingStarAmbientVolume;
public static boolean fullMoon;
public static boolean bloodMoonSleeping;
public static int bloodMoonSpawnMultiplier;
Expand Down Expand Up @@ -68,6 +70,7 @@ public final class Config {
public static int crystalDurability;
public static int hammerDamage;
public static double bowDamageMultiplier;
public static String[] scytheDropChances;
public static Set<ItemStack> scytheDropBlacklist;
private static Set<String> _scytheDropBlacklist;
public static Set<LunarWaterSource> lunarWaterRemoveNegative;
Expand Down Expand Up @@ -148,6 +151,8 @@ public static void load() {
fallingStars = instance.get("fallingStars", "fallingStars", true, "If falling stars should be enabled").getBoolean();
fallingStarRarity = instance.get("fallingStars", "fallingStarRarity", 0.01F, "The chance in percent (1 = 100%) for a falling star to appear at night for each player per second", 0, 1).getDouble();
fallingStarRarityShower = instance.get("fallingStars", "fallingStarRarityShower", 0.15F, "The chance for a falling star to appear during a star shower for each player per second", 0, 1).getDouble();
fallingStarImpactVolume = instance.get("fallingStars", "fallingStarImpactVolume", 10F, "The volume for the falling star impact sound").getDouble();
fallingStarAmbientVolume = instance.get("fallingStars", "fallingStarAmbientVolume", 5F, "The volume for the falling star ambient sound").getDouble();

bloodMoon = new LunarEventConfig("bloodMoon", "bloodMoon", "Blood Moon", 0.05);
bloodMoonSleeping = instance.get("bloodMoon", "bloodMoonSleeping", false, "If sleeping is allowed during a blood moon").getBoolean();
Expand All @@ -169,10 +174,18 @@ public static void load() {
meteorDisallowTime = instance.get("meteors", "meteorDisallowTime", 12000, "The amount of ticks that need to pass for each player until the chance of a meteor spawning in the area is halved (and then halved again, and so on). This decreases the chance of a meteor hitting a base or player hub").getInt();
meteorKillUnloaded = instance.get("meteors", "meteorKillUnloaded", false, "If meteors passing through unloaded chunks should be removed. If the game is lagging because of the unloaded chunks, try enabling this").getBoolean();
meteorCacheUnloaded = instance.get("meteors", "meteorCacheUnloaded", false, "If meteors passing through unloaded chunks should be cached at that position until entering the unloaded chunk. This option is ignored if meteorKillUnloaded is true.").getBoolean();
crystalDurability = instance.get("meteors", "crystalDurability", 1000, "The amount of uses that a gleaning crystal should have for bone-mealing").getInt();
hammerDamage = instance.get("meteors", "hammerDamage", 15, "The amount of damage that the meteor hammer deals if the maximum flight time was used").getInt();
bowDamageMultiplier = instance.get("meteors", "bowDamageMult", 1.75, "The multiplier for the amount of damage inflicted by the meteor bow's arrows").getDouble();
_scytheDropBlacklist = Sets.newHashSet(instance.get("meteors", "scytheDropBlacklist", new String[0], "Drops that the scythe shouldn't multiply").getStringList());

crystalDurability = instance.get("equipment", "crystalDurability", 1000, "The amount of uses that a gleaning crystal should have for bone-mealing").getInt();
hammerDamage = instance.get("equipment", "hammerDamage", 15, "The amount of damage that the meteor hammer deals if the maximum flight time was used").getInt();
bowDamageMultiplier = instance.get("equipment", "bowDamageMult", 1.75, "The multiplier for the amount of damage inflicted by the meteor bow's arrows").getDouble();
_scytheDropBlacklist = Sets.newHashSet(instance.get("equipment", "scytheDropBlacklist", new String[0], "Drops that the scythe shouldn't multiply").getStringList());
scytheDropChances = instance.get("equipment", "scytheDropChances", new String[]{"0.6;2", "0.4;3", "0.2;4"},
"The drop chances for the scythe. The order of this list matters!\n" +
"The scythe will, for each drop, check against this list in order.\n" +
"Each line shows the chance for that drop and the multiplier for that drop if the chance is selected.\n" +
"If the drop is not selected, the scythe moves to the next drop chance.\n" +
"If the list is empty, the scythe will not multiply drops.\n" +
"The format for each line is 'chance;drop_mult'").getStringList();

if (instance.hasChanged())
instance.save();
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/de/ellpeck/nyx/entities/FallingStar.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package de.ellpeck.nyx.entities;

import de.ellpeck.nyx.Config;
import de.ellpeck.nyx.Nyx;
import de.ellpeck.nyx.Registry;
import net.minecraft.entity.Entity;
Expand All @@ -8,7 +9,6 @@
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;

Expand Down Expand Up @@ -40,15 +40,15 @@ protected void customUpdate() {

if (!this.world.isRemote) {
if (this.collided) {
this.world.playSound(null, this.posX, this.posY, this.posZ, Registry.fallingStarImpactSound, SoundCategory.AMBIENT, 10, 1);
this.playSound(Registry.fallingStarImpactSound, (float) Config.fallingStarImpactVolume, 1);

EntityItem item = new EntityItem(this.world, this.posX, this.posY, this.posZ, new ItemStack(Registry.fallenStar));
item.getEntityData().setBoolean(Nyx.ID + ":fallen_star", true);
this.world.spawnEntity(item);
this.setDead();
} else {
if (this.ticksExisted % 40 == 0)
this.world.playSound(null, this.posX, this.posY, this.posZ, Registry.fallingStarSound, SoundCategory.AMBIENT, 5, 1);
this.playSound(Registry.fallingStarSound, (float) Config.fallingStarAmbientVolume, 1);
}
} else {
for (int i = 0; i < 2; i++) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/de/ellpeck/nyx/events/Events.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public static void onPlayerTick(TickEvent.PlayerTickEvent event) {
entity.attackEntityFrom(source, damage);
entity.motionY = 1;
}
player.world.playSound(null, player.getPosition(), Registry.hammerEndSound, SoundCategory.PLAYERS, 1, 1);
player.playSound(Registry.hammerEndSound, 1, 1);
}
}
player.getEntityData().removeTag(Nyx.ID + ":leap_start");
Expand Down
13 changes: 7 additions & 6 deletions src/main/java/de/ellpeck/nyx/items/Scythe.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import net.minecraft.util.EnumHand;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.common.IPlantable;
import net.minecraftforge.event.ForgeEventFactory;
Expand Down Expand Up @@ -63,12 +64,12 @@ public boolean onBlockStartBreak(ItemStack itemstack, BlockPos pos, EntityPlayer
if (worldIn.rand.nextFloat() > chance)
continue;
// increase drop amount by chance
if (worldIn.rand.nextFloat() <= 0.6F) {
multCount(drop, 2);
} else if (worldIn.rand.nextFloat() <= 0.4F) {
multCount(drop, 3);
} else if (worldIn.rand.nextFloat() <= 0.2F) {
multCount(drop, 4);
for (String s : Config.scytheDropChances) {
String[] split = s.split(";");
if (worldIn.rand.nextDouble() <= MathHelper.getDouble(split[0], -1)) {
multCount(drop, MathHelper.getInt(split[1], 1));
break;
}
}
Block.spawnAsEntity(worldIn, offset, drop);
}
Expand Down

0 comments on commit daa4adc

Please sign in to comment.