added canola
@@ -15,5 +15,6 @@ public class QuicklyClient implements ClientModInitializer {
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
BlockRenderLayerMap.putBlock(QuicklyBlocks.COTTONPLANT, ChunkSectionLayer.CUTOUT);
|
||||
BlockRenderLayerMap.putBlock(QuicklyBlocks.CANOLAPLANT, ChunkSectionLayer.CUTOUT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@ public class QuicklyBlocks {
|
||||
p -> new BlockOreDeepslateTurquoise(p));
|
||||
public static final Block COTTONPLANT = registerBlock("blockcottonplant", Properties.ofFullCopy(Blocks.WHEAT),
|
||||
p -> new BlockPlant(p, "cottonseed", "cotton"));
|
||||
public static final Block CANOLAPLANT = registerBlock("blockcanolaplant", Properties.ofFullCopy(Blocks.WHEAT),
|
||||
p -> new BlockPlant(p, "canolaseed", "canola"));
|
||||
|
||||
private static final Block registerBlock(String name, Properties properties) {
|
||||
return QuicklyBlocks.registerBlock(name, properties, p -> new Block(p));
|
||||
@@ -57,6 +59,7 @@ public class QuicklyBlocks {
|
||||
block.accept(ORETURQUOISE);
|
||||
block.accept(OREDEEPSLATETURQUOISE);
|
||||
block.accept(COTTONPLANT);
|
||||
block.accept(CANOLAPLANT);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ public class QuicklyComposter {
|
||||
public static final void registerComposterItems() {
|
||||
CompostingChanceRegistry.INSTANCE.add(QuicklyItems.COTTONSEED, 0.5f);
|
||||
CompostingChanceRegistry.INSTANCE.add(QuicklyItems.COTTON, 0.75f);
|
||||
CompostingChanceRegistry.INSTANCE.add(QuicklyItems.CANOLASEED, 0.5f);
|
||||
CompostingChanceRegistry.INSTANCE.add(QuicklyItems.CANOLA, 0.75f);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,6 +26,10 @@ public class QuicklyItems {
|
||||
public static final Item COTTON = registerItem("cotton");
|
||||
public static final Item COTTONPLANT = registerItem("cottonplant");
|
||||
public static final Item COTTONSEED = registerItem("cottonseed", properties -> new Plant(properties, "blockcottonplant"));
|
||||
public static final Item CANOLA = registerItem("canola");
|
||||
public static final Item CANOLAPLANT = registerItem("canolaplant");
|
||||
public static final Item CANOLASEED = registerItem("canolaseed", properties -> new Plant(properties, "blockcanolaplant"));
|
||||
|
||||
public static final Item ROTTENFLESHSTRIPES = registerItem("rotten_flesh_stripes");
|
||||
|
||||
public static final Item ARMOR_TURQUOISE_BOOTS = registerItem("turquoise_boots", ArmorType.BOOTS);
|
||||
|
||||
@@ -3,6 +3,7 @@ package de.jottyfan.minecraft.loot;
|
||||
import de.jottyfan.minecraft.item.QuicklyItems;
|
||||
import net.fabricmc.fabric.api.loot.v3.LootTableEvents;
|
||||
import net.minecraft.resources.Identifier;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.level.storage.loot.LootPool;
|
||||
import net.minecraft.world.level.storage.loot.entries.LootItem;
|
||||
import net.minecraft.world.level.storage.loot.predicates.LootItemRandomChanceCondition;
|
||||
@@ -18,19 +19,19 @@ public class QuicklyLootTables {
|
||||
public static final void registerChanges() {
|
||||
LootTableEvents.MODIFY.register((key, tableBuilder, source, registries) -> {
|
||||
if (source.isBuiltin()) {
|
||||
// TODO: maybe, better harvest cotton from dry grass instead?
|
||||
Identifier shortGrass = Identifier.fromNamespaceAndPath("minecraft", "blocks/short_grass");
|
||||
Identifier tallGrass = Identifier.fromNamespaceAndPath("minecraft", "blocks/tall_grass");
|
||||
if (key.identifier().equals(shortGrass)) {
|
||||
LootPool.Builder poolBuilder = LootPool.lootPool()
|
||||
.setRolls(ConstantValue.exactly(1f))
|
||||
.when(LootItemRandomChanceCondition.randomChance(0.1f))
|
||||
.add(LootItem.lootTableItem(QuicklyItems.COTTONSEED));
|
||||
tableBuilder.withPool(poolBuilder);
|
||||
tableBuilder.withPool(harvestItemByChance(QuicklyItems.COTTONSEED, 0.05f));
|
||||
} else if (key.identifier().equals(tallGrass)) {
|
||||
// for the canola loot table block later
|
||||
tableBuilder.withPool(harvestItemByChance(QuicklyItems.CANOLASEED, 0.03f));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static final LootPool.Builder harvestItemByChance(Item item, float chance) {
|
||||
return LootPool.lootPool().setRolls(ConstantValue.exactly(1f))
|
||||
.when(LootItemRandomChanceCondition.randomChance(chance)).add(LootItem.lootTableItem(item));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"variants": {
|
||||
"age=0": { "model": "quickly:block/canolaplant0" },
|
||||
"age=1": { "model": "quickly:block/canolaplant1" },
|
||||
"age=2": { "model": "quickly:block/canolaplant2" },
|
||||
"age=3": { "model": "quickly:block/canolaplant3" },
|
||||
"age=4": { "model": "quickly:block/canolaplant4" },
|
||||
"age=5": { "model": "quickly:block/canolaplant5" },
|
||||
"age=6": { "model": "quickly:block/canolaplant6" },
|
||||
"age=7": { "model": "quickly:block/canolaplant7" }
|
||||
}
|
||||
}
|
||||
6
src/main/resources/assets/quickly/items/canola.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "quickly:item/canola"
|
||||
}
|
||||
}
|
||||
6
src/main/resources/assets/quickly/items/canolaplant.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "quickly:item/canolaseed"
|
||||
}
|
||||
}
|
||||
6
src/main/resources/assets/quickly/items/canolaseed.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "quickly:item/canolaseed"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,9 @@
|
||||
{
|
||||
"item.quickly.blockcanolaplant": "Rapspflanze",
|
||||
"item.quickly.blockcottonplant": "Baumwollpflanze",
|
||||
"item.quickly.blockturquoise": "Türkisblock",
|
||||
"item.quickly.canola": "Raps",
|
||||
"item.quickly.canolaseed": "Rapssaat",
|
||||
"item.quickly.cotton": "Baumwolle",
|
||||
"item.quickly.cottonseed": "Baumwollsaat",
|
||||
"item.quickly.kelpbundle": "Seegrassbündel",
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
{
|
||||
"item.quickly.blockcanolaplant": "canola plant",
|
||||
"item.quickly.blockcottonplant": "cotton plant",
|
||||
"item.quickly.blockturquoise": "block of turquoise",
|
||||
"item.quickly.canola": "canola",
|
||||
"item.quickly.canolaseed": "canola seed",
|
||||
"item.quickly.cotton": "cotton",
|
||||
"item.quickly.cottonseed": "cotton seed",
|
||||
"item.quickly.kelpbundle": "kelp bundle",
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent":"block/cross",
|
||||
"textures":{
|
||||
"cross":"quickly:block/canolaplant0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent":"block/cross",
|
||||
"textures":{
|
||||
"cross":"quickly:block/canolaplant1"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent":"block/cross",
|
||||
"textures":{
|
||||
"cross":"quickly:block/canolaplant2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent":"block/cross",
|
||||
"textures":{
|
||||
"cross":"quickly:block/canolaplant3"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent":"block/cross",
|
||||
"textures":{
|
||||
"cross":"quickly:block/canolaplant4"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent":"block/cross",
|
||||
"textures":{
|
||||
"cross":"quickly:block/canolaplant5"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent":"block/cross",
|
||||
"textures":{
|
||||
"cross":"quickly:block/canolaplant6"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent":"block/cross",
|
||||
"textures":{
|
||||
"cross":"quickly:block/canolaplant7"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "quickly:item/canola"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "quickly:item/canolaseed"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "quickly:item/canolaseed"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 590 B |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 603 B |
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
BIN
src/main/resources/assets/quickly/textures/item/canola.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
src/main/resources/assets/quickly/textures/item/canolaseed.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |