Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for effects.food instead of effects.potions config when adding status effects to food tooltip #115

Open
wants to merge 4 commits into
base: 1.20
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.quiltmc.loom' version '1.2.+'
id 'org.quiltmc.loom' version '1.3.+'
id 'java-library'
id 'maven-publish'
id 'org.quiltmc.gradle.licenser' version '2.0.+'
Expand All @@ -9,7 +9,7 @@ plugins {

group = project.maven_group
version = "${project.mod_version}+${getMCVersionString()}"
archivesBaseName = project.archives_base_name
base.archivesName = project.archives_base_name

def targetJavaVersion = 17

Expand Down Expand Up @@ -107,7 +107,7 @@ processResources {

jar {
from('LICENSE') {
rename { "${it}_${project.archivesBaseName}" }
rename { "${it}_${project.base.archivesName.get()}" }
}
}

Expand Down
9 changes: 5 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
org.gradle.jvmargs=-Xmx1G
org.gradle.parallel=true

# Fabric properties
minecraft_version=1.20
quilt_mappings=1
loader_version=0.18.5
minecraft_version=1.20.1
quilt_mappings=23
loader_version=0.20.2

qsl_version=6.0.1
qsl_version=6.1.1

# Mod properties
mod_version=1.8.1
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
19 changes: 12 additions & 7 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,26 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -197,6 +198,10 @@ if "$cygwin" || "$msys" ; then
done
fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/github/queerbric/inspecio/Inspecio.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
import io.github.queerbric.inspecio.api.InspecioEntrypoint;
import io.github.queerbric.inspecio.api.InventoryProvider;
import net.minecraft.block.Block;
import net.minecraft.block.DispenserBlock;
import net.minecraft.block.HopperBlock;
import net.minecraft.block.ShulkerBoxBlock;
import net.minecraft.block.dispenser.DispenserBlock;
import net.minecraft.entity.effect.StatusEffect;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.inventory.Inventories;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.mojang.serialization.JsonOps;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import net.minecraft.block.*;
import net.minecraft.block.dispenser.DispenserBlock;
import net.minecraft.util.math.MathHelper;
import org.jetbrains.annotations.Nullable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ private void getTooltipData(CallbackInfoReturnable<Optional<TooltipData>> info)
datas.add(new FoodTooltipComponent(comp));
}

if (config.getEffectsConfig().hasPotions()) {
if (config.getEffectsConfig().hasFood()) {
if (stack.isIn(Inspecio.HIDDEN_EFFECTS_TAG)) {
datas.add(new StatusEffectTooltipComponent());
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
import com.mojang.blaze3d.vertex.VertexConsumer;
import io.github.queerbric.inspecio.Inspecio;
import io.github.queerbric.inspecio.SignTooltipMode;
import net.minecraft.block.AbstractSignBlock;
import net.minecraft.block.entity.SignText;
import net.minecraft.block.sign.AbstractSignBlock;
import net.minecraft.block.sign.SignType;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.GuiGraphics;
Expand All @@ -49,7 +50,6 @@
import net.minecraft.text.Text;
import net.minecraft.util.DyeColor;
import net.minecraft.util.Identifier;
import net.minecraft.util.SignType;
import net.minecraft.util.math.Axis;
import org.joml.Matrix4f;
import org.quiltmc.qsl.tooltip.api.ConvertibleTooltipData;
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/quilt.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
"depends": [
{
"id": "minecraft",
"versions": "~1.20"
"versions": "~1.20.1"
},
{
"id": "quilt_loader",
"versions": ">=0.17.11"
"versions": "*"
},
"quilt_client_command",
"quilt_resource_loader",
Expand All @@ -48,4 +48,4 @@
]
},
"mixin": "inspecio.mixins.json"
}
}