added blazeplant

This commit is contained in:
Jottyfan committed 2026-10-11 16:11:54 +02:00
1 parent ac74b8124b
commit e19566c27d
34 files changed
+175 -20

No files matched your search

+3 -3
View File
@@ -7,14 +7,14 @@ org.gradle.configuration-cache=false
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/develop # check these on https://fabricmc.net/develop
minecraft_version=26.4-snapshot-1 minecraft_version=26.4-snapshot-3
loader_version=0.19.5 loader_version=0.19.5
loom_version=1.18-SNAPSHOT loom_version=1.18-SNAPSHOT
# Mod Properties # Mod Properties
mod_version=26.4.0 mod_version=26.4.1
maven_group=de.jottyfan.minecraft maven_group=de.jottyfan.minecraft
archives_base_name=quickly archives_base_name=quickly
# Dependencies # Dependencies
fabric_api_version=0.161.1+26.4 fabric_api_version=0.162.2+26.4
@@ -1,5 +1,8 @@
package de.jottyfan.minecraft.block; package de.jottyfan.minecraft.block;
import java.util.ArrayList;
import java.util.List;
import de.jottyfan.minecraft.item.QuicklyItems; import de.jottyfan.minecraft.item.QuicklyItems;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.world.Containers; import net.minecraft.world.Containers;
@@ -9,12 +12,10 @@ import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.ItemLike; import net.minecraft.world.level.ItemLike;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.CropBlock; import net.minecraft.world.level.block.CropBlock;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.storage.loot.LootParams.Builder;
import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
/** /**
* *
@@ -26,17 +27,18 @@ public class BlockPlant extends CropBlock {
private DropDefinition seedDefinition; private DropDefinition seedDefinition;
private DropDefinition fruitDefinition; private DropDefinition fruitDefinition;
public BlockPlant(Properties properties, DropDefinition fruitDefinition) {
super(properties.noOcclusion().dynamicShape());
this.seedDefinition = null;
this.fruitDefinition = fruitDefinition;
}
public BlockPlant(Properties properties, DropDefinition seedDefinition, DropDefinition fruitDefinition) { public BlockPlant(Properties properties, DropDefinition seedDefinition, DropDefinition fruitDefinition) {
super(properties.noOcclusion().dynamicShape()); super(properties.noOcclusion().dynamicShape());
this.seedDefinition = seedDefinition; this.seedDefinition = seedDefinition;
this.fruitDefinition = fruitDefinition; this.fruitDefinition = fruitDefinition;
} }
@Override
protected VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
return Block.box(2.0D, 0.0D, 2.0D, 14.0D, 13.0D, 14.0D);
}
@Override @Override
protected float getShadeBrightness(BlockState state, BlockGetter level, BlockPos pos) { protected float getShadeBrightness(BlockState state, BlockGetter level, BlockPos pos) {
return 1.0F; return 1.0F;
@@ -48,11 +50,25 @@ public class BlockPlant extends CropBlock {
} }
public ItemLike getSeed() { public ItemLike getSeed() {
return QuicklyItems.of(seedDefinition.getIdentifier()); return seedDefinition != null ? QuicklyItems.of(seedDefinition.getIdentifier()) : null;
} }
public ItemLike getFruit() { public ItemLike getFruit() {
return QuicklyItems.of(fruitDefinition.getIdentifier()); return fruitDefinition != null ? QuicklyItems.of(fruitDefinition.getIdentifier()) : null;
}
@Override
protected List<ItemStack> getDrops(BlockState state, Builder params) {
List<ItemStack> list = new ArrayList<>();
ItemLike fruit = getFruit();
ItemLike seed = getSeed();
if (fruit != null) {
list.add(new ItemStack(fruit));
}
if (seed != null) {
list.add(new ItemStack(seed));
}
return list;
} }
@Override @Override
@@ -60,8 +76,14 @@ public class BlockPlant extends CropBlock {
BlockHitResult hitResult) { BlockHitResult hitResult) {
if (!level.isClientSide() && isMaxAge(state)) { if (!level.isClientSide() && isMaxAge(state)) {
int fruitAmount = (level.getRandom().nextFloat() > 0.9f) ? 2 : 1; int fruitAmount = (level.getRandom().nextFloat() > 0.9f) ? 2 : 1;
Containers.dropItemStack(level, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(getFruit(), fruitAmount)); ItemLike fruit = getFruit();
Containers.dropItemStack(level, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(getSeed())); if (fruit != null) {
Containers.dropItemStack(level, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(getFruit(), fruitAmount));
}
ItemLike seed = getSeed();
if (seed != null) {
Containers.dropItemStack(level, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(getSeed()));
}
level.setBlock(pos, state.setValue(AGE, 0), 2); level.setBlock(pos, state.setValue(AGE, 0), 2);
return InteractionResult.SUCCESS; return InteractionResult.SUCCESS;
} }
@@ -2,7 +2,9 @@ package de.jottyfan.minecraft.block;
import java.util.Random; import java.util.Random;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.Identifier; import net.minecraft.resources.Identifier;
import net.minecraft.world.item.Item;
/** /**
* *
@@ -9,6 +9,7 @@ import de.jottyfan.minecraft.name.ID;
import net.minecraft.core.Registry; import net.minecraft.core.Registry;
import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.registries.Registries; import net.minecraft.core.registries.Registries;
import net.minecraft.references.ItemIds;
import net.minecraft.resources.Identifier; import net.minecraft.resources.Identifier;
import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceKey;
import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundEvents;
@@ -16,7 +17,7 @@ import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.sounds.BlockSoundSets;
import net.minecraft.world.level.block.state.BlockBehaviour.Properties; import net.minecraft.world.level.block.state.BlockBehaviour.Properties;
/** /**
@@ -26,10 +27,10 @@ import net.minecraft.world.level.block.state.BlockBehaviour.Properties;
*/ */
public class QuicklyBlocks { public class QuicklyBlocks {
public static final Block KELPBUNDLE = registerBlock(ID.KELPBUNDLE, public static final Block KELPBUNDLE = registerBlock(ID.KELPBUNDLE,
Properties.of().instabreak().sound(SoundType.WET_GRASS).strength(0.1f).friction(0.95f)); Properties.of().instabreak().sound(BlockSoundSets.WET_GRASS).strength(0.1f).friction(0.95f));
public static final Block TURQUOISEBLOCK = registerBlock(ID.BLOCKTURQUOISE, Properties.of().strength(1.5f)); public static final Block TURQUOISEBLOCK = registerBlock(ID.BLOCKTURQUOISE, Properties.of().strength(1.5f));
public static final Block ORETURQUOISE = registerBlock(ID.ORETURQUOISE, public static final Block ORETURQUOISE = registerBlock(ID.ORETURQUOISE,
properties -> new BlockOre(properties.strength(3.0f).sound(SoundType.AMETHYST), SoundEvents.AMETHYST_BLOCK_CHIME, properties -> new BlockOre(properties.strength(3.0f).sound(BlockSoundSets.AMETHYST), SoundEvents.AMETHYST_BLOCK_CHIME,
ID.RAWTURQUOISE)); ID.RAWTURQUOISE));
public static final Block OREDEEPSLATETURQUOISE = registerBlock(ID.OREDEEPSLATETURQUOISE, public static final Block OREDEEPSLATETURQUOISE = registerBlock(ID.OREDEEPSLATETURQUOISE,
properties -> new BlockOre(properties, SoundEvents.AMETHYST_BLOCK_CHIME, ID.RAWTURQUOISE)); properties -> new BlockOre(properties, SoundEvents.AMETHYST_BLOCK_CHIME, ID.RAWTURQUOISE));
@@ -39,6 +40,8 @@ public class QuicklyBlocks {
public static final Block CANOLAPLANT = registerBlock(ID.BLOCKCANOLAPLANT, Properties.ofFullCopy(Blocks.WHEAT), public static final Block CANOLAPLANT = registerBlock(ID.BLOCKCANOLAPLANT, Properties.ofFullCopy(Blocks.WHEAT),
properties -> new BlockPlant(properties, DropDefinition.of(ID.CANOLASEED, 1, 1), properties -> new BlockPlant(properties, DropDefinition.of(ID.CANOLASEED, 1, 1),
DropDefinition.of(ID.CANOLA, 1, 1))); DropDefinition.of(ID.CANOLA, 1, 1)));
public static final Block BLAZEPLANT = registerBlock(ID.BLOCKBLAZEPLANT, Properties.ofFullCopy(Blocks.WHEAT).lightLevel(state -> state.getValue(BlockPlant.AGE) * 2),
properties -> new BlockPlant(properties, DropDefinition.of(ItemIds.BLAZE_ROD.identifier(), 1, 1)));
public static final Block LAVAHOARDER = registerBlock(ID.LAVAHOARDER, public static final Block LAVAHOARDER = registerBlock(ID.LAVAHOARDER,
Properties.of().strength(2.5f).lightLevel(state -> state.getValue(Lavahoarder.FILLED) ? 15 : 0), Properties.of().strength(2.5f).lightLevel(state -> state.getValue(Lavahoarder.FILLED) ? 15 : 0),
Lavahoarder::new); Lavahoarder::new);
@@ -7,8 +7,8 @@ import com.google.common.collect.Lists;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.Containers;
import net.minecraft.world.InteractionResult; import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.ToolMaterial; import net.minecraft.world.item.ToolMaterial;
@@ -84,7 +84,8 @@ public class QHoe extends Item implements ToolRangeable {
.withOptionalParameter(LootContextParams.BLOCK_ENTITY, level.getBlockEntity(pos)) .withOptionalParameter(LootContextParams.BLOCK_ENTITY, level.getBlockEntity(pos))
.withParameter(LootContextParams.TOOL, ItemStack.EMPTY); .withParameter(LootContextParams.TOOL, ItemStack.EMPTY);
for (ItemStack stack : blockState.getDrops(builder)) { for (ItemStack stack : blockState.getDrops(builder)) {
Containers.dropItemStack(level, pos.getX(), pos.getY(), pos.getZ(), stack); ItemEntity entity = new ItemEntity(level, pos.getX(), pos.getY(), pos.getZ(), stack);
level.addFreshEntity(entity);
} }
level.setBlockAndUpdate(pos, cBlock.defaultBlockState()); level.setBlockAndUpdate(pos, cBlock.defaultBlockState());
} }
@@ -24,6 +24,8 @@ public class QuicklyItems {
public static final Item STUB = registerItem(ID.STUB, Stub::new); public static final Item STUB = registerItem(ID.STUB, Stub::new);
public static final Item RAWTURQUOISE = registerItem(ID.RAWTURQUOISE); public static final Item RAWTURQUOISE = registerItem(ID.RAWTURQUOISE);
public static final Item TURQUOISEINGOT = registerItem(ID.TURQUOISEINGOT); public static final Item TURQUOISEINGOT = registerItem(ID.TURQUOISEINGOT);
public static final Item BLAZEPLANT = registerItem(ID.BLAZEPLANT);
public static final Item BLAZESEED = registerItem(ID.BLAZESEED, ofCompostable(QIP.of(ID.BLOCKBLAZEPLANT)), Plant::new);
public static final Item COTTON = registerItem(ID.COTTON, ofCompostable(QIP.of(ID.COTTON))); public static final Item COTTON = registerItem(ID.COTTON, ofCompostable(QIP.of(ID.COTTON)));
public static final Item COTTONPLANT = registerItem(ID.COTTONPLANT); public static final Item COTTONPLANT = registerItem(ID.COTTONPLANT);
public static final Item COTTONSEED = registerItem(ID.COTTONSEED, ofCompostable(QIP.of(ID.BLOCKCOTTONPLANT)), Plant::new); public static final Item COTTONSEED = registerItem(ID.COTTONSEED, ofCompostable(QIP.of(ID.BLOCKCOTTONPLANT)), Plant::new);
@@ -114,6 +116,8 @@ public class QuicklyItems {
set.add(COTTON); set.add(COTTON);
set.add(COTTONSEED); set.add(COTTONSEED);
set.add(PILLOW); set.add(PILLOW);
set.add(BLAZEPLANT);
set.add(BLAZESEED);
set.add(CANOLA); set.add(CANOLA);
set.add(CANOLASEED); set.add(CANOLASEED);
set.add(CANOLABOTTLE); set.add(CANOLABOTTLE);
@@ -17,6 +17,8 @@ public class ID {
public static final Identifier COTTONPLANT = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "cottonplant"); public static final Identifier COTTONPLANT = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "cottonplant");
public static final Identifier COTTONSEED = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "cottonseed"); public static final Identifier COTTONSEED = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "cottonseed");
public static final Identifier PILLOW = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "pillow"); public static final Identifier PILLOW = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "pillow");
public static final Identifier BLAZEPLANT = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "blazeplant");
public static final Identifier BLAZESEED = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "blazeseed");
public static final Identifier CANOLA = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "canola"); public static final Identifier CANOLA = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "canola");
public static final Identifier CANOLAPLANT = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "canolaplant"); public static final Identifier CANOLAPLANT = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "canolaplant");
public static final Identifier CANOLASEED = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "canolaseed"); public static final Identifier CANOLASEED = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "canolaseed");
@@ -75,6 +77,7 @@ public class ID {
"oredeepslateturquoise"); "oredeepslateturquoise");
public static final Identifier BLOCKCOTTONPLANT = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "blockcottonplant"); public static final Identifier BLOCKCOTTONPLANT = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "blockcottonplant");
public static final Identifier BLOCKCANOLAPLANT = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "blockcanolaplant"); public static final Identifier BLOCKCANOLAPLANT = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "blockcanolaplant");
public static final Identifier BLOCKBLAZEPLANT = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "blockblazeplant");
public static final Identifier LAVAHOARDER = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "lavahoarder"); public static final Identifier LAVAHOARDER = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "lavahoarder");
public static final Identifier BLOCKQUICKIEPOWDER = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, public static final Identifier BLOCKQUICKIEPOWDER = Identifier.fromNamespaceAndPath(Quickly.MOD_ID,
"blockquickiepowder"); "blockquickiepowder");
@@ -0,0 +1,12 @@
{
"variants": {
"age=0": { "model": "quickly:block/blazeplant0" },
"age=1": { "model": "quickly:block/blazeplant1" },
"age=2": { "model": "quickly:block/blazeplant2" },
"age=3": { "model": "quickly:block/blazeplant3" },
"age=4": { "model": "quickly:block/blazeplant4" },
"age=5": { "model": "quickly:block/blazeplant5" },
"age=6": { "model": "quickly:block/blazeplant6" },
"age=7": { "model": "quickly:block/blazeplant7" }
}
}
@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickly:item/blazeplant"
}
}
@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickly:item/blazeseed"
}
}
@@ -3,6 +3,8 @@
"info.block.drillstraight": "auf ebenes Bohren umgestellt", "info.block.drillstraight": "auf ebenes Bohren umgestellt",
"info.block.itemhoarder": "enthält: %s", "info.block.itemhoarder": "enthält: %s",
"info.block.monsterhoarder": "Radius: %s, Brenndauer: %s Ticks", "info.block.monsterhoarder": "Radius: %s, Brenndauer: %s Ticks",
"item.quickly.blazeplant": "Lohenpflanze",
"item.quickly.blazeseed": "Lohensamen",
"item.quickly.blockcanolaplant": "Rapspflanze", "item.quickly.blockcanolaplant": "Rapspflanze",
"item.quickly.blockcottonplant": "Baumwollpflanze", "item.quickly.blockcottonplant": "Baumwollpflanze",
"item.quickly.blockquickiepowder": "Eilpulverblock", "item.quickly.blockquickiepowder": "Eilpulverblock",
@@ -3,6 +3,8 @@
"info.block.drillstraight": "switched to face drilling", "info.block.drillstraight": "switched to face drilling",
"info.block.itemhoarder": "contains: %s", "info.block.itemhoarder": "contains: %s",
"info.block.monsterhoarder": "radius: %s, burn ticks: %s", "info.block.monsterhoarder": "radius: %s, burn ticks: %s",
"item.quickly.blazeplant": "blaze plant",
"item.quickly.blazeseed": "blaze seed",
"item.quickly.blockcanolaplant": "canola plant", "item.quickly.blockcanolaplant": "canola plant",
"item.quickly.blockcottonplant": "cotton plant", "item.quickly.blockcottonplant": "cotton plant",
"item.quickly.blockquickiepowder": "quickie powder block", "item.quickly.blockquickiepowder": "quickie powder block",
@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/cross",
"render_type": "minecraft:cutout",
"textures":{
"cross":"quickly:block/blazeplant0"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/cross",
"render_type": "minecraft:cutout",
"textures":{
"cross":"quickly:block/blazeplant1"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/cross",
"render_type": "minecraft:cutout",
"textures":{
"cross":"quickly:block/blazeplant2"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/cross",
"render_type": "minecraft:cutout",
"textures":{
"cross":"quickly:block/blazeplant3"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/cross",
"render_type": "minecraft:cutout",
"textures":{
"cross":"quickly:block/blazeplant4"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/cross",
"render_type": "minecraft:cutout",
"textures":{
"cross":"quickly:block/blazeplant5"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/cross",
"render_type": "minecraft:cutout",
"textures":{
"cross":"quickly:block/blazeplant6"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/cross",
"render_type": "minecraft:cutout",
"textures":{
"cross":"quickly:block/blazeplant7"
}
}
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "quickly:block/blazeplant7"
}
}
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "quickly:item/blazeseed"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

@@ -0,0 +1,8 @@
{
"type": "minecraft:stonecutting",
"ingredient": "minecraft:magma_block",
"result": {
"id": "quickly:blazeseed",
"count": 1
}
}
@@ -0,0 +1,8 @@
{
"type": "minecraft:stonecutting",
"ingredient": "minecraft:magma_cream",
"result": {
"id": "quickly:blazeseed",
"count": 1
}
}
@@ -0,0 +1,8 @@
{
"type": "minecraft:stonecutting",
"ingredient": "minecraft:blaze_rod",
"result": {
"id": "quickly:blazeseed",
"count": 1
}
}