This commit is contained in:
weold957 2023-09-07 23:31:36 +08:00 committed by 97589
commit c0b7d604af
38 changed files with 1265 additions and 0 deletions

20
.gitignore vendored Normal file
View File

@ -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

136
biglifantasy.mcreator Normal file
View File

@ -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
}

63
build.gradle Normal file
View File

@ -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'

View File

@ -0,0 +1,11 @@
{
"_fv": 47,
"_type": "tab",
"definition": {
"name": "BigLi's Fantasy",
"icon": {
"value": "Items.RECORD_FAR"
},
"showSearch": true
}
}

25
elements/Bless.mod.json Normal file
View File

@ -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
}
}

View File

@ -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"
}
}

View File

@ -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"
}
}

142
elements/Test.mod.json Normal file
View File

@ -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": "<NONE>",
"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
}
}

View File

@ -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
}
}

View File

@ -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"
}
}

2
gradle.properties Normal file
View File

@ -0,0 +1,2 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View File

@ -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

172
gradlew vendored Normal file
View File

@ -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" "$@"

84
gradlew.bat vendored Normal file
View File

@ -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

0
mcreator.gradle Normal file
View File

6
settings.gradle Normal file
View File

@ -0,0 +1,6 @@
pluginManagement {
repositories {
gradlePluginPortal()
maven { url = 'https://maven.minecraftforge.net/' }
}
}

View File

@ -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 <T> void addNetworkMessage(Class<T> messageType, BiConsumer<T, FriendlyByteBuf> encoder, Function<FriendlyByteBuf, T> decoder, BiConsumer<T, Supplier<NetworkEvent.Context>> messageConsumer) {
PACKET_HANDLER.registerMessage(messageID, messageType, encoder, decoder, messageConsumer);
messageID++;
}
private static final Collection<AbstractMap.SimpleEntry<Runnable, Integer>> 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<AbstractMap.SimpleEntry<Runnable, Integer>> 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);
}
}
}

View File

@ -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<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
List<ItemStack> dropsOriginal = super.getDrops(state, builder);
if (!dropsOriginal.isEmpty())
return dropsOriginal;
return Collections.singletonList(new ItemStack(this, 1));
}
}

View File

@ -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;
}
}

View File

@ -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<Block> REGISTRY = DeferredRegister.create(ForgeRegistries.BLOCKS, BiglifantasyMod.MODID);
public static final RegistryObject<Block> TEST = REGISTRY.register("test", () -> new TestBlock());
}

View File

@ -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<Enchantment> REGISTRY = DeferredRegister.create(ForgeRegistries.ENCHANTMENTS, BiglifantasyMod.MODID);
public static final RegistryObject<Enchantment> BLESS = REGISTRY.register("bless", () -> new BlessEnchantment());
}

View File

@ -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<Item> REGISTRY = DeferredRegister.create(ForgeRegistries.ITEMS, BiglifantasyMod.MODID);
public static final RegistryObject<Item> TEST_SWORD = REGISTRY.register("test_sword", () -> new TestSwordItem());
public static final RegistryObject<Item> TEST = block(BiglifantasyModBlocks.TEST);
private static RegistryObject<Item> block(RegistryObject<Block> block) {
return REGISTRY.register(block.getId().getPath(), () -> new BlockItem(block.get(), new Item.Properties()));
}
}

View File

@ -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());
}
}

View File

@ -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;
}
}

View File

@ -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"

View File

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "biglifantasy:block/test"
}
}
}

View File

@ -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"
}

View File

@ -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": "大力的幻想"
}

View File

@ -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"
}

View File

@ -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
]
}
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/handheld",
"textures": {
"layer0": "biglifantasy:item/big_li_sword"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

View File

@ -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
}
}

View File

@ -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
}
}
]
}
]
}
]
}

View File

@ -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
}
}
]
}
]
}
]
}

View File

@ -0,0 +1,8 @@
{
"pack": {
"description": "biglifantasy mod resources",
"pack_format": 13,
"forge:resource_pack_format": 13,
"forge:data_pack_format": 12
}
}