Compare commits

..

No commits in common. "332b3df6321334531864b69e4003a879840cf38d" and "f83d2c220fb21d593a6e92c372bc8c8914b271e0" have entirely different histories.

13 changed files with 554 additions and 332 deletions

View File

@ -20,10 +20,9 @@
nether_ore, bone, netherite, ancient_debris, lodestone, chain, nether_ore, bone, netherite, ancient_debris, lodestone, chain,
nether_gold_ore, gilded_blackstone, candle, amethyst_block, nether_gold_ore, gilded_blackstone, candle, amethyst_block,
amethyst_cluster, small_amethyst_bud, medium_amethyst_bud, amethyst_cluster, small_amethyst_bud, medium_amethyst_bud,
large_amethyst_bud, tuff, tuff_bricks, polished_tuff, calcite, large_amethyst_bud, tuff, calcite, dripstone_block,
dripstone_block, pointed_dripstone, copper, copper_bulb, pointed_dripstone, copper, cave_vines, spore_blossom, azalea,
copper_grate, cave_vines, spore_blossom, azalea, flowering_azalea, flowering_azalea, moss_carpet, pink_petals, moss_block, big_dripleaf,
moss_carpet, pink_petals, moss_block, big_dripleaf,
small_dripleaf, rooted_dirt, hanging_roots, azalea_leaves, small_dripleaf, rooted_dirt, hanging_roots, azalea_leaves,
sculk_sensor, sculk_catalyst, sculk, sculk_vein, sculk_shrieker, sculk_sensor, sculk_catalyst, sculk, sculk_vein, sculk_shrieker,
glow_lichen, deepslate, deepslate_bricks, deepslate_tiles, glow_lichen, deepslate, deepslate_bricks, deepslate_tiles,
@ -32,9 +31,7 @@
nether_wood_hanging_sign, bamboo_wood_hanging_sign, bamboo_wood, nether_wood_hanging_sign, bamboo_wood_hanging_sign, bamboo_wood,
nether_wood, cherry_wood, cherry_sapling, cherry_leaves, nether_wood, cherry_wood, cherry_sapling, cherry_leaves,
cherry_wood_hanging_sign, chiseled_bookshelf, suspicious_sand, cherry_wood_hanging_sign, chiseled_bookshelf, suspicious_sand,
suspicious_gravel, decorated_pot, decorated_pot_shatter, suspicious_gravel, decorated_pot, decorated_pot_shatter
trial_spawner, sponge, wet_sponge, vault, heavy_core,
cobweb
changes how the block sounds changes how the block sounds
"dropTableId" ~ string "dropTableId" ~ string
@ -58,7 +55,7 @@
"slipperiness" ~ float "slipperiness" ~ float
"movementVelocityMultiplier" ~ float "slowDownMultiplier" ~ float
"jumpVelocityMultiplier" ~ float "jumpVelocityMultiplier" ~ float

View File

@ -1,6 +1,5 @@
plugins { plugins {
id "com.modrinth.minotaur" version "2.+" id 'fabric-loom' version '1.2-SNAPSHOT'
id 'fabric-loom' version '1.7-SNAPSHOT'
id 'maven-publish' id 'maven-publish'
} }
@ -49,11 +48,18 @@ dependencies {
// Uncomment the following line to enable the deprecated Fabric API modules. // Uncomment the following line to enable the deprecated Fabric API modules.
// These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time. // These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time.
modImplementation "maven.modrinth:midnightlib:${project.midnightlib_version}"
include "maven.modrinth:midnightlib:${project.midnightlib_version}"
modImplementation("me.shedaniel.cloth:cloth-config-fabric:$project.cloth_config_version") include(modApi(platform("de.siphalor.tweed4:tweed4-bom-$project.minecraft_major_version:$project.tweed_version")))
// Pick any modules you want to use, e.g.:
include(modApi("de.siphalor.tweed4:tweed4-base-$project.minecraft_major_version"))
include(modApi("de.siphalor.tweed4:tweed4-annotated-$project.minecraft_major_version"))
include(modApi("de.siphalor.tweed4:tweed4-data-$project.minecraft_major_version"))
include(modApi("de.siphalor.tweed4:tweed4-data-hjson-$project.minecraft_major_version"))
//include(modApi("de.siphalor.tweed4:tweed4-tailor-cloth-$project.minecraft_major_version"))
include(modApi("de.siphalor.tweed4:tweed4-tailor-screen-$project.minecraft_major_version"))
modImplementation("me.shedaniel.cloth:cloth-config-fabric:$project.cloth_config_version")
// modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}" // modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}"
} }
@ -73,7 +79,7 @@ processResources {
} }
tasks.withType(JavaCompile).configureEach { tasks.withType(JavaCompile).configureEach {
it.options.release = 21 it.options.release = 17
} }
java { java {
@ -82,8 +88,8 @@ java {
// If you remove this line, sources will not be generated. // If you remove this line, sources will not be generated.
withSourcesJar() withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_21 sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_21 targetCompatibility = JavaVersion.VERSION_17
} }
jar { jar {
@ -92,16 +98,6 @@ jar {
} }
} }
import com.modrinth.minotaur.dependencies.ModDependency
modrinth {
projectId = 'vHsuCD0F' // The ID of your Modrinth project. Slugs will not work.
uploadFile = remapJar // Tells Minotaur to use the remapped jar
versionType = "alpha"
dependencies = [
new ModDependency('P7dR8mSH', 'required'), //required dependency on Fabric API
]
}
// configure the maven publication // configure the maven publication
publishing { publishing {
publications { publications {

View File

@ -1,17 +1,18 @@
org.gradle.jvmargs = -Xmx1G org.gradle.jvmargs = -Xmx1G
#Fabric properties #Fabric properties
minecraft_version=1.21 minecraft_version=1.20.1
yarn_mappings=1.21+build.8 minecraft_major_version=1.20
loader_version=0.15.11 yarn_mappings=1.20.1+build.9
loader_version=0.14.21
# Fabric API #Fabric api
fabric_version=0.100.6+1.21 fabric_version=0.84.0+1.20.1
#Mod properties #Mod properties
mod_version = 0.10.2 mod_version = 0.10.1
maven_group = quimufu.simple_creator maven_group = quimufu.simple_creator
archives_base_name = simple_creator archives_base_name = simple_creator
cloth_config_version=15.0.127 tweed_version=1.3.0+mc1.20-pre1
midnightlib_version=1.5.7-fabric cloth_config_version=11.0.99

View File

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

View File

@ -4,6 +4,7 @@ import com.google.common.collect.Maps;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.registry.FlammableBlockRegistry; import net.fabricmc.fabric.api.registry.FlammableBlockRegistry;
@ -11,17 +12,15 @@ import net.minecraft.block.AbstractBlock;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.MapColor; import net.minecraft.block.MapColor;
import net.minecraft.block.enums.NoteBlockInstrument; import net.minecraft.block.enums.Instrument;
import net.minecraft.block.piston.PistonBehavior; import net.minecraft.block.piston.PistonBehavior;
import net.minecraft.entity.EntityType; import net.minecraft.entity.EntityType;
import net.minecraft.item.BlockItem; import net.minecraft.item.BlockItem;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemGroup;
import net.minecraft.loot.LootTable;
import net.minecraft.registry.Registries; import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry; import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey; import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.sound.BlockSoundGroup; import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import net.minecraft.util.Pair; import net.minecraft.util.Pair;
@ -59,7 +58,6 @@ public class BlockResourceLoader extends GenericManualResourceLoader<Pair<Block,
@Override @Override
protected Pair<Block, Item> deserialize(Pair<Identifier, JsonObject> e) { protected Pair<Block, Item> deserialize(Pair<Identifier, JsonObject> e) {
JsonObject jo = e.getRight(); JsonObject jo = e.getRight();
log(Level.INFO, e.getRight().toString());
// get block information // get block information
BlockSettingsPojo bspj = GSON.fromJson(jo, BlockSettingsPojo.class); BlockSettingsPojo bspj = GSON.fromJson(jo, BlockSettingsPojo.class);
@ -72,7 +70,7 @@ public class BlockResourceLoader extends GenericManualResourceLoader<Pair<Block,
RegistryKey<ItemGroup> g = ItemResourceLoader.findGroup(group); RegistryKey<ItemGroup> g = ItemResourceLoader.findGroup(group);
//create block and corresponding item //create block and corresponding item
Block resB = new Block(bs); Block resB = new Block(bs);
Item resI = new BlockItem(resB, new Item.Settings()); Item resI = new BlockItem(resB, new FabricItemSettings());
ItemGroupEvents.modifyEntriesEvent(g).register(content -> content.add(resI)); ItemGroupEvents.modifyEntriesEvent(g).register(content -> content.add(resI));
int burnChance = bspj.burnChance; int burnChance = bspj.burnChance;
@ -91,7 +89,7 @@ public class BlockResourceLoader extends GenericManualResourceLoader<Pair<Block,
fabricBlockSettings fabricBlockSettings
.collidable(bspj.collidable) .collidable(bspj.collidable)
.slipperiness(bspj.slipperiness) .slipperiness(bspj.slipperiness)
.velocityMultiplier(bspj.movementVelocityMultiplier) .velocityMultiplier(bspj.slowDownMultiplier)
.jumpVelocityMultiplier(bspj.jumpVelocityMultiplier) .jumpVelocityMultiplier(bspj.jumpVelocityMultiplier)
.sounds(getSoundGroup(bspj.soundGroup)) .sounds(getSoundGroup(bspj.soundGroup))
.drops(getDropTableId(bspj.dropTableId)) .drops(getDropTableId(bspj.dropTableId))
@ -142,49 +140,73 @@ public class BlockResourceLoader extends GenericManualResourceLoader<Pair<Block,
return fabricBlockSettings; return fabricBlockSettings;
} }
private NoteBlockInstrument getInstrument(String instrument) { private Instrument getInstrument(String instrument) {
return switch (instrument.toUpperCase()) { switch (instrument.toUpperCase()) {
case "HARP" -> NoteBlockInstrument.HARP; case "HARP":
case "BASEDRUM" -> NoteBlockInstrument.BASEDRUM; return Instrument.HARP;
case "SNARE" -> NoteBlockInstrument.SNARE; case "BASEDRUM":
case "HAT" -> NoteBlockInstrument.HAT; return Instrument.BASEDRUM;
case "BASS" -> NoteBlockInstrument.BASS; case "SNARE":
case "FLUTE" -> NoteBlockInstrument.FLUTE; return Instrument.SNARE;
case "BELL" -> NoteBlockInstrument.BELL; case "HAT":
case "GUITAR" -> NoteBlockInstrument.GUITAR; return Instrument.HAT;
case "CHIME" -> NoteBlockInstrument.CHIME; case "BASS":
case "XYLOPHONE" -> NoteBlockInstrument.XYLOPHONE; return Instrument.BASS;
case "IRON_XYLOPHONE" -> NoteBlockInstrument.IRON_XYLOPHONE; case "FLUTE":
case "COW_BELL" -> NoteBlockInstrument.COW_BELL; return Instrument.FLUTE;
case "DIDGERIDOO" -> NoteBlockInstrument.DIDGERIDOO; case "BELL":
case "BIT" -> NoteBlockInstrument.BIT; return Instrument.BELL;
case "BANJO" -> NoteBlockInstrument.BANJO; case "GUITAR":
case "PLING" -> NoteBlockInstrument.PLING; return Instrument.GUITAR;
case "ZOMBIE" -> NoteBlockInstrument.ZOMBIE; case "CHIME":
case "SKELETON" -> NoteBlockInstrument.SKELETON; return Instrument.CHIME;
case "CREEPER" -> NoteBlockInstrument.CREEPER; case "XYLOPHONE":
case "DRAGON" -> NoteBlockInstrument.DRAGON; return Instrument.XYLOPHONE;
case "WITHER_SKELETON" -> NoteBlockInstrument.WITHER_SKELETON; case "IRON_XYLOPHONE":
case "PIGLIN" -> NoteBlockInstrument.PIGLIN; return Instrument.IRON_XYLOPHONE;
case "CUSTOM_HEAD" -> NoteBlockInstrument.CUSTOM_HEAD; case "COW_BELL":
default -> { return Instrument.COW_BELL;
case "DIDGERIDOO":
return Instrument.DIDGERIDOO;
case "BIT":
return Instrument.BIT;
case "BANJO":
return Instrument.BANJO;
case "PLING":
return Instrument.PLING;
case "ZOMBIE":
return Instrument.ZOMBIE;
case "SKELETON":
return Instrument.SKELETON;
case "CREEPER":
return Instrument.CREEPER;
case "DRAGON":
return Instrument.DRAGON;
case "WITHER_SKELETON":
return Instrument.WITHER_SKELETON;
case "PIGLIN":
return Instrument.PIGLIN;
case "CUSTOM_HEAD":
return Instrument.CUSTOM_HEAD;
default:
log(Level.WARN, "Instrument " + instrument + " not found, using harp"); log(Level.WARN, "Instrument " + instrument + " not found, using harp");
yield NoteBlockInstrument.HARP; return Instrument.HARP;
} }
};
} }
private AbstractBlock.OffsetType getOffset(String modelOffset) { private AbstractBlock.OffsetType getOffset(String modelOffset) {
return switch (modelOffset.toUpperCase()) { switch (modelOffset.toUpperCase()) {
case "NONE" -> AbstractBlock.OffsetType.NONE; case "NONE":
case "XZ" -> AbstractBlock.OffsetType.XZ; return AbstractBlock.OffsetType.NONE;
case "XYZ" -> AbstractBlock.OffsetType.XYZ; case "XZ":
default -> { return AbstractBlock.OffsetType.XZ;
case "XYZ":
return AbstractBlock.OffsetType.XYZ;
default:
log(Level.WARN, "ModelOffset " + modelOffset + " not found, using none"); log(Level.WARN, "ModelOffset " + modelOffset + " not found, using none");
yield AbstractBlock.OffsetType.NONE; return AbstractBlock.OffsetType.NONE;
} }
};
} }
@ -213,221 +235,386 @@ public class BlockResourceLoader extends GenericManualResourceLoader<Pair<Block,
} }
private PistonBehavior getPistonBehavior(String pistonBehavior) { private PistonBehavior getPistonBehavior(String pistonBehavior) {
return switch (pistonBehavior.toUpperCase()) { switch (pistonBehavior.toUpperCase()) {
case "NORMAL" -> PistonBehavior.NORMAL; case "NORMAL" -> {
case "DESTROY" -> PistonBehavior.DESTROY; return PistonBehavior.NORMAL;
case "BLOCK" -> PistonBehavior.BLOCK; }
case "IGNORE" -> PistonBehavior.IGNORE; case "DESTROY" -> {
case "PUSH_ONLY" -> PistonBehavior.PUSH_ONLY; return PistonBehavior.DESTROY;
}
case "BLOCK" -> {
return PistonBehavior.BLOCK;
}
case "IGNORE" -> {
return PistonBehavior.IGNORE;
}
case "PUSH_ONLY" -> {
return PistonBehavior.PUSH_ONLY;
}
default -> { default -> {
log(Level.WARN, "Piston Behavior " + pistonBehavior + " not found, using normal"); log(Level.WARN, "Piston Behavior " + pistonBehavior + " not found, using normal");
yield PistonBehavior.NORMAL; return PistonBehavior.NORMAL;
} }
}; }
} }
private MapColor getMapColor(String color) { private MapColor getMapColor(String color) {
return switch (color.toUpperCase()) { switch (color.toUpperCase()) {
case "CLEAR" -> MapColor.CLEAR; case "CLEAR":
case "PALE_GREEN" -> MapColor.PALE_GREEN; return MapColor.CLEAR;
case "PALE_YELLOW" -> MapColor.PALE_YELLOW; case "PALE_GREEN":
case "WHITE_GRAY" -> MapColor.WHITE_GRAY; return MapColor.PALE_GREEN;
case "BRIGHT_RED" -> MapColor.BRIGHT_RED; case "PALE_YELLOW":
case "PALE_PURPLE" -> MapColor.PALE_PURPLE; return MapColor.PALE_YELLOW;
case "IRON_GRAY" -> MapColor.IRON_GRAY; case "WHITE_GRAY":
case "DARK_GREEN" -> MapColor.DARK_GREEN; return MapColor.WHITE_GRAY;
case "WHITE" -> MapColor.WHITE; case "BRIGHT_RED":
case "LIGHT_BLUE_GRAY" -> MapColor.LIGHT_BLUE_GRAY; return MapColor.BRIGHT_RED;
case "DIRT_BROWN" -> MapColor.DIRT_BROWN; case "PALE_PURPLE":
case "STONE_GRAY" -> MapColor.STONE_GRAY; return MapColor.PALE_PURPLE;
case "WATER_BLUE" -> MapColor.WATER_BLUE; case "IRON_GRAY":
case "OAK_TAN" -> MapColor.OAK_TAN; return MapColor.IRON_GRAY;
case "OFF_WHITE" -> MapColor.OFF_WHITE; case "DARK_GREEN":
case "ORANGE" -> MapColor.ORANGE; return MapColor.DARK_GREEN;
case "MAGENTA" -> MapColor.MAGENTA; case "WHITE":
case "LIGHT_BLUE" -> MapColor.LIGHT_BLUE; return MapColor.WHITE;
case "YELLOW" -> MapColor.YELLOW; case "LIGHT_BLUE_GRAY":
case "LIME" -> MapColor.LIME; return MapColor.LIGHT_BLUE_GRAY;
case "PINK" -> MapColor.PINK; case "DIRT_BROWN":
case "GRAY" -> MapColor.GRAY; return MapColor.DIRT_BROWN;
case "LIGHT_GRAY" -> MapColor.LIGHT_GRAY; case "STONE_GRAY":
case "CYAN" -> MapColor.CYAN; return MapColor.STONE_GRAY;
case "PURPLE" -> MapColor.PURPLE; case "WATER_BLUE":
case "BLUE" -> MapColor.BLUE; return MapColor.WATER_BLUE;
case "BROWN" -> MapColor.BROWN; case "OAK_TAN":
case "GREEN" -> MapColor.GREEN; return MapColor.OAK_TAN;
case "RED" -> MapColor.RED; case "OFF_WHITE":
case "BLACK" -> MapColor.BLACK; return MapColor.OFF_WHITE;
case "GOLD" -> MapColor.GOLD; case "ORANGE":
case "DIAMOND_BLUE" -> MapColor.DIAMOND_BLUE; return MapColor.ORANGE;
case "LAPIS_BLUE" -> MapColor.LAPIS_BLUE; case "MAGENTA":
case "EMERALD_GREEN" -> MapColor.EMERALD_GREEN; return MapColor.MAGENTA;
case "SPRUCE_BROWN" -> MapColor.SPRUCE_BROWN; case "LIGHT_BLUE":
case "DARK_RED" -> MapColor.DARK_RED; return MapColor.LIGHT_BLUE;
case "TERRACOTTA_WHITE" -> MapColor.TERRACOTTA_WHITE; case "YELLOW":
case "TERRACOTTA_ORANGE" -> MapColor.TERRACOTTA_ORANGE; return MapColor.YELLOW;
case "TERRACOTTA_MAGENTA" -> MapColor.TERRACOTTA_MAGENTA; case "LIME":
case "TERRACOTTA_LIGHT_BLUE" -> MapColor.TERRACOTTA_LIGHT_BLUE; return MapColor.LIME;
case "TERRACOTTA_YELLOW" -> MapColor.TERRACOTTA_YELLOW; case "PINK":
case "TERRACOTTA_LIME" -> MapColor.TERRACOTTA_LIME; return MapColor.PINK;
case "TERRACOTTA_PINK" -> MapColor.TERRACOTTA_PINK; case "GRAY":
case "TERRACOTTA_GRAY" -> MapColor.TERRACOTTA_GRAY; return MapColor.GRAY;
case "TERRACOTTA_LIGHT_GRAY" -> MapColor.TERRACOTTA_LIGHT_GRAY; case "LIGHT_GRAY":
case "TERRACOTTA_CYAN" -> MapColor.TERRACOTTA_CYAN; return MapColor.LIGHT_GRAY;
case "TERRACOTTA_PURPLE" -> MapColor.TERRACOTTA_PURPLE; case "CYAN":
case "TERRACOTTA_BLUE" -> MapColor.TERRACOTTA_BLUE; return MapColor.CYAN;
case "TERRACOTTA_BROWN" -> MapColor.TERRACOTTA_BROWN; case "PURPLE":
case "TERRACOTTA_GREEN" -> MapColor.TERRACOTTA_GREEN; return MapColor.PURPLE;
case "TERRACOTTA_RED" -> MapColor.TERRACOTTA_RED; case "BLUE":
case "TERRACOTTA_BLACK" -> MapColor.TERRACOTTA_BLACK; return MapColor.BLUE;
case "DULL_RED" -> MapColor.DULL_RED; case "BROWN":
case "DULL_PINK" -> MapColor.DULL_PINK; return MapColor.BROWN;
case "DARK_CRIMSON" -> MapColor.DARK_CRIMSON; case "GREEN":
case "TEAL" -> MapColor.TEAL; return MapColor.GREEN;
case "DARK_AQUA" -> MapColor.DARK_AQUA; case "RED":
case "DARK_DULL_PINK" -> MapColor.DARK_DULL_PINK; return MapColor.RED;
case "BRIGHT_TEAL" -> MapColor.BRIGHT_TEAL; case "BLACK":
case "DEEPSLATE_GRAY" -> MapColor.DEEPSLATE_GRAY; return MapColor.BLACK;
case "RAW_IRON_PINK" -> MapColor.RAW_IRON_PINK; case "GOLD":
case "LICHEN_GREEN" -> MapColor.LICHEN_GREEN; return MapColor.GOLD;
default -> { case "DIAMOND_BLUE":
return MapColor.DIAMOND_BLUE;
case "LAPIS_BLUE":
return MapColor.LAPIS_BLUE;
case "EMERALD_GREEN":
return MapColor.EMERALD_GREEN;
case "SPRUCE_BROWN":
return MapColor.SPRUCE_BROWN;
case "DARK_RED":
return MapColor.DARK_RED;
case "TERRACOTTA_WHITE":
return MapColor.TERRACOTTA_WHITE;
case "TERRACOTTA_ORANGE":
return MapColor.TERRACOTTA_ORANGE;
case "TERRACOTTA_MAGENTA":
return MapColor.TERRACOTTA_MAGENTA;
case "TERRACOTTA_LIGHT_BLUE":
return MapColor.TERRACOTTA_LIGHT_BLUE;
case "TERRACOTTA_YELLOW":
return MapColor.TERRACOTTA_YELLOW;
case "TERRACOTTA_LIME":
return MapColor.TERRACOTTA_LIME;
case "TERRACOTTA_PINK":
return MapColor.TERRACOTTA_PINK;
case "TERRACOTTA_GRAY":
return MapColor.TERRACOTTA_GRAY;
case "TERRACOTTA_LIGHT_GRAY":
return MapColor.TERRACOTTA_LIGHT_GRAY;
case "TERRACOTTA_CYAN":
return MapColor.TERRACOTTA_CYAN;
case "TERRACOTTA_PURPLE":
return MapColor.TERRACOTTA_PURPLE;
case "TERRACOTTA_BLUE":
return MapColor.TERRACOTTA_BLUE;
case "TERRACOTTA_BROWN":
return MapColor.TERRACOTTA_BROWN;
case "TERRACOTTA_GREEN":
return MapColor.TERRACOTTA_GREEN;
case "TERRACOTTA_RED":
return MapColor.TERRACOTTA_RED;
case "TERRACOTTA_BLACK":
return MapColor.TERRACOTTA_BLACK;
case "DULL_RED":
return MapColor.DULL_RED;
case "DULL_PINK":
return MapColor.DULL_PINK;
case "DARK_CRIMSON":
return MapColor.DARK_CRIMSON;
case "TEAL":
return MapColor.TEAL;
case "DARK_AQUA":
return MapColor.DARK_AQUA;
case "DARK_DULL_PINK":
return MapColor.DARK_DULL_PINK;
case "BRIGHT_TEAL":
return MapColor.BRIGHT_TEAL;
case "DEEPSLATE_GRAY":
return MapColor.DEEPSLATE_GRAY;
case "RAW_IRON_PINK":
return MapColor.RAW_IRON_PINK;
case "LICHEN_GREEN":
return MapColor.LICHEN_GREEN;
default:
log(Level.WARN, "MapColor " + color + " not found, using pink"); log(Level.WARN, "MapColor " + color + " not found, using pink");
yield MapColor.PINK; return MapColor.PINK;
} }
};
} }
private RegistryKey<LootTable> getDropTableId(String s) { private Identifier getDropTableId(String s) {
if (s == null) if (s == null)
return null; return null;
Identifier i = Identifier.tryParse(s); Identifier i = Identifier.tryParse(s);
if (i == null) { if (i == null) {
log(Level.WARN, "Drop table invalid " + s + ", using default"); log(Level.WARN, "Drop table invalid " + s + ", using default");
i = null;
} }
return RegistryKey.of(RegistryKeys.LOOT_TABLE, i); return i;
} }
private BlockSoundGroup getSoundGroup(String s) { private BlockSoundGroup getSoundGroup(String s) {
return switch (s.toUpperCase()) { switch (s.toUpperCase()) {
case "INTENTIONALLY_EMPTY" -> BlockSoundGroup.INTENTIONALLY_EMPTY; case "INTENTIONALLY_EMPTY":
case "WOOD" -> BlockSoundGroup.WOOD; return BlockSoundGroup.INTENTIONALLY_EMPTY;
case "GRAVEL" -> BlockSoundGroup.GRAVEL; case "WOOD":
case "GRASS" -> BlockSoundGroup.GRASS; return BlockSoundGroup.WOOD;
case "LILY_PAD" -> BlockSoundGroup.LILY_PAD; case "GRAVEL":
case "STONE" -> BlockSoundGroup.STONE; return BlockSoundGroup.GRAVEL;
case "METAL" -> BlockSoundGroup.METAL; case "GRASS":
case "GLASS" -> BlockSoundGroup.GLASS; return BlockSoundGroup.GRASS;
case "WOOL" -> BlockSoundGroup.WOOL; case "LILY_PAD":
case "SAND" -> BlockSoundGroup.SAND; return BlockSoundGroup.LILY_PAD;
case "SNOW" -> BlockSoundGroup.SNOW; case "STONE":
case "POWDER_SNOW" -> BlockSoundGroup.POWDER_SNOW; return BlockSoundGroup.STONE;
case "LADDER" -> BlockSoundGroup.LADDER; case "METAL":
case "ANVIL" -> BlockSoundGroup.ANVIL; return BlockSoundGroup.METAL;
case "SLIME" -> BlockSoundGroup.SLIME; case "GLASS":
case "HONEY" -> BlockSoundGroup.HONEY; return BlockSoundGroup.GLASS;
case "WET_GRASS" -> BlockSoundGroup.WET_GRASS; case "WOOL":
case "CORAL" -> BlockSoundGroup.CORAL; return BlockSoundGroup.WOOL;
case "BAMBOO" -> BlockSoundGroup.BAMBOO; case "SAND":
case "BAMBOO_SAPLING" -> BlockSoundGroup.BAMBOO_SAPLING; return BlockSoundGroup.SAND;
case "SCAFFOLDING" -> BlockSoundGroup.SCAFFOLDING; case "SNOW":
case "SWEET_BERRY_BUSH" -> BlockSoundGroup.SWEET_BERRY_BUSH; return BlockSoundGroup.SNOW;
case "CROP" -> BlockSoundGroup.CROP; case "POWDER_SNOW":
case "STEM" -> BlockSoundGroup.STEM; return BlockSoundGroup.POWDER_SNOW;
case "VINE" -> BlockSoundGroup.VINE; case "LADDER":
case "NETHER_WART" -> BlockSoundGroup.NETHER_WART; return BlockSoundGroup.LADDER;
case "LANTERN" -> BlockSoundGroup.LANTERN; case "ANVIL":
case "NETHER_STEM" -> BlockSoundGroup.NETHER_STEM; return BlockSoundGroup.ANVIL;
case "NYLIUM" -> BlockSoundGroup.NYLIUM; case "SLIME":
case "FUNGUS" -> BlockSoundGroup.FUNGUS; return BlockSoundGroup.SLIME;
case "ROOTS" -> BlockSoundGroup.ROOTS; case "HONEY":
case "SHROOMLIGHT" -> BlockSoundGroup.SHROOMLIGHT; return BlockSoundGroup.HONEY;
case "WEEPING_VINES" -> BlockSoundGroup.WEEPING_VINES; case "WET_GRASS":
case "WEEPING_VINES_LOW_PITCH" -> BlockSoundGroup.WEEPING_VINES_LOW_PITCH; return BlockSoundGroup.WET_GRASS;
case "SOUL_SAND" -> BlockSoundGroup.SOUL_SAND; case "CORAL":
case "SOUL_SOIL" -> BlockSoundGroup.SOUL_SOIL; return BlockSoundGroup.CORAL;
case "BASALT" -> BlockSoundGroup.BASALT; case "BAMBOO":
case "WART_BLOCK" -> BlockSoundGroup.WART_BLOCK; return BlockSoundGroup.BAMBOO;
case "NETHERRACK" -> BlockSoundGroup.NETHERRACK; case "BAMBOO_SAPLING":
case "NETHER_BRICKS" -> BlockSoundGroup.NETHER_BRICKS; return BlockSoundGroup.BAMBOO_SAPLING;
case "NETHER_SPROUTS" -> BlockSoundGroup.NETHER_SPROUTS; case "SCAFFOLDING":
case "NETHER_ORE" -> BlockSoundGroup.NETHER_ORE; return BlockSoundGroup.SCAFFOLDING;
case "BONE" -> BlockSoundGroup.BONE; case "SWEET_BERRY_BUSH":
case "NETHERITE" -> BlockSoundGroup.NETHERITE; return BlockSoundGroup.SWEET_BERRY_BUSH;
case "ANCIENT_DEBRIS" -> BlockSoundGroup.ANCIENT_DEBRIS; case "CROP":
case "LODESTONE" -> BlockSoundGroup.LODESTONE; return BlockSoundGroup.CROP;
case "CHAIN" -> BlockSoundGroup.CHAIN; case "STEM":
case "NETHER_GOLD_ORE" -> BlockSoundGroup.NETHER_GOLD_ORE; return BlockSoundGroup.STEM;
case "GILDED_BLACKSTONE" -> BlockSoundGroup.GILDED_BLACKSTONE; case "VINE":
case "CANDLE" -> BlockSoundGroup.CANDLE; return BlockSoundGroup.VINE;
case "AMETHYST_BLOCK" -> BlockSoundGroup.AMETHYST_BLOCK; case "NETHER_WART":
case "AMETHYST_CLUSTER" -> BlockSoundGroup.AMETHYST_CLUSTER; return BlockSoundGroup.NETHER_WART;
case "SMALL_AMETHYST_BUD" -> BlockSoundGroup.SMALL_AMETHYST_BUD; case "LANTERN":
case "MEDIUM_AMETHYST_BUD" -> BlockSoundGroup.MEDIUM_AMETHYST_BUD; return BlockSoundGroup.LANTERN;
case "LARGE_AMETHYST_BUD" -> BlockSoundGroup.LARGE_AMETHYST_BUD; case "NETHER_STEM":
case "TUFF" -> BlockSoundGroup.TUFF; return BlockSoundGroup.NETHER_STEM;
case "TUFF_BRICKS" -> BlockSoundGroup.TUFF_BRICKS; case "NYLIUM":
case "POLISHED_TUFF" -> BlockSoundGroup.POLISHED_TUFF; return BlockSoundGroup.NYLIUM;
case "CALCITE" -> BlockSoundGroup.CALCITE; case "FUNGUS":
case "DRIPSTONE_BLOCK" -> BlockSoundGroup.DRIPSTONE_BLOCK; return BlockSoundGroup.FUNGUS;
case "POINTED_DRIPSTONE" -> BlockSoundGroup.POINTED_DRIPSTONE; case "ROOTS":
case "COPPER" -> BlockSoundGroup.COPPER; return BlockSoundGroup.ROOTS;
case "COPPER_BULB" -> BlockSoundGroup.COPPER_BULB; case "SHROOMLIGHT":
case "COPPER_GRATE" -> BlockSoundGroup.COPPER_GRATE; return BlockSoundGroup.SHROOMLIGHT;
case "CAVE_VINES" -> BlockSoundGroup.CAVE_VINES; case "WEEPING_VINES":
case "SPORE_BLOSSOM" -> BlockSoundGroup.SPORE_BLOSSOM; return BlockSoundGroup.WEEPING_VINES;
case "AZALEA" -> BlockSoundGroup.AZALEA; case "WEEPING_VINES_LOW_PITCH":
case "FLOWERING_AZALEA" -> BlockSoundGroup.FLOWERING_AZALEA; return BlockSoundGroup.WEEPING_VINES_LOW_PITCH;
case "MOSS_CARPET" -> BlockSoundGroup.MOSS_CARPET; case "SOUL_SAND":
case "PINK_PETALS" -> BlockSoundGroup.PINK_PETALS; return BlockSoundGroup.SOUL_SAND;
case "MOSS_BLOCK" -> BlockSoundGroup.MOSS_BLOCK; case "SOUL_SOIL":
case "BIG_DRIPLEAF" -> BlockSoundGroup.BIG_DRIPLEAF; return BlockSoundGroup.SOUL_SOIL;
case "SMALL_DRIPLEAF" -> BlockSoundGroup.SMALL_DRIPLEAF; case "BASALT":
case "ROOTED_DIRT" -> BlockSoundGroup.ROOTED_DIRT; return BlockSoundGroup.BASALT;
case "HANGING_ROOTS" -> BlockSoundGroup.HANGING_ROOTS; case "WART_BLOCK":
case "AZALEA_LEAVES" -> BlockSoundGroup.AZALEA_LEAVES; return BlockSoundGroup.WART_BLOCK;
case "SCULK_SENSOR" -> BlockSoundGroup.SCULK_SENSOR; case "NETHERRACK":
case "SCULK_CATALYST" -> BlockSoundGroup.SCULK_CATALYST; return BlockSoundGroup.NETHERRACK;
case "SCULK" -> BlockSoundGroup.SCULK; case "NETHER_BRICKS":
case "SCULK_VEIN" -> BlockSoundGroup.SCULK_VEIN; return BlockSoundGroup.NETHER_BRICKS;
case "SCULK_SHRIEKER" -> BlockSoundGroup.SCULK_SHRIEKER; case "NETHER_SPROUTS":
case "GLOW_LICHEN" -> BlockSoundGroup.GLOW_LICHEN; return BlockSoundGroup.NETHER_SPROUTS;
case "DEEPSLATE" -> BlockSoundGroup.DEEPSLATE; case "NETHER_ORE":
case "DEEPSLATE_BRICKS" -> BlockSoundGroup.DEEPSLATE_BRICKS; return BlockSoundGroup.NETHER_ORE;
case "DEEPSLATE_TILES" -> BlockSoundGroup.DEEPSLATE_TILES; case "BONE":
case "POLISHED_DEEPSLATE" -> BlockSoundGroup.POLISHED_DEEPSLATE; return BlockSoundGroup.BONE;
case "FROGLIGHT" -> BlockSoundGroup.FROGLIGHT; case "NETHERITE":
case "FROGSPAWN" -> BlockSoundGroup.FROGSPAWN; return BlockSoundGroup.NETHERITE;
case "MANGROVE_ROOTS" -> BlockSoundGroup.MANGROVE_ROOTS; case "ANCIENT_DEBRIS":
case "MUDDY_MANGROVE_ROOTS" -> BlockSoundGroup.MUDDY_MANGROVE_ROOTS; return BlockSoundGroup.ANCIENT_DEBRIS;
case "MUD" -> BlockSoundGroup.MUD; case "LODESTONE":
case "MUD_BRICKS" -> BlockSoundGroup.MUD_BRICKS; return BlockSoundGroup.LODESTONE;
case "PACKED_MUD" -> BlockSoundGroup.PACKED_MUD; case "CHAIN":
case "HANGING_SIGN" -> BlockSoundGroup.HANGING_SIGN; return BlockSoundGroup.CHAIN;
case "NETHER_WOOD_HANGING_SIGN" -> BlockSoundGroup.NETHER_WOOD_HANGING_SIGN; case "NETHER_GOLD_ORE":
case "BAMBOO_WOOD_HANGING_SIGN" -> BlockSoundGroup.BAMBOO_WOOD_HANGING_SIGN; return BlockSoundGroup.NETHER_GOLD_ORE;
case "BAMBOO_WOOD" -> BlockSoundGroup.BAMBOO_WOOD; case "GILDED_BLACKSTONE":
case "NETHER_WOOD" -> BlockSoundGroup.NETHER_WOOD; return BlockSoundGroup.GILDED_BLACKSTONE;
case "CHERRY_WOOD" -> BlockSoundGroup.CHERRY_WOOD; case "CANDLE":
case "CHERRY_SAPLING" -> BlockSoundGroup.CHERRY_SAPLING; return BlockSoundGroup.CANDLE;
case "CHERRY_LEAVES" -> BlockSoundGroup.CHERRY_LEAVES; case "AMETHYST_BLOCK":
case "CHERRY_WOOD_HANGING_SIGN" -> BlockSoundGroup.CHERRY_WOOD_HANGING_SIGN; return BlockSoundGroup.AMETHYST_BLOCK;
case "CHISELED_BOOKSHELF" -> BlockSoundGroup.CHISELED_BOOKSHELF; case "AMETHYST_CLUSTER":
case "SUSPICIOUS_SAND" -> BlockSoundGroup.SUSPICIOUS_SAND; return BlockSoundGroup.AMETHYST_CLUSTER;
case "SUSPICIOUS_GRAVEL" -> BlockSoundGroup.SUSPICIOUS_GRAVEL; case "SMALL_AMETHYST_BUD":
case "DECORATED_POT" -> BlockSoundGroup.DECORATED_POT; return BlockSoundGroup.SMALL_AMETHYST_BUD;
case "DECORATED_POT_SHATTER" -> BlockSoundGroup.DECORATED_POT_SHATTER; case "MEDIUM_AMETHYST_BUD":
case "TRIAL_SPAWNER" -> BlockSoundGroup.TRIAL_SPAWNER; return BlockSoundGroup.MEDIUM_AMETHYST_BUD;
case "SPONGE" -> BlockSoundGroup.SPONGE; case "LARGE_AMETHYST_BUD":
case "WET_SPONGE" -> BlockSoundGroup.WET_SPONGE; return BlockSoundGroup.LARGE_AMETHYST_BUD;
case "VAULT" -> BlockSoundGroup.VAULT; case "TUFF":
case "HEAVY_CORE" -> BlockSoundGroup.HEAVY_CORE; return BlockSoundGroup.TUFF;
case "COBWEB" -> BlockSoundGroup.COBWEB; case "CALCITE":
default -> { return BlockSoundGroup.CALCITE;
case "DRIPSTONE_BLOCK":
return BlockSoundGroup.DRIPSTONE_BLOCK;
case "POINTED_DRIPSTONE":
return BlockSoundGroup.POINTED_DRIPSTONE;
case "COPPER":
return BlockSoundGroup.COPPER;
case "CAVE_VINES":
return BlockSoundGroup.CAVE_VINES;
case "SPORE_BLOSSOM":
return BlockSoundGroup.SPORE_BLOSSOM;
case "AZALEA":
return BlockSoundGroup.AZALEA;
case "FLOWERING_AZALEA":
return BlockSoundGroup.FLOWERING_AZALEA;
case "MOSS_CARPET":
return BlockSoundGroup.MOSS_CARPET;
case "PINK_PETALS":
return BlockSoundGroup.PINK_PETALS;
case "MOSS_BLOCK":
return BlockSoundGroup.MOSS_BLOCK;
case "BIG_DRIPLEAF":
return BlockSoundGroup.BIG_DRIPLEAF;
case "SMALL_DRIPLEAF":
return BlockSoundGroup.SMALL_DRIPLEAF;
case "ROOTED_DIRT":
return BlockSoundGroup.ROOTED_DIRT;
case "HANGING_ROOTS":
return BlockSoundGroup.HANGING_ROOTS;
case "AZALEA_LEAVES":
return BlockSoundGroup.AZALEA_LEAVES;
case "SCULK_SENSOR":
return BlockSoundGroup.SCULK_SENSOR;
case "SCULK_CATALYST":
return BlockSoundGroup.SCULK_CATALYST;
case "SCULK":
return BlockSoundGroup.SCULK;
case "SCULK_VEIN":
return BlockSoundGroup.SCULK_VEIN;
case "SCULK_SHRIEKER":
return BlockSoundGroup.SCULK_SHRIEKER;
case "GLOW_LICHEN":
return BlockSoundGroup.GLOW_LICHEN;
case "DEEPSLATE":
return BlockSoundGroup.DEEPSLATE;
case "DEEPSLATE_BRICKS":
return BlockSoundGroup.DEEPSLATE_BRICKS;
case "DEEPSLATE_TILES":
return BlockSoundGroup.DEEPSLATE_TILES;
case "POLISHED_DEEPSLATE":
return BlockSoundGroup.POLISHED_DEEPSLATE;
case "FROGLIGHT":
return BlockSoundGroup.FROGLIGHT;
case "FROGSPAWN":
return BlockSoundGroup.FROGSPAWN;
case "MANGROVE_ROOTS":
return BlockSoundGroup.MANGROVE_ROOTS;
case "MUDDY_MANGROVE_ROOTS":
return BlockSoundGroup.MUDDY_MANGROVE_ROOTS;
case "MUD":
return BlockSoundGroup.MUD;
case "MUD_BRICKS":
return BlockSoundGroup.MUD_BRICKS;
case "PACKED_MUD":
return BlockSoundGroup.PACKED_MUD;
case "HANGING_SIGN":
return BlockSoundGroup.HANGING_SIGN;
case "NETHER_WOOD_HANGING_SIGN":
return BlockSoundGroup.NETHER_WOOD_HANGING_SIGN;
case "BAMBOO_WOOD_HANGING_SIGN":
return BlockSoundGroup.BAMBOO_WOOD_HANGING_SIGN;
case "BAMBOO_WOOD":
return BlockSoundGroup.BAMBOO_WOOD;
case "NETHER_WOOD":
return BlockSoundGroup.NETHER_WOOD;
case "CHERRY_WOOD":
return BlockSoundGroup.CHERRY_WOOD;
case "CHERRY_SAPLING":
return BlockSoundGroup.CHERRY_SAPLING;
case "CHERRY_LEAVES":
return BlockSoundGroup.CHERRY_LEAVES;
case "CHERRY_WOOD_HANGING_SIGN":
return BlockSoundGroup.CHERRY_WOOD_HANGING_SIGN;
case "CHISELED_BOOKSHELF":
return BlockSoundGroup.CHISELED_BOOKSHELF;
case "SUSPICIOUS_SAND":
return BlockSoundGroup.SUSPICIOUS_SAND;
case "SUSPICIOUS_GRAVEL":
return BlockSoundGroup.SUSPICIOUS_GRAVEL;
case "DECORATED_POT":
return BlockSoundGroup.DECORATED_POT;
case "DECORATED_POT_SHATTER":
return BlockSoundGroup.DECORATED_POT_SHATTER;
default:
log(Level.WARN, "Sound group " + s + " not found, using stone"); log(Level.WARN, "Sound group " + s + " not found, using stone");
yield BlockSoundGroup.STONE; return BlockSoundGroup.STONE;
} }
};
} }

View File

@ -10,7 +10,7 @@ public class BlockSettingsPojo {
public float explosionResistance = 6.0F; public float explosionResistance = 6.0F;
public float hardness = 1.5F; public float hardness = 1.5F;
public float slipperiness = 0.6F; public float slipperiness = 0.6F;
public float movementVelocityMultiplier = 1.0F; public float slowDownMultiplier = 1.0F;
public float jumpVelocityMultiplier = 1.0F; public float jumpVelocityMultiplier = 1.0F;
public boolean opaque = true; public boolean opaque = true;
public boolean allowsSpawning = true; public boolean allowsSpawning = true;

View File

@ -88,7 +88,7 @@ public abstract class GenericManualResourceLoader<T> {
continue; continue;
} }
String entryName = blockJsonName.substring(0,blockJsonName.length()-5); String entryName = blockJsonName.substring(0,blockJsonName.length()-5);
Identifier identifier = Identifier.of(modId, entryName); Identifier identifier = new Identifier(modId, entryName);
try (Reader reader = new FileReader(entryJson)) { try (Reader reader = new FileReader(entryJson)) {
JsonObject jsonObject = gson.fromJson(reader, JsonObject.class); JsonObject jsonObject = gson.fromJson(reader, JsonObject.class);

View File

@ -3,16 +3,15 @@ package quimufu.simple_creator;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.gson.*; import com.google.gson.*;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.minecraft.component.type.FoodComponent;
import net.minecraft.entity.effect.StatusEffect; import net.minecraft.entity.effect.StatusEffect;
import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.item.FoodComponent;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemGroups; import net.minecraft.item.ItemGroups;
import net.minecraft.registry.Registries; import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry; import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey; import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import net.minecraft.util.JsonHelper; import net.minecraft.util.JsonHelper;
import net.minecraft.util.Pair; import net.minecraft.util.Pair;
@ -87,10 +86,12 @@ public class ItemResourceLoader extends GenericManualResourceLoader<Item> {
private static FoodComponent deserializeFoodComponent(JsonObject jo) { private static FoodComponent deserializeFoodComponent(JsonObject jo) {
FoodComponent fc; FoodComponent fc;
FoodComponent.Builder fcb = new FoodComponent.Builder(); FoodComponent.Builder fcb = new FoodComponent.Builder();
fcb.nutrition(JsonHelper.getInt(jo, "hunger", 4)); fcb.hunger(JsonHelper.getInt(jo, "hunger", 4));
fcb.saturationModifier(JsonHelper.getFloat(jo, "saturationModifier", 0.3F)); fcb.saturationModifier(JsonHelper.getFloat(jo, "saturationModifier", 0.3F));
if (JsonHelper.getBoolean(jo, "isAlwaysEdible", false)) if (JsonHelper.getBoolean(jo, "isAlwaysEdible", false))
fcb.alwaysEdible(); fcb.alwaysEdible();
if (JsonHelper.getBoolean(jo, "isWolfFood", false))
fcb.meat();
if (JsonHelper.getBoolean(jo, "isFast", false)) if (JsonHelper.getBoolean(jo, "isFast", false))
fcb.snack(); fcb.snack();
if (JsonHelper.hasArray(jo, "effects")) { if (JsonHelper.hasArray(jo, "effects")) {
@ -103,7 +104,7 @@ public class ItemResourceLoader extends GenericManualResourceLoader<Item> {
private static void deserializeEffects(FoodComponent.Builder fcb, JsonArray ja) { private static void deserializeEffects(FoodComponent.Builder fcb, JsonArray ja) {
for (JsonElement e : ja) { for (JsonElement e : ja) {
RegistryEntry<StatusEffect> type; StatusEffect type;
int duration = 0; int duration = 0;
int amplifier = 0; int amplifier = 0;
boolean ambient = false; boolean ambient = false;
@ -113,9 +114,9 @@ public class ItemResourceLoader extends GenericManualResourceLoader<Item> {
String effect = JsonHelper.getString(jo, "effect"); String effect = JsonHelper.getString(jo, "effect");
Identifier ei = Identifier.tryParse(effect); Identifier ei = Identifier.tryParse(effect);
if (ei != null) { if (ei != null) {
Optional<RegistryEntry.Reference<StatusEffect>> se = Registries.STATUS_EFFECT.getEntry(ei); StatusEffect se = Registries.STATUS_EFFECT.get(ei);
if (se.isPresent()) { if (se != null) {
type = se.get(); type = se;
} else { } else {
log(Level.WARN, "Effect " + ei + " not found, skipping"); log(Level.WARN, "Effect " + ei + " not found, skipping");
continue; continue;
@ -135,7 +136,7 @@ public class ItemResourceLoader extends GenericManualResourceLoader<Item> {
private static Rarity findRarity(String filter) { private static Rarity findRarity(String filter) {
for (Rarity r : Rarity.values()) { for (Rarity r : Rarity.values()) {
if (r.name().equalsIgnoreCase(filter)) if (r.name().toLowerCase().equals(filter.toLowerCase()))
return r; return r;
} }
log(Level.WARN, "Rarity " + filter + " not found, using common"); log(Level.WARN, "Rarity " + filter + " not found, using common");

View File

@ -1,12 +1,19 @@
package quimufu.simple_creator; package quimufu.simple_creator;
import eu.midnightdust.lib.config.MidnightConfig; import com.google.common.base.CaseFormat;
import de.siphalor.tweed4.annotated.AConfigEntry;
import de.siphalor.tweed4.annotated.ATweedConfig;
import de.siphalor.tweed4.config.ConfigEnvironment;
import de.siphalor.tweed4.config.ConfigScope;
public class SimpleCreatorConfig extends MidnightConfig {
@Comment(category = "text") @ATweedConfig(serializer = "tweed4:hjson", scope = ConfigScope.GAME, environment = ConfigEnvironment.UNIVERSAL, tailors = {"tweed4:lang_json_descriptions", "tweed4:coat", "tweed4:json_schema"}, casing = CaseFormat.LOWER_HYPHEN)
public static Comment explanation; //@ClothData(modid = "tweed4_testmod")
public class SimpleCreatorConfig {
@Entry(category = "text", name = "Enables included test Blocks and Items") @AConfigEntry(name = "enableTestThings", comment = "Enables included test Blocks and Items")
public static boolean enableTestThings = false; public static boolean enableTestThings = false;
public static boolean extendedLogging = false;
} }

View File

@ -1,6 +1,9 @@
package quimufu.simple_creator; package quimufu.simple_creator;
import eu.midnightdust.lib.config.MidnightConfig; import de.siphalor.tweed4.Tweed;
import de.siphalor.tweed4.config.ConfigEnvironment;
import de.siphalor.tweed4.config.ConfigLoader;
import de.siphalor.tweed4.config.TweedRegistry;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;
import net.fabricmc.api.ModInitializer; import net.fabricmc.api.ModInitializer;
import net.fabricmc.loader.api.FabricLoader; import net.fabricmc.loader.api.FabricLoader;
@ -25,12 +28,15 @@ public class SimpleCreatorMod implements ModInitializer {
@Override @Override
public void onInitialize() { public void onInitialize() {
log(Level.INFO, "Simply creating Blocks and Items"); log(Level.INFO, "Initializing");
MidnightConfig.init(MOD_ID, SimpleCreatorConfig.class); Tweed.runEntryPoints();
ConfigLoader.initialReload(
TweedRegistry.getConfigFile(MOD_ID),
FabricLoader.getInstance().getEnvironmentType() == EnvType.SERVER ? ConfigEnvironment.SERVER : ConfigEnvironment.UNIVERSAL
);
irl.load(); irl.load();
brl.load(); brl.load();
log(Level.INFO, "Simply created!");
} }
public static void log(Level level, String message) { public static void log(Level level, String message) {

View File

@ -20,43 +20,70 @@ public class SimpleCreatorModClient implements ClientModInitializer {
} }
private net.minecraft.client.render.RenderLayer getRenderLayer(String renderLayer) { private net.minecraft.client.render.RenderLayer getRenderLayer(String renderLayer) {
return switch (renderLayer.toUpperCase()) { switch (renderLayer.toUpperCase()){
case "SOLID" -> RenderLayer.getSolid(); case "SOLID":
case "CUTOUT_MIPPED" -> RenderLayer.getCutoutMipped(); return RenderLayer.getSolid();
case "CUTOUT" -> RenderLayer.getCutout(); case "CUTOUT_MIPPED":
case "TRANSLUCENT" -> RenderLayer.getTranslucent(); return RenderLayer.getCutoutMipped();
case "TRANSLUCENT_MOVING_BLOCK" -> RenderLayer.getTranslucentMovingBlock(); case "CUTOUT":
case "LEASH" -> RenderLayer.getLeash(); return RenderLayer.getCutout();
case "WATER_MASK" -> RenderLayer.getWaterMask(); case "TRANSLUCENT":
case "ARMOR_ENTITY_GLINT" -> RenderLayer.getArmorEntityGlint(); return RenderLayer.getTranslucent();
case "GLINT_TRANSLUCENT" -> RenderLayer.getGlintTranslucent(); case "TRANSLUCENT_MOVING_BLOCK":
case "GLINT" -> RenderLayer.getGlint(); return RenderLayer.getTranslucentMovingBlock();
case "ENTITY_GLINT" -> RenderLayer.getEntityGlint(); case "TRANSLUCENT_NO_CRUMBLING":
case "DIRECT_ENTITY_GLINT" -> RenderLayer.getDirectEntityGlint(); return RenderLayer.getTranslucentNoCrumbling();
case "TEXT_BACKGROUND" -> RenderLayer.getTextBackground(); case "LEASH":
case "TEXT_BACKGROUND_SEE_THROUGH" -> RenderLayer.getTextBackgroundSeeThrough(); return RenderLayer.getLeash();
case "LIGHTNING" -> RenderLayer.getLightning(); case "WATER_MASK":
case "DRAGON_RAYS" -> RenderLayer.getDragonRays(); return RenderLayer.getWaterMask();
case "DRAGON_RAYS_DEPTH" -> RenderLayer.getDragonRaysDepth(); case "ARMOR_GLINT":
case "TRIPWIRE" -> RenderLayer.getTripwire(); return RenderLayer.getArmorGlint();
case "END_PORTAL" -> RenderLayer.getEndPortal(); case "ARMOR_ENTITY_GLINT":
case "END_GATEWAY" -> RenderLayer.getEndGateway(); return RenderLayer.getArmorEntityGlint();
case "FAST_CLOUDS" -> RenderLayer.getFastClouds(); case "GLINT_TRANSLUCENT":
case "FANCY_CLOUDS" -> RenderLayer.getFancyClouds(); return RenderLayer.getGlintTranslucent();
case "LINES" -> RenderLayer.getLines(); case "GLINT":
case "LINE_STRIP" -> RenderLayer.getLineStrip(); return RenderLayer.getGlint();
case "DEBUG_FILLED_BOX" -> RenderLayer.getDebugFilledBox(); case "DIRECT_GLINT":
case "DEBUG_QUADS" -> RenderLayer.getDebugQuads(); return RenderLayer.getDirectGlint();
case "DEBUG_STRUCTURE_QUADS" -> RenderLayer.getDebugStructureQuads(); case "ENTITY_GLINT":
case "DEBUG_SECTION_QUADS" -> RenderLayer.getDebugSectionQuads(); return RenderLayer.getEntityGlint();
case "GUI" -> RenderLayer.getGui(); case "DIRECT_ENTITY_GLINT":
case "GUI_OVERLAY" -> RenderLayer.getGuiOverlay(); return RenderLayer.getDirectEntityGlint();
case "GUI_TEXT_HIGHLIGHT" -> RenderLayer.getGuiTextHighlight(); case "TEXT_BACKGROUND":
case "GUI_GHOST_RECIPE_OVERLAY" -> RenderLayer.getGuiGhostRecipeOverlay(); return RenderLayer.getTextBackground();
default -> { case "TEXT_BACKGROUND_SEE_THROUGH":
return RenderLayer.getTextBackgroundSeeThrough();
case "LIGHTNING":
return RenderLayer.getLightning();
case "TRIPWIRE":
return RenderLayer.getTripwire();
case "END_PORTAL":
return RenderLayer.getEndPortal();
case "END_GATEWAY":
return RenderLayer.getEndGateway();
case "LINES":
return RenderLayer.getLines();
case "LINE_STRIP":
return RenderLayer.getLineStrip();
case "DEBUG_FILLED_BOX":
return RenderLayer.getDebugFilledBox();
case "DEBUG_QUADS":
return RenderLayer.getDebugQuads();
case "DEBUG_SECTION_QUADS":
return RenderLayer.getDebugSectionQuads();
case "GUI":
return RenderLayer.getGui();
case "GUI_OVERLAY":
return RenderLayer.getGuiOverlay();
case "GUI_TEXT_HIGHLIGHT":
return RenderLayer.getGuiTextHighlight();
case "GUI_GHOST_RECIPE_OVERLAY":
return RenderLayer.getGuiGhostRecipeOverlay();
default:
SimpleCreatorMod.log(Level.INFO, "Could not find renderLayer " + renderLayer + " using solid"); SimpleCreatorMod.log(Level.INFO, "Could not find renderLayer " + renderLayer + " using solid");
yield RenderLayer.getSolid(); return RenderLayer.getSolid();
} }
};
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"simple_creator.midnightconfig.title": "Simple Item/Block Creator Settings", "text.autoconfig.simple_creator.title": "Simple Item/Block Creator Settings",
"simple_creator.midnightconfig.enableTestThings": "Enable a test item and block", "text.autoconfig.simple_creator.option.enableTestThings": "Enable a test item and block",
"item.simple_creator.test_item": "Forbidden Fruit", "item.simple_creator.test_item": "Forbidden Fruit",
"block.simple_creator.test_block": "Fast jumpy wooly diamond-dropping block of Eternal Fire" "block.simple_creator.test_block": "Fast jumpy wooly diamond-dropping block of Eternal Fire"
} }

View File

@ -9,7 +9,7 @@
"explosionResistance": 5.0, "explosionResistance": 5.0,
"hardness": 0.5, "hardness": 0.5,
"slipperiness": 0.6, "slipperiness": 0.6,
"movementVelocityMultiplier": 2.0, "slowDownMultiplier": 2.0,
"jumpVelocityMultiplier": 2.0, "jumpVelocityMultiplier": 2.0,
"opaque": true, "opaque": true,
"itemGroup": "minecraft:building_blocks", "itemGroup": "minecraft:building_blocks",