doc
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"group" :"food",
|
||||
"group" :"minecraft:food_and_drinks",
|
||||
"durability" : 15,
|
||||
"stackSize": 25,
|
||||
"rarity" :"rare",
|
||||
|
||||
Reference in New Issue
Block a user