1.16.4.0
This commit is contained in:
parent
4dd73c0e78
commit
6e67d3f422
@ -3,15 +3,15 @@ org.gradle.jvmargs=-Xmx1G
|
|||||||
|
|
||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# check these on https://fabricmc.net/use
|
# check these on https://fabricmc.net/use
|
||||||
minecraft_version=1.16.3
|
minecraft_version=1.16.4
|
||||||
yarn_mappings=1.16.3+build.1
|
yarn_mappings=1.16.4+build.3
|
||||||
loader_version=0.9.3+build.207
|
loader_version=0.10.6+build.214
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 1.16.3.9
|
mod_version = 1.16.4.0
|
||||||
maven_group = de.jottyfan.minecraft
|
maven_group = de.jottyfan.minecraft
|
||||||
archives_base_name = quickiefabric
|
archives_base_name = quickiefabric
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
||||||
fabric_version=0.20.2+build.402-1.16
|
fabric_version=0.25.1+build.416-1.16
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package de.jottyfan.minecraft.quickiefabric.blocks;
|
package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import de.jottyfan.minecraft.quickiefabric.items.QuickieItems;
|
import de.jottyfan.minecraft.quickiefabric.items.QuickieItems;
|
||||||
@ -10,6 +11,7 @@ import net.minecraft.block.CropBlock;
|
|||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.ItemConvertible;
|
import net.minecraft.item.ItemConvertible;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.loot.context.LootContext.Builder;
|
||||||
import net.minecraft.util.ActionResult;
|
import net.minecraft.util.ActionResult;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.ItemScatterer;
|
import net.minecraft.util.ItemScatterer;
|
||||||
@ -24,6 +26,32 @@ public class BlockCottonplant extends CropBlock {
|
|||||||
super(FabricBlockSettings.copy(Blocks.WHEAT));
|
super(FabricBlockSettings.copy(Blocks.WHEAT));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ItemStack> getDroppedStacks(BlockState state, Builder builder) {
|
||||||
|
DefaultedList<ItemStack> list = DefaultedList.of();
|
||||||
|
list.add(new ItemStack(getSeedsItem())); // the one from the seed
|
||||||
|
if (isMature(state)) {
|
||||||
|
list.add(new ItemStack(getSeedsItem(), new Random().nextInt(3)));
|
||||||
|
list.add(new ItemStack(QuickieItems.COTTON, new Random().nextFloat() > 0.9f ? 2 : 1));
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void spawnHarvested(World world, BlockPos pos, BlockState state) {
|
||||||
|
DefaultedList<ItemStack> list = DefaultedList.of();
|
||||||
|
getDroppedStacks(state, null).forEach(itemStack -> {
|
||||||
|
list.add(itemStack);
|
||||||
|
});
|
||||||
|
ItemScatterer.spawn(world, pos, list);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player) {
|
||||||
|
spawnHarvested(world, pos, state);
|
||||||
|
super.onBreak(world, pos, state, player);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ItemConvertible getSeedsItem() {
|
protected ItemConvertible getSeedsItem() {
|
||||||
return QuickieItems.COTTONSEED;
|
return QuickieItems.COTTONSEED;
|
||||||
@ -33,11 +61,8 @@ public class BlockCottonplant extends CropBlock {
|
|||||||
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand,
|
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand,
|
||||||
BlockHitResult hitResult) {
|
BlockHitResult hitResult) {
|
||||||
if (!world.isClient && isMature(state)) {
|
if (!world.isClient && isMature(state)) {
|
||||||
DefaultedList<ItemStack> list = DefaultedList.of();
|
spawnHarvested(world, pos, state);
|
||||||
list.add(new ItemStack(getSeedsItem(), new Random().nextInt(3) + 1));
|
|
||||||
list.add(new ItemStack(QuickieItems.COTTON, new Random().nextFloat() > 0.9f ? 2 : 1));
|
|
||||||
world.setBlockState(pos, state.with(AGE, 0));
|
world.setBlockState(pos, state.with(AGE, 0));
|
||||||
ItemScatterer.spawn(world, pos, list);
|
|
||||||
}
|
}
|
||||||
return super.onUse(state, world, pos, player, hand, hitResult);
|
return super.onUse(state, world, pos, player, hand, hitResult);
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,15 @@
|
|||||||
{
|
{
|
||||||
"type": "minecraft:crafting_shapeless",
|
"type": "minecraft:crafting_shaped",
|
||||||
"ingredients": [
|
"pattern": [
|
||||||
{
|
"c",
|
||||||
|
"c",
|
||||||
|
"c"
|
||||||
|
],
|
||||||
|
"key": {
|
||||||
|
"c": {
|
||||||
"item": "quickiefabric:cotton"
|
"item": "quickiefabric:cotton"
|
||||||
}
|
}
|
||||||
],
|
},
|
||||||
"result": {
|
"result": {
|
||||||
"item": "minecraft:string",
|
"item": "minecraft:string",
|
||||||
"count": 1
|
"count": 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user