Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/1.19.3-fabric' into 1.20-fabric
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/publish.yml
#	gradle.properties
#	src/main/java/me/melontini/goodtea/behaviors/TeaBehavior.java
#	src/main/java/me/melontini/goodtea/util/GoodTeaStuff.java
  • Loading branch information
melontini committed Aug 14, 2023
2 parents b365ad4 + a79fe54 commit 54b7717
Show file tree
Hide file tree
Showing 23 changed files with 121 additions and 148 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: publish
on:
push:
tags:
- 'v*'
on: [workflow_dispatch]

jobs:
publish:
Expand All @@ -26,15 +23,14 @@ jobs:
echo "VERSION_INFORMATION=$(${{github.workspace}}/gradlew -q printVersionName)" >> $GITHUB_ENV
echo "VERSION_PLAIN=$(${{github.workspace}}/gradlew -q printVersion)" >> $GITHUB_ENV
- name: Publish Minecraft Mods
uses: Kir-Antipov/mc-publish@v3.2
uses: Kir-Antipov/mc-publish@v3.3
with:
version-type: beta
changelog-file: CHANGELOG.md
name: ${{ env.VERSION_INFORMATION }}
version: ${{ env.VERSION_PLAIN }}

game-versions: |
1.20
1.20.1
loaders: |
Expand All @@ -43,14 +39,20 @@ jobs:
java: |
17
github-tag: v${{ env.VERSION_PLAIN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
github-prerelease: false

modrinth-id: fLAsXzkA
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
modrinth-featured: true
modrinth-unfeature-mode: subset
modrinth-dependencies: |
fabric-api | depends | *
fabric-api(required)
dark-matter(embedded)
curseforge-id: 825157
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
curseforge-dependencies: |
fabric-api | depends | *
fabric-api(required)
dark-matter(embedded)
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## What's new:

* The kettle now uses cutout rendering instead of translucent.
* CrackerUtil -> Dark Matter
* Switched from Accessor and Invokers to AWs.
* Updated Dark Matter, Fabric API and Loader.
15 changes: 10 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'fabric-loom' version '0.12-SNAPSHOT'
id 'fabric-loom' version '1.3-SNAPSHOT'
id 'maven-publish'
id 'io.github.juuxel.loom-quiltflower' version '1.7.+'
id 'io.github.juuxel.loom-vineflower' version '1.11.+'
}

version = project.mod_version
Expand Down Expand Up @@ -43,9 +43,14 @@ dependencies {
// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

modImplementation include("me.melontini.dark-matter:dark-matter-base:${project.dark_matter}")
modImplementation include("me.melontini.dark-matter:dark-matter-minecraft:${project.dark_matter}")
modImplementation include("me.melontini.dark-matter:dark-matter-content:${project.dark_matter}")
def dmModules = ["base", "minecraft", "content"]
for (final def module in dmModules) {
modApi include("me.melontini.dark-matter:dark-matter-${module}:${project.dark_matter}")
}
}

loom {
accessWidenerPath = file("src/main/resources/good-tea.accesswidener")
}

processResources {
Expand Down
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ systemProp.org.gradle.internal.http.socketTimeout=180000
org.gradle.jvmargs=-Xmx2G
# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.20
yarn_mappings=1.20+build.1
loader_version=0.14.21
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.10
loader_version=0.14.22
# Mod Properties
mod_version=0.3.3-1.19.3
mod_version=0.4.0-1.20
maven_group=me.melontini
archives_base_name=good-tea
# Dependencies
# check this on https://modmuss50.me/fabric.html
fabric_version=0.83.0+1.20
fabric_version=0.87.0+1.20.1
kahur_version=1.27
dark_matter=v0.6.1-1.20
dark_matter=b189c32b42
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 4 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
30 changes: 22 additions & 8 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,13 +80,10 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}

# 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"'
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,22 +130,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
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
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -193,6 +197,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 All @@ -205,6 +213,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
15 changes: 9 additions & 6 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,7 +25,8 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand All @@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand Down Expand Up @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/me/melontini/goodtea/GoodTea.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package me.melontini.goodtea;

import me.melontini.dark_matter.util.PrependingLogger;
import me.melontini.dark_matter.api.base.util.PrependingLogger;
import me.melontini.goodtea.behaviors.KahurCompat;
import me.melontini.goodtea.behaviors.KettleBehaviour;
import me.melontini.goodtea.behaviors.TeaBehavior;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package me.melontini.goodtea.behaviors;

import me.melontini.dark_matter.util.MakeSure;
import me.melontini.dark_matter.api.base.util.MakeSure;
import me.melontini.goodtea.GoodTea;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
Expand Down
29 changes: 11 additions & 18 deletions src/main/java/me/melontini/goodtea/behaviors/TeaBehavior.java
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
package me.melontini.goodtea.behaviors;

import me.melontini.dark_matter.minecraft.util.TextUtil;
import me.melontini.dark_matter.util.MakeSure;
import me.melontini.dark_matter.util.MathStuff;
import me.melontini.dark_matter.util.Utilities;
import me.melontini.dark_matter.api.base.util.MakeSure;
import me.melontini.dark_matter.api.base.util.MathStuff;
import me.melontini.dark_matter.api.base.util.Utilities;
import me.melontini.dark_matter.api.minecraft.util.TextUtil;
import me.melontini.goodtea.GoodTea;
import me.melontini.goodtea.ducks.ChorusAccess;
import me.melontini.goodtea.ducks.CraftingScreenAllowanceAccess;
import me.melontini.goodtea.ducks.DivineAccess;
import me.melontini.goodtea.ducks.HoglinRepellentAccess;
import me.melontini.goodtea.mixin.BucketItemAccessor;
import me.melontini.goodtea.mixin.GoatHornItemAccessor;
import me.melontini.goodtea.mixin.PotionEntityAccessor;
import me.melontini.goodtea.mixin.SpongeBlockAccessor;
import net.minecraft.block.BedBlock;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.FlowerBlock;
import net.minecraft.block.*;
import net.minecraft.client.item.TooltipContext;
import net.minecraft.entity.Bucketable;
import net.minecraft.entity.Entity;
Expand Down Expand Up @@ -115,7 +108,7 @@ public void init() {

addBehavior(Items.AXOLOTL_BUCKET, (entity, stack) -> {
entity.addStatusEffect(new StatusEffectInstance(StatusEffects.REGENERATION, 100, 0));
var bucketEntity = ((BucketItemAccessor) Items.AXOLOTL_BUCKET).gt$getEntityType().spawnFromItemStack((ServerWorld) entity.world, stack, null, new BlockPos((int) entity.getX(), (int) entity.getEyePos().y, (int) entity.getZ()), SpawnReason.BUCKET, true, false);
var bucketEntity = ((EntityBucketItem)Items.AXOLOTL_BUCKET).entityType.spawnFromItemStack((ServerWorld) entity.world, stack, null, new BlockPos((int) entity.getX(), (int) entity.getEyePos().y, (int) entity.getZ()), SpawnReason.BUCKET, true, false);
if (bucketEntity instanceof Bucketable bucketable) {
bucketable.copyDataFromNbt(stack.getOrCreateNbt());
bucketable.setFromBucket(true);
Expand Down Expand Up @@ -179,7 +172,7 @@ public void init() {
boolean bl = potion == Potions.WATER && list1.isEmpty();

if (bl) this.damageEntitiesHurtByWater(potionEntity);
else if (!list1.isEmpty()) ((PotionEntityAccessor) potionEntity).gt$applySplashPotion(list1, entity);
else if (!list1.isEmpty()) potionEntity.applySplashPotion(list1, entity);

int i = potion.hasInstantEffect() ? WorldEvents.INSTANT_SPLASH_POTION_SPLASHED : WorldEvents.SPLASH_POTION_SPLASHED;
entity.world.syncWorldEvent(i, entity.getBlockPos(), PotionUtil.getColor(stack));
Expand All @@ -202,7 +195,7 @@ public void init() {
boolean bl = potion == Potions.WATER && list1.isEmpty();

if (bl) this.damageEntitiesHurtByWater(potionEntity);
else if (!list1.isEmpty()) ((PotionEntityAccessor) potionEntity).gt$applyLingeringPotion(stack, potion);
else if (!list1.isEmpty()) potionEntity.applyLingeringPotion(stack, potion);

int i = potion.hasInstantEffect() ? WorldEvents.INSTANT_SPLASH_POTION_SPLASHED : WorldEvents.SPLASH_POTION_SPLASHED;
entity.world.syncWorldEvent(i, entity.getBlockPos(), PotionUtil.getColor(stack));
Expand All @@ -211,7 +204,7 @@ public void init() {
});

addBehavior(Items.SPONGE, (entity, stack) -> {
if (((SpongeBlockAccessor) Blocks.SPONGE).gt$absorbWater(entity.world, entity.getBlockPos())) {
if (((SpongeBlock) Blocks.SPONGE).absorbWater(entity.world, entity.getBlockPos())) {
ItemScatterer.spawn(entity.world, entity.getX(), entity.getY(), entity.getZ(), new ItemStack(Items.WET_SPONGE));
} else {
ItemScatterer.spawn(entity.world, entity.getX(), entity.getY(), entity.getZ(), new ItemStack(Items.SPONGE));
Expand Down Expand Up @@ -243,7 +236,7 @@ public void init() {
addBehavior((entity, stack) -> entity.addStatusEffect(new StatusEffectInstance(StatusEffects.GLOWING, 1200, 0)), Items.OCHRE_FROGLIGHT, Items.PEARLESCENT_FROGLIGHT, Items.VERDANT_FROGLIGHT);

addBehavior(Items.GOAT_HORN, (entity, stack) -> {
((GoatHornItemAccessor) Items.GOAT_HORN).gt$getInstrument(stack).ifPresent(registryEntry -> {
((GoatHornItem)Items.GOAT_HORN).getInstrument(stack).ifPresent(registryEntry -> {
Instrument instrument = (Instrument) ((RegistryEntry<?>) registryEntry).value();
SoundEvent soundEvent = instrument.soundEvent().value();
float f = instrument.range() / 16.0F;
Expand Down Expand Up @@ -294,7 +287,7 @@ public void initAuto() {
}
if (item instanceof EntityBucketItem entityBucketItem) {
if (item != Items.AXOLOTL_BUCKET) addBehavior(item, (entity, stack) -> {
var bucketEntity = ((BucketItemAccessor) entityBucketItem).gt$getEntityType().spawnFromItemStack((ServerWorld) entity.world, stack, null, new BlockPos((int) entity.getX(), (int) entity.getEyePos().y, (int) entity.getZ()), SpawnReason.BUCKET, true, false);
var bucketEntity = entityBucketItem.entityType.spawnFromItemStack((ServerWorld) entity.world, stack, null, new BlockPos((int) entity.getX(), (int) entity.getEyePos().y, (int) entity.getZ()), SpawnReason.BUCKET, true, false);
if (bucketEntity instanceof Bucketable bucketable) {
bucketable.copyDataFromNbt(stack.getOrCreateNbt());
bucketable.setFromBucket(true);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package me.melontini.goodtea.blocks.entity;

import me.melontini.dark_matter.content.data.NBTUtil;
import me.melontini.dark_matter.content.data.NbtBuilder;
import me.melontini.dark_matter.minecraft.util.TextUtil;
import me.melontini.dark_matter.api.minecraft.data.NbtBuilder;
import me.melontini.dark_matter.api.minecraft.data.NbtUtil;
import me.melontini.dark_matter.api.minecraft.util.TextUtil;
import me.melontini.goodtea.behaviors.KettleBehaviour;
import me.melontini.goodtea.blocks.KettleBlock;
import me.melontini.goodtea.screens.KettleScreenHandler;
Expand Down Expand Up @@ -221,7 +221,7 @@ public void readNbt(NbtCompound nbt) {
this.time = nbt.getInt("Time");
waterStorage.variant = FluidVariant.fromNbt(nbt.getCompound("fluidVariant"));
waterStorage.amount = nbt.getLong("amount");
NBTUtil.readInventoryFromNbt(nbt, this);
NbtUtil.readInventoryFromNbt(nbt, this);
}

@Override
Expand All @@ -230,7 +230,7 @@ protected void writeNbt(NbtCompound nbt) {
nbt.putInt("Time", this.time);
nbt.put("fluidVariant", waterStorage.variant.toNbt());
nbt.putLong("amount", waterStorage.amount);
NBTUtil.writeInventoryToNbt(nbt, this);
NbtUtil.writeInventoryToNbt(nbt, this);
}

@Nullable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package me.melontini.goodtea.client.screens;

import com.mojang.blaze3d.systems.RenderSystem;
import me.melontini.dark_matter.minecraft.client.util.DrawUtil;
import me.melontini.dark_matter.minecraft.util.TextUtil;
import me.melontini.dark_matter.api.minecraft.client.util.DrawUtil;
import me.melontini.dark_matter.api.minecraft.util.TextUtil;
import me.melontini.goodtea.screens.KettleScreenHandler;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.ingame.HandledScreen;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/me/melontini/goodtea/items/TeaMugItem.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.melontini.goodtea.items;

import me.melontini.dark_matter.minecraft.util.TextUtil;
import me.melontini.dark_matter.util.MakeSure;
import me.melontini.dark_matter.api.base.util.MakeSure;
import me.melontini.dark_matter.api.minecraft.util.TextUtil;
import me.melontini.goodtea.behaviors.TeaBehavior;
import net.minecraft.advancement.criterion.Criteria;
import net.minecraft.block.Block;
Expand Down
Loading

0 comments on commit 54b7717

Please sign in to comment.