10 changes: 6 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ val overweight_farming_version: String by extra
val farmers_delight_version: String by extra
val blueprint_version: String by extra
val neapolitan_version: String by extra
val cofh_core_version: String by extra
val thermal_foundation_version: String by extra
val thermal_expansion_version: String by extra
val thermal_cultivation_version: String by extra

plugins {
id("com.possible-triangle.gradle") version ("0.1.0")
id("com.possible-triangle.gradle") version ("0.1.1")
}

withKotlin()
Expand Down Expand Up @@ -112,9 +116,7 @@ tasks.withType<Jar> {
}

enablePublishing {
repositories {
githubPackages(project)
}
githubPackages()
}

uploadToCurseforge {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ maven_group=com.possible-triangle

kotlin_forge_version=3.12.0
flywheel_version=0.6.9-18
create_version=0.5.1.c-36
create_version=0.5.1.f-46
registrate_version=MC1.19-1.1.5

jei_version=11.6.0.1015
Expand Down
25 changes: 18 additions & 7 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 @@ -143,12 +140,16 @@ fi
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 +194,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 +210,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
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.possible_triangle.sliceanddice.mixins;

import com.google.common.base.Suppliers;
import com.possible_triangle.sliceanddice.compat.ModCompat;
import com.simibubi.create.content.contraptions.actors.harvester.HarvesterMovementBehaviour;
import net.minecraft.world.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyVariable;

import java.util.function.Supplier;

@Mixin(value = HarvesterMovementBehaviour.class, remap = false)
public class HarvesterMovementBehaviourMixin {

@Unique
private static final Supplier<ItemStack> sliceanddice$TOOL = Suppliers.memoize(ModCompat.INSTANCE::getHarvesterTool);

@ModifyVariable(
require = 0,
method = "visitNewPosition(Lcom/simibubi/create/content/contraptions/behaviour/MovementContext;Lnet/minecraft/core/BlockPos;)V",
at = @At(value = "STORE", ordinal = 0)
)
private ItemStack overwriteDefaultItem(ItemStack stack) {
return sliceanddice$TOOL.get();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class SlicerRenderer(context: BlockEntityRendererProvider.Context) : KineticBloc

val renderedHeadOffset = te.getRenderedHeadOffset(partialTicks)
val speed = te.getRenderedHeadRotationSpeed()
val time = AnimationTickHolder.getRenderTime(te.getLevel())
val time = AnimationTickHolder.getRenderTime(te.level)
val angle = time * speed * 6 / 10f % 360 / 180 * Math.PI.toFloat()

val poleRender = CachedBufferer.partial(AllPartialModels.MECHANICAL_MIXER_POLE, blockState)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class LazyMixingRecipe(params: ProcessingRecipeParams) : MixingRecipe(params) {
private fun fluidOf(ingredient: Ingredient): FluidStack {
if (!Configs.SERVER.REPLACE_FLUID_CONTAINERS.get()) return FluidStack.EMPTY
val fluids = ingredient.items.mapNotNull { stack ->
emptyingRecipes.find {
emptyingRecipes.filter { it.ingredients.isNotEmpty() }.find {
val required = it.ingredients[0]
required.test(stack)
}?.resultingFluid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.possible_triangle.sliceanddice.compat

import com.possible_triangle.sliceanddice.SliceAndDice
import net.minecraft.resources.ResourceLocation
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.Items
import net.minecraft.world.item.crafting.Recipe
import net.minecraft.world.level.ItemLike
Expand Down Expand Up @@ -33,6 +34,11 @@ object ModCompat : IRecipeInjector {
OverweightFarmingCompat.ifLoaded { injectRecipes(existing, add) }
}

val harvesterTool
get(): ItemStack? {
return ifLoaded(FARMERS_DELIGHT) { ModItems.IRON_KNIFE.get() }?.let(::ItemStack) ?: ItemStack.EMPTY
}

val exampleTool
get(): ItemLike {
return ifLoaded(FARMERS_DELIGHT) { ModItems.IRON_KNIFE.get() } ?: Items.IRON_AXE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.possible_triangle.sliceanddice.datagen

import com.google.gson.GsonBuilder
import com.google.gson.JsonObject
import com.possible_triangle.sliceanddice.PonderScenes
import com.possible_triangle.sliceanddice.SliceAndDice
Expand All @@ -14,6 +15,8 @@ private typealias LangProvider = () -> JsonObject

class LangGen(private val generator: DataGenerator) : DataProvider {

private val GSON = GsonBuilder().setPrettyPrinting().create()

companion object {
private val PARTIALS = listOf<LangProvider>(
fromResource("partials"),
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ issueTrackerURL = "https://github.com/${repository}/issues"
[[dependencies.${mod_id}]]
modId = "create"
mandatory = true
versionRange = "[0.5.1.a,)"
versionRange = "[0.5.1.f,)"
ordering = "NONE"
side = "BOTH"

Expand All @@ -36,4 +36,4 @@ issueTrackerURL = "https://github.com/${repository}/issues"
mandatory=true
versionRange="[3.9.1,)"
ordering="NONE"
side="BOTH"
side="BOTH"
17 changes: 17 additions & 0 deletions src/main/resources/assets/sliceanddice/lang/es_mx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"block.sliceanddice.fertilizer": "Fertilizante líquido",
"block.sliceanddice.slicer": "Rebanador",
"block.sliceanddice.sprinkler": "Regador",
"block.sliceanddice.wet_air": "Aire húmedo",
"fluid.sliceanddice.fertilizer": "Fertilizante líquido",
"item.sliceanddice.fertilizer_bucket": "Cubo de Fertilizante Líquido",
"sliceanddice.gui.contraptions.wrong_direction": "Parece que este %s está rotando en la _dirección incorrecta_.",
"sliceanddice.ponder.slicer.header": "Cortando con el rebanador",
"sliceanddice.ponder.slicer.text_1": "Haz clic derecho en él con una herramienta válida",
"sliceanddice.ponder.slicer.text_2": "El rebanador también puede operar en una pileta",
"sliceanddice.ponder.sprinkler/intro.header": "Rociando por encima",
"sliceanddice.ponder.sprinkler/intro.text_1": "Coloca un regador debajo de una tubería",
"sliceanddice.ponder.sprinkler/uses.header": "Tipos de rociadores",
"sliceanddice.ponder.sprinkler/uses.text_1": "Diferentes fluidos también afectan a las entidades de manera diferente",
"sliceanddice.tooltip.rotationDirection": "Dirección de Rotación"
}
17 changes: 17 additions & 0 deletions src/main/resources/assets/sliceanddice/lang/fr_fr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"block.sliceanddice.fertilizer": "Engrais liquide",
"block.sliceanddice.slicer": "Trancheuse",
"block.sliceanddice.sprinkler": "Arroseur",
"block.sliceanddice.wet_air": "Air humide",
"fluid.sliceanddice.fertilizer": "Engrais liquide",
"item.sliceanddice.fertilizer_bucket": "Seau d'engrais liquide",
"sliceanddice.gui.contraptions.wrong_direction": "Il semblerait que ce(t)(te) %s tourne dans la _mauvaise direction_.",
"sliceanddice.ponder.slicer.header": "Couper avec la trancheuse",
"sliceanddice.ponder.slicer.text_1": "Clic droit avec un outil valide",
"sliceanddice.ponder.slicer.text_2": "La trancheuse peut aussi fonctionner sur un bassin",
"sliceanddice.ponder.sprinkler/intro.header": "Pluie d'arrosage",
"sliceanddice.ponder.sprinkler/intro.text_1": "Placer un arroseur sous un tuyau",
"sliceanddice.ponder.sprinkler/uses.header": "Différents arrosages",
"sliceanddice.ponder.sprinkler/uses.text_1": "Des fluides différents affectent les entités différemment",
"sliceanddice.tooltip.rotationDirection": "Sens de rotation"
}
8 changes: 4 additions & 4 deletions src/main/resources/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"pack": {
"description": "Create: Slice & Dice resources",
"pack_format": 6
}
"pack": {
"description": "${mod_name} resources",
"pack_format": 6
}
}
1 change: 1 addition & 0 deletions src/main/resources/sliceanddice.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"refmap": "${mod_id}.refmap.json",
"mixins": [
"EntityMixin",
"HarvesterMovementBehaviourMixin",
"LevelMixin",
"RecipeEventJSMixin",
"RecipeManagerAccessor",
Expand Down