mirror of
https://github.com/Oth3r/Sit.git
synced 2025-09-19 16:03:22 +02:00
Compare commits
4 commits
85cc76a022
...
6dcd99c12a
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6dcd99c12a |
||
![]() |
392d508ef3 |
||
![]() |
00c52b26cf |
||
![]() |
34c20ac753 |
10 changed files with 60 additions and 41 deletions
|
@ -15,7 +15,10 @@ base {
|
|||
repositories {
|
||||
mavenLocal()
|
||||
maven { url = "https://maven.terraformersmc.com/releases/" }
|
||||
maven { url = "https://maven.isxander.dev/releases" }
|
||||
maven {
|
||||
name "oth3rMavenSnapshots"
|
||||
url "https://maven.oth3r.one/snapshots"
|
||||
}
|
||||
}
|
||||
|
||||
loom {
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
# v1.2.4.4
|
||||
* bumped OtterLib version to `0.2.0.0`
|
||||
* now relies on OtterLib Language Reader
|
||||
|
||||
# v1.2.4.3
|
||||
* added a max OtterLib version as the beta will have breaking changes between major versions
|
||||
|
||||
|
|
|
@ -4,21 +4,21 @@ org.gradle.parallel=true
|
|||
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/develop
|
||||
min_minecraft_version=1.21.5
|
||||
max_minecraft_version=1.21.5
|
||||
minecraft_versions=1.21.5
|
||||
min_minecraft_version=1.21.6
|
||||
max_minecraft_version=1.21.6
|
||||
minecraft_versions=1.21.6
|
||||
|
||||
minecraft_version=1.21.5
|
||||
yarn_mappings=1.21.5+build.1
|
||||
minecraft_version=1.21.6
|
||||
yarn_mappings=1.21.6+build.1
|
||||
loader_version=0.16.14
|
||||
|
||||
# Mod Properties
|
||||
mod_version=1.2.4.3+1.21.5
|
||||
mod_version=1.2.4.4+1.21.6
|
||||
maven_group=one.oth3r
|
||||
file_name=sit!
|
||||
|
||||
# Dependencies
|
||||
fabric_version=0.124.0+1.21.5
|
||||
modmenu_version=14.0.0-rc.2
|
||||
otterlib_version=0.1.2.1+1.21.5-fabric
|
||||
otterlib_max_version=0.2.0.0+1.21.5-fabric
|
||||
fabric_version=0.127.1+1.21.6
|
||||
modmenu_version=15.0.0-beta.1
|
||||
otterlib_version=0.2.0.0+1.21.6-fabric
|
||||
otterlib_max_version=0.3.0.0+1.21.6-fabric
|
||||
|
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
7
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
7
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
25
gradlew
vendored
25
gradlew
vendored
|
@ -15,6 +15,8 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
|
@ -55,7 +57,7 @@
|
|||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
|
@ -83,7 +85,8 @@ done
|
|||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
@ -111,7 +114,7 @@ case "$( uname )" in #(
|
|||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
CLASSPATH="\\\"\\\""
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
|
@ -144,7 +147,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=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
|
@ -152,7 +155,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=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
|
@ -201,16 +204,16 @@ 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
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
|
|
26
gradlew.bat
vendored
26
gradlew.bat
vendored
|
@ -13,6 +13,8 @@
|
|||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
|
@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
|
|||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
|
@ -57,22 +59,22 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
set CLASSPATH=
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
|
|
|
@ -74,7 +74,7 @@ public class Events {
|
|||
// just send the sit command
|
||||
if (Data.isInGame()) {
|
||||
if (Data.isSupportedServer()) {
|
||||
player.networkHandler.sendCommand("sit");
|
||||
player.networkHandler.sendChatCommand("sit");
|
||||
} else {
|
||||
// unsupported server message if not in a Sit! server
|
||||
player.sendMessage(Chat.lang("sit!.chat.unsupported")
|
||||
|
|
|
@ -37,7 +37,7 @@ public class Logic {
|
|||
// check if the block is in the right y level limits from the config
|
||||
if (!checkYLimits(player, blockPos)) return false;
|
||||
|
||||
ServerWorld serverWorld = player.getServerWorld();
|
||||
ServerWorld serverWorld = player.getWorld();
|
||||
|
||||
Double sitHeight = Utl.getSittingHeight(player,blockPos,hitResult);
|
||||
|
||||
|
@ -60,7 +60,7 @@ public class Logic {
|
|||
public static boolean sit(ServerPlayerEntity player, BlockPos blockPos, @Nullable BlockHitResult hitResult) {
|
||||
if (!canSit(player, blockPos, hitResult)) return false;
|
||||
// assets
|
||||
ServerWorld serverWorld = player.getServerWorld();
|
||||
ServerWorld serverWorld = player.getWorld();
|
||||
Double sitHeight = Utl.getSittingHeight(player,blockPos,hitResult);
|
||||
// shouldn't be null because we already checked, but do another check to clear IDE errors
|
||||
assert sitHeight != null;
|
||||
|
@ -77,7 +77,7 @@ public class Logic {
|
|||
* @return true if sitting was successful
|
||||
*/
|
||||
public static boolean sitLooking(ServerPlayerEntity player) {
|
||||
return sit(player, Utl.getBlockPosPlayerIsLookingAt(player.getServerWorld(),player,
|
||||
return sit(player, Utl.getBlockPosPlayerIsLookingAt(player.getWorld(),player,
|
||||
Utl.getPlayerReach(player)),null);
|
||||
}
|
||||
|
||||
|
@ -151,7 +151,7 @@ public class Logic {
|
|||
// get the new entity
|
||||
DisplayEntity.TextDisplayEntity sitEntity = Data.getSpawnList().get(player);
|
||||
// spawn and ride the entity
|
||||
player.getServerWorld().spawnEntity(sitEntity);
|
||||
player.getWorld().spawnEntity(sitEntity);
|
||||
player.startRiding(sitEntity);
|
||||
// add the entity to the list
|
||||
Data.addSitEntity(player, sitEntity);
|
||||
|
|
|
@ -120,7 +120,7 @@ public class Utl {
|
|||
* @return null if not a valid block
|
||||
*/
|
||||
public static Double getSittingHeight(ServerPlayerEntity player, BlockPos blockPos, @Nullable BlockHitResult hit) {
|
||||
ServerWorld serverWorld = player.getServerWorld();
|
||||
ServerWorld serverWorld = player.getWorld();
|
||||
ServerConfig config = FileData.getServerConfig();
|
||||
BlockState blockState = serverWorld.getBlockState(blockPos);
|
||||
Block block = blockState.getBlock();
|
||||
|
@ -266,7 +266,7 @@ public class Utl {
|
|||
/// FYI it cant purge an entity from a disconnected player or unloaded chunks
|
||||
|
||||
// get a list of sit entities
|
||||
List<? extends DisplayEntity.TextDisplayEntity> list = player.getServerWorld()
|
||||
List<? extends DisplayEntity.TextDisplayEntity> list = player.getWorld()
|
||||
.getEntitiesByType(TypeFilter.instanceOf(DisplayEntity.TextDisplayEntity.class),
|
||||
entity -> entity.getName().getString().equals(Data.ENTITY_NAME));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue