Compare commits

14 Commits

Author SHA1 Message Date
a54ec93551 1.20.3-pre2 2023-11-23 17:54:39 +01:00
96a334448e snapshot version 2023-11-13 23:48:55 +01:00
8661f7f12e log compatibility on some mods 2023-10-31 20:50:39 +01:00
a687e935b2 added block speedpowder 2023-10-28 22:38:48 +02:00
a1a521adbb version 1.20.2.0 2023-09-22 21:42:29 +02:00
829fa5bc52 repaired block stacker gui 2023-09-20 21:32:48 +02:00
5028212e81 improved graphics 2023-08-26 18:28:29 +02:00
f9537529f5 added blocksalpeter 2023-07-17 22:51:44 +02:00
69b8e07f2e repaired recipes for blacksmith 2023-07-14 14:23:07 +02:00
2c9aaea4c8 fixed backpack rendering 2023-07-01 18:37:53 +02:00
69c52f5bb8 1.20.1 2023-06-29 20:01:33 +02:00
a851302f94 1.20.1 first trials 2023-06-21 23:40:20 +02:00
62da9e3afb version 1.19.4 2023-03-17 19:20:50 +01:00
9b01b89884 uprades 2023-03-04 16:03:31 +01:00
74 changed files with 634 additions and 289 deletions

View File

@ -4,17 +4,17 @@
# Fabric Properties
# check these on https://fabricmc.net/versions.html
minecraft_version=23w06a
yarn_mappings=23w06a+build.12
loader_version=0.14.14
minecraft_version=1.20.3-pre2
yarn_mappings=1.20.3-pre2+build.2
loader_version=0.14.24
# Mod Properties
mod_version = 1.19.4.0
mod_version = 1.20.3.1
maven_group = de.jottyfan.minecraft
archives_base_name = quickiefabric
# Dependencies
fabric_version=0.73.5+1.19.4
fabric_version=0.90.12+1.20.3
# for ExtendedLeavesBlock
terraform_wood_api_version=5.0.0-beta.1
terraform_wood_api_version=9.0.0-alpha.3

View File

@ -21,5 +21,6 @@ public class QuickieFabric implements ModInitializer {
RegistryManager.registerContainer();
RegistryManager.registerLootings();
RegistryManager.registerTags();
RegistryManager.registerItemGroup();
}
}

View File

@ -27,10 +27,12 @@ public class EmptyLavaHoarderBlockEntity extends BlockEntity {
public static final void spawnRandomItems(World world, BlockPos pos, Integer count) {
world.spawnEntity(new ItemEntity(world, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(Items.DIAMOND, new Random().nextInt(count))));
world.spawnEntity(new ItemEntity(world, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(Items.EMERALD, new Random().nextInt(count))));
world.spawnEntity(new ItemEntity(world, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(Items.GOLD_NUGGET, new Random().nextInt(count))));
world.spawnEntity(new ItemEntity(world, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(Items.IRON_NUGGET, new Random().nextInt(count))));
world.spawnEntity(new ItemEntity(world, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(Items.GOLD_ORE, new Random().nextInt(count))));
world.spawnEntity(new ItemEntity(world, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(Items.IRON_ORE, new Random().nextInt(count))));
world.spawnEntity(new ItemEntity(world, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(Items.COPPER_ORE, new Random().nextInt(count))));
world.spawnEntity(new ItemEntity(world, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(Items.OBSIDIAN, new Random().nextInt(count))));
world.spawnEntity(new ItemEntity(world, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(Items.LAPIS_LAZULI, new Random().nextInt(count))));
world.spawnEntity(new ItemEntity(world, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(QuickieItems.SULPHOR, 1 + new Random().nextInt(count))));
world.spawnEntity(new ItemEntity(world, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(QuickieItems.SULPHOR, new Random().nextInt(count))));
}
/**

View File

@ -81,7 +81,7 @@ public class ItemHoarderBlockEntity extends LootableContainerBlockEntity {
@Override
public void writeNbt(NbtCompound nbt) {
super.writeNbt(nbt);
if (!this.serializeLootTable(nbt)) {
if (!this.writeLootTable(nbt)) {
Inventories.writeNbt(nbt, this.stacks);
}
}
@ -90,7 +90,7 @@ public class ItemHoarderBlockEntity extends LootableContainerBlockEntity {
public void readNbt(NbtCompound nbt) {
super.readNbt(nbt);
this.stacks = DefaultedList.ofSize(this.size(), ItemStack.EMPTY);
if (!this.deserializeLootTable(nbt)) {
if (!this.readLootTable(nbt)) {
Inventories.readNbt(nbt, this.stacks);
}
}
@ -104,8 +104,8 @@ public class ItemHoarderBlockEntity extends LootableContainerBlockEntity {
return 54; // container chest size (9 * 6)
}
@Override
protected DefaultedList<ItemStack> getInvStackList() {
@Override // before: getInvStackList
protected DefaultedList<ItemStack> method_11282() {
return stacks;
}

View File

@ -11,7 +11,7 @@ import net.minecraft.block.CropBlock;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemConvertible;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.ItemScatterer;
@ -46,9 +46,9 @@ public class BlockCottonplant extends CropBlock {
}
@Override
public void onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player) {
public BlockState onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player) {
spawnHarvested(world, pos, state);
super.onBreak(world, pos, state, player);
return super.onBreak(world, pos, state, player);
}
@Override

View File

@ -4,25 +4,26 @@ import java.util.Arrays;
import java.util.List;
import java.util.Random;
import com.mojang.serialization.MapCodec;
import de.jottyfan.minecraft.quickiefabric.items.QuickieItems;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.GravelBlock;
import net.minecraft.block.Material;
import net.minecraft.block.FallingBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
/**
*
* @author jotty
*
*/
public class BlockDirtSalpeter extends GravelBlock {
public class BlockDirtSalpeter extends FallingBlock {
public BlockDirtSalpeter() {
super(FabricBlockSettings.of(Material.STONE).hardness(3.1f));
super(FabricBlockSettings.create().hardness(3.1f));
}
@Override
@ -36,4 +37,10 @@ public class BlockDirtSalpeter extends GravelBlock {
: new ItemStack[] { salpeterStack, dirtStack };
return Arrays.asList(spawnies);
}
@Override
protected MapCodec<? extends FallingBlock> getCodec() {
// TODO Auto-generated method stub
return null;
}
}

View File

@ -3,18 +3,19 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
import java.util.ArrayList;
import java.util.List;
import com.mojang.serialization.MapCodec;
import de.jottyfan.minecraft.quickiefabric.blockentity.DrillBlockDownEntity;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockEntityProvider;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.FallingBlock;
import net.minecraft.block.Material;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityTicker;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@ -26,7 +27,7 @@ import net.minecraft.world.World;
public class BlockDrillDown extends FallingBlock implements BlockEntityProvider {
public BlockDrillDown() {
super(FabricBlockSettings.of(Material.STONE).hardness(2.5f));
super(FabricBlockSettings.create().hardness(2.5f));
}
public BlockEntity createBlockEntity(BlockPos pos, BlockState blockState) {
@ -49,4 +50,9 @@ public class BlockDrillDown extends FallingBlock implements BlockEntityProvider
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state, BlockEntityType<T> type){
return (world1, pos, state1, be) -> DrillBlockDownEntity.tick(world1, pos, state1, be);
}
@Override
protected MapCodec<? extends FallingBlock> getCodec() {
return null; // TODO: what to return here?
}
}

View File

@ -3,18 +3,19 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
import java.util.ArrayList;
import java.util.List;
import com.mojang.serialization.MapCodec;
import de.jottyfan.minecraft.quickiefabric.blockentity.DrillBlockEastEntity;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockEntityProvider;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.FallingBlock;
import net.minecraft.block.Material;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityTicker;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@ -26,7 +27,7 @@ import net.minecraft.world.World;
public class BlockDrillEast extends FallingBlock implements BlockEntityProvider {
public BlockDrillEast() {
super(FabricBlockSettings.of(Material.STONE).hardness(2.5f));
super(FabricBlockSettings.create().hardness(2.5f));
}
@Override
@ -50,4 +51,10 @@ public class BlockDrillEast extends FallingBlock implements BlockEntityProvider
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state, BlockEntityType<T> type){
return (world1, pos, state1, be) -> DrillBlockEastEntity.tick(world1, pos, state1, be);
}
@Override
protected MapCodec<? extends FallingBlock> getCodec() {
// TODO Auto-generated method stub
return null;
}
}

View File

@ -3,18 +3,19 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
import java.util.ArrayList;
import java.util.List;
import com.mojang.serialization.MapCodec;
import de.jottyfan.minecraft.quickiefabric.blockentity.DrillBlockNorthEntity;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockEntityProvider;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.FallingBlock;
import net.minecraft.block.Material;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityTicker;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@ -26,7 +27,7 @@ import net.minecraft.world.World;
public class BlockDrillNorth extends FallingBlock implements BlockEntityProvider {
public BlockDrillNorth() {
super(FabricBlockSettings.of(Material.STONE).hardness(2.5f));
super(FabricBlockSettings.create().hardness(2.5f));
}
@Override
@ -50,4 +51,10 @@ public class BlockDrillNorth extends FallingBlock implements BlockEntityProvider
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state, BlockEntityType<T> type){
return (world1, pos, state1, be) -> DrillBlockNorthEntity.tick(world1, pos, state1, be);
}
@Override
protected MapCodec<? extends FallingBlock> getCodec() {
// TODO Auto-generated method stub
return null;
}
}

View File

@ -3,18 +3,19 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
import java.util.ArrayList;
import java.util.List;
import com.mojang.serialization.MapCodec;
import de.jottyfan.minecraft.quickiefabric.blockentity.DrillBlockSouthEntity;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockEntityProvider;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.FallingBlock;
import net.minecraft.block.Material;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityTicker;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@ -26,7 +27,7 @@ import net.minecraft.world.World;
public class BlockDrillSouth extends FallingBlock implements BlockEntityProvider {
public BlockDrillSouth() {
super(FabricBlockSettings.of(Material.STONE).hardness(2.5f));
super(FabricBlockSettings.create().hardness(2.5f));
}
@Override
@ -50,4 +51,10 @@ public class BlockDrillSouth extends FallingBlock implements BlockEntityProvider
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state, BlockEntityType<T> type){
return (world1, pos, state1, be) -> DrillBlockSouthEntity.tick(world1, pos, state1, be);
}
@Override
protected MapCodec<? extends FallingBlock> getCodec() {
// TODO Auto-generated method stub
return null;
}
}

View File

@ -3,18 +3,19 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
import java.util.ArrayList;
import java.util.List;
import com.mojang.serialization.MapCodec;
import de.jottyfan.minecraft.quickiefabric.blockentity.DrillBlockWestEntity;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockEntityProvider;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.FallingBlock;
import net.minecraft.block.Material;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityTicker;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@ -26,7 +27,7 @@ import net.minecraft.world.World;
public class BlockDrillWest extends FallingBlock implements BlockEntityProvider {
public BlockDrillWest() {
super(FabricBlockSettings.of(Material.STONE).hardness(2.5f));
super(FabricBlockSettings.create().hardness(2.5f));
}
@Override
@ -50,4 +51,10 @@ public class BlockDrillWest extends FallingBlock implements BlockEntityProvider
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state, BlockEntityType<T> type){
return (world1, pos, state1, be) -> DrillBlockWestEntity.tick(world1, pos, state1, be);
}
@Override
protected MapCodec<? extends FallingBlock> getCodec() {
// TODO Auto-generated method stub
return null;
}
}

View File

@ -6,9 +6,9 @@ import java.util.List;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Material;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
/**
*
@ -18,7 +18,7 @@ import net.minecraft.loot.context.LootContext.Builder;
public class BlockDrillstop extends Block {
public BlockDrillstop() {
super(FabricBlockSettings.of(Material.STONE).hardness(2.5f));
super(FabricBlockSettings.create().hardness(2.5f));
}
@Override

View File

@ -12,14 +12,13 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockEntityProvider;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.Material;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityTicker;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.entity.ExperienceOrbEntity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@ -31,7 +30,7 @@ import net.minecraft.world.World;
public class BlockEmptyLavahoarder extends Block implements BlockEntityProvider {
public BlockEmptyLavahoarder() {
super(FabricBlockSettings.of(Material.STONE).hardness(2.5f));
super(FabricBlockSettings.create().hardness(2.5f));
}
@Override

View File

@ -11,13 +11,12 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockEntityProvider;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.Material;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityTicker;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
import net.minecraft.text.Style;
import net.minecraft.text.Text;
import net.minecraft.util.ActionResult;
@ -36,7 +35,7 @@ import net.minecraft.world.World;
public class BlockItemhoarder extends Block implements BlockEntityProvider {
public BlockItemhoarder() {
super(FabricBlockSettings.of(Material.WOOD).hardness(2.5f));
super(FabricBlockSettings.create().hardness(2.5f));
}
@Override
@ -62,7 +61,7 @@ public class BlockItemhoarder extends Block implements BlockEntityProvider {
}
@Override
public void onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player) {
public BlockState onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player) {
BlockEntity blockEntity = world.getBlockEntity(pos);
if (blockEntity instanceof ItemHoarderBlockEntity) {
ItemHoarderBlockEntity ihbe = (ItemHoarderBlockEntity) blockEntity;
@ -70,7 +69,7 @@ public class BlockItemhoarder extends Block implements BlockEntityProvider {
ItemScatterer.spawn(world, pos.getX(), pos.getY(), pos.getZ(), stack);
}
}
super.onBreak(world, pos, state, player);
return super.onBreak(world, pos, state, player);
}
@Override

View File

@ -3,14 +3,14 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
import java.util.Arrays;
import java.util.List;
import com.mojang.serialization.MapCodec;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockState;
import net.minecraft.block.GravelBlock;
import net.minecraft.block.MapColor;
import net.minecraft.block.Material;
import net.minecraft.block.FallingBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
import net.minecraft.sound.BlockSoundGroup;
/**
@ -18,10 +18,10 @@ import net.minecraft.sound.BlockSoundGroup;
* @author jotty
*
*/
public class BlockKelpstack extends GravelBlock {
public class BlockKelpstack extends FallingBlock {
public BlockKelpstack() {
super(FabricBlockSettings.of(Material.SOLID_ORGANIC, MapColor.GREEN).hardness(0.1f).slipperiness(1.0f)
super(FabricBlockSettings.create().hardness(0.1f).slipperiness(1.0f)
.breakInstantly().sounds(BlockSoundGroup.WET_GRASS));
}
@ -29,4 +29,10 @@ public class BlockKelpstack extends GravelBlock {
public List<ItemStack> getDroppedStacks(BlockState blockState, Builder builder) {
return Arrays.asList(new ItemStack[] { new ItemStack(Items.KELP, 9) });
}
@Override
protected MapCodec<? extends FallingBlock> getCodec() {
// TODO Auto-generated method stub
return null;
}
}

View File

@ -9,7 +9,6 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockEntityProvider;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.Material;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityTicker;
import net.minecraft.block.entity.BlockEntityType;
@ -17,7 +16,7 @@ import net.minecraft.entity.ItemEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
@ -32,7 +31,7 @@ import net.minecraft.world.World;
public class BlockLavahoarder extends Block implements BlockEntityProvider {
public BlockLavahoarder() {
super(FabricBlockSettings.of(Material.STONE).hardness(2.5f).luminance(16));
super(FabricBlockSettings.create().hardness(2.5f).luminance(state -> 15));
}
@Override

View File

@ -5,17 +5,13 @@ import java.util.List;
import de.jottyfan.minecraft.quickiefabric.blockentity.MonsterHoarderBlockEntity;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.BlockEntityProvider;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.Material;
import net.minecraft.block.*;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityTicker;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.math.BlockPos;
@ -28,8 +24,9 @@ import net.minecraft.world.World;
*/
public class BlockMonsterhoarder extends Block implements BlockEntityProvider {
public BlockMonsterhoarder() {
super(FabricBlockSettings.of(Material.WOOD).hardness(2.5f).luminance(20));
super(FabricBlockSettings.create().hardness(2.5f).luminance(state -> 15));
}
@Override

View File

@ -3,13 +3,14 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
import java.util.Arrays;
import java.util.List;
import de.jottyfan.minecraft.quickiefabric.blocks.help.IntProviderHelper;
import de.jottyfan.minecraft.quickiefabric.items.QuickieItems;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockState;
import net.minecraft.block.ExperienceDroppingBlock;
import net.minecraft.block.Material;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
/**
*
@ -19,7 +20,7 @@ import net.minecraft.loot.context.LootContext.Builder;
public class BlockOreDeepslateSulphor extends ExperienceDroppingBlock {
public BlockOreDeepslateSulphor() {
super(FabricBlockSettings.of(Material.STONE).hardness(1.9f).requiresTool());
super(IntProviderHelper.of(0, 2), FabricBlockSettings.create().hardness(1.9f).requiresTool());
}
@Override

View File

@ -3,14 +3,14 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
import java.util.Arrays;
import java.util.List;
import de.jottyfan.minecraft.quickiefabric.blocks.help.IntProviderHelper;
import de.jottyfan.minecraft.quickiefabric.items.QuickieItems;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.ExperienceDroppingBlock;
import net.minecraft.block.Material;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
/**
*
@ -20,7 +20,7 @@ import net.minecraft.loot.context.LootContext.Builder;
public class BlockOreNetherSulphor extends ExperienceDroppingBlock {
public BlockOreNetherSulphor() {
super(FabricBlockSettings.of(Material.STONE).hardness(2.1f).requiresTool());
super(IntProviderHelper.of(0, 2), FabricBlockSettings.create().hardness(2.1f).requiresTool());
}
@Override

View File

@ -3,13 +3,13 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
import java.util.Arrays;
import java.util.List;
import de.jottyfan.minecraft.quickiefabric.blocks.help.IntProviderHelper;
import de.jottyfan.minecraft.quickiefabric.items.QuickieItems;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockState;
import net.minecraft.block.ExperienceDroppingBlock;
import net.minecraft.block.Material;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
import net.minecraft.util.math.random.Random;
/**
@ -20,7 +20,7 @@ import net.minecraft.util.math.random.Random;
public class BlockOreSalpeter extends ExperienceDroppingBlock {
public BlockOreSalpeter() {
super(FabricBlockSettings.of(Material.STONE).hardness(3.1f).requiresTool());
super(IntProviderHelper.of(0, 2), FabricBlockSettings.create().hardness(3.1f).requiresTool());
}
@Override

View File

@ -3,14 +3,14 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
import java.util.Arrays;
import java.util.List;
import de.jottyfan.minecraft.quickiefabric.blocks.help.IntProviderHelper;
import de.jottyfan.minecraft.quickiefabric.items.QuickieItems;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.ExperienceDroppingBlock;
import net.minecraft.block.Material;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
import net.minecraft.util.math.random.Random;
/**
@ -21,7 +21,7 @@ import net.minecraft.util.math.random.Random;
public class BlockOreSandSalpeter extends ExperienceDroppingBlock {
public BlockOreSandSalpeter() {
super(FabricBlockSettings.of(Material.STONE).hardness(2.9f).requiresTool());
super(IntProviderHelper.of(0, 2), FabricBlockSettings.create().hardness(2.9f).requiresTool());
}
@Override

View File

@ -3,13 +3,14 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
import java.util.Arrays;
import java.util.List;
import de.jottyfan.minecraft.quickiefabric.blocks.help.IntProviderHelper;
import de.jottyfan.minecraft.quickiefabric.items.QuickieItems;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockState;
import net.minecraft.block.ExperienceDroppingBlock;
import net.minecraft.block.Material;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
/**
*
@ -19,7 +20,7 @@ import net.minecraft.loot.context.LootContext.Builder;
public class BlockOreSulphor extends ExperienceDroppingBlock {
public BlockOreSulphor() {
super(FabricBlockSettings.of(Material.STONE).hardness(1.9f).requiresTool());
super(IntProviderHelper.of(0, 2), FabricBlockSettings.create().hardness(1.9f).requiresTool());
}
@Override

View File

@ -0,0 +1,29 @@
package de.jottyfan.minecraft.quickiefabric.blocks;
import java.util.Arrays;
import java.util.List;
import de.jottyfan.minecraft.quickiefabric.blocks.help.IntProviderHelper;
import de.jottyfan.minecraft.quickiefabric.items.QuickieItems;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockState;
import net.minecraft.block.ExperienceDroppingBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
/**
*
* @author jotty
*
*/
public class BlockSalpeter extends ExperienceDroppingBlock {
public BlockSalpeter() {
super(IntProviderHelper.of(0, 2), FabricBlockSettings.create().hardness(0.5f));
}
@Override
public List<ItemStack> getDroppedStacks(BlockState state, Builder builder) {
return Arrays.asList(new ItemStack[] { new ItemStack(QuickieItems.SALPETER, 9) });
}
}

View File

@ -3,14 +3,15 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
import java.util.Arrays;
import java.util.List;
import com.mojang.serialization.MapCodec;
import de.jottyfan.minecraft.quickiefabric.items.QuickieItems;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.GravelBlock;
import net.minecraft.block.Material;
import net.minecraft.block.FallingBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
import net.minecraft.util.math.random.Random;
/**
@ -18,14 +19,20 @@ import net.minecraft.util.math.random.Random;
* @author jotty
*
*/
public class BlockSandSalpeter extends GravelBlock {
public class BlockSandSalpeter extends FallingBlock {
public BlockSandSalpeter() {
super(FabricBlockSettings.of(Material.STONE).hardness(3.1f).requiresTool());
super(FabricBlockSettings.create().hardness(3.1f).requiresTool());
}
@Override
public List<ItemStack> getDroppedStacks(BlockState state, Builder builder) {
return Arrays.asList(new ItemStack[] { new ItemStack(QuickieItems.SALPETER, 3 + Random.create().nextInt(2)), new ItemStack(Blocks.SAND) });
}
@Override
protected MapCodec<? extends FallingBlock> getCodec() {
// TODO Auto-generated method stub
return null;
}
}

View File

@ -0,0 +1,42 @@
package de.jottyfan.minecraft.quickiefabric.blocks;
import java.util.Arrays;
import java.util.List;
import com.mojang.serialization.MapCodec;
import de.jottyfan.minecraft.quickiefabric.items.QuickieItems;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockState;
import net.minecraft.block.FallingBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
import net.minecraft.world.explosion.Explosion;
/**
*
* @author jotty
*
*/
public class BlockSpeedpowder extends FallingBlock {
public BlockSpeedpowder() {
super(FabricBlockSettings.create().luminance(state -> 12));
}
@Override
public List<ItemStack> getDroppedStacks(BlockState state, Builder builder) {
return Arrays.asList(new ItemStack[] { new ItemStack(QuickieItems.SPEEDPOWDER, 9) });
}
@Override
public boolean shouldDropItemsOnExplosion(Explosion explosion) {
return true;
}
@Override
protected MapCodec<? extends FallingBlock> getCodec() {
// TODO Auto-generated method stub
return null;
}
}

View File

@ -2,18 +2,19 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
import java.util.List;
import com.mojang.serialization.MapCodec;
import de.jottyfan.minecraft.quickiefabric.blockentity.BlockSpreaderEntity;
import de.jottyfan.minecraft.quickiefabric.blockentity.QuickieFabricBlockEntity;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.BlockWithEntity;
import net.minecraft.block.Material;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityTicker;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@ -25,7 +26,7 @@ import net.minecraft.world.World;
public class BlockSpreader extends BlockWithEntity {
public BlockSpreader() {
super(FabricBlockSettings.of(Material.STONE).hardness(2.5f));
super(FabricBlockSettings.create().hardness(2.5f));
}
@Override
@ -41,7 +42,7 @@ public class BlockSpreader extends BlockWithEntity {
@Override
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state,
BlockEntityType<T> type) {
return checkType(type, QuickieFabricBlockEntity.BLOCKSPREADER_ENTITY,
return validateTicker(type, QuickieFabricBlockEntity.BLOCKSPREADER_ENTITY,
(world1, pos, state1, be) -> BlockSpreaderEntity.tick(world1, pos, state1, be));
}
@ -49,4 +50,10 @@ public class BlockSpreader extends BlockWithEntity {
public List<ItemStack> getDroppedStacks(BlockState state, Builder builder) {
return List.of(new ItemStack(QuickieBlocks.BLOCKSPREADER.asItem()));
}
@Override
protected MapCodec<? extends BlockWithEntity> getCodec() {
// TODO Auto-generated method stub
return null;
}
}

View File

@ -2,6 +2,8 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
import java.util.List;
import com.mojang.serialization.MapCodec;
import de.jottyfan.minecraft.quickiefabric.blockentity.BlockStackerEntity;
import de.jottyfan.minecraft.quickiefabric.blockentity.QuickieFabricBlockEntity;
import de.jottyfan.minecraft.quickiefabric.blocks.help.BlockStacker;
@ -9,13 +11,12 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.BlockWithEntity;
import net.minecraft.block.Material;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityTicker;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
import net.minecraft.screen.NamedScreenHandlerFactory;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.util.ActionResult;
@ -34,7 +35,7 @@ import net.minecraft.world.World;
public class BlockStackerDown extends BlockWithEntity implements BlockStacker {
public BlockStackerDown() {
super(FabricBlockSettings.of(Material.STONE).hardness(2.5f));
super(FabricBlockSettings.create().hardness(2.5f));
}
@Override
@ -65,7 +66,7 @@ public class BlockStackerDown extends BlockWithEntity implements BlockStacker {
@Override
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state,
BlockEntityType<T> type) {
return checkType(type, QuickieFabricBlockEntity.BLOCKSTACKER_ENTITY,
return validateTicker(type, QuickieFabricBlockEntity.BLOCKSTACKER_ENTITY,
(world1, pos, state1, be) -> BlockStackerEntity.tick(world1, pos, state1, be));
}
@ -103,4 +104,10 @@ public class BlockStackerDown extends BlockWithEntity implements BlockStacker {
public int getComparatorOutput(BlockState state, World world, BlockPos pos) {
return ScreenHandler.calculateComparatorOutput(world.getBlockEntity(pos));
}
@Override
protected MapCodec<? extends BlockWithEntity> getCodec() {
// TODO Auto-generated method stub
return null;
}
}

View File

@ -2,6 +2,8 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
import java.util.List;
import com.mojang.serialization.MapCodec;
import de.jottyfan.minecraft.quickiefabric.blockentity.BlockStackerEntity;
import de.jottyfan.minecraft.quickiefabric.blockentity.QuickieFabricBlockEntity;
import de.jottyfan.minecraft.quickiefabric.blocks.help.BlockStacker;
@ -9,13 +11,12 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.BlockWithEntity;
import net.minecraft.block.Material;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityTicker;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
import net.minecraft.screen.NamedScreenHandlerFactory;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.util.ActionResult;
@ -34,7 +35,7 @@ import net.minecraft.world.World;
public class BlockStackerEast extends BlockWithEntity implements BlockStacker {
public BlockStackerEast() {
super(FabricBlockSettings.of(Material.STONE).hardness(2.5f));
super(FabricBlockSettings.create().hardness(2.5f));
}
@Override
@ -65,7 +66,7 @@ public class BlockStackerEast extends BlockWithEntity implements BlockStacker {
@Override
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state,
BlockEntityType<T> type) {
return checkType(type, QuickieFabricBlockEntity.BLOCKSTACKER_ENTITY,
return validateTicker(type, QuickieFabricBlockEntity.BLOCKSTACKER_ENTITY,
(world1, pos, state1, be) -> BlockStackerEntity.tick(world1, pos, state1, be));
}
@ -103,4 +104,10 @@ public class BlockStackerEast extends BlockWithEntity implements BlockStacker {
public int getComparatorOutput(BlockState state, World world, BlockPos pos) {
return ScreenHandler.calculateComparatorOutput(world.getBlockEntity(pos));
}
@Override
protected MapCodec<? extends BlockWithEntity> getCodec() {
// TODO Auto-generated method stub
return null;
}
}

View File

@ -2,6 +2,8 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
import java.util.List;
import com.mojang.serialization.MapCodec;
import de.jottyfan.minecraft.quickiefabric.blockentity.BlockStackerEntity;
import de.jottyfan.minecraft.quickiefabric.blockentity.QuickieFabricBlockEntity;
import de.jottyfan.minecraft.quickiefabric.blocks.help.BlockStacker;
@ -9,13 +11,12 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.BlockWithEntity;
import net.minecraft.block.Material;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityTicker;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
import net.minecraft.screen.NamedScreenHandlerFactory;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.util.ActionResult;
@ -34,7 +35,7 @@ import net.minecraft.world.World;
public class BlockStackerNorth extends BlockWithEntity implements BlockStacker {
public BlockStackerNorth() {
super(FabricBlockSettings.of(Material.STONE).hardness(2.5f));
super(FabricBlockSettings.create().hardness(2.5f));
}
@Override
@ -65,7 +66,7 @@ public class BlockStackerNorth extends BlockWithEntity implements BlockStacker {
@Override
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state,
BlockEntityType<T> type) {
return checkType(type, QuickieFabricBlockEntity.BLOCKSTACKER_ENTITY,
return validateTicker(type, QuickieFabricBlockEntity.BLOCKSTACKER_ENTITY,
(world1, pos, state1, be) -> BlockStackerEntity.tick(world1, pos, state1, be));
}
@ -103,4 +104,10 @@ public class BlockStackerNorth extends BlockWithEntity implements BlockStacker {
public int getComparatorOutput(BlockState state, World world, BlockPos pos) {
return ScreenHandler.calculateComparatorOutput(world.getBlockEntity(pos));
}
@Override
protected MapCodec<? extends BlockWithEntity> getCodec() {
// TODO Auto-generated method stub
return null;
}
}

View File

@ -2,6 +2,8 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
import java.util.List;
import com.mojang.serialization.MapCodec;
import de.jottyfan.minecraft.quickiefabric.blockentity.BlockStackerEntity;
import de.jottyfan.minecraft.quickiefabric.blockentity.QuickieFabricBlockEntity;
import de.jottyfan.minecraft.quickiefabric.blocks.help.BlockStacker;
@ -9,13 +11,12 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.BlockWithEntity;
import net.minecraft.block.Material;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityTicker;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
import net.minecraft.screen.NamedScreenHandlerFactory;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.util.ActionResult;
@ -34,7 +35,7 @@ import net.minecraft.world.World;
public class BlockStackerSouth extends BlockWithEntity implements BlockStacker {
public BlockStackerSouth() {
super(FabricBlockSettings.of(Material.STONE).hardness(2.5f));
super(FabricBlockSettings.create().hardness(2.5f));
}
@Override
@ -65,7 +66,7 @@ public class BlockStackerSouth extends BlockWithEntity implements BlockStacker {
@Override
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state,
BlockEntityType<T> type) {
return checkType(type, QuickieFabricBlockEntity.BLOCKSTACKER_ENTITY,
return validateTicker(type, QuickieFabricBlockEntity.BLOCKSTACKER_ENTITY,
(world1, pos, state1, be) -> BlockStackerEntity.tick(world1, pos, state1, be));
}
@ -103,4 +104,10 @@ public class BlockStackerSouth extends BlockWithEntity implements BlockStacker {
public int getComparatorOutput(BlockState state, World world, BlockPos pos) {
return ScreenHandler.calculateComparatorOutput(world.getBlockEntity(pos));
}
@Override
protected MapCodec<? extends BlockWithEntity> getCodec() {
// TODO Auto-generated method stub
return null;
}
}

View File

@ -2,6 +2,8 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
import java.util.List;
import com.mojang.serialization.MapCodec;
import de.jottyfan.minecraft.quickiefabric.blockentity.BlockStackerEntity;
import de.jottyfan.minecraft.quickiefabric.blockentity.QuickieFabricBlockEntity;
import de.jottyfan.minecraft.quickiefabric.blocks.help.BlockStacker;
@ -9,13 +11,12 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.BlockWithEntity;
import net.minecraft.block.Material;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityTicker;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
import net.minecraft.screen.NamedScreenHandlerFactory;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.util.ActionResult;
@ -34,7 +35,7 @@ import net.minecraft.world.World;
public class BlockStackerUp extends BlockWithEntity implements BlockStacker {
public BlockStackerUp() {
super(FabricBlockSettings.of(Material.STONE).hardness(2.5f));
super(FabricBlockSettings.create().hardness(2.5f));
}
@Override
@ -65,7 +66,7 @@ public class BlockStackerUp extends BlockWithEntity implements BlockStacker {
@Override
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state,
BlockEntityType<T> type) {
return checkType(type, QuickieFabricBlockEntity.BLOCKSTACKER_ENTITY,
return validateTicker(type, QuickieFabricBlockEntity.BLOCKSTACKER_ENTITY,
(world1, pos, state1, be) -> BlockStackerEntity.tick(world1, pos, state1, be));
}
@ -103,4 +104,10 @@ public class BlockStackerUp extends BlockWithEntity implements BlockStacker {
public int getComparatorOutput(BlockState state, World world, BlockPos pos) {
return ScreenHandler.calculateComparatorOutput(world.getBlockEntity(pos));
}
@Override
protected MapCodec<? extends BlockWithEntity> getCodec() {
// TODO Auto-generated method stub
return null;
}
}

View File

@ -2,6 +2,8 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
import java.util.List;
import com.mojang.serialization.MapCodec;
import de.jottyfan.minecraft.quickiefabric.blockentity.BlockStackerEntity;
import de.jottyfan.minecraft.quickiefabric.blockentity.QuickieFabricBlockEntity;
import de.jottyfan.minecraft.quickiefabric.blocks.help.BlockStacker;
@ -9,13 +11,12 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.BlockWithEntity;
import net.minecraft.block.Material;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityTicker;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
import net.minecraft.screen.NamedScreenHandlerFactory;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.util.ActionResult;
@ -34,7 +35,7 @@ import net.minecraft.world.World;
public class BlockStackerWest extends BlockWithEntity implements BlockStacker {
public BlockStackerWest() {
super(FabricBlockSettings.of(Material.STONE).hardness(2.5f));
super(FabricBlockSettings.create().hardness(2.5f));
}
@Override
@ -65,7 +66,7 @@ public class BlockStackerWest extends BlockWithEntity implements BlockStacker {
@Override
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state,
BlockEntityType<T> type) {
return checkType(type, QuickieFabricBlockEntity.BLOCKSTACKER_ENTITY,
return validateTicker(type, QuickieFabricBlockEntity.BLOCKSTACKER_ENTITY,
(world1, pos, state1, be) -> BlockStackerEntity.tick(world1, pos, state1, be));
}
@ -103,4 +104,10 @@ public class BlockStackerWest extends BlockWithEntity implements BlockStacker {
public int getComparatorOutput(BlockState state, World world, BlockPos pos) {
return ScreenHandler.calculateComparatorOutput(world.getBlockEntity(pos));
}
@Override
protected MapCodec<? extends BlockWithEntity> getCodec() {
// TODO Auto-generated method stub
return null;
}
}

View File

@ -3,13 +3,13 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
import java.util.Arrays;
import java.util.List;
import de.jottyfan.minecraft.quickiefabric.blocks.help.IntProviderHelper;
import de.jottyfan.minecraft.quickiefabric.items.QuickieItems;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockState;
import net.minecraft.block.ExperienceDroppingBlock;
import net.minecraft.block.Material;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
/**
*
@ -19,7 +19,7 @@ import net.minecraft.loot.context.LootContext.Builder;
public class BlockSulphor extends ExperienceDroppingBlock {
public BlockSulphor() {
super(FabricBlockSettings.of(Material.STONE).hardness(0.5f));
super(IntProviderHelper.of(0, 2), FabricBlockSettings.create().hardness(0.5f));
}
@Override

View File

@ -20,6 +20,7 @@ public class QuickieBlocks {
public static final BlockKelpstack KELPSTACK = new BlockKelpstack();
public static final BlockCottonplant COTTONPLANT = new BlockCottonplant();
public static final BlockSulphor BLOCKSULPHOR = new BlockSulphor();
public static final BlockSalpeter BLOCKSALPETER = new BlockSalpeter();
public static final BlockDrillDown DRILL_DOWN = new BlockDrillDown();
public static final BlockDrillEast DRILL_EAST = new BlockDrillEast();
public static final BlockDrillSouth DRILL_SOUTH = new BlockDrillSouth();
@ -33,4 +34,5 @@ public class QuickieBlocks {
public static final BlockStackerNorth BLOCKSTACKERNORTH = new BlockStackerNorth();
public static final BlockStackerSouth BLOCKSTACKERSOUTH = new BlockStackerSouth();
public static final BlockSpreader BLOCKSPREADER = new BlockSpreader();
public static final BlockSpeedpowder BLOCKSPEEDPOWDER = new BlockSpeedpowder();;
}

View File

@ -0,0 +1,37 @@
package de.jottyfan.minecraft.quickiefabric.blocks.help;
import net.minecraft.util.math.intprovider.IntProvider;
import net.minecraft.util.math.intprovider.IntProviderType;
import net.minecraft.util.math.random.Random;
/**
*
* @author jotty
*
*/
public class IntProviderHelper {
public static final IntProvider of(Integer min, Integer max) {
return new IntProvider() {
@Override
public IntProviderType<?> getType() {
return IntProviderType.CONSTANT;
}
@Override
public int getMin() {
return min;
}
@Override
public int getMax() {
return max;
}
@Override
public int get(Random random) {
return random.nextBetween(min, max);
}
};
}
}

View File

@ -1,14 +1,12 @@
package de.jottyfan.minecraft.quickiefabric.container;
import com.mojang.blaze3d.systems.RenderSystem;
import de.jottyfan.minecraft.quickiefabric.init.RegistryManager;
import de.jottyfan.minecraft.quickiefabric.items.ItemBackpack;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.ingame.HandledScreen;
import net.minecraft.client.gui.screen.ingame.ScreenHandlerProvider;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
@ -27,45 +25,37 @@ public class BackpackScreen extends HandledScreen<BackpackScreenHandler>
private final Integer containerWidth = 176;
public BackpackScreen(BackpackScreenHandler handler, PlayerInventory inventory, Text text) {
super(handler, inventory, Text.translatable("container.quickiefabric.backpack"));
super(handler, inventory, Text.empty());
}
@Override
protected void init() {
super.init();
this.titleX = (this.width - this.containerWidth) / 2;
this.playerInventoryTitleY = -1000;
}
private void drawSlots(MatrixStack matrices, int guiX, int guiY) {
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
RenderSystem.setShaderTexture(0, SLOT_TEXTURE);
private void drawSlots(DrawContext context, int guiX, int guiY) {
context.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
for (int y = 0; y < (ItemBackpack.SLOTSIZE / 9); y++) {
for (int x = 0; x < 9; x++) {
this.drawTexture(matrices, guiX + 7 + (x * 18), guiY + 17 + (y * 18), 0, 0, 18, 18);
context.drawTexture(SLOT_TEXTURE, guiX + 7 + (x * 18), guiY + 17 + (y * 18), 0, 0, 18, 18);
}
}
}
@Override
public void render(MatrixStack matrices, int mouseX, int mouseY, float partialTicks) {
this.renderBackground(matrices);
super.render(matrices, mouseX, mouseY, partialTicks);
this.drawMouseoverTooltip(matrices, mouseX, mouseY);
public void render(DrawContext drawContext, int mouseX, int mouseY, float partialTicks) {
this.renderInGameBackground(drawContext);
super.render(drawContext, mouseX, mouseY, partialTicks);
this.drawMouseoverTooltip(drawContext, mouseX, mouseY);
}
@Override
protected void drawBackground(MatrixStack matrices, float delta, int mouseX, int mouseY) {
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
RenderSystem.setShaderTexture(0, TEXTURE);
int guiX = this.titleX;
protected void drawBackground(DrawContext context, float delta, int mouseX, int mouseY) {
context.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
int guiX = (this.width - this.containerWidth) / 2;
int guiY = (this.height - this.containerHeight) / 2;
this.drawTexture(matrices, guiX, guiY, 0, 0, this.containerWidth, this.containerHeight);
drawSlots(matrices, guiX, guiY);
}
@Override
protected void drawForeground(MatrixStack matrixStack, int i, int j) {
this.textRenderer.draw(matrixStack, this.title, 8.0F, -20.0F, 0xffcccccc); // αrgb
context.drawTexture(TEXTURE, guiX, guiY, 0, 0, containerWidth, containerHeight);
drawSlots(context, guiX, guiY);
}
}

View File

@ -11,10 +11,7 @@ import net.minecraft.network.PacketByteBuf;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.screen.slot.Slot;
import net.minecraft.screen.slot.SlotActionType;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
public class BackpackScreenHandler extends ScreenHandler {
@ -60,29 +57,30 @@ public class BackpackScreenHandler extends ScreenHandler {
}
@Override
public void close(PlayerEntity player) {
public void onClosed(PlayerEntity player) {
this.backpackInventory.setHand(hand);
this.backpackInventory.onClose(player);
super.close(player);
super.onClosed(player);
}
@Override
public ItemStack quickMove(PlayerEntity player, int index) {
ItemStack itemStack = ItemStack.EMPTY;
Slot slot = (Slot) this.slots.get(index);
if (slot != null && slot.hasStack()) {
ItemStack itemStack2 = slot.getStack();
itemStack = itemStack2.copy();
if (index < 54 ? !this.insertItem(itemStack2, 54, this.slots.size(), true) : !this.insertItem(itemStack2, 0, 54, false)) {
return ItemStack.EMPTY;
}
if (itemStack2.isEmpty()) {
slot.setStack(ItemStack.EMPTY);
} else {
slot.markDirty();
}
}
return itemStack;
ItemStack itemStack = ItemStack.EMPTY;
Slot slot = (Slot) this.slots.get(index);
if (slot != null && slot.hasStack()) {
ItemStack itemStack2 = slot.getStack();
itemStack = itemStack2.copy();
if (index < 54 ? !this.insertItem(itemStack2, 54, this.slots.size(), true)
: !this.insertItem(itemStack2, 0, 54, false)) {
return ItemStack.EMPTY;
}
if (itemStack2.isEmpty()) {
slot.setStack(ItemStack.EMPTY);
} else {
slot.markDirty();
}
}
return itemStack;
}
@Override
@ -98,10 +96,6 @@ public class BackpackScreenHandler extends ScreenHandler {
} else {
super.onSlotClick(slotId, quickCraftData, actionType, playerEntity);
}
} else {
if (playerEntity.world.isClient) {
playerEntity.world.playSound(null, new BlockPos(playerEntity.getPos()), SoundEvents.ENTITY_VILLAGER_NO, SoundCategory.PLAYERS, 1f, 1f);
}
}
}

View File

@ -1,14 +1,11 @@
package de.jottyfan.minecraft.quickiefabric.container;
import com.mojang.blaze3d.systems.RenderSystem;
import de.jottyfan.minecraft.quickiefabric.init.RegistryManager;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.ingame.HandledScreen;
import net.minecraft.client.gui.screen.ingame.ScreenHandlerProvider;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
@ -22,6 +19,8 @@ import net.minecraft.util.Identifier;
public class BlockStackerScreen extends HandledScreen<BlockStackerScreenHandler>
implements ScreenHandlerProvider<BlockStackerScreenHandler> {
private final static Identifier TEXTURE = new Identifier(RegistryManager.QUICKIEFABRIC, "textures/gui/blockstacker.png");
private final Integer containerHeight = 222;
private final Integer containerWidth = 176;
public BlockStackerScreen(BlockStackerScreenHandler handler, PlayerInventory inventory, Text text) {
super(handler, inventory, text);
@ -30,22 +29,21 @@ public class BlockStackerScreen extends HandledScreen<BlockStackerScreenHandler>
@Override
protected void init() {
super.init();
this.titleX = (backgroundWidth - textRenderer.getWidth(title)) / 2;
}
@Override
public void render(MatrixStack matrices, int mouseX, int mouseY, float partialTicks) {
this.renderBackground(matrices);
super.render(matrices, mouseX, mouseY, partialTicks);
this.drawMouseoverTooltip(matrices, mouseX, mouseY);
public void render(DrawContext drawContext, int mouseX, int mouseY, float partialTicks) {
this.renderInGameBackground(drawContext);
super.render(drawContext, mouseX, mouseY, partialTicks);
this.drawMouseoverTooltip(drawContext, mouseX, mouseY);
}
@Override
protected void drawBackground(MatrixStack matrices, float delta, int mouseX, int mouseY) {
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
RenderSystem.setShaderTexture(0, TEXTURE);
int x = (width - backgroundWidth) / 2;
int y = (height - backgroundHeight) / 2;
drawTexture(matrices, x, y, 0, 0, backgroundWidth, backgroundHeight);
protected void drawBackground(DrawContext context, float delta, int mouseX, int mouseY) {
// context.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
int guiX = (this.width - this.containerWidth) / 2;
int guiY = (this.height - this.containerHeight) / 2;
super.renderInGameBackground(context);
context.drawTexture(TEXTURE, guiX, guiY, 0, 0, containerWidth, containerHeight);
}
}

View File

@ -42,6 +42,7 @@ import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.registry.tag.TagKey;
import net.minecraft.screen.ScreenHandlerType;
@ -66,69 +67,75 @@ public class RegistryManager {
public static final ScreenHandlerType<BlockStackerScreenHandler> BLOCKSTACKER_SCREEN_HANDLER = ScreenHandlerRegistry
.registerSimple(RegistryManager.STACKER_IDENTIFIER, BlockStackerScreenHandler::new);
public static final ItemGroup QUICKIEFABRIC_GROUP = FabricItemGroup.builder(new Identifier(QUICKIEFABRIC, "all"))
.displayName(Text.literal(QUICKIEFABRIC))
.icon(() -> new ItemStack(QuickieItems.SPEEDPOWDER))
.entries((enabledFeatures, stacks, operatorEnabled) -> {
stacks.add(new ItemStack(QuickieItems.SALPETER));
stacks.add(new ItemStack(QuickieItems.SULPHOR));
stacks.add(new ItemStack(QuickieItems.SPEEDPOWDER));
stacks.add(new ItemStack(QuickieItems.LEVELUP));
stacks.add(new ItemStack(QuickieItems.PENCIL));
stacks.add(new ItemStack(QuickieItems.ROTTEN_FLESH_STRIPES));
stacks.add(new ItemStack(QuickieItems.CARROTSTACK));
stacks.add(new ItemStack(QuickieItems.COTTON));
stacks.add(new ItemStack(QuickieItems.COTTONSEED));
stacks.add(new ItemStack(QuickieItems.BACKPACK_BROWN));
stacks.add(new ItemStack(QuickieItems.BACKPACK_WHITE));
stacks.add(new ItemStack(QuickieItems.BACKPACK_BLACK));
stacks.add(new ItemStack(QuickieItems.BACKPACK_BLUE));
stacks.add(new ItemStack(QuickieItems.BACKPACK_CYAN));
stacks.add(new ItemStack(QuickieItems.BACKPACK_GREEN));
stacks.add(new ItemStack(QuickieItems.BACKPACK_PINK));
stacks.add(new ItemStack(QuickieItems.BACKPACK_RED));
stacks.add(new ItemStack(QuickieItems.BACKPACK_YELLOW));
stacks.add(new ItemStack(QuickieItems.BACKPACK_DARKGRAY));
stacks.add(new ItemStack(QuickieItems.BACKPACK_LIGHTGRAY));
stacks.add(new ItemStack(QuickieItems.BACKPACK_LIGHTGREEN));
stacks.add(new ItemStack(QuickieItems.BACKPACK_MAGENTA));
stacks.add(new ItemStack(QuickieItems.BACKPACK_ORANGE));
stacks.add(new ItemStack(QuickieItems.BACKPACK_PURPLE));
stacks.add(new ItemStack(QuickieItems.BACKPACK_LIGHTBLUE));
stacks.add(new ItemStack(QuickieItems.BAG));
stacks.add(new ItemStack(QuickieItems.STUB));
stacks.add(new ItemStack(QuickieTools.SPEEDPOWDERAXE));
stacks.add(new ItemStack(QuickieTools.SPEEDPOWDERPICKAXE));
stacks.add(new ItemStack(QuickieTools.SPEEDPOWDERSHOVEL));
stacks.add(new ItemStack(QuickieTools.SPEEDPOWDERHOE));
stacks.add(new ItemStack(QuickieTools.SPEEDPOWDERWATERHOE));
stacks.add(new ItemStack(QuickieBlocks.DIRT_SALPETER));
stacks.add(new ItemStack(QuickieBlocks.ORE_NETHER_SULPHOR));
stacks.add(new ItemStack(QuickieBlocks.ORE_SALPETER));
stacks.add(new ItemStack(QuickieBlocks.ORE_SAND_SALPETER));
stacks.add(new ItemStack(QuickieBlocks.ORE_SULPHOR));
stacks.add(new ItemStack(QuickieBlocks.ORE_DEEPSLATESULPHOR));
stacks.add(new ItemStack(QuickieBlocks.SAND_SALPETER));
stacks.add(new ItemStack(QuickieBlocks.LAVAHOARDER));
stacks.add(new ItemStack(QuickieBlocks.EMPTYLAVAHOARDER));
stacks.add(new ItemStack(QuickieBlocks.ITEMHOARDER));
stacks.add(new ItemStack(QuickieBlocks.MONSTERHOARDER));
stacks.add(new ItemStack(QuickieBlocks.KELPSTACK));
stacks.add(new ItemStack(QuickieBlocks.BLOCKSULPHOR));
stacks.add(new ItemStack(QuickieBlocks.DRILL_DOWN));
stacks.add(new ItemStack(QuickieBlocks.DRILL_EAST));
stacks.add(new ItemStack(QuickieBlocks.DRILL_SOUTH));
stacks.add(new ItemStack(QuickieBlocks.DRILL_WEST));
stacks.add(new ItemStack(QuickieBlocks.DRILL_NORTH));
stacks.add(new ItemStack(QuickieBlocks.DRILLSTOP));
stacks.add(new ItemStack(QuickieBlocks.BLOCKSTACKERUP));
stacks.add(new ItemStack(QuickieBlocks.BLOCKSTACKERDOWN));
stacks.add(new ItemStack(QuickieBlocks.BLOCKSTACKEREAST));
stacks.add(new ItemStack(QuickieBlocks.BLOCKSTACKERWEST));
stacks.add(new ItemStack(QuickieBlocks.BLOCKSTACKERNORTH));
stacks.add(new ItemStack(QuickieBlocks.BLOCKSTACKERSOUTH));
stacks.add(new ItemStack(QuickieBlocks.BLOCKSPREADER));
}).build();
public static final RegistryKey<ItemGroup> QUICKIEFABRIC_GROUP = RegistryKey.of(RegistryKeys.ITEM_GROUP,
new Identifier(QUICKIEFABRIC, "itemgroups"));
public static final void registerItemGroup() {
Registry.register(Registries.ITEM_GROUP, QUICKIEFABRIC_GROUP,
FabricItemGroup.builder().icon(() -> new ItemStack(QuickieItems.SPEEDPOWDER))
.displayName(Text.literal(QUICKIEFABRIC)).entries((enabledFeatures, stacks) -> {
stacks.add(new ItemStack(QuickieItems.SALPETER));
stacks.add(new ItemStack(QuickieItems.SULPHOR));
stacks.add(new ItemStack(QuickieItems.SPEEDPOWDER));
stacks.add(new ItemStack(QuickieItems.LEVELUP));
stacks.add(new ItemStack(QuickieItems.PENCIL));
stacks.add(new ItemStack(QuickieItems.ROTTEN_FLESH_STRIPES));
stacks.add(new ItemStack(QuickieItems.CARROTSTACK));
stacks.add(new ItemStack(QuickieItems.COTTON));
stacks.add(new ItemStack(QuickieItems.COTTONSEED));
stacks.add(new ItemStack(QuickieItems.BACKPACK_BROWN));
stacks.add(new ItemStack(QuickieItems.BACKPACK_WHITE));
stacks.add(new ItemStack(QuickieItems.BACKPACK_BLACK));
stacks.add(new ItemStack(QuickieItems.BACKPACK_BLUE));
stacks.add(new ItemStack(QuickieItems.BACKPACK_CYAN));
stacks.add(new ItemStack(QuickieItems.BACKPACK_GREEN));
stacks.add(new ItemStack(QuickieItems.BACKPACK_PINK));
stacks.add(new ItemStack(QuickieItems.BACKPACK_RED));
stacks.add(new ItemStack(QuickieItems.BACKPACK_YELLOW));
stacks.add(new ItemStack(QuickieItems.BACKPACK_DARKGRAY));
stacks.add(new ItemStack(QuickieItems.BACKPACK_LIGHTGRAY));
stacks.add(new ItemStack(QuickieItems.BACKPACK_LIGHTGREEN));
stacks.add(new ItemStack(QuickieItems.BACKPACK_MAGENTA));
stacks.add(new ItemStack(QuickieItems.BACKPACK_ORANGE));
stacks.add(new ItemStack(QuickieItems.BACKPACK_PURPLE));
stacks.add(new ItemStack(QuickieItems.BACKPACK_LIGHTBLUE));
stacks.add(new ItemStack(QuickieItems.BAG));
stacks.add(new ItemStack(QuickieItems.STUB));
stacks.add(new ItemStack(QuickieTools.SPEEDPOWDERAXE));
stacks.add(new ItemStack(QuickieTools.SPEEDPOWDERPICKAXE));
stacks.add(new ItemStack(QuickieTools.SPEEDPOWDERSHOVEL));
stacks.add(new ItemStack(QuickieTools.SPEEDPOWDERHOE));
stacks.add(new ItemStack(QuickieTools.SPEEDPOWDERWATERHOE));
stacks.add(new ItemStack(QuickieBlocks.DIRT_SALPETER));
stacks.add(new ItemStack(QuickieBlocks.ORE_NETHER_SULPHOR));
stacks.add(new ItemStack(QuickieBlocks.ORE_SALPETER));
stacks.add(new ItemStack(QuickieBlocks.ORE_SAND_SALPETER));
stacks.add(new ItemStack(QuickieBlocks.ORE_SULPHOR));
stacks.add(new ItemStack(QuickieBlocks.ORE_DEEPSLATESULPHOR));
stacks.add(new ItemStack(QuickieBlocks.SAND_SALPETER));
stacks.add(new ItemStack(QuickieBlocks.LAVAHOARDER));
stacks.add(new ItemStack(QuickieBlocks.EMPTYLAVAHOARDER));
stacks.add(new ItemStack(QuickieBlocks.ITEMHOARDER));
stacks.add(new ItemStack(QuickieBlocks.MONSTERHOARDER));
stacks.add(new ItemStack(QuickieBlocks.KELPSTACK));
stacks.add(new ItemStack(QuickieBlocks.BLOCKSULPHOR));
stacks.add(new ItemStack(QuickieBlocks.BLOCKSALPETER));
stacks.add(new ItemStack(QuickieBlocks.BLOCKSPEEDPOWDER));
stacks.add(new ItemStack(QuickieBlocks.DRILL_DOWN));
stacks.add(new ItemStack(QuickieBlocks.DRILL_EAST));
stacks.add(new ItemStack(QuickieBlocks.DRILL_SOUTH));
stacks.add(new ItemStack(QuickieBlocks.DRILL_WEST));
stacks.add(new ItemStack(QuickieBlocks.DRILL_NORTH));
stacks.add(new ItemStack(QuickieBlocks.DRILLSTOP));
stacks.add(new ItemStack(QuickieBlocks.BLOCKSTACKERUP));
stacks.add(new ItemStack(QuickieBlocks.BLOCKSTACKERDOWN));
stacks.add(new ItemStack(QuickieBlocks.BLOCKSTACKEREAST));
stacks.add(new ItemStack(QuickieBlocks.BLOCKSTACKERWEST));
stacks.add(new ItemStack(QuickieBlocks.BLOCKSTACKERNORTH));
stacks.add(new ItemStack(QuickieBlocks.BLOCKSTACKERSOUTH));
stacks.add(new ItemStack(QuickieBlocks.BLOCKSPREADER));
}).build());
}
private static final void registerBlock(Block block, String name) {
Registry.register(Registries.BLOCK, new Identifier(QUICKIEFABRIC, name), block);
@ -192,6 +199,8 @@ public class RegistryManager {
registerBlock(QuickieBlocks.KELPSTACK, "kelpstack");
registerBlock(QuickieBlocks.COTTONPLANT, "cottonplant");
registerBlock(QuickieBlocks.BLOCKSULPHOR, "blocksulphor");
registerBlock(QuickieBlocks.BLOCKSALPETER, "blocksalpeter");
registerBlock(QuickieBlocks.BLOCKSPEEDPOWDER, "blockspeedpowder");
registerBlock(QuickieBlocks.DRILL_DOWN, "drill");
registerBlock(QuickieBlocks.DRILL_EAST, "drilleast");
registerBlock(QuickieBlocks.DRILL_SOUTH, "drillsouth");
@ -274,8 +283,8 @@ public class RegistryManager {
BiomeSelectors.foundInOverworld(), FeaturesManager.overworldOres());
// Nether features
BiomeModifications.create(new Identifier(QUICKIEFABRIC, "nether_features"))
.add(ModificationPhase.ADDITIONS, BiomeSelectors.foundInTheNether(), FeaturesManager.netherOres());
BiomeModifications.create(new Identifier(QUICKIEFABRIC, "nether_features")).add(ModificationPhase.ADDITIONS,
BiomeSelectors.foundInTheNether(), FeaturesManager.netherOres());
}
public static final void registerLootings() {

View File

@ -3,7 +3,7 @@ package de.jottyfan.minecraft.quickiefabric.mixin;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import de.jottyfan.minecraft.quickiefabric.event.BreakBlockCallback;
import net.minecraft.block.Block;
@ -21,8 +21,8 @@ import net.minecraft.world.World;
@Mixin(Block.class)
public class BlockBreakMixin {
@Inject(at = @At("HEAD"), method = "onBreak(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/entity/player/PlayerEntity;)V")
private void onBreak(final World world, final BlockPos blockPos, final BlockState blockState, final PlayerEntity playerEntity, final CallbackInfo info) {
@Inject(at = @At("HEAD"), method = "onBreak(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/block/BlockState;")
private void onBreak(final World world, final BlockPos blockPos, final BlockState blockState, final PlayerEntity playerEntity, final CallbackInfoReturnable<BlockBreakMixin> info) {
ActionResult result = BreakBlockCallback.EVENT.invoker().injectBlockBreakCallback(world, blockPos, blockState, playerEntity);
if (result == ActionResult.FAIL) {
info.cancel();

View File

@ -50,7 +50,7 @@ public class ToolRangeableAxe extends AxeItem implements ToolRangeable {
@Override
public boolean canBreakNeighbors(BlockState blockIn) {
return super.isSuitableFor(blockIn) || isLeavesBlock(blockIn);
return super.isSuitableFor(blockIn) || isLeavesBlock(blockIn) || blockIn.isIn(BlockTags.LOGS);
}
@Override

View File

@ -79,7 +79,7 @@ public class ToolSpeedpowderHoe extends HoeItem implements ToolRangeable {
@Override
public boolean canBreakNeighbors(BlockState blockState) {
return super.isSuitableFor(blockState)
|| Blocks.GRASS.equals(blockState.getBlock())
|| Blocks.TALL_GRASS.equals(blockState.getBlock())
|| Blocks.FERN.equals(blockState.getBlock())
|| Blocks.LARGE_FERN.equals(blockState.getBlock());
}

View File

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "quickiefabric:block/blocksalpeter"
}
}
}

View File

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "quickiefabric:block/blockspeedpowder"
}
}
}

View File

@ -57,18 +57,20 @@
"block.quickiefabric.kelpstack": "Seegrassbündel",
"block.quickiefabric.cottonplant": "Baumwollpflanze",
"block.quickiefabric.blocksulphor": "Schwefelblock",
"block.quickiefabric.blocksalpeter": "Salpeterblock",
"block.quickiefabric.blockspeedpowder": "Fluchtpulverblock",
"block.quickiefabric.drill": "Bohrer",
"block.quickiefabric.drilleast": "Ost-Bohrer",
"block.quickiefabric.drillsouth": "Süd-Bohrer",
"block.quickiefabric.drillwest": "West-Bohrer",
"block.quickiefabric.drillnorth": "Nord-Bohrer",
"block.quickiefabric.drillstop": "Bohrerstopper",
"block.quickiefabric.blockstackerup": "Blockhochstapler",
"block.quickiefabric.blockstackerdown": "Blocktiefstapler",
"block.quickiefabric.blockstackereast": "Ostblockstapler",
"block.quickiefabric.blockstackerwest": "Westblockstapler",
"block.quickiefabric.blockstackernorth": "Nordblockstapler",
"block.quickiefabric.blockstackersouth": "Südblockstapler",
"block.quickiefabric.blockstackerup": "Hochstapler",
"block.quickiefabric.blockstackerdown": "Tiefstapler",
"block.quickiefabric.blockstackereast": "Oststapler",
"block.quickiefabric.blockstackerwest": "Weststapler",
"block.quickiefabric.blockstackernorth": "Nordstapler",
"block.quickiefabric.blockstackersouth": "Südstapler",
"block.quickiefabric.blockspreader": "Blockverteiler",
"container.quickiefabric.backpack": "Rucksack",
"container.quickiefabric.blockstacker": "Blockstapler",

View File

@ -57,18 +57,20 @@
"block.quickiefabric.kelpstack": "kelp bundle",
"block.quickiefabric.cottonplant": "cotton plant",
"block.quickiefabric.blocksulphor": "block of sulfur",
"block.quickiefabric.blocksalpeter": "block of salpeter",
"block.quickiefabric.blockspeedpowder": "block of speedpowder",
"block.quickiefabric.drill": "drill",
"block.quickiefabric.drilleast": "east drill",
"block.quickiefabric.drillsouth": "south drill",
"block.quickiefabric.drillwest": "west drill",
"block.quickiefabric.drillnorth": "north drill",
"block.quickiefabric.drillstop": "drill stopper",
"block.quickiefabric.blockstackerup": "block up stacker",
"block.quickiefabric.blockstackerdown": "block down stacker",
"block.quickiefabric.blockstackereast": "block east stacker",
"block.quickiefabric.blockstackerwest": "block west stacker",
"block.quickiefabric.blockstackernorth": "block north stacker",
"block.quickiefabric.blockstackersouth": "block south stacker",
"block.quickiefabric.blockstackerup": "up stacker",
"block.quickiefabric.blockstackerdown": "down stacker",
"block.quickiefabric.blockstackereast": "east stacker",
"block.quickiefabric.blockstackerwest": "west stacker",
"block.quickiefabric.blockstackernorth": "north stacker",
"block.quickiefabric.blockstackersouth": "south stacker",
"block.quickiefabric.blockspreader": "block spreader",
"container.quickiefabric.backpack": "backpack",
"container.quickiefabric.blockstacker": "block stacker",

View File

@ -0,0 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "quickiefabric:block/blocksalpeter"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "quickiefabric:block/blockspeedpowder"
}
}

View File

@ -0,0 +1,10 @@
{
"parent": "quickiefabric:block/blocksalpeter",
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],
"translation": [ 0, 1.5, -2.75 ],
"scale": [ 0.375, 0.375, 0.375 ]
}
}
}

View File

@ -0,0 +1,10 @@
{
"parent": "quickiefabric:block/blockspeedpowder",
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],
"translation": [ 0, 1.5, -2.75 ],
"scale": [ 0.375, 0.375, 0.375 ]
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

@ -0,0 +1,17 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"sss",
"sss",
"sss"
],
"key": {
"s": {
"item": "quickiefabric:salpeter"
}
},
"result": {
"item": "quickiefabric:blocksalpeter",
"count": 1
}
}

View File

@ -0,0 +1,16 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "quickiefabric:blocksalpeter"
},{
"item": "quickiefabric:blocksulphor"
},{
"item": "minecraft:coal_block"
}
],
"result": {
"item": "quickiefabric:blockspeedpowder",
"count": 1
}
}

View File

@ -0,0 +1,17 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"sss",
"sss",
"sss"
],
"key": {
"s": {
"item": "quickiefabric:speedpowder"
}
},
"result": {
"item": "quickiefabric:blockspeedpowder",
"count": 1
}
}

View File

@ -0,0 +1,15 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "minecraft:item_frame"
},
{
"item": "minecraft:glowstone_dust"
}
],
"result": {
"item": "minecraft:glow_item_frame",
"count": 2
}
}

View File

@ -1,12 +1,15 @@
{
"type": "minecraft:smithing",
"base": {
"item": "minecraft:bucket"
},
"addition": {
"item": "minecraft:magma_block"
},
"result": {
"item": "minecraft:lava_bucket"
}
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "minecraft:bucket"
},
{
"item": "minecraft:magma_block"
}
],
"result": {
"item": "minecraft:lava_bucket",
"count": 1
}
}

View File

@ -0,0 +1,12 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "quickiefabric:blocksalpeter"
}
],
"result": {
"item": "quickiefabric:salpeter",
"count": 9
}
}

View File

@ -0,0 +1,12 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "quickiefabric:blockspeedpowder"
}
],
"result": {
"item": "quickiefabric:speedpowder",
"count": 9
}
}

View File

@ -4,6 +4,6 @@
"item": "quickiefabric:stub"
},
"result": "minecraft:torch",
"experience": 0,
"cookingtime": 50
"experience": 0.1,
"cookingtime": 20
}

View File

@ -26,9 +26,9 @@
"quickiefabric.mixins.json"
],
"depends": {
"fabricloader": ">=0.14.14",
"fabricloader": ">=0.14.24",
"fabric": "*",
"minecraft": "23w06a",
"minecraft": "1.20.3-pre2+build.2",
"java": ">=17"
},
"suggests": {