diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 943f0cb..c1962a7 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradlew b/gradlew index 65dcd68..aeb74cb 100644 --- a/gradlew +++ b/gradlew @@ -85,9 +85,6 @@ done 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"' - # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +141,7 @@ 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 @@ -152,7 +149,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | 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 @@ -197,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 diff --git a/src/main/java/com/hlysine/create_power_loader/content/andesitechunkloader/AndesiteChunkLoaderBlock.java b/src/main/java/com/hlysine/create_power_loader/content/andesitechunkloader/AndesiteChunkLoaderBlock.java index 5213229..ab33ca0 100644 --- a/src/main/java/com/hlysine/create_power_loader/content/andesitechunkloader/AndesiteChunkLoaderBlock.java +++ b/src/main/java/com/hlysine/create_power_loader/content/andesitechunkloader/AndesiteChunkLoaderBlock.java @@ -6,9 +6,12 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.Direction.Axis; +import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; +import org.jetbrains.annotations.NotNull; public class AndesiteChunkLoaderBlock extends DirectionalKineticBlock implements IBE { @@ -31,6 +34,22 @@ public SpeedLevel getMinimumRequiredSpeedLevel() { return SpeedLevel.MEDIUM; } + @SuppressWarnings("deprecation") + @Override + public boolean hasAnalogOutputSignal(@NotNull BlockState pState) { + return true; + } + + @SuppressWarnings("deprecation") + @Override + public int getAnalogOutputSignal(@NotNull BlockState pState, @NotNull Level pLevel, @NotNull BlockPos pPos) { + BlockEntity be = pLevel.getBlockEntity(pPos); + if (be instanceof AndesiteChunkLoaderBlockEntity chunkLoader) { + return chunkLoader.isSpeedRequirementFulfilled() ? 15 : 0; + } + return 0; + } + @Override public Class getBlockEntityClass() { return AndesiteChunkLoaderBlockEntity.class; diff --git a/src/main/java/com/hlysine/create_power_loader/content/andesitechunkloader/AndesiteChunkLoaderBlockEntity.java b/src/main/java/com/hlysine/create_power_loader/content/andesitechunkloader/AndesiteChunkLoaderBlockEntity.java index 98132a1..001e9cb 100644 --- a/src/main/java/com/hlysine/create_power_loader/content/andesitechunkloader/AndesiteChunkLoaderBlockEntity.java +++ b/src/main/java/com/hlysine/create_power_loader/content/andesitechunkloader/AndesiteChunkLoaderBlockEntity.java @@ -57,6 +57,7 @@ public void tick() { if (server && chunkUpdateCooldown-- <= 0) { chunkUpdateCooldown = 10; if (needsUpdate()) { + setChanged(); lastBlockPos = getBlockPos().immutable(); lastSpeedRequirement = isSpeedRequirementFulfilled(); updateForcedChunks(); diff --git a/src/main/java/com/hlysine/create_power_loader/content/brasschunkloader/BrassChunkLoaderBlock.java b/src/main/java/com/hlysine/create_power_loader/content/brasschunkloader/BrassChunkLoaderBlock.java index e173dd5..43b3a25 100644 --- a/src/main/java/com/hlysine/create_power_loader/content/brasschunkloader/BrassChunkLoaderBlock.java +++ b/src/main/java/com/hlysine/create_power_loader/content/brasschunkloader/BrassChunkLoaderBlock.java @@ -1,14 +1,18 @@ package com.hlysine.create_power_loader.content.brasschunkloader; import com.hlysine.create_power_loader.CPLBlockEntityTypes; +import com.hlysine.create_power_loader.content.andesitechunkloader.AndesiteChunkLoaderBlockEntity; import com.simibubi.create.content.kinetics.base.DirectionalKineticBlock; import com.simibubi.create.foundation.block.IBE; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.Direction.Axis; +import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; +import org.jetbrains.annotations.NotNull; public class BrassChunkLoaderBlock extends DirectionalKineticBlock implements IBE { @@ -31,6 +35,22 @@ public SpeedLevel getMinimumRequiredSpeedLevel() { return SpeedLevel.MEDIUM; } + @SuppressWarnings("deprecation") + @Override + public boolean hasAnalogOutputSignal(@NotNull BlockState pState) { + return true; + } + + @SuppressWarnings("deprecation") + @Override + public int getAnalogOutputSignal(@NotNull BlockState pState, @NotNull Level pLevel, @NotNull BlockPos pPos) { + BlockEntity be = pLevel.getBlockEntity(pPos); + if (be instanceof BrassChunkLoaderBlockEntity chunkLoader) { + return chunkLoader.isSpeedRequirementFulfilled() ? 15 : 0; + } + return 0; + } + @Override public Class getBlockEntityClass() { return BrassChunkLoaderBlockEntity.class; diff --git a/src/main/java/com/hlysine/create_power_loader/content/brasschunkloader/BrassChunkLoaderBlockEntity.java b/src/main/java/com/hlysine/create_power_loader/content/brasschunkloader/BrassChunkLoaderBlockEntity.java index 789967a..7a1318f 100644 --- a/src/main/java/com/hlysine/create_power_loader/content/brasschunkloader/BrassChunkLoaderBlockEntity.java +++ b/src/main/java/com/hlysine/create_power_loader/content/brasschunkloader/BrassChunkLoaderBlockEntity.java @@ -73,6 +73,7 @@ public void tick() { if (server && chunkUpdateCooldown-- <= 0) { chunkUpdateCooldown = 10; if (needsUpdate()) { + setChanged(); lastBlockPos = getBlockPos().immutable(); lastSpeedRequirement = isSpeedRequirementFulfilled(); lastRange = getLoadingRange();