Skip to content

Commit

Permalink
Merge pull request #37 from Hephaestus-Dev/1.16.3
Browse files Browse the repository at this point in the history
Merge into Master
  • Loading branch information
Haven-King authored Nov 15, 2020
2 parents bd732ab + 3c7c733 commit b4ef626
Show file tree
Hide file tree
Showing 84 changed files with 2,177 additions and 486 deletions.
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,27 @@ A collection of small tweaks for Minecraft.
## Plant Tweaks
* Easy Harvest Crops - Right clicking fully grown clops harvests and replants them
* Easy Harvest Sugarcane - Right clicking sugarcane harvests all sugarcane higher than the one you clicked. Preserves the bottom-most block
* Sapling Succession - Saplings that fall on dirt or grass will automatically plant
* Grass Spreading - Grass and long grass spread naturally over time. Also removes hitboxes from grass and long grass. Seeds can be obtained by hoeing the ground under them
* Auto Planting - Plants that fall on dirt or grass will automatically plant. Applies to saplings, wheat seeds, pumpkin seeds, melon seeds, beetroot seeds, carrots, and potatoes
* Grass Spreading - Grass and long grass spread naturally over time
* Plant Hitboxes - Removes hitboxes from long grass. Hitboxes are shown when using shears. Seeds can be gathered by using a hoe on the ground below them
* Passable Leaves - Removes collision from leaves
* Better Lily Pads - Allows boats to pass through lily pads without breaking them. Also allows entities to rise through the bottom of a lily pad
* Farmer Villager Automation - Farmer villagers will deposit excess items into a nearby chest

## Animal Tweaks
* Animals Eat off the Ground - Chickens, cows, horeses, pigs, sheep, and wolves will eat off the ground
* Animals Eat off the Ground - Chickens, cows, horses, pigs, sheep, and wolves will eat off the ground
* Wild Wolves Breed - Wild wolves are able to be bred. Allows for some neat natural systems!

## Miscellaneous Tweaks
* Bubble Columns Flow - When set to On, bubble columns behave as they do in vanilla. When set to Off, bubble columns don't spread water to their surrounding blocks
* Burned Logs Drop Charcoal - When a log on fire burns, it drops a charcoal (Also makes charcoal fireproof)
* Double Doors - Doors and trapdoors open adjacent doors and trapdoors of the same type. Works when opened by hand or with redstone
* Editable Signs - No config for this one, just don't use it if you don't want it!
* Entity Ignition - Right click mobs with flint and steel to light them on fire
* Sturdy Lanterns - Gives lanterns a blast resistance of 6 (allows them to survive Ghast fireballs)
* Sturdy Lanterns - Gives lanterns a blast resistance of 6 (allows them to survive Ghast fireballs)
* Infinite Cauldrons - Right clicking a Cauldron with a Heart of the Sea creates an infinite water source
* Easy XP - All vanilla XP sources give their XP directly to the player that earns them (other than the Ender Dragon)
* Tinted Tipped Arrows - The heads of tipped arrows render the color of their status effect

## Contact Me
I can be found hanging out on the Fabric Discord as Haven King#2790. Feel free to shoot me a message there if you have any questions.
44 changes: 37 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.2.7-SNAPSHOT'
id 'fabric-loom' version '0.5-SNAPSHOT'
id 'maven-publish'
}

Expand All @@ -11,10 +11,22 @@ version = project.mod_version
group = project.maven_group

minecraft {
accessWidener = file("src/main/resources/tweaks.accesswidener")
}

repositories {
mavenLocal()
jcenter()
maven {
url = "https://www.cursemaven.com"
}
maven {
url = "http://maven.fabricmc.net/"
name = "Fabric"
}
maven {
url "https://hephaestus.dev/release"
}
}

dependencies {
Expand All @@ -24,15 +36,33 @@ dependencies {
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
compileOnly "com.google.code.findbugs:jsr305:3.0.2"

modImplementation "io.github.prospector:modmenu:${project.modmenu_version}"
modImplementation ("io.github.prospector:modmenu:${project.mod_menu_version}") {
exclude group: "net.fabricmc.fabric-api"
}

modImplementation ("dev.hephaestus:climbable:${project.climbable_version}")
include "dev.hephaestus:climbable:${project.climbable_version}"


modApi "me.shedaniel.cloth:config-2:${project.cloth_config_2_version}"
include "me.shedaniel.cloth:config-2:${project.cloth_config_2_version}"
// modImplementation ("net.fabricmc:fabric-language-kotlin:1.3.72+build.1") {
// exclude group: "net.fabricmc.fabric-api"
// }
// modImplementation "curse.maven:sodium:3003093"
// modImplementation "curse.maven:lithium:3000628"

modApi ("me.shedaniel.cloth:config-2:${project.cloth_config_version}") {
exclude group: "net.fabricmc.fabric-api"
}

include "me.shedaniel.cloth:config-2:${project.cloth_config_version}"

modImplementation ("me.sargunvohra.mcmods:autoconfig1u:${project.auto_config_version}") {
exclude group: "net.fabricmc.fabric-api"
}

modCompile "me.sargunvohra.mcmods:autoconfig1u:${project.autoconfig1u_version}"
include "me.sargunvohra.mcmods:autoconfig1u:${project.autoconfig1u_version}"
include "me.sargunvohra.mcmods:autoconfig1u:${project.auto_config_version}"

modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
}

processResources {
Expand Down
23 changes: 13 additions & 10 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
org.gradle.jvmargs = -Xmx1G

#Fabric properties
minecraft_version = 1.15.2
yarn_mappings = 1.15.2+build.15
loader_version = 0.8.2+build.194
minecraft_version = 1.16.3
yarn_mappings = 1.16.3+build.11
loader_version = 0.10.0+local

#Mod properties
mod_version = 1.0.7
maven_group = dev.hephaestus
archives_base_name = tinytweaks
mod_version = 1.0.16
maven_group = dev.hephaestus
archives_base_name = tinytweaks

#Dependencies
fabric_api_version = 0.7.1+build.301-1.15
modmenu_version = 1.10.2+build.32
cloth_config_2_version = 2.13.2
autoconfig1u_version = 2.0.1
fabric_version = 0.21.0+build.407-1.16
cloth_config_version = 4.8.1
auto_config_version = 3.2.2
climbable_version = 0.2.0

# Dev Mods
mod_menu_version = 1.14.6+build.31
10 changes: 7 additions & 3 deletions src/main/java/dev/hephaestus/tweaks/Tweaks.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dev.hephaestus.tweaks;

import dev.hephaestus.climbable.api.ClimbingSpeedRegistry;
import dev.hephaestus.tweaks.block.Moistener;
import dev.hephaestus.tweaks.client.render.block.entity.BarrelBlockLabelRenderer;
import me.sargunvohra.mcmods.autoconfig1u.AutoConfig;
Expand All @@ -9,18 +10,19 @@
import net.fabricmc.fabric.api.client.rendereregistry.v1.BlockEntityRendererRegistry;
import net.minecraft.block.Blocks;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.state.property.BooleanProperty;
import net.minecraft.tag.BlockTags;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class Tweaks implements ModInitializer, ClientModInitializer {

public static Logger LOGGER = LogManager.getLogger();
public static final Logger LOGGER = LogManager.getLogger();

public static final String MOD_ID = "tinytweaks";
public static final String MOD_NAME = "TinyTweaks";

public static final double LILY_PAD_MOD = 0.2109375D /* 27 / 128 */;
public static final double LILY_PAD_MOD = 0.2109375D;

public static TweaksConfig CONFIG = new TweaksConfig();

Expand All @@ -38,6 +40,8 @@ public void onInitialize() {
Moistener.canMoisten(Blocks.STONE_BRICK_SLAB, Blocks.MOSSY_STONE_BRICK_SLAB);
Moistener.canMoisten(Blocks.STONE_BRICK_STAIRS, Blocks.MOSSY_STONE_BRICK_STAIRS);
Moistener.canMoisten(Blocks.STONE_BRICK_WALL, Blocks.MOSSY_STONE_BRICK_WALL);

ClimbingSpeedRegistry.registerClimbableTag(BlockTags.LOGS, e -> CONFIG.leaves.treeClimbingSpeed, e -> CONFIG.leaves.climb);
}

public static void log(Level level, String message, Object... args){
Expand Down
77 changes: 71 additions & 6 deletions src/main/java/dev/hephaestus/tweaks/TweaksConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ public class TweaksConfig implements ConfigData {
public boolean easyHarvestSugarcane = true;

@ConfigEntry.Category("plants")
@ConfigEntry.Gui.Tooltip
public boolean saplingsAutoPlant = true;
@ConfigEntry.Gui.CollapsibleObject
public AutoPlanting autoPlanting = new AutoPlanting();

@ConfigEntry.Category("plants")
@ConfigEntry.Gui.CollapsibleObject
Expand Down Expand Up @@ -49,6 +49,19 @@ public class TweaksConfig implements ConfigData {
@ConfigEntry.Gui.Tooltip
public boolean breedWildWolves = true;

// - Nether! --------------------------------------------------------------
@ConfigEntry.Category("nether")
@ConfigEntry.Gui.CollapsibleObject
public NetherRejuvenation netherRejuvenation = new NetherRejuvenation();

@ConfigEntry.Category("nether")
@ConfigEntry.Gui.Tooltip(count = 2)
public boolean blueSoulFireEffects = true;

@ConfigEntry.Category("nether")
@ConfigEntry.Gui.Tooltip(count = 2)
public boolean soulFireDoesMoreDamage = false;

// - Miscellaneous! -------------------------------------------------------
@ConfigEntry.Category("misc")
@ConfigEntry.Gui.CollapsibleObject
Expand All @@ -63,23 +76,70 @@ public class TweaksConfig implements ConfigData {
public NamesAndThings namesAndThings = new NamesAndThings();

@ConfigEntry.Category("misc")
@ConfigEntry.Gui.Tooltip(count = 2)
@ConfigEntry.Gui.Tooltip(count = 4)
public boolean mossyThings = true;

@ConfigEntry.Category("debug")
public boolean grassDestroysRedstoneTorches = false;
@ConfigEntry.Category("misc")
public boolean burningLogsDropCharcoal = true;

@ConfigEntry.Category("misc")
@ConfigEntry.Gui.Tooltip(count = 2)
public boolean doubleDoors = true;

@ConfigEntry.Category("misc")
public boolean bubbleColumnsFlow = false;

@ConfigEntry.Category("misc")
@ConfigEntry.Gui.Tooltip
public boolean infiniteCauldrons = true;

@ConfigEntry.Category("misc")
@ConfigEntry.Gui.Tooltip(count = 2)
public boolean easyXp = true;

public static class AutoPlanting {
@ConfigEntry.Gui.Tooltip(count = 4)
public boolean enabled = true;

@ConfigEntry.Gui.Tooltip
public int delay = 20;
}

public static class Rejuvenation {
@ConfigEntry.Gui.Tooltip
public boolean enabled = true;

@ConfigEntry.Gui.Tooltip
public double grassGrowthRate = 0.0125D;

@ConfigEntry.Gui.Tooltip(count = 5)
public double thePowerOfFriendship = 1.25;

@ConfigEntry.Gui.Tooltip(count = 2)
public float longGrass = 0.01f;
public float longGrass = 0.01F;

@ConfigEntry.Gui.Tooltip
public boolean saplings = true;
}

public static class NetherRejuvenation {
@ConfigEntry.Gui.Tooltip(count = 2)
public boolean enabled = true;

@ConfigEntry.Gui.Tooltip
public double rootsGrowthRate = 0.0125D;

@ConfigEntry.Gui.Tooltip(count = 5)
public double thePowerOfFriendship = 1.25;

@ConfigEntry.Gui.Tooltip(count = 2)
@ConfigEntry.BoundedDiscrete(min = 0, max = 100)
public int sproutRootsRatio = 75;

@ConfigEntry.Gui.Tooltip(count = 2)
public double vinesChance = 0.01;
}

public static class LeavesConfig {
public boolean collide = false;
@ConfigEntry.Gui.Tooltip
Expand All @@ -88,7 +148,12 @@ public static class LeavesConfig {
@ConfigEntry.Gui.Tooltip
public boolean slow = true;

public double slowAmount = 0.75D;

public boolean climb = true;

@ConfigEntry.Gui.Tooltip(count = 2)
public double treeClimbingSpeed = 0.75D;
}

public static class FlintAndSteelConfig {
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/dev/hephaestus/tweaks/block/Moistener.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@ public static BlockState dry(BlockState blockState) {
public static void canMoisten(Block in, Block out) {
CONVERTIBLE.put(in, out);
}

public static boolean canMoisten(Block block) {
return CONVERTIBLE.containsKey(block) || CONVERTIBLE.inverse().containsKey(block);
}
}
28 changes: 28 additions & 0 deletions src/main/java/dev/hephaestus/tweaks/block/PlayerProvider.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package dev.hephaestus.tweaks.block;

import net.minecraft.server.network.ServerPlayerEntity;

public interface PlayerProvider {
ThreadLocal<PlayerProvider> STATIC = new ThreadLocal<>();

static void init() {
if (STATIC.get() == null) {
STATIC.set(new PlayerProvider() {
private ServerPlayerEntity playerEntity = null;

@Override
public ServerPlayerEntity getPlayer() {
return this.playerEntity;
}

@Override
public void setPlayer(ServerPlayerEntity player) {
this.playerEntity = player;
}
});
}
}

ServerPlayerEntity getPlayer();
void setPlayer(ServerPlayerEntity player);
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,7 @@ public class LabelRenderer {
private static final Quaternion rotate180 = new Quaternion(yAxis, 180, true);
private static final Quaternion rotate270 = new Quaternion(yAxis, 270, true);

static boolean test = true;
public static void renderLabel(LockableContainerBlockEntity blockEntity, BlockEntityRenderDispatcher dispatcher, MatrixStack matrices, VertexConsumerProvider vertexConsumers, boolean open, Direction facing) {
if (test) {
BlockState state = Blocks.STONE.getDefaultState();
BakedModel model = MinecraftClient.getInstance().getBlockRenderManager().getModel(state);
List<BakedQuad> quads = model.getQuads(state, null, new Random());

test = false;
}
if (!blockEntity.hasCustomName() && MinecraftClient.getInstance().getNetworkHandler() != null) {
MinecraftClient.getInstance().getNetworkHandler().getDataQueryHandler().queryBlockNbt(blockEntity.getPos(), (tag) -> {
if (tag.contains("CustomName", 8)) {
Expand Down Expand Up @@ -97,7 +89,7 @@ else if (dispatcher.crosshairTarget.getType() == HitResult.Type.BLOCK){
TextRenderer textRenderer = dispatcher.getTextRenderer();
String string = blockEntity.getName().asString();

float s = (float) (-textRenderer.getStringWidth(string) / 2);
float s = (float) (-textRenderer.getWidth(string) / 2);
textRenderer.draw(string, s, 0f, 16777215, true, matrices.peek().getModel(), vertexConsumers, false, 0, 15728880);
matrices.pop();
}
Expand Down Expand Up @@ -177,7 +169,7 @@ public static void renderLabel(LockableContainerBlockEntity blockEntity, BlockEn
TextRenderer textRenderer = dispatcher.getTextRenderer();
String string = blockEntity.getName().asString();

float s = (float) (-textRenderer.getStringWidth(string) / 2);
float s = (float) (-textRenderer.getWidth(string) / 2);
textRenderer.draw(string, s, 0f, 16777215, true, matrices.peek().getModel(), vertexConsumers, false, 0, 15728880);
matrices.pop();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package dev.hephaestus.tweaks.entity.ai.goal;

import dev.hephaestus.tweaks.Tweaks;
import jdk.internal.jline.internal.Nullable;
import net.minecraft.entity.ItemEntity;
import net.minecraft.entity.ai.goal.Goal;
import net.minecraft.entity.passive.AnimalEntity;
Expand Down Expand Up @@ -32,7 +31,7 @@ public GroundFoodMateGoal(AnimalEntity animal, Ingredient food) {
}

public boolean canStart() {
if (Tweaks.CONFIG.animalsEatOffGround && this.animal.getEntityWorld().getGameRules().getBoolean(GameRules.MOB_GRIEFING) && this.animal.canEat() && this.animal.getBreedingAge() == 0) {
if (Tweaks.CONFIG.animalsEatOffGround && this.animal.getEntityWorld().getGameRules().getBoolean(GameRules.DO_MOB_GRIEFING) && this.animal.canEat() && this.animal.getBreedingAge() == 0) {
this.foodEntity = this.findFood();
}

Expand All @@ -57,9 +56,8 @@ public void tick() {
}
}

@Nullable
private ItemEntity findFood() {
List<ItemEntity> list = animal.world.getEntities(ItemEntity.class, this.animal.getBoundingBox().expand(8.0D), null);
List<ItemEntity> list = animal.world.getEntitiesByClass(ItemEntity.class, this.animal.getBoundingBox().expand(8.0D), null);
double d = Double.MAX_VALUE;

ItemEntity result = null;
Expand Down
Loading

0 comments on commit b4ef626

Please sign in to comment.