Skip to content

Commit

Permalink
Add configs for annoying Kami features (#40)
Browse files Browse the repository at this point in the history
1. Kami/Ichor Leggings have had the "produce light" ability config'ed and disabled by default.
2. Kami/Ichor boots have had the "dirt into grass" ability config'ed but left enabled by default.

Just let me know if the general consensus would be that the dirt into grass should also be disabled by default and I'll swap that to default to false as well.
  • Loading branch information
TheUnderTaker11 authored May 21, 2024
1 parent 8ce7293 commit 2633f75
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pluginManagement {
}

plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.21'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.22'
}


Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public final class ConfigHandler {
public static int netherDimensionID;
public static int endDimensionID;
public static int bedrockDimensionID = 19;
public static boolean shouldKamiLegsDoLightFeature = false;
public static boolean shouldKamiBootsDoGrass = true;

public static int soulHeartHeight;

Expand Down Expand Up @@ -228,6 +230,16 @@ public static void loadConfig(File configFile) {
-1023,
1023,
"The Dimension ID for the End, leave at 1 if you don't modify it with another mod/plugin.");
shouldKamiLegsDoLightFeature = config.getBoolean(
"Kami Leggings Light Placing Feature Enabled",
"general.kami",
shouldKamiLegsDoLightFeature,
"Sets if Legs of the Burning Mantle (Awakened Kami leggings) will do the effect where it places lights near you.");
shouldKamiBootsDoGrass = config.getBoolean(
"Kami Boots Dirt into Grass Feature Enabled",
"general.kami",
shouldKamiBootsDoGrass,
"Sets if Boots of the Horizontal Shield (Awakened Kami Boots) will do the effect where dirt under you turns into grass.");
}

LibEnchantIDs.idAscentBoost = loadEnchant(LibEnchantNames.ASCENT_BOOST, LibEnchantIDs.idAscentBoost);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ void tickPlayer(EntityPlayer player) {
player.jumpMovementFactor = player.isSprinting() ? 0.05F : 0.04F;
player.fallDistance = 0F;

int x = (int) player.posX;
int y = (int) player.posY - 1;
int z = (int) player.posZ;
if (player.worldObj.getBlock(x, y, z) == Blocks.dirt && player.worldObj.getBlockMetadata(x, y, z) == 0)
player.worldObj.setBlock(x, y, z, Blocks.grass, 0, 2);
if (ConfigHandler.shouldKamiBootsDoGrass) {
int x = (int) player.posX;
int y = (int) player.posY - 1;
int z = (int) player.posZ;
if (player.worldObj.getBlock(x, y, z) == Blocks.dirt && player.worldObj.getBlockMetadata(x, y, z) == 0)
player.worldObj.setBlock(x, y, z, Blocks.grass, 0, 2);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ void tickPlayer(EntityPlayer player) {

if (player.isBurning()) player.heal(0.5F);
addPotionEffect(player, Potion.fireResistance, 119, -1);
setNearBrightNitor(player);
if (ConfigHandler.shouldKamiLegsDoLightFeature) {
setNearBrightNitor(player);
}
}
}

Expand Down

0 comments on commit 2633f75

Please sign in to comment.