This repository has been archived by the owner on Dec 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
339 changed files
with
4,500 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+26.8 KB
.../fabric-biomes-v1-0.2.4+4a08d6b20b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+31.9 KB
...ped_mods/fabric-biomes-v1-0.2.4+4a08d6b20b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+8.73 KB
...ockrenderlayer-v1-1.1.4+c6a8ea890b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+9.8 KB
...abric-blockrenderlayer-v1-1.1.4+c6a8ea890b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+7.58 KB
...ic-command-api-v1-1.0.3+da175ad60b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+8.79 KB
...ods/fabric-command-api-v1-1.0.3+da175ad60b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+2.81 KB
...abric-commands-v0-0.2.0+52d308360b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+3.14 KB
...d_mods/fabric-commands-v0-0.2.0+52d308360b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+15.6 KB
...ric-containers-v0-0.1.7+d249f7b60b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+16.8 KB
...mods/fabric-containers-v0-0.1.7+d249f7b60b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+18.6 KB
...ent-registries-v0-0.1.7+da175ad60b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+22.5 KB
...ric-content-registries-v0-0.1.7+da175ad60b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+5.28 KB
...sh-report-info-v1-0.1.2+b7f9825d0b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+6.76 KB
...bric-crash-report-info-v1-0.1.2+b7f9825d0b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+27 KB
...ts-interaction-v0-0.3.1+6d41837a0b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+33.5 KB
...ric-events-interaction-v0-0.3.1+6d41837a0b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+14.3 KB
...ents-lifecycle-v0-0.1.2+1a47cd780b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+17.5 KB
...abric-events-lifecycle-v0-0.1.2+1a47cd780b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+17 KB
...c-item-groups-v0-0.1.12+63435d4b0b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+23.1 KB
...ds/fabric-item-groups-v0-0.1.12+63435d4b0b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+11.3 KB
...ic-keybindings-v0-0.1.2+4a08d6b20b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+13.7 KB
...ods/fabric-keybindings-v0-0.1.2+4a08d6b20b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+18.4 KB
...ic-loot-tables-v1-0.1.8+da175ad60b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+22.3 KB
...ods/fabric-loot-tables-v1-0.1.8+da175ad60b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+5.27 KB
...-mining-levels-v0-0.1.2+b764ce990b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+5.46 KB
...s/fabric-mining-levels-v0-0.1.2+b764ce990b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+15.4 KB
.../fabric-models-v0-0.1.0+dfdb52d60b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+18.9 KB
...ped_mods/fabric-models-v0-0.1.0+dfdb52d60b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+8.83 KB
...ng-blockentity-v0-0.2.5+b50ffc7b0b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+10.3 KB
...networking-blockentity-v0-0.2.5+b50ffc7b0b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+31.8 KB
...ric-networking-v0-0.1.9+1a47cd780b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+35.8 KB
...mods/fabric-networking-v0-0.1.9+1a47cd780b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+32.2 KB
...ct-builder-api-v1-1.5.1+c6ab3e1b0b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+37 KB
...ric-object-builder-api-v1-1.5.1+c6ab3e1b0b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+15.9 KB
...bject-builders-v0-0.6.0+da175ad60b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+21 KB
...fabric-object-builders-v0-0.6.0+da175ad60b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+12.7 KB
...bric-particles-v1-0.1.3+4a08d6b20b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+17.7 KB
..._mods/fabric-particles-v1-0.1.3+4a08d6b20b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+39 KB
...-registry-sync-v0-0.3.4+da175ad60b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+55.3 KB
...s/fabric-registry-sync-v0-0.3.4+da175ad60b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+39 KB
...-renderer-api-v1-0.2.13+eae12eb80b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+32.6 KB
...s/fabric-renderer-api-v1-0.2.13+eae12eb80b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+80.9 KB
...c-renderer-indigo-0.3.0+4a01746c0b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+115 KB
...ds/fabric-renderer-indigo-0.3.0+4a01746c0b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+11.5 KB
...rer-registries-v1-2.0.1+5a0f9a600b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+15.7 KB
...ic-renderer-registries-v1-2.0.1+5a0f9a600b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+11.9 KB
...ata-attachment-v1-0.1.3+b7f9825d0b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+11.5 KB
...dering-data-attachment-v1-0.1.3+b7f9825d0b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+12.3 KB
...ndering-fluids-v1-0.1.7+12a8474c0b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+15.1 KB
...abric-rendering-fluids-v1-0.1.7+12a8474c0b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+7.35 KB
...bric-rendering-v0-1.1.0+534104900b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+9.36 KB
..._mods/fabric-rendering-v0-1.1.0+534104900b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+18.2 KB
...bric-rendering-v1-1.1.1+1aa9d4720b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+22.2 KB
..._mods/fabric-rendering-v1-1.1.1+1aa9d4720b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+29.5 KB
...esource-loader-v0-0.2.0+da175ad60b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+38.6 KB
...fabric-resource-loader-v0-0.2.0+da175ad60b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+11.6 KB
...tag-extensions-v0-0.2.4+2fd224ca0b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+13 KB
.../fabric-tag-extensions-v0-0.2.4+2fd224ca0b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+11.5 KB
...abric-textures-v0-1.0.4+eae12eb80b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+14.5 KB
...d_mods/fabric-textures-v0-1.0.4+eae12eb80b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
Binary file added
BIN
+26.4 KB
...-attribute-api-v1-1.1.1+da175ad60b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2-sources.jar
Binary file not shown.
Binary file added
BIN
+35.4 KB
...ric-tool-attribute-api-v1-1.1.1+da175ad60b@net.fabricmc.yarn.20w22a.20w22a+build.1-v2.jar
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
# Done to increase the memory available to gradle. | ||
org.gradle.jvmargs=-Xmx1G -Dhttps.proxyHost=127.0.0.1 -Dhttp.proxyHost=127.0.0.1 -Dhttps.proxyPort=10809 -Dhttp.proxyPort=10809 | ||
org.gradle.jvmargs=-Xmx1G -Dhttps.proxyHost=127.0.0.1 -Dhttp.proxyHost=127.0.0.1 -Dhttps.proxyPort=10809 -Dhttp.proxyPort=10809 -XX:+UseG1GC | ||
|
||
# Fabric Properties | ||
# check these on https://fabricmc.net/use | ||
minecraft_version=1.15.2 | ||
yarn_mappings=1.15.2+build.15 | ||
minecraft_version=20w22a | ||
yarn_mappings=20w22a+build.1 | ||
loader_version=0.8.4+build.198 | ||
|
||
# Mod Properties | ||
mod_version = 1.15.2-0.4.9 | ||
mod_version = 1.16-0.1.0 | ||
maven_group = io.github.squid233.squidcraft | ||
archives_base_name = SquidCraft | ||
|
||
# Dependencies | ||
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api | ||
fabric_version=0.10.8+build.310-1.15 | ||
fabric_version=0.11.1+build.350-1.16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#Tue May 26 13:24:44 CST 2020 | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
-XX:+UseLargePagesInMetaspace | ||
-XX:+UseG1GC | ||
-XX:+UnlockExperimentalVMOptions | ||
-XX:MaxGCPauseMillis=100 | ||
-XX:+DisableExplicitGC | ||
-XX:TargetSurvivorRatio=90 | ||
-XX:G1NewSizePercent=50 | ||
-XX:G1MaxNewSizePercent=80 | ||
-XX:G1MixedGCLiveThresholdPercent=35 | ||
-XX:+AlwaysPreTouch | ||
-XX:+ParallelRefProcEnabled | ||
-Dfabric.dli.config=D:\SquidCraft-1.16.x\.gradle\loom-cache\launch.cfg | ||
-Dfabric.dli.env=client | ||
-Dfabric.dli.main=net.fabricmc.loader.launch.knot.KnotClient |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package io.github.squid233.api.block; | ||
|
||
public abstract class Block extends net.minecraft.block.Block { | ||
|
||
public Block(Settings settings) { | ||
super(settings); | ||
} | ||
|
||
public abstract String getRegistryName(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package io.github.squid233.api.item; | ||
|
||
public abstract class Item extends net.minecraft.item.Item { | ||
|
||
public Item(Settings settings) { | ||
super(settings); | ||
} | ||
|
||
public abstract String getRegistryName(); | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/io/github/squid233/api/state/property/Properties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package io.github.squid233.api.state.property; | ||
|
||
import net.minecraft.state.property.DirectionProperty; | ||
import net.minecraft.util.math.Direction; | ||
|
||
public class Properties { | ||
} |
40 changes: 40 additions & 0 deletions
40
src/main/java/io/github/squid233/squidcraft/SquidCraft.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package io.github.squid233.squidcraft; | ||
|
||
import io.github.squid233.squidcraft.config.CreateConfig; | ||
import io.github.squid233.squidcraft.util.handle.LootTablesHandle; | ||
import io.github.squid233.squidcraft.util.registers.*; | ||
import net.fabricmc.api.ModInitializer; | ||
import org.apache.logging.log4j.LogManager; | ||
|
||
/** | ||
* @author squid233 and baka4n → (logger4j test)! | ||
*/ | ||
public final class SquidCraft implements ModInitializer { | ||
public static final String MODID = "squidcraft"; | ||
@Override | ||
public void onInitialize() { | ||
String s = "SquidCraft register all"; | ||
CreateConfig.config(); | ||
new ItemRegister(); | ||
log(s, "item register success"); | ||
new BlockRegister(); | ||
log(s, "block register success"); | ||
new FluidRegister(); | ||
log(s, "fluid register success"); | ||
new EnchantmentRegister(); | ||
log(s, "enchantment register success"); | ||
new WorldGenRegister(); | ||
log(s, "world generator register success"); | ||
new LootTablesHandle(); | ||
log(s, "loot table register success"); | ||
log(s, "load on initialize success"); | ||
} | ||
|
||
/** | ||
* @param s1 logger name | ||
* @param s2 logger info | ||
*/ | ||
public static void log(String s1, String s2) { | ||
LogManager.getLogger(s1).info(s2); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/main/java/io/github/squid233/squidcraft/api/BlockRegisters.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package io.github.squid233.squidcraft.api; | ||
|
||
import net.minecraft.block.Block; | ||
import net.minecraft.item.BlockItem; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.util.Identifier; | ||
import net.minecraft.util.registry.Registry; | ||
|
||
import static io.github.squid233.squidcraft.SquidCraft.log; | ||
|
||
public class BlockRegisters { | ||
/** | ||
* <h1>The register method</h1> | ||
* <p>You can use this method just like this below:</p> | ||
* <code>public static final {@link Block} EXAMPLE_BLOCK = register("modid", "example", new {@link Block}(new {@link Block.Settings}()), new {@link Item.Settings}());</code> | ||
* <p>After register, log4j will be remind you:</p> | ||
* <code>"register modid:example success!"<br> | ||
* "register modid:example block success!"</code> | ||
* @param modid Mod identifier. | ||
* @param name Block registry name. | ||
* @param block Block. | ||
* @param settings Block item settings. | ||
* @return Register block. | ||
*/ | ||
public static Block register(String modid, String name, Block block, Item.Settings settings) { | ||
String s = "register block and block item"; | ||
ItemRegisters.register(modid, name, new BlockItem(block, settings)); | ||
//ItemRegisters.register(modid, name, new BlockItem(block, settings)); | ||
log(s, "register " + modid + ":" + name + " block success!"); | ||
return Registry.register(Registry.BLOCK, new Identifier(modid, name), block); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/io/github/squid233/squidcraft/api/FluidRegister.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package io.github.squid233.squidcraft.api; | ||
|
||
import net.minecraft.block.Block; | ||
import net.minecraft.fluid.FlowableFluid; | ||
import net.minecraft.util.Identifier; | ||
import net.minecraft.util.registry.Registry; | ||
|
||
public class FluidRegister { | ||
/** | ||
* Let it cannot constructing | ||
*/ | ||
private FluidRegister() { | ||
|
||
} | ||
|
||
/** | ||
* This method can register still fluid and flowing fluid. | ||
* @param modid Mod identifier | ||
* @param fluidID Still fluid's register name is fluidID. Flowing fluid's register name is flowing_ + fluidID. | ||
* @param stillFluid The still fluid. | ||
* @param flowingFluid The flowing fluid. | ||
* @param fluidBlock The fluid block. | ||
*/ | ||
public static void registerFluid(String modid, String fluidID, FlowableFluid stillFluid, FlowableFluid flowingFluid, Block fluidBlock) { | ||
Registry.register(Registry.FLUID, new Identifier(modid, fluidID), stillFluid); | ||
Registry.register(Registry.FLUID, new Identifier(modid, "flowing_"+fluidID), flowingFluid); | ||
Registry.register(Registry.BLOCK, new Identifier(modid, fluidID), fluidBlock); | ||
} | ||
} |
125 changes: 125 additions & 0 deletions
125
src/main/java/io/github/squid233/squidcraft/api/ItemRegisters.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
package io.github.squid233.squidcraft.api; | ||
|
||
import net.minecraft.item.Item; | ||
import net.minecraft.util.Identifier; | ||
import net.minecraft.util.registry.Registry; | ||
|
||
import static io.github.squid233.squidcraft.SquidCraft.log; | ||
|
||
/** | ||
* items register api → (item, tool and armor) register. | ||
*/ | ||
public class ItemRegisters { | ||
|
||
/** | ||
* <h1>The register method</h1> | ||
* <p>You can use this method just like this below:</p> | ||
* <code>public static final {@link Item} EXAMPLE_ITEM = register("modid", "example", new {@link Item}(new {@link Item.Settings}());</code> | ||
* <p>After register, log4j will be remind you: "register modid:example success!"</p> | ||
* @param modid Mod identifier. | ||
* @param name Item registry name. | ||
* @param item Item. | ||
* @return Register item. | ||
*/ | ||
public static Item register(String modid, String name, Item item) { | ||
log("Items Register", "register " + modid + ":" + name + " success!"); | ||
return Registry.register(Registry.ITEM, new Identifier(modid, name), item); | ||
} | ||
|
||
/** | ||
* @param modid Mod identifier. | ||
* @param name Helmet prefix. | ||
* @param item Helmet item. | ||
* @return Register item. | ||
*/ | ||
public static Item registerHelmet(String modid, String name, Item item) { | ||
return register(modid, name + "_helmet", item); | ||
} | ||
|
||
/** | ||
* @param modid Mod identifier. | ||
* @param name Chestplate prefix. | ||
* @param item Chestplate item. | ||
* @return Register item. | ||
*/ | ||
public static Item registerChestplate(String modid, String name, Item item) { | ||
return register(modid, name + "_chestplate", item); | ||
} | ||
|
||
/** | ||
* @param modid Mod identifier. | ||
* @param name Leggings prefix. | ||
* @param item Leggings item. | ||
* @return Register item. | ||
*/ | ||
public static Item registerLeggings(String modid, String name, Item item) { | ||
return register(modid, name + "_leggings", item); | ||
} | ||
|
||
/** | ||
* @param modid Mod identifier. | ||
* @param name Boots prefix. | ||
* @param item Boots item. | ||
* @return Register item. | ||
*/ | ||
public static Item registerBoots(String modid, String name, Item item) { | ||
return register(modid, name + "_boots", item); | ||
} | ||
|
||
/** | ||
* @param modid Mod identifier. | ||
* @param name Axe prefix. | ||
* @param item Axe item. | ||
* @return Register item. | ||
*/ | ||
public static Item registerAxe(String modid, String name, Item item) { | ||
return register(modid, name + "_axe", item); | ||
} | ||
|
||
/** | ||
* @param modid Mod identifier. | ||
* @param name Hoe prefix. | ||
* @param item Hoe item. | ||
* @return Register item. | ||
*/ | ||
public static Item registerHoe(String modid, String name, Item item) { | ||
return register(modid, name + "_hoe", item); | ||
} | ||
|
||
/** | ||
* @param modid Mod identifier. | ||
* @param name Pickaxe prefix. | ||
* @param item Pickaxe item. | ||
* @return Register item. | ||
*/ | ||
public static Item registerPickaxe(String modid, String name, Item item) { | ||
return register(modid, name + "_pickaxe", item); | ||
} | ||
|
||
/** | ||
* @param modid Mod identifier. | ||
* @param name Shovel prefix. | ||
* @param item Shovel item. | ||
* @return Register item. | ||
*/ | ||
public static Item registerShovel(String modid, String name, Item item) { | ||
return register(modid, name + "_shovel", item); | ||
} | ||
|
||
/** | ||
* @param modid Mod identifier. | ||
* @param name Sword prefix. | ||
* @param item Sword item. | ||
* @return Register item. | ||
*/ | ||
public static Item registerSword(String modid, String name, Item item) { | ||
return register(modid, name + "_sword", item); | ||
} | ||
|
||
public static void registerAll(String modid, io.github.squid233.api.item.Item... items) { | ||
for (io.github.squid233.api.item.Item item : items) { | ||
register(modid, item.getRegistryName(), item); | ||
} | ||
} | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/io/github/squid233/squidcraft/api/SoundsRegister.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package io.github.squid233.squidcraft.api; | ||
|
||
import net.minecraft.sound.SoundEvent; | ||
import net.minecraft.util.Identifier; | ||
import net.minecraft.util.registry.Registry; | ||
import static io.github.squid233.squidcraft.SquidCraft.log; | ||
|
||
public class SoundsRegister { | ||
public static void registerSound(Identifier soundID, SoundEvent sound) { | ||
Registry.register(Registry.SOUND_EVENT, soundID, sound); | ||
log("register sounds", "register " + soundID + " success"); | ||
} | ||
} |
Oops, something went wrong.