Complet GUI, add fly-in animation

This commit is contained in:
TopchetoEU 2022-09-12 20:35:26 +03:00
parent cf11a16d1e
commit 3d13ebef47
No known key found for this signature in database
GPG Key ID: 0F2543CA49C81E3A
42 changed files with 0 additions and 1231 deletions

3
.github/FUNDING.YML vendored
View File

@ -1,3 +0,0 @@
# These are supported funding model platforms
custom: [ 'https://paypal.me/caden2k3' ]

View File

@ -1,33 +0,0 @@
---
name: Bug report
about: Use this template if you're running into bugs or other issues
title: ''
labels: bug
assignees: ''
---
### Expected Behavior
Replace this text with what you expected to happen.
_Example: The Piston should extend._
### Actual Behavior
Replace this text with what actually happened.
_Example: The Piston does not extend._
### Reproduction Steps
Provide information on how to reproduce this game crash. You can either fill in the example below or do something else -- just make sure your instructions are minimal and clear! If applicable, please provide a world file as a compressed ZIP which contains a minimally reproducible example of the issue.
1. Place a Redstone Lamp beside a Redstone Repeater
2. Use a Lever to activate the Redstone Repeater
3. Nothing happens
### Attachments
Add any relevant screenshots or videos to this issue as you feel necessary to explain the issue.
### System Information
You can obtain this information from the in-game debug screen or through using [DxDiag](https://support.microsoft.com/en-us/help/4028644/windows-open-and-run-dxdiagexe) on Windows.
- Java Version: [fill me in]
- CPU: [fill me in]
- GPU: [fill me in]

View File

@ -1,21 +0,0 @@
---
name: Crash report
about: Use this template if your game is crashing or failing to start correctly
title: ''
labels: crash
assignees: ''
---
### Reproduction Steps
Provide information on how to reproduce this game crash. This step is critical for ensuring that your crash can be debugged by other developers. You can either fill in the example below or do something else -- just make sure your instructions are minimal and clear. If applicable, provide a Minecraft save containing a minimal example on how to reproduce this crash as a compressed ZIP file.
1. Place a Redstone Lamp beside a Redstone Repeater
2. Use a Lever to activate the Redstone Repeater
3. The game crashes
### Crash Report File
Please upload your crash report as a file to [GitHub Gist](https://gist.github.com/) and replace this text with a link to the uploaded report.
### Additional Information
Provide any additional information or context which may be relevant to the issue. If you have none to add, you can remove this section.

View File

@ -1,20 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

View File

@ -1,26 +0,0 @@
---
name: Bug fix
about: Use this template if you're creating a pull request which fixes another bug or issue
title: ''
labels: bug
assignees: ''
---
### Preface
Please read our [Contributor Guidelines](https://github.com/fl0gic/smooth-chunks/blob/main/contributing.md) before
submitting any pull requests to this repository.
By submitting a pull request, you are indicating that you agree to the [Contributor License Agreement](https://github.com/fl0gic/smooth-chunks/blob/main/contributing.md#contributor-license-agreement-cla)
and that your code will be licensed irrecoverably under the GNU LGPLv3. If you do not agree to these terms, do not open
a pull request.
Please remove this section before submitting your pull request. Doing so indicates that you have read and acknowledged it.
### Linked Issues
Provide links to the issue(s) which will be closed upon merging this pull request. There must be an open issue for
pull requests which fix bugs or other issues.
### Proposed Changes
Provide a detailed description of what your pull request changes.

View File

@ -1,22 +0,0 @@
---
name: Bug fix
about: Use this template if you're creating a pull request which adds a feature or other enhancement
title: ''
labels: enhancement
assignees: ''
---
### Preface
Please read our [Contributor Guidelines](https://github.com/jellysquid3/sodium-fabric/blob/1.15.x/CONTRIBUTING.md) before
submitting any pull requests to this repository.
By submitting a pull request, you are indicating that you agree to the [Contributor License Agreement](https://github.com/jellysquid3/sodium-fabric/blob/1.15.x/CONTRIBUTING.md#contributor-license-agreement-cla)
and that your code will be licensed irrecoverably under the GNU LGPLv3. If you do not agree to these terms, do not open
a pull request.
Please remove this section before submitting your pull request. Doing so indicates that you have read and acknowledged it.
### Proposed Changes
Provide a detailed description of what your pull request changes.

View File

@ -1,71 +0,0 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name: "codeql-analysis"
on:
push:
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
# schedule:
# - cron: '0 23 * * 5'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['java']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

View File

@ -1,24 +0,0 @@
name: "gradle-build"
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Upload build artifacts
uses: actions/upload-artifact@v1
with:
name: build-artifacts
path: build/libs

121
.gitignore vendored
View File

@ -1,121 +0,0 @@
# User-specific stuff
.idea/
*.iml
*.ipr
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
.gradle
build/
# Ignore Gradle GUI config
gradle-app.setting
# Cache of project
.gradletasknamecache
**/build/
# Common working directory
run/
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
src/main/generated/
src/test/
remappedSrc/

22
LICENSE
View File

@ -1,22 +0,0 @@
The MIT License (MIT)
Copyright (c) 2022 TopchetoEU
Copyright (c) 2020 Caden Kriese
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@ -1,81 +0,0 @@
plugins {
id 'fabric-loom' version '0.5-SNAPSHOT'
id 'io.freefair.lombok' version '5.2.1'
id 'maven-publish'
}
archivesBaseName = project.archives_base_name
version = project.mod_version as Object
group = project.maven_group as Object
dependencies {
//to change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// Fabric API.
//TODO try this approach to fabric api in the future to avoid unneeded modules.
// for some reason it asks for like fabric-biomes and stuff right now.
// Set<String> apiModules = [
// "fabric-api-base",
// "fabric-registry-sync-v0"
// ]
//
// // Add each module as a dependency
// apiModules.forEach {
// modImplementation(fabricApi.module(it, project.fabric_version))
// }
// Fabric API.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
// Cloth Config / Autoconfig
modImplementation("me.shedaniel.cloth:config-2:${project.cloth_version}") {
exclude(group: "net.fabricmc.fabric-api")
exclude(module: "modmenu")
}
modImplementation("me.sargunvohra.mcmods:autoconfig1u:${project.autoconfig_version}") {
exclude(group: "net.fabricmc.fabric-api")
}
include("me.shedaniel.cloth:config-2:${project.cloth_version}")
include("me.sargunvohra.mcmods:autoconfig1u:${project.autoconfig_version}")
modImplementation("io.github.prospector:modmenu:${project.modmenu_version}")
}
minecraft {
accessWidener "src/main/resources/$archivesBaseName" + ".accesswidener"
}
processResources {
inputs.property "version", project.version
from(sourceSets.main.resources.srcDirs) {
include "fabric.mod.json"
expand "version": project.version
}
from(sourceSets.main.resources.srcDirs) {
exclude "fabric.mod.json"
}
}
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
task sourcesJar(type: Jar, dependsOn: classes) {
getArchiveClassifier().set("sources")
from sourceSets.main.allSource
}
jar {
from "LICENSE"
}
// configure the maven publication
//publishing {}

View File

@ -1,42 +0,0 @@
## Issues
When opening issues, please be sure to include the following information as applicable.
- The exact version of the mod you are running, such as `0.1.0-fabric`, and the version of Fabric/Forge you are using.
- If your issue is a crash, attach the latest client or server log, and the complete crash report as a file. You can
attach these as a file (preferred) or host them on a service such as [GitHub Gist](https://gist.github.com/) or [Hastebin](https://hastebin.com/).
- If your issue is a bug or otherwise unexpected behavior, explain what you expected to happen.
- If your issue only occurs with other mods installed, be sure to specify the names and versions of those mods.
## Pull Requests
It's super awesome to hear you're wishing to contribute to the project! Before you open a pull request, you'll need to
give a quick read to the following guidelines.
### Contributor License Agreement (CLA)
By submitting changes to this repository, you are hereby agreeing that:
- Your contributions will be licensed irrecoverably under the [MIT License](https://mit-license.org).
- Your contributions are of your own work and free of legal restrictions (such as patents and copyrights) or other
issues which would pose issues for inclusion or distribution under the above license.
If you do not agree to these terms, please do not submit contributions to this repository.
### Code Style
When contributing source code changes to the project, ensure that you make consistent use of the code style guidelines
used throughout the codebase (which follow pretty closely after the standard Java code style guidelines). These guidelines
have also been packaged as EditorConfig and IDEA inspection profiles which can be found in the repository root and `idea`
directory respectively.
- Use 4 spaces for indentation, not tabs. Avoid lines which exceed 120 characters.
- Use `this` to qualify member and field access.
- Always use braces when writing if-statements and loops.
- Annotate overriding methods with `@Override` so that breaking changes when updating will create hard compile errors.
### Making a Pull Request
Your pull request should include a brief description of the changes it makes and link to any open issues which it
resolves. You should also ensure that your code is well documented where non-trivial and that it follows the
outlined code style guidelines above.

View File

@ -1,16 +0,0 @@
# Check for updates on https://modmuss50.me/fabric.html
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
minecraft_version=1.16.4
yarn_mappings=1.16.4+build.1
loader_version=0.10.6+build.214
# Mod Properties
mod_version=1.0.0
maven_group=cc.flogi.dev
archives_base_name=smooth-chunks
# Dependencies
fabric_version=0.25.1+build.416-1.16
autoconfig_version=3.3.1
cloth_version=4.8.2
modmenu_version=1.14.6+build.31

Binary file not shown.

View File

@ -1,5 +0,0 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

185
gradlew vendored
View File

@ -1,185 +0,0 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$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"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
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.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"

89
gradlew.bat vendored
View File

@ -1,89 +0,0 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "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.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
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.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="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
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View File

@ -1,2 +0,0 @@
# This file is generated by the 'io.freefair.lombok' Gradle plugin
config.stopBubbling = true

Binary file not shown.

Before

Width:  |  Height:  |  Size: 387 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 920 KiB

View File

@ -1,22 +0,0 @@
# Smooth chunks
NOTE: This is a fork of [cadenkriese](https://github.com/cadenkriese/smooth-chunks)'s mod
## What is this?
This is a mod that adds animations of currently loading chunks. This makes chunk loading generally seem much more pleasant than them appearing out of thin air. There are multiple built-in animations, but this mod will be made so you can configure your own custom animations.
Generally, this is what you'd call a "eye-candy" mod.
## Currently supported animations:
- Fade (like in bedrock) (planned)
- Rise (planned)
- Fall (planned)
- Scale (planned)
- Random (columns of blocks will randomly appear) (planned)
## Future plans:
In the future, I plan to extend the scope of this mod to not only smoothen the chunk loading, but entity spawning / despawning / dying, liquids, crops growing, etc.

View File

@ -1,10 +0,0 @@
pluginManagement {
repositories {
jcenter()
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
gradlePluginPortal()
}
}

View File

@ -1,12 +0,0 @@
package cc.flogi.dev.smoothchunks;
import net.fabricmc.api.ModInitializer;
/**
* @author Caden Kriese (flogic)
*
* Created on 09/21/2020
*/
public class SmoothChunks implements ModInitializer {
@Override public void onInitialize() {}
}

View File

@ -1,28 +0,0 @@
package cc.flogi.dev.smoothchunks.client;
import cc.flogi.dev.smoothchunks.client.config.SmoothChunksConfig;
import lombok.Getter;
import me.sargunvohra.mcmods.autoconfig1u.AutoConfig;
import me.sargunvohra.mcmods.autoconfig1u.serializer.Toml4jConfigSerializer;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
/**
* @author Caden Kriese (flogic)
*
* Created on 09/21/2020
*/
@Environment(EnvType.CLIENT) public class SmoothChunksClient implements ClientModInitializer {
private static SmoothChunksClient instance;
@Getter private SmoothChunksConfig config;
public static SmoothChunksClient get() {return instance;}
@Override public void onInitializeClient() {
instance = this;
AutoConfig.register(SmoothChunksConfig.class, Toml4jConfigSerializer::new);
config = AutoConfig.getConfigHolder(SmoothChunksConfig.class).getConfig();
}
}

View File

@ -1,13 +0,0 @@
package cc.flogi.dev.smoothchunks.client.config;
/**
* @author Caden Kriese (flogic)
*
* Created on 09/28/2020
*/
public enum LoadAnimation {
DOWNWARD,
UPWARD,
INWARD,
SCALE
}

View File

@ -1,43 +0,0 @@
package cc.flogi.dev.smoothchunks.client.config;
import lombok.Getter;
import me.sargunvohra.mcmods.autoconfig1u.ConfigData;
import me.sargunvohra.mcmods.autoconfig1u.annotation.Config;
import me.sargunvohra.mcmods.autoconfig1u.annotation.ConfigEntry;
import me.sargunvohra.mcmods.autoconfig1u.shadowed.blue.endless.jankson.Comment;
/**
* @author Caden Kriese (flogic)
*
* Created on 09/28/2020
*/
@Config(name = "smooth-chunks") @Config.Gui.Background("minecraft:textures/block/stone.png") @Getter
public class SmoothChunksConfig implements ConfigData {
//TODO use localization for comment strings. (Somehow, not super straightforward bc annotations need const value)
@Comment("Duration of the animation in seconds.")
double duration = 1;
@Comment("The amount the chunk moves to get to its final position.")
@ConfigEntry.BoundedDiscrete(min = 1, max = 10)
int translationAmount = 5;
@Comment("Type of animation for loading chunks.")
@ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON)
LoadAnimation loadAnimation = LoadAnimation.UPWARD;
@Comment("Disable animating chunks close to you")
boolean disableNearby = true;
/*
* Custom Getters
*/
/**
* Gets the config value for translation amount, translating config value to usable value.
*
* @return The translation amount as an int 1 to 10 where higher = more translation.
*/
public double getTranslationAmount() {
return (double) translationAmount / 5d;
}
}

View File

@ -1,21 +0,0 @@
package cc.flogi.dev.smoothchunks.client.config;
import io.github.prospector.modmenu.api.ConfigScreenFactory;
import io.github.prospector.modmenu.api.ModMenuApi;
import me.sargunvohra.mcmods.autoconfig1u.AutoConfig;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.gui.screen.Screen;
/**
* @author Caden Kriese (flogic)
*
* Created on 09/28/2020
*/
@Environment(EnvType.CLIENT)
public class SmoothChunksModMenu implements ModMenuApi {
@Override
public ConfigScreenFactory<?> getModConfigScreenFactory() {
return (ConfigScreenFactory<Screen>) parent -> AutoConfig.getConfigScreen(SmoothChunksConfig.class, parent).get();
}
}

View File

@ -1,112 +0,0 @@
package cc.flogi.dev.smoothchunks.client.handler;
import cc.flogi.dev.smoothchunks.client.SmoothChunksClient;
import cc.flogi.dev.smoothchunks.client.config.LoadAnimation;
import cc.flogi.dev.smoothchunks.client.config.SmoothChunksConfig;
import cc.flogi.dev.smoothchunks.util.UtilEasing;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.chunk.ChunkBuilder;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.Vec3i;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
/**
* @author Caden Kriese (flogic)
*
* Created on 09/27/2020
*/
public final class ChunkAnimationHandler {
/*TODO use Reference2ReferenceLinkedHashMap from FastUtil or just inject the AnimationController directly into BuiltChunk.
* Need to solve concurrency issue as currently #addChunk is called from both render & worker threads.
*/
private static final ChunkAnimationHandler instance = new ChunkAnimationHandler();
private final Map<ChunkBuilder.BuiltChunk, AnimationController> animations = new HashMap<>();
@Getter private final Set<Vec3i> loadedChunks = new HashSet<>();
public static ChunkAnimationHandler get() {
return instance;
}
public void addChunk(ChunkBuilder.BuiltChunk chunk) {
Vec3i origin = chunk.getOrigin();
if (loadedChunks.contains(origin)) return;
loadedChunks.add(origin);
Direction direction = null;
if (SmoothChunksClient.get().getConfig().getLoadAnimation() == LoadAnimation.INWARD
&& MinecraftClient.getInstance().getCameraEntity() != null) {
BlockPos delta = chunk.getOrigin().subtract(MinecraftClient.getInstance().getCameraEntity().getBlockPos());
int dX = Math.abs(delta.getX());
int dZ = Math.abs(delta.getZ());
if (dX > dZ) {
if (delta.getX() > 0) direction = Direction.WEST;
else direction = Direction.EAST;
} else {
if (delta.getZ() > 0) direction = Direction.NORTH;
else direction = Direction.SOUTH;
}
}
animations.putIfAbsent(chunk, new AnimationController(chunk.getOrigin(), direction, System.currentTimeMillis()));
}
public void updateChunk(ChunkBuilder.BuiltChunk chunk, MatrixStack stack) {
SmoothChunksConfig config = SmoothChunksClient.get().getConfig();
AnimationController controller = animations.get(chunk);
if (controller == null || MinecraftClient.getInstance().getCameraEntity() == null) return;
BlockPos finalPos = controller.getFinalPos();
if (config.isDisableNearby()) {
double dX = finalPos.getX() - MinecraftClient.getInstance().getCameraEntity().getPos().getX();
double dZ = finalPos.getZ() - MinecraftClient.getInstance().getCameraEntity().getPos().getZ();
if (dX * dX + dZ * dZ < 32 * 32) return;
}
double completion = (double) (System.currentTimeMillis() - controller.getStartTime()) / config.getDuration() / 1000d;
completion = UtilEasing.easeOutSine(Math.min(completion, 1.0));
switch (config.getLoadAnimation()) {
default:
case DOWNWARD:
stack.translate(0, (finalPos.getY() - completion * finalPos.getY()) * config.getTranslationAmount(), 0);
break;
case UPWARD:
stack.translate(0, (-finalPos.getY() + completion * finalPos.getY()) * config.getTranslationAmount(), 0);
break;
case INWARD:
if (controller.getDirection() == null) break;
Vec3i dirVec = controller.getDirection().getVector();
double mod = -(200 - UtilEasing.easeInOutSine(completion) * 200) * config.getTranslationAmount();
stack.translate(dirVec.getX() * mod, 0, dirVec.getZ() * mod);
break;
case SCALE:
//TODO Find a way to scale centered at the middle of the chunk rather than the origin.
stack.scale((float) completion, (float) completion, (float) completion);
break;
}
if (completion >= 1.0) animations.remove(chunk);
}
@AllArgsConstructor @Data
private static class AnimationController {
private BlockPos finalPos;
private Direction direction;
private long startTime;
}
}

View File

@ -1,28 +0,0 @@
package cc.flogi.dev.smoothchunks.mixin;
import cc.flogi.dev.smoothchunks.client.handler.ChunkAnimationHandler;
import net.minecraft.client.render.chunk.ChunkBuilder;
import net.minecraft.util.math.BlockPos;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
/**
* @author Caden Kriese (flogic)
*
* Created on 11/01/2020
*/
@Mixin(ChunkBuilder.BuiltChunk.class)
public abstract class BuiltChunkMixin {
@Shadow public abstract BlockPos getOrigin();
@Inject(
method = "clear",
at = @At(value = "TAIL")
)
public void onDelete(CallbackInfo ci) {
ChunkAnimationHandler.get().getLoadedChunks().remove(getOrigin());
}
}

View File

@ -1,35 +0,0 @@
package cc.flogi.dev.smoothchunks.mixin;
import cc.flogi.dev.smoothchunks.client.handler.ChunkAnimationHandler;
import net.minecraft.client.render.WorldRenderer;
import net.minecraft.client.render.chunk.BlockBufferBuilderStorage;
import net.minecraft.client.render.chunk.ChunkBuilder;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.util.concurrent.CompletableFuture;
/**
* @author Caden Kriese (flogic)
*
* Created on 10/07/2020
*/
@SuppressWarnings("rawtypes") @Mixin(ChunkBuilder.BuiltChunk.RebuildTask.class)
public abstract class RebuildTaskMixin {
//Parent class
@SuppressWarnings("ShadowTarget") @Shadow private ChunkBuilder.BuiltChunk field_20839;
@Inject(
method = "run",
at = @At(
value = "INVOKE",
target = "Ljava/util/Set;forEach(Ljava/util/function/Consumer;)V"
)
)
public void onChunkUploads(BlockBufferBuilderStorage buffers, CallbackInfoReturnable<CompletableFuture> cir) {
ChunkAnimationHandler.get().addChunk(field_20839);
}
}

View File

@ -1,35 +0,0 @@
package cc.flogi.dev.smoothchunks.mixin;
import cc.flogi.dev.smoothchunks.client.handler.ChunkAnimationHandler;
import it.unimi.dsi.fastutil.objects.ObjectListIterator;
import net.minecraft.client.gl.VertexBuffer;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.WorldRenderer;
import net.minecraft.client.render.chunk.ChunkBuilder;
import net.minecraft.client.util.math.MatrixStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
/**
* @author Caden Kriese (flogic)
*
* Created on 09/25/2020
*/
@SuppressWarnings("rawtypes") @Mixin(WorldRenderer.class)
public abstract class WorldRendererMixin {
@Inject(
method = "renderLayer",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/gl/VertexBuffer;bind()V"),
locals = LocalCapture.CAPTURE_FAILHARD
)
private void renderLayerInject(RenderLayer renderLayer, MatrixStack matrixStack, double d, double e, double f,
CallbackInfo ci, boolean bl, ObjectListIterator objectListIterator,
WorldRenderer.ChunkInfo chunkInfo2, ChunkBuilder.BuiltChunk builtChunk, VertexBuffer vertexBuffer) {
ChunkAnimationHandler.get().updateChunk(builtChunk, matrixStack);
}
}

View File

@ -1,18 +0,0 @@
package cc.flogi.dev.smoothchunks.util;
/**
* @author Caden Kriese (flogic)
*
* Created on 10/24/2020
*/
public final class UtilEasing {
private static final double PI = Math.PI;
public static double easeInOutSine(double completion) {
return -((Math.cos(PI * completion) - 1) / 2);
}
public static double easeOutSine(double completion) {
return Math.sin(PI * completion / 2);
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

View File

@ -1,7 +0,0 @@
{
"text.autoconfig.smooth-chunks.title": "Smooth Chunks Config",
"text.autoconfig.smooth-chunks.option.loadAnimation": "Load Animation",
"text.autoconfig.smooth-chunks.option.duration": "Duration",
"text.autoconfig.smooth-chunks.option.translationAmount": "Translation Amount",
"text.autoconfig.smooth-chunks.option.disableNearby": "Disable for Nearby Chunks"
}

View File

@ -1,7 +0,0 @@
{
"text.autoconfig.smooth-chunks.title": "平滑区块加载配置Smooth Chunk",
"text.autoconfig.smooth-chunks.option.loadAnimation": "区块加载动画",
"text.autoconfig.smooth-chunks.option.duration": "动画持续时间",
"text.autoconfig.smooth-chunks.option.translationAmount": "转换幅度",
"text.autoconfig.smooth-chunks.option.disableNearby": "禁用邻近区块动画"
}

View File

@ -1,38 +0,0 @@
{
"schemaVersion": 1,
"id": "smooth-chunks",
"version": "${version}",
"name": "Smooth Chunks",
"description": "Smooth chunk load animations.",
"authors": [
"flogic"
],
"contact": {
"website": "flogi.cc",
"repo": "repo.flogi.cc"
},
"license": "MIT",
"icon": "assets/smooth-chunks/icon.png",
"environment": "client",
"accessWidener": "smooth-chunks.accesswidener",
"modmenu:clientsideOnly": "true",
"entrypoints": {
"modmenu": [
"cc.flogi.dev.smoothchunks.client.config.SmoothChunksModMenu"
],
"client": [
"cc.flogi.dev.smoothchunks.client.SmoothChunksClient"
],
"main": [
"cc.flogi.dev.smoothchunks.SmoothChunks"
]
},
"mixins": [
"smooth-chunks.mixins.json"
],
"depends": {
"fabricloader": ">=0.9.3+build.207",
"fabric": "*",
"minecraft": ">=1.16.2"
}
}

View File

@ -1,4 +0,0 @@
accessWidener v1 named
accessible class net/minecraft/client/render/chunk/ChunkBuilder$BuiltChunk$RebuildTask
accessible class net/minecraft/client/render/WorldRenderer$ChunkInfo

View File

@ -1,15 +0,0 @@
{
"required": true,
"minVersion": "0.8",
"package": "cc.flogi.dev.smoothchunks.mixin",
"compatibilityLevel": "JAVA_8",
"mixins": [],
"client": [
"BuiltChunkMixin",
"RebuildTaskMixin",
"WorldRendererMixin"
],
"injectors": {
"defaultRequire": 1
}
}