This commit is contained in:
QuImUfu 2023-07-02 15:40:36 +02:00
parent 0003fc6c6b
commit 138258d845
4 changed files with 84 additions and 12 deletions
blockPropertyDocumentation.txt
src/main
java/quimufu/simple_creator
resources/data/simple_creator/items

View File

@ -1,3 +1,13 @@
"itemGroup" ~ string
one of:
minecraft:building_blocks, minecraft:colored_blocks,
minecraft:natural_blocks, minecraft:functional_blocks,
minecraft:redstone_blocks, minecraft:hotbar, minecraft:search,
minecraft:tools_and_utilities, minecraft:combat,
minecraft:food_and_drinks, minecraft:ingredients, minecraft:spawn_eggs,
minecraft:op_blocks, minecraft:inventory
the creative inventory tab
"soundGroup" ~ string
one of:
intentionally_empty, wood, gravel, grass, lily_pad, stone,
@ -43,19 +53,43 @@
-1.0-50.0+
how hard it is to break the block. -1.0 is unbreakable, 50.0 is obsidian, 1.5 is stone, 2.0 cobble
"pistonBehavior" ~ string
one of:
normal, destroy, block, ignore, push_only
controls what happens when a piston pushes this block
"slipperiness" ~ float
"slowDownMultiplier" ~ float
"jumpVelocityMultiplier" ~ float
"blocksMovement" ~ boolean
this sets whether water can flow away this block if "collidable" is false, otherwise subtily changes how fluids look around it
"opaque" ~ boolean
"allowsSpawning" ~ boolean
"solidBlock" ~ boolean
"suffocates" ~ boolean
"blockVision" ~ boolean
"postProcess" ~ boolean
"emissiveLighting" ~ boolean
whether the block texture is always rendered as if in bright light.
"modelOffset" ~ string
one of:
none, xz, xyz
slightly moves the model randomly. used e.g. for grass.
"pistonBehavior" ~ string
one of:
normal, destroy, block, ignore, push_only
controls what happens when a piston pushes this block
"instrument" ~ string
one of:
harp, basedrum, snare, hat, bass, flute, bell, guitar, chime,
xylophone, iron_xylophone, cow_bell, didgeridoo, bit, banjo,
pling, zombie, skeleton, creeper, dragon, wither_skeleton, piglin,
custom_head
"burnable" ~ boolean
does lava ignite the block
@ -66,5 +100,40 @@
"spreadChance" ~ int
how easily this block catches fire ( wood 5, leaves 30, flowers 60) if null, block can only be ignited by lava if burnable.
"replaceable" ~ boolean
can be replaced like grass
"noBlockBreakParticles" ~ boolean
"requiresTool" ~ boolean
this sets whether the block drops when broken without tool.
"breaksInstantly" ~ boolean
"mapColor" ~ string
one of:
CLEAR (0x000000), PALE_GREEN (0x7FB238), PALE_YELLOW (0xF7E9A3),
WHITE_GRAY (0xC7C7C7), BRIGHT_RED (0xFF0000), PALE_PURPLE (0xA0A0FF),
IRON_GRAY (0xA7A7A7), DARK_GREEN (0x007C00), WHITE (0xFFFFFF),
LIGHT_BLUE_GRAY (0xA4A8B8), DIRT_BROWN (0x976D4D),
STONE_GRAY (0x707070), WATER_BLUE (0x4040FF), OAK_TAN (9402184),
OFF_WHITE (0xFFFCF5), ORANGE (14188339), MAGENTA (11685080),
LIGHT_BLUE (6724056), YELLOW (0xE5E533), LIME (0x7FCC19),
PINK (0xF27FA5), GRAY (0x4C4C4C), LIGHT_GRAY (0x999999),
CYAN (0x4C7F99), PURPLE (0x7F3FB2), BLUE (0x334CB2),
BROWN (0x664C33), GREEN (0x667F33), RED (0x993333),
BLACK (0x191919), GOLD (0xFAEE4D), DIAMOND_BLUE (0x5CDBD5),
LAPIS_BLUE (0x4A80FF), EMERALD_GREEN (0x00D93A),
SPRUCE_BROWN (0x815631), DARK_RED (0x700200),
TERRACOTTA_WHITE (0xD1B1A1), TERRACOTTA_ORANGE (0x9F5224),
TERRACOTTA_MAGENTA (0x95576C), TERRACOTTA_LIGHT_BLUE (0x706C8A),
TERRACOTTA_YELLOW (0xBA8524), TERRACOTTA_LIME (0x677535),
TERRACOTTA_PINK (0xA04D4E), TERRACOTTA_GRAY (0x392923),
TERRACOTTA_LIGHT_GRAY (0x876B62), TERRACOTTA_CYAN (0x575C5C),
TERRACOTTA_PURPLE (0x7A4958), TERRACOTTA_BLUE (0x4C3E5C),
TERRACOTTA_BROWN (0x4C3223), TERRACOTTA_GREEN (0x4C522A),
TERRACOTTA_RED (0x8E3C2E), TERRACOTTA_BLACK (0x251610),
DULL_RED (0xBD3031), DULL_PINK (0x943F61), DARK_CRIMSON (0x5C191D),
TEAL (0x167E86), DARK_AQUA (0x3A8E8C), DARK_DULL_PINK (0x562C3E),
BRIGHT_TEAL (0x14B485), DEEPSLATE_GRAY (0x646464),
RAW_IRON_PINK (0xD8AF93), LICHEN_GREEN (0x7FA796)

View File

@ -23,7 +23,6 @@ import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.util.Identifier;
import net.minecraft.util.JsonHelper;
import net.minecraft.util.Pair;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.BlockView;
@ -67,15 +66,15 @@ public class BlockResourceLoader extends GenericManualResourceLoader<Pair<Block,
Block.Settings bs = getSettings(bspj);
// parse item group
String group = JsonHelper.getString(jo, "itemGroup", "misc");
String group = bspj.itemGroup;
RegistryKey<ItemGroup> g = ItemResourceLoader.findGroup(group);
//create block and corresponding item
Block resB = new Block(bs);
Item resI = new BlockItem(resB, new FabricItemSettings());
ItemGroupEvents.modifyEntriesEvent(g).register(content -> content.add(resI));
int burnChance = JsonHelper.getInt(jo, "burnChance", -1);
int spreadChance = JsonHelper.getInt(jo, "spreadChance", -1);
int burnChance = bspj.burnChance;
int spreadChance = bspj.spreadChance;
if (burnChance != -1 && spreadChance != -1) {
FlammableBlockRegistry.getDefaultInstance().add(resB, spreadChance, burnChance);
}

View File

@ -1,6 +1,8 @@
package quimufu.simple_creator;
public class BlockSettingsPojo {
public String itemGroup = "minecraft:building_blocks";
public String soundGroup = "stone";
public String dropTableId = null;
public boolean collidable = true;
@ -21,6 +23,8 @@ public class BlockSettingsPojo {
public String pistonBehavior = "normal";
public String instrument = "harp";
public boolean burnable = false;
public int burnChance = -1;
public int spreadChance = -1;
public boolean replaceable = false;
public boolean noBlockBreakParticles = false;
public boolean requiresTool = false;

View File

@ -1,5 +1,5 @@
{
"group" :"food",
"group" :"minecraft:food_and_drinks",
"durability" : 15,
"stackSize": 25,
"rarity" :"rare",