commit c0b7d604afff3e97af678dd6d8fe90c66d0a0a62 Author: weold957 <97589@LAPTOP-B93J3L7V> Date: Thu Sep 7 23:31:36 2023 +0800 new diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..427c838 --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +# Gradle build system ignores +.gradle/ +build/ + +# Other IDE related folders +.idea/ +.settings/ + +# MCreator workspace +.mcreator/ + +# Minecraft client/server files +run/ + +# MacOS system files +.DS_STORE + +# Other Files (In Eclipse) +.classpath +.project diff --git a/biglifantasy.mcreator b/biglifantasy.mcreator new file mode 100644 index 0000000..6b48a22 --- /dev/null +++ b/biglifantasy.mcreator @@ -0,0 +1,136 @@ +{ + "mod_elements": [ + { + "name": "Bless", + "type": "enchantment", + "sortid": 3, + "compiles": true, + "locked_code": false, + "registry_name": "bless", + "metadata": { + "files": [ + "src/main/java/net/mcreator/biglifantasy/enchantment/BlessEnchantment.java" + ] + } + }, + { + "name": "BigLiFantasy", + "type": "tab", + "sortid": 4, + "compiles": true, + "locked_code": false, + "registry_name": "big_li_fantasy", + "metadata": { + "files": [] + } + }, + { + "name": "Test", + "type": "block", + "sortid": 2, + "compiles": true, + "locked_code": false, + "registry_name": "test", + "metadata": { + "files": [ + "src/main/resources/assets/biglifantasy/models/item/test.json", + "src/main/java/net/mcreator/biglifantasy/block/TestBlock.java", + "src/main/resources/assets/biglifantasy/models/block/test.json", + "src/main/resources/assets/biglifantasy/blockstates/test.json" + ] + } + }, + { + "name": "BlessBook", + "type": "recipe", + "sortid": 5, + "compiles": true, + "locked_code": false, + "registry_name": "bless_book", + "metadata": { + "files": [ + "src/main/resources/data/biglifantasy/recipes/bless_book.json" + ] + } + }, + { + "name": "TestSword", + "type": "tool", + "sortid": 1, + "compiles": true, + "locked_code": false, + "registry_name": "test_sword", + "metadata": { + "files": [ + "src/main/java/net/mcreator/biglifantasy/item/TestSwordItem.java", + "src/main/resources/assets/biglifantasy/models/item/test_sword.json" + ] + } + }, + { + "name": "WitherDrop", + "type": "loottable", + "sortid": 6, + "compiles": true, + "locked_code": false, + "registry_name": "wither_drop", + "metadata": { + "files": [ + "src/main/resources/data/minecraft/loot_tables/entities/wither.json" + ] + } + }, + { + "name": "EnderDragonDrop", + "type": "loottable", + "sortid": 7, + "compiles": true, + "locked_code": false, + "registry_name": "ender_dragon_drop", + "metadata": { + "files": [ + "src/main/resources/data/minecraft/loot_tables/entities/ender_dragon.json" + ] + } + } + ], + "variable_elements": [], + "sound_elements": [], + "language_map": { + "en_us": { + "block.biglifantasy.test": "Test", + "enchantment.biglifantasy.bless": "Bless", + "item.biglifantasy.test_sword": "Test Sword", + "item_group.biglifantasy.big_li_fantasy": "BigLi\u0027s Fantasy" + }, + "zh_cn": { + "block.biglifantasy.test": "Test", + "enchantment.biglifantasy.bless": "护佑", + "item.biglifantasy.test_sword": "§4§l大§l§5力§l§6王§l§7剑 §l§0§m(测试刀)", + "item_group.biglifantasy.big_li_fantasy": "大力的幻想" + } + }, + "foldersRoot": { + "name": "~", + "children": [] + }, + "workspaceSettings": { + "modid": "biglifantasy", + "modName": "大力的幻想", + "version": "1.0.0", + "author": "Coldsmile, MCreator", + "websiteURL": "http://www.mcstarsky.top", + "license": "Academic Free License v3.0", + "disableForgeVersionCheck": true, + "serverSideOnly": false, + "requiredMods": [], + "dependencies": [], + "dependants": [], + "mcreatorDependencies": [], + "currentGenerator": "forge-1.19.4", + "credits": "Created using mod maker MCreator - https://mcreator.net/about", + "modElementsPackage": "net.mcreator.biglifantasy", + "lockBaseModFiles": false + }, + "mcreatorVersion": 202300336712 +} \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..fcf87fb --- /dev/null +++ b/build.gradle @@ -0,0 +1,63 @@ +buildscript { + repositories { + maven { url = 'https://maven.minecraftforge.net' } + mavenCentral() + } + dependencies { + classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true + } +} + +apply plugin: 'net.minecraftforge.gradle' +apply plugin: 'eclipse' + +version = '1.0' +group = 'com.yourname.modid' +archivesBaseName = 'modid' + +java.toolchain.languageVersion = JavaLanguageVersion.of(17) + +minecraft { + mappings channel: 'official', version: '1.19.4' + + accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') + + runs { + client { + workingDirectory project.file('run') + + property 'forge.logging.markers', 'REGISTRIES' + property 'forge.logging.console.level', 'debug' + + mods { + examplemod { + source sourceSets.main + } + } + } + + server { + workingDirectory project.file('run') + + property 'forge.logging.markers', 'REGISTRIES' + property 'forge.logging.console.level', 'debug' + + mods { + examplemod { + source sourceSets.main + } + } + } + } +} + +dependencies { + minecraft 'net.minecraftforge:forge:1.19.4-45.1.0' +} + +tasks.withType(JavaCompile).configureEach { + options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation +} + +apply from: 'mcreator.gradle' + diff --git a/elements/BigLiFantasy.mod.json b/elements/BigLiFantasy.mod.json new file mode 100644 index 0000000..84ab8de --- /dev/null +++ b/elements/BigLiFantasy.mod.json @@ -0,0 +1,11 @@ +{ + "_fv": 47, + "_type": "tab", + "definition": { + "name": "BigLi's Fantasy", + "icon": { + "value": "Items.RECORD_FAR" + }, + "showSearch": true + } +} \ No newline at end of file diff --git a/elements/Bless.mod.json b/elements/Bless.mod.json new file mode 100644 index 0000000..9309864 --- /dev/null +++ b/elements/Bless.mod.json @@ -0,0 +1,25 @@ +{ + "_fv": 47, + "_type": "enchantment", + "definition": { + "name": "Bless", + "type": "BREAKABLE", + "rarity": "COMMON", + "minLevel": 1, + "maxLevel": 1, + "damageModifier": 1, + "compatibleEnchantments": [], + "excludeEnchantments": false, + "compatibleItems": [ + { + "value": "Items.WATER_BUCKET" + } + ], + "excludeItems": false, + "isTreasureEnchantment": true, + "isCurse": false, + "isAllowedOnBooks": true, + "canGenerateInLootTables": false, + "canVillagerTrade": false + } +} \ No newline at end of file diff --git a/elements/BlessBook.mod.json b/elements/BlessBook.mod.json new file mode 100644 index 0000000..30a74d7 --- /dev/null +++ b/elements/BlessBook.mod.json @@ -0,0 +1,48 @@ +{ + "_fv": 47, + "_type": "recipe", + "definition": { + "recipeType": "Crafting", + "recipeRetstackSize": 1, + "group": "blessbook", + "cookingBookCategory": "MISC", + "xpReward": 0.0, + "cookingTime": 200, + "craftingBookCategory": "MISC", + "recipeShapeless": true, + "recipeSlots": [ + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "Items.ENCHANTED_BOOK" + }, + { + "value": "Items.ENCHANTED_BOOK" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + } + ], + "recipeReturnStack": { + "value": "Items.ENCHANTED_BOOK" + }, + "name": "bless_book", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/EnderDragonDrop.mod.json b/elements/EnderDragonDrop.mod.json new file mode 100644 index 0000000..2db3202 --- /dev/null +++ b/elements/EnderDragonDrop.mod.json @@ -0,0 +1,34 @@ +{ + "_fv": 47, + "_type": "loottable", + "definition": { + "type": "Entity", + "pools": [ + { + "minrolls": 1, + "maxrolls": 1, + "minbonusrolls": 1, + "maxbonusrolls": 1, + "hasbonusrolls": false, + "entries": [ + { + "type": "item", + "item": { + "value": "Items.ELYTRA" + }, + "weight": 1, + "minCount": 1, + "maxCount": 1, + "minEnchantmentLevel": 0, + "maxEnchantmentLevel": 0, + "affectedByFortune": false, + "explosionDecay": false, + "silkTouchMode": 0 + } + ] + } + ], + "name": "entities/ender_dragon", + "namespace": "minecraft" + } +} \ No newline at end of file diff --git a/elements/Test.mod.json b/elements/Test.mod.json new file mode 100644 index 0000000..63a024c --- /dev/null +++ b/elements/Test.mod.json @@ -0,0 +1,142 @@ +{ + "_fv": 47, + "_type": "block", + "definition": { + "texture": "test", + "textureTop": "test", + "textureLeft": "test", + "textureFront": "test", + "textureRight": "test", + "textureBack": "test", + "renderType": 10, + "customModelName": "Normal", + "rotationMode": 0, + "enablePitch": false, + "emissiveRendering": false, + "displayFluidOverlay": false, + "itemTexture": "", + "particleTexture": "", + "tintType": "No tint", + "isItemTinted": false, + "hasTransparency": false, + "connectedSides": false, + "transparencyType": "SOLID", + "disableOffset": false, + "boundingBoxes": [ + { + "mx": 0.0, + "my": 0.0, + "mz": 0.0, + "Mx": 16.0, + "My": 16.0, + "Mz": 16.0, + "subtract": false + } + ], + "name": "Test", + "specialInfo": [], + "hardness": 1.0, + "resistance": 10.0, + "hasGravity": false, + "isWaterloggable": false, + "creativeTab": { + "value": "CUSTOM:BigLiFantasy" + }, + "destroyTool": "Not specified", + "customDrop": { + "value": "" + }, + "dropAmount": 1, + "useLootTableForDrops": false, + "requiresCorrectTool": false, + "enchantPowerBonus": 0.0, + "plantsGrowOn": false, + "canRedstoneConnect": false, + "lightOpacity": 15, + "material": { + "value": "ROCK" + }, + "tickRate": 0, + "tickRandomly": false, + "isReplaceable": false, + "canProvidePower": false, + "emittedRedstonePower": { + "fixedValue": 15.0 + }, + "colorOnMap": "DEFAULT", + "creativePickItem": { + "value": "" + }, + "offsetType": "NONE", + "aiPathNodeType": "DEFAULT", + "flammability": 0, + "fireSpreadSpeed": 0, + "isLadder": false, + "slipperiness": 0.6, + "speedFactor": 1.0, + "jumpFactor": 1.0, + "reactionToPushing": "NORMAL", + "isNotColidable": false, + "isCustomSoundType": false, + "soundOnStep": { + "value": "GROUND" + }, + "breakSound": { + "value": "" + }, + "fallSound": { + "value": "" + }, + "hitSound": { + "value": "" + }, + "placeSound": { + "value": "" + }, + "stepSound": { + "value": "" + }, + "luminance": 0, + "unbreakable": false, + "breakHarvestLevel": 1, + "isBonemealable": false, + "hasInventory": false, + "guiBoundTo": "", + "openGUIOnRightClick": false, + "inventorySize": 9, + "inventoryStackSize": 64, + "inventoryDropWhenDestroyed": true, + "inventoryComparatorPower": true, + "inventoryOutSlotIDs": [], + "inventoryInSlotIDs": [], + "hasEnergyStorage": false, + "energyInitial": 0, + "energyCapacity": 400000, + "energyMaxReceive": 200, + "energyMaxExtract": 200, + "isFluidTank": false, + "fluidCapacity": 8000, + "fluidRestrictions": [], + "spawnWorldTypes": [], + "restrictionBiomes": [], + "blocksToReplace": [ + { + "value": "Blocks.STONE#0" + }, + { + "value": "Blocks.STONE#1" + }, + { + "value": "Blocks.STONE#3" + }, + { + "value": "Blocks.STONE#5" + } + ], + "generationShape": "UNIFORM", + "frequencyPerChunks": 10, + "frequencyOnChunk": 16, + "minGenerateHeight": 0, + "maxGenerateHeight": 64 + } +} \ No newline at end of file diff --git a/elements/TestSword.mod.json b/elements/TestSword.mod.json new file mode 100644 index 0000000..859769c --- /dev/null +++ b/elements/TestSword.mod.json @@ -0,0 +1,27 @@ +{ + "_fv": 47, + "_type": "tool", + "definition": { + "toolType": "Sword", + "renderType": 0, + "texture": "big_li_sword", + "customModelName": "Normal", + "name": "Test Sword", + "specialInfo": [], + "creativeTab": { + "value": "CUSTOM:BigLiFantasy" + }, + "harvestLevel": 1, + "efficiency": 4.0, + "attackSpeed": 1.0, + "enchantability": 2, + "damageVsEntity": 500.0, + "usageCount": 100, + "blocksAffected": [], + "hasGlow": true, + "repairItems": [], + "immuneToFire": true, + "stayInGridWhenCrafting": false, + "damageOnCrafting": false + } +} \ No newline at end of file diff --git a/elements/WitherDrop.mod.json b/elements/WitherDrop.mod.json new file mode 100644 index 0000000..4780e53 --- /dev/null +++ b/elements/WitherDrop.mod.json @@ -0,0 +1,34 @@ +{ + "_fv": 47, + "_type": "loottable", + "definition": { + "type": "Entity", + "pools": [ + { + "minrolls": 1, + "maxrolls": 1, + "minbonusrolls": 1, + "maxbonusrolls": 1, + "hasbonusrolls": false, + "entries": [ + { + "type": "item", + "item": { + "value": "Items.SKULL#1" + }, + "weight": 1, + "minCount": 3, + "maxCount": 3, + "minEnchantmentLevel": 0, + "maxEnchantmentLevel": 0, + "affectedByFortune": false, + "explosionDecay": false, + "silkTouchMode": 0 + } + ] + } + ], + "name": "entities/wither", + "namespace": "minecraft" + } +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..f237dcf --- /dev/null +++ b/gradle.properties @@ -0,0 +1,2 @@ +org.gradle.jvmargs=-Xmx3G +org.gradle.daemon=false \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..249e583 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..ae04661 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..cccdd3d --- /dev/null +++ b/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## 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="" + +# 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, switch paths to Windows format before running java +if $cygwin ; 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=$((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" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..e95643d --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,84 @@ +@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 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= + +@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 init + +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 init + +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 + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +: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 %CMD_LINE_ARGS% + +: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 diff --git a/mcreator.gradle b/mcreator.gradle new file mode 100644 index 0000000..e69de29 diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..fb61b26 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,6 @@ +pluginManagement { + repositories { + gradlePluginPortal() + maven { url = 'https://maven.minecraftforge.net/' } + } +} \ No newline at end of file diff --git a/src/main/java/net/mcreator/biglifantasy/BiglifantasyMod.java b/src/main/java/net/mcreator/biglifantasy/BiglifantasyMod.java new file mode 100644 index 0000000..42e579c --- /dev/null +++ b/src/main/java/net/mcreator/biglifantasy/BiglifantasyMod.java @@ -0,0 +1,89 @@ +/* + * MCreator note: + * + * If you lock base mod element files, you can edit this file and it won't get overwritten. + * If you change your modid or package, you need to apply these changes to this file MANUALLY. + * + * Settings in @Mod annotation WON'T be changed in case of the base mod element + * files lock too, so you need to set them manually here in such case. + * + * If you do not lock base mod element files in Workspace settings, this file + * will be REGENERATED on each build. + * + */ +package net.mcreator.biglifantasy; + +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.LogManager; + +import net.minecraftforge.network.simple.SimpleChannel; +import net.minecraftforge.network.NetworkRegistry; +import net.minecraftforge.network.NetworkEvent; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.eventbus.api.IEventBus; +import net.minecraftforge.event.TickEvent; +import net.minecraftforge.common.MinecraftForge; + +import net.minecraft.resources.ResourceLocation; +import net.minecraft.network.FriendlyByteBuf; + +import net.mcreator.biglifantasy.init.BiglifantasyModItems; +import net.mcreator.biglifantasy.init.BiglifantasyModEnchantments; +import net.mcreator.biglifantasy.init.BiglifantasyModBlocks; + +import java.util.function.Supplier; +import java.util.function.Function; +import java.util.function.BiConsumer; +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.List; +import java.util.Collection; +import java.util.ArrayList; +import java.util.AbstractMap; + +@Mod("biglifantasy") +public class BiglifantasyMod { + public static final Logger LOGGER = LogManager.getLogger(BiglifantasyMod.class); + public static final String MODID = "biglifantasy"; + + public BiglifantasyMod() { + MinecraftForge.EVENT_BUS.register(this); + IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus(); + + BiglifantasyModBlocks.REGISTRY.register(bus); + BiglifantasyModItems.REGISTRY.register(bus); + + BiglifantasyModEnchantments.REGISTRY.register(bus); + + } + + private static final String PROTOCOL_VERSION = "1"; + public static final SimpleChannel PACKET_HANDLER = NetworkRegistry.newSimpleChannel(new ResourceLocation(MODID, MODID), () -> PROTOCOL_VERSION, PROTOCOL_VERSION::equals, PROTOCOL_VERSION::equals); + private static int messageID = 0; + + public static void addNetworkMessage(Class messageType, BiConsumer encoder, Function decoder, BiConsumer> messageConsumer) { + PACKET_HANDLER.registerMessage(messageID, messageType, encoder, decoder, messageConsumer); + messageID++; + } + + private static final Collection> workQueue = new ConcurrentLinkedQueue<>(); + + public static void queueServerWork(int tick, Runnable action) { + workQueue.add(new AbstractMap.SimpleEntry(action, tick)); + } + + @SubscribeEvent + public void tick(TickEvent.ServerTickEvent event) { + if (event.phase == TickEvent.Phase.END) { + List> actions = new ArrayList<>(); + workQueue.forEach(work -> { + work.setValue(work.getValue() - 1); + if (work.getValue() == 0) + actions.add(work); + }); + actions.forEach(e -> e.getKey().run()); + workQueue.removeAll(actions); + } + } +} diff --git a/src/main/java/net/mcreator/biglifantasy/block/TestBlock.java b/src/main/java/net/mcreator/biglifantasy/block/TestBlock.java new file mode 100644 index 0000000..68919b7 --- /dev/null +++ b/src/main/java/net/mcreator/biglifantasy/block/TestBlock.java @@ -0,0 +1,34 @@ + +package net.mcreator.biglifantasy.block; + +import net.minecraft.world.level.storage.loot.LootContext; +import net.minecraft.world.level.material.Material; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.BlockBehaviour; +import net.minecraft.world.level.block.SoundType; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.item.ItemStack; +import net.minecraft.core.BlockPos; + +import java.util.List; +import java.util.Collections; + +public class TestBlock extends Block { + public TestBlock() { + super(BlockBehaviour.Properties.of(Material.STONE).sound(SoundType.GRAVEL).strength(1f, 10f)); + } + + @Override + public int getLightBlock(BlockState state, BlockGetter worldIn, BlockPos pos) { + return 15; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } +} diff --git a/src/main/java/net/mcreator/biglifantasy/enchantment/BlessEnchantment.java b/src/main/java/net/mcreator/biglifantasy/enchantment/BlessEnchantment.java new file mode 100644 index 0000000..df4a9cb --- /dev/null +++ b/src/main/java/net/mcreator/biglifantasy/enchantment/BlessEnchantment.java @@ -0,0 +1,41 @@ + +package net.mcreator.biglifantasy.enchantment; + +import net.minecraft.world.item.enchantment.EnchantmentCategory; +import net.minecraft.world.item.enchantment.Enchantment; +import net.minecraft.world.item.crafting.Ingredient; +import net.minecraft.world.item.Items; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.damagesource.DamageSource; + +public class BlessEnchantment extends Enchantment { + public BlessEnchantment(EquipmentSlot... slots) { + super(Enchantment.Rarity.COMMON, EnchantmentCategory.BREAKABLE, slots); + } + + @Override + public int getDamageProtection(int level, DamageSource source) { + return level * 1; + } + + @Override + public boolean canApplyAtEnchantingTable(ItemStack itemstack) { + return Ingredient.of(new ItemStack(Items.WATER_BUCKET)).test(itemstack); + } + + @Override + public boolean isTreasureOnly() { + return true; + } + + @Override + public boolean isDiscoverable() { + return false; + } + + @Override + public boolean isTradeable() { + return false; + } +} diff --git a/src/main/java/net/mcreator/biglifantasy/init/BiglifantasyModBlocks.java b/src/main/java/net/mcreator/biglifantasy/init/BiglifantasyModBlocks.java new file mode 100644 index 0000000..9b9c711 --- /dev/null +++ b/src/main/java/net/mcreator/biglifantasy/init/BiglifantasyModBlocks.java @@ -0,0 +1,19 @@ + +/* + * MCreator note: This file will be REGENERATED on each build. + */ +package net.mcreator.biglifantasy.init; + +import net.minecraftforge.registries.RegistryObject; +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.registries.DeferredRegister; + +import net.minecraft.world.level.block.Block; + +import net.mcreator.biglifantasy.block.TestBlock; +import net.mcreator.biglifantasy.BiglifantasyMod; + +public class BiglifantasyModBlocks { + public static final DeferredRegister REGISTRY = DeferredRegister.create(ForgeRegistries.BLOCKS, BiglifantasyMod.MODID); + public static final RegistryObject TEST = REGISTRY.register("test", () -> new TestBlock()); +} diff --git a/src/main/java/net/mcreator/biglifantasy/init/BiglifantasyModEnchantments.java b/src/main/java/net/mcreator/biglifantasy/init/BiglifantasyModEnchantments.java new file mode 100644 index 0000000..6d8c257 --- /dev/null +++ b/src/main/java/net/mcreator/biglifantasy/init/BiglifantasyModEnchantments.java @@ -0,0 +1,19 @@ + +/* + * MCreator note: This file will be REGENERATED on each build. + */ +package net.mcreator.biglifantasy.init; + +import net.minecraftforge.registries.RegistryObject; +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.registries.DeferredRegister; + +import net.minecraft.world.item.enchantment.Enchantment; + +import net.mcreator.biglifantasy.enchantment.BlessEnchantment; +import net.mcreator.biglifantasy.BiglifantasyMod; + +public class BiglifantasyModEnchantments { + public static final DeferredRegister REGISTRY = DeferredRegister.create(ForgeRegistries.ENCHANTMENTS, BiglifantasyMod.MODID); + public static final RegistryObject BLESS = REGISTRY.register("bless", () -> new BlessEnchantment()); +} diff --git a/src/main/java/net/mcreator/biglifantasy/init/BiglifantasyModItems.java b/src/main/java/net/mcreator/biglifantasy/init/BiglifantasyModItems.java new file mode 100644 index 0000000..ba69420 --- /dev/null +++ b/src/main/java/net/mcreator/biglifantasy/init/BiglifantasyModItems.java @@ -0,0 +1,26 @@ + +/* + * MCreator note: This file will be REGENERATED on each build. + */ +package net.mcreator.biglifantasy.init; + +import net.minecraftforge.registries.RegistryObject; +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.registries.DeferredRegister; + +import net.minecraft.world.level.block.Block; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.BlockItem; + +import net.mcreator.biglifantasy.item.TestSwordItem; +import net.mcreator.biglifantasy.BiglifantasyMod; + +public class BiglifantasyModItems { + public static final DeferredRegister REGISTRY = DeferredRegister.create(ForgeRegistries.ITEMS, BiglifantasyMod.MODID); + public static final RegistryObject TEST_SWORD = REGISTRY.register("test_sword", () -> new TestSwordItem()); + public static final RegistryObject TEST = block(BiglifantasyModBlocks.TEST); + + private static RegistryObject block(RegistryObject block) { + return REGISTRY.register(block.getId().getPath(), () -> new BlockItem(block.get(), new Item.Properties())); + } +} diff --git a/src/main/java/net/mcreator/biglifantasy/init/BiglifantasyModTabs.java b/src/main/java/net/mcreator/biglifantasy/init/BiglifantasyModTabs.java new file mode 100644 index 0000000..576f870 --- /dev/null +++ b/src/main/java/net/mcreator/biglifantasy/init/BiglifantasyModTabs.java @@ -0,0 +1,26 @@ + +/* + * MCreator note: This file will be REGENERATED on each build. + */ +package net.mcreator.biglifantasy.init; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.CreativeModeTabEvent; + +import net.minecraft.world.item.Items; +import net.minecraft.world.item.ItemStack; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.network.chat.Component; + +@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) +public class BiglifantasyModTabs { + @SubscribeEvent + public static void buildTabContentsModded(CreativeModeTabEvent.Register event) { + event.registerCreativeModeTab(new ResourceLocation("biglifantasy", "big_li_fantasy"), + builder -> builder.title(Component.translatable("item_group.biglifantasy.big_li_fantasy")).icon(() -> new ItemStack(Items.MUSIC_DISC_FAR)).displayItems((parameters, tabData) -> { + tabData.accept(BiglifantasyModItems.TEST_SWORD.get()); + tabData.accept(BiglifantasyModBlocks.TEST.get().asItem()); + }).withSearchBar()); + } +} diff --git a/src/main/java/net/mcreator/biglifantasy/item/TestSwordItem.java b/src/main/java/net/mcreator/biglifantasy/item/TestSwordItem.java new file mode 100644 index 0000000..d49e6ce --- /dev/null +++ b/src/main/java/net/mcreator/biglifantasy/item/TestSwordItem.java @@ -0,0 +1,47 @@ + +package net.mcreator.biglifantasy.item; + +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.item.crafting.Ingredient; +import net.minecraft.world.item.Tier; +import net.minecraft.world.item.SwordItem; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Item; + +public class TestSwordItem extends SwordItem { + public TestSwordItem() { + super(new Tier() { + public int getUses() { + return 100; + } + + public float getSpeed() { + return 4f; + } + + public float getAttackDamageBonus() { + return 498f; + } + + public int getLevel() { + return 1; + } + + public int getEnchantmentValue() { + return 2; + } + + public Ingredient getRepairIngredient() { + return Ingredient.of(); + } + }, 3, -3f, new Item.Properties().fireResistant()); + } + + @Override + @OnlyIn(Dist.CLIENT) + public boolean isFoil(ItemStack itemstack) { + return true; + } +} diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml new file mode 100644 index 0000000..50f4a2a --- /dev/null +++ b/src/main/resources/META-INF/mods.toml @@ -0,0 +1,22 @@ +modLoader="javafml" +loaderVersion="[45,)" +license="Academic Free License v3.0" + +[[mods]] +modId="biglifantasy" +version="1.0.0" +displayName="大力的幻想" +credits="Created using mod maker MCreator - https://mcreator.net/about" +displayURL="http://www.mcstarsky.top" +authors="Coldsmile, MCreator" + +[[dependencies.biglifantasy]] + modId="minecraft" + mandatory=true + versionRange="[1.19.4]" + ordering="NONE" + side="BOTH" + + + + diff --git a/src/main/resources/assets/biglifantasy/blockstates/test.json b/src/main/resources/assets/biglifantasy/blockstates/test.json new file mode 100644 index 0000000..b716587 --- /dev/null +++ b/src/main/resources/assets/biglifantasy/blockstates/test.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "biglifantasy:block/test" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/biglifantasy/lang/en_us.json b/src/main/resources/assets/biglifantasy/lang/en_us.json new file mode 100644 index 0000000..3c97e98 --- /dev/null +++ b/src/main/resources/assets/biglifantasy/lang/en_us.json @@ -0,0 +1,6 @@ +{ + "block.biglifantasy.test": "Test", + "enchantment.biglifantasy.bless": "Bless", + "item.biglifantasy.test_sword": "Test Sword", + "item_group.biglifantasy.big_li_fantasy": "BigLi\u0027s Fantasy" +} \ No newline at end of file diff --git a/src/main/resources/assets/biglifantasy/lang/zh_cn.json b/src/main/resources/assets/biglifantasy/lang/zh_cn.json new file mode 100644 index 0000000..1887e29 --- /dev/null +++ b/src/main/resources/assets/biglifantasy/lang/zh_cn.json @@ -0,0 +1,6 @@ +{ + "block.biglifantasy.test": "Test", + "enchantment.biglifantasy.bless": "护佑", + "item.biglifantasy.test_sword": "§4§l大§l§5力§l§6王§l§7剑 §l§0§m(测试刀)", + "item_group.biglifantasy.big_li_fantasy": "大力的幻想" +} \ No newline at end of file diff --git a/src/main/resources/assets/biglifantasy/models/block/test.json b/src/main/resources/assets/biglifantasy/models/block/test.json new file mode 100644 index 0000000..c551dfc --- /dev/null +++ b/src/main/resources/assets/biglifantasy/models/block/test.json @@ -0,0 +1,13 @@ +{ + "parent": "block/cube", + "textures": { + "down": "biglifantasy:block/test", + "up": "biglifantasy:block/test", + "north": "biglifantasy:block/test", + "east": "biglifantasy:block/test", + "south": "biglifantasy:block/test", + "west": "biglifantasy:block/test", + "particle": "biglifantasy:block/test" + }, + "render_type": "solid" +} \ No newline at end of file diff --git a/src/main/resources/assets/biglifantasy/models/item/test.json b/src/main/resources/assets/biglifantasy/models/item/test.json new file mode 100644 index 0000000..f70eaab --- /dev/null +++ b/src/main/resources/assets/biglifantasy/models/item/test.json @@ -0,0 +1,22 @@ +{ + "parent": "biglifantasy:block/test", + "display": { + "thirdperson": { + "rotation": [ + 10, + -45, + 170 + ], + "translation": [ + 0, + 1.5, + -2.75 + ], + "scale": [ + 0.375, + 0.375, + 0.375 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/biglifantasy/models/item/test_sword.json b/src/main/resources/assets/biglifantasy/models/item/test_sword.json new file mode 100644 index 0000000..f15f7ce --- /dev/null +++ b/src/main/resources/assets/biglifantasy/models/item/test_sword.json @@ -0,0 +1,6 @@ +{ + "parent": "item/handheld", + "textures": { + "layer0": "biglifantasy:item/big_li_sword" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/biglifantasy/textures/block/test.png b/src/main/resources/assets/biglifantasy/textures/block/test.png new file mode 100644 index 0000000..10c419f Binary files /dev/null and b/src/main/resources/assets/biglifantasy/textures/block/test.png differ diff --git a/src/main/resources/assets/biglifantasy/textures/item/big_li_sword.png b/src/main/resources/assets/biglifantasy/textures/item/big_li_sword.png new file mode 100644 index 0000000..15f9536 Binary files /dev/null and b/src/main/resources/assets/biglifantasy/textures/item/big_li_sword.png differ diff --git a/src/main/resources/data/biglifantasy/recipes/bless_book.json b/src/main/resources/data/biglifantasy/recipes/bless_book.json new file mode 100644 index 0000000..615458d --- /dev/null +++ b/src/main/resources/data/biglifantasy/recipes/bless_book.json @@ -0,0 +1,17 @@ +{ + "type": "minecraft:crafting_shapeless", + "group": "blessbook", + "category": "misc", + "ingredients": [ + { + "item": "minecraft:enchanted_book" + }, + { + "item": "minecraft:enchanted_book" + } + ], + "result": { + "item": "minecraft:enchanted_book", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/loot_tables/entities/ender_dragon.json b/src/main/resources/data/minecraft/loot_tables/entities/ender_dragon.json new file mode 100644 index 0000000..84a91f8 --- /dev/null +++ b/src/main/resources/data/minecraft/loot_tables/entities/ender_dragon.json @@ -0,0 +1,24 @@ +{ + "type": "minecraft:entity", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:elytra", + "weight": 1, + "functions": [ + { + "function": "set_count", + "count": { + "min": 1, + "max": 1 + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/loot_tables/entities/wither.json b/src/main/resources/data/minecraft/loot_tables/entities/wither.json new file mode 100644 index 0000000..7435b77 --- /dev/null +++ b/src/main/resources/data/minecraft/loot_tables/entities/wither.json @@ -0,0 +1,24 @@ +{ + "type": "minecraft:entity", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:wither_skeleton_skull", + "weight": 1, + "functions": [ + { + "function": "set_count", + "count": { + "min": 3, + "max": 3 + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta new file mode 100644 index 0000000..2525796 --- /dev/null +++ b/src/main/resources/pack.mcmeta @@ -0,0 +1,8 @@ +{ + "pack": { + "description": "biglifantasy mod resources", + "pack_format": 13, + "forge:resource_pack_format": 13, + "forge:data_pack_format": 12 + } +} \ No newline at end of file