Skip to content

Commit

Permalink
Fixed mossy things turning not mossy in the sun even if adjacent to w…
Browse files Browse the repository at this point in the history
…ater. Removed free renames. Tree climbing is configurable.
  • Loading branch information
Haven-King committed May 28, 2020
1 parent 989427e commit bd732ab
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/main/java/dev/hephaestus/tweaks/TweaksConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ public static class LeavesConfig {

@ConfigEntry.Gui.Tooltip
public boolean slow = true;

public boolean climb = true;
}

public static class FlintAndSteelConfig {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dev.hephaestus.tweaks.mixin.entity;

import dev.hephaestus.tweaks.Tweaks;
import net.minecraft.block.BlockState;
import net.minecraft.block.LeavesBlock;
import net.minecraft.block.LogBlock;
Expand All @@ -25,13 +26,15 @@ public void onIsClimbing(CallbackInfoReturnable<Boolean> info, BlockState state)
BlockPos pos = this.getBlockPos();

if ((state.getBlock() instanceof LeavesBlock || world.getBlockState(pos.up()).getBlock() instanceof LeavesBlock)) {
boolean logsAdjacent =
world.getBlockState(pos.north()).getBlock() instanceof LogBlock ||
world.getBlockState(pos.east()).getBlock() instanceof LogBlock ||
world.getBlockState(pos.south()).getBlock() instanceof LogBlock ||
world.getBlockState(pos.west()).getBlock() instanceof LogBlock;
if (Tweaks.CONFIG.leaves.climb) {
boolean logsAdjacent =
world.getBlockState(pos.north()).getBlock() instanceof LogBlock ||
world.getBlockState(pos.east()).getBlock() instanceof LogBlock ||
world.getBlockState(pos.south()).getBlock() instanceof LogBlock ||
world.getBlockState(pos.west()).getBlock() instanceof LogBlock;

info.setReturnValue(logsAdjacent);
info.setReturnValue(logsAdjacent);
}
}
}
}
3 changes: 3 additions & 0 deletions src/main/resources/assets/tinytweaks/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"text.autoconfig.tinytweaks.option.leaves.collide": "Leaf Collision",
"text.autoconfig.tinytweaks.option.leaves.slow": "Leaves Slow",
"text.autoconfig.tinytweaks.option.leaves.slow.@Tooltip": "Leaves slow non-item entities passing through them",
"text.autoconfig.tinytweaks.option.leaves.climb": "Climbable Trees",
"text.autoconfig.tinytweaks.option.leaves.persistentCollide": "Persistent Leaf Collision",
"text.autoconfig.tinytweaks.option.leaves.persistentCollide.@Tooltip": "These are leaves placed by the player",
"text.autoconfig.tinytweaks.option.namesAndThings": "Names and Things",
Expand Down Expand Up @@ -73,6 +74,7 @@
"text.autoconfig.tinytweaks.option.leaves.collide.boolean.true": "§aOn",
"text.autoconfig.tinytweaks.option.leaves.slow.boolean.true": "§aOn",
"text.autoconfig.tinytweaks.option.leaves.persistentCollide.boolean.true": "§aOn",
"text.autoconfig.tinytweaks.option.leaves.climb.boolean.true": "§aOn",
"text.autoconfig.tinytweaks.option.mossyThings.boolean.true": "§aOn",
"text.autoconfig.tinytweaks.option.easyHarvestCrops.boolean.false": "§cOff",
"text.autoconfig.tinytweaks.option.easyHarvestSugarcane.boolean.false": "§cOff",
Expand All @@ -92,5 +94,6 @@
"text.autoconfig.tinytweaks.option.leaves.collide.boolean.false": "§cOff",
"text.autoconfig.tinytweaks.option.leaves.slow.boolean.false": "§cOff",
"text.autoconfig.tinytweaks.option.leaves.persistentCollide.boolean.false": "§cOff",
"text.autoconfig.tinytweaks.option.leaves.climb.boolean.false": "§cOff",
"text.autoconfig.tinytweaks.option.mossyThings.boolean.false": "§cOff"
}

0 comments on commit bd732ab

Please sign in to comment.