block stacker for all 6 directions
@ -9,7 +9,7 @@
|
||||
loader_version=0.14.8
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.19.0.2
|
||||
mod_version = 1.19.0.3
|
||||
maven_group = de.jottyfan.minecraft
|
||||
archives_base_name = quickiefabric
|
||||
|
||||
|
@ -5,9 +5,6 @@ import org.apache.logging.log4j.Logger;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.block.entity.LootableContainerBlockEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@ -24,72 +21,6 @@ public class BlockSpreaderEntity extends BlockEntity {
|
||||
}
|
||||
|
||||
public static void tick(World world, BlockPos pos, BlockState state, BlockSpreaderEntity entity) {
|
||||
if (!world.isClient) {
|
||||
// TODO: source is a chest type below
|
||||
BlockEntity source = world.getBlockEntity(pos.down());
|
||||
// dest is the block that fits to the filter of the gui (north, south, west, east only)
|
||||
BlockEntity dest = world.getBlockEntity(pos.north());
|
||||
Boolean sourceIsLootable = source instanceof LootableContainerBlockEntity;
|
||||
Boolean destIsLootable = dest instanceof LootableContainerBlockEntity;
|
||||
if (sourceIsLootable && destIsLootable) {
|
||||
LootableContainerBlockEntity lootableSource = (LootableContainerBlockEntity) source;
|
||||
LootableContainerBlockEntity lootableDest = (LootableContainerBlockEntity) dest;
|
||||
transferOneStack(lootableSource, lootableDest);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static final void transferOneStack(LootableContainerBlockEntity source, LootableContainerBlockEntity dest) {
|
||||
Integer sourceSlot = findItemStackPos(source, false);
|
||||
if (sourceSlot != null && !Items.AIR.equals(source.getStack(sourceSlot).getItem())) {
|
||||
ItemStack sourceStack = source.getStack(sourceSlot);
|
||||
Integer destSlot = findItemStackPos(dest, sourceStack);
|
||||
if (destSlot != null) {
|
||||
Integer occupied = dest.getStack(destSlot).getCount();
|
||||
Integer free = dest.getStack(destSlot).getMaxCount() - occupied;
|
||||
Integer candidates = source.getStack(sourceSlot).getCount();
|
||||
Integer travellers = candidates > free ? free : candidates;
|
||||
if (travellers > 0) {
|
||||
LOGGER.debug("transfer {}/{} of {} from slot {} to slot {} on top of {} ones", travellers, candidates, source.getStack(sourceSlot).getItem().toString(), sourceSlot, destSlot, occupied);
|
||||
source.getStack(sourceSlot).decrement(travellers);
|
||||
if (source.getStack(sourceSlot).getCount() < 1) {
|
||||
source.removeStack(sourceSlot); // make empty slots really empty
|
||||
}
|
||||
dest.getStack(destSlot).increment(travellers);
|
||||
}
|
||||
} else {
|
||||
Integer destFreeSlot = findItemStackPos(dest, true);
|
||||
if (destFreeSlot != null) {
|
||||
LOGGER.debug("transfer all of {} from slot {} to slot {}", source.getStack(sourceSlot).getItem().toString(), sourceSlot, destSlot);
|
||||
dest.setStack(destFreeSlot, source.removeStack(sourceSlot));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static final Integer findItemStackPos(LootableContainerBlockEntity lcbe, ItemStack sourceStack) {
|
||||
Integer counter = lcbe.size();
|
||||
while (counter > 0) {
|
||||
counter--;
|
||||
ItemStack stack = lcbe.getStack(counter);
|
||||
if (stack.getItem().equals(sourceStack.getItem())) {
|
||||
if (stack.getCount() < stack.getMaxCount()) {
|
||||
return counter;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static final Integer findItemStackPos(LootableContainerBlockEntity lcbe, Boolean empty) {
|
||||
Integer counter = lcbe.size();
|
||||
while (counter > 0) {
|
||||
counter--;
|
||||
ItemStack stack = lcbe.getStack(counter);
|
||||
if (empty.equals(ItemStack.EMPTY.equals(stack))) {
|
||||
return counter;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
LOGGER.debug("not yet implemented");
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package de.jottyfan.minecraft.quickiefabric.blockentity;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.blocks.help.BlockStacker;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.block.entity.LootableContainerBlockEntity;
|
||||
@ -25,8 +26,10 @@ public class BlockStackerEntity extends BlockEntity {
|
||||
|
||||
public static void tick(World world, BlockPos pos, BlockState state, BlockStackerEntity entity) {
|
||||
if (!world.isClient) {
|
||||
BlockEntity source = world.getBlockEntity(pos.down());
|
||||
BlockEntity dest = world.getBlockEntity(pos.up());
|
||||
pos.down();
|
||||
BlockStacker block = (BlockStacker) state.getBlock();
|
||||
BlockEntity source = world.getBlockEntity(pos.offset(block.getSourceOffset()));
|
||||
BlockEntity dest = world.getBlockEntity(pos.offset(block.getDestOffset()));
|
||||
Boolean sourceIsLootable = source instanceof LootableContainerBlockEntity;
|
||||
Boolean destIsLootable = dest instanceof LootableContainerBlockEntity;
|
||||
if (sourceIsLootable && destIsLootable) {
|
||||
|
@ -0,0 +1,67 @@
|
||||
package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.BlockStackerEntity;
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.QuickieFabricBlockEntity;
|
||||
import de.jottyfan.minecraft.quickiefabric.blocks.help.BlockStacker;
|
||||
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.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jotty
|
||||
*
|
||||
*/
|
||||
public class BlockStackerDown extends BlockWithEntity implements BlockStacker {
|
||||
|
||||
public BlockStackerDown() {
|
||||
super(FabricBlockSettings.of(Material.STONE).hardness(2.5f));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Direction getSourceOffset() {
|
||||
return Direction.UP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Direction getDestOffset() {
|
||||
return Direction.DOWN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockPos pos, BlockState state) {
|
||||
return new BlockStackerEntity(pos, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockRenderType getRenderType(BlockState state) {
|
||||
return BlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDroppedStacks(BlockState state, Builder builder) {
|
||||
List<ItemStack> list = new ArrayList<>();
|
||||
list.add(new ItemStack(QuickieBlocks.BLOCKSTACKERDOWN.asItem()));
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state,
|
||||
BlockEntityType<T> type) {
|
||||
return checkType(type, QuickieFabricBlockEntity.BLOCKSTACKER_ENTITY,
|
||||
(world1, pos, state1, be) -> BlockStackerEntity.tick(world1, pos, state1, be));
|
||||
}
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.BlockStackerEntity;
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.QuickieFabricBlockEntity;
|
||||
import de.jottyfan.minecraft.quickiefabric.blocks.help.BlockStacker;
|
||||
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.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jotty
|
||||
*
|
||||
*/
|
||||
public class BlockStackerEast extends BlockWithEntity implements BlockStacker {
|
||||
|
||||
public BlockStackerEast() {
|
||||
super(FabricBlockSettings.of(Material.STONE).hardness(2.5f));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Direction getSourceOffset() {
|
||||
return Direction.WEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Direction getDestOffset() {
|
||||
return Direction.EAST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockPos pos, BlockState state) {
|
||||
return new BlockStackerEntity(pos, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockRenderType getRenderType(BlockState state) {
|
||||
return BlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDroppedStacks(BlockState state, Builder builder) {
|
||||
List<ItemStack> list = new ArrayList<>();
|
||||
list.add(new ItemStack(QuickieBlocks.BLOCKSTACKEREAST.asItem()));
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state,
|
||||
BlockEntityType<T> type) {
|
||||
return checkType(type, QuickieFabricBlockEntity.BLOCKSTACKER_ENTITY,
|
||||
(world1, pos, state1, be) -> BlockStackerEntity.tick(world1, pos, state1, be));
|
||||
}
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.BlockStackerEntity;
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.QuickieFabricBlockEntity;
|
||||
import de.jottyfan.minecraft.quickiefabric.blocks.help.BlockStacker;
|
||||
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.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jotty
|
||||
*
|
||||
*/
|
||||
public class BlockStackerNorth extends BlockWithEntity implements BlockStacker {
|
||||
|
||||
public BlockStackerNorth() {
|
||||
super(FabricBlockSettings.of(Material.STONE).hardness(2.5f));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Direction getSourceOffset() {
|
||||
return Direction.SOUTH;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Direction getDestOffset() {
|
||||
return Direction.NORTH;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockPos pos, BlockState state) {
|
||||
return new BlockStackerEntity(pos, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockRenderType getRenderType(BlockState state) {
|
||||
return BlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDroppedStacks(BlockState state, Builder builder) {
|
||||
List<ItemStack> list = new ArrayList<>();
|
||||
list.add(new ItemStack(QuickieBlocks.BLOCKSTACKERNORTH.asItem()));
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state,
|
||||
BlockEntityType<T> type) {
|
||||
return checkType(type, QuickieFabricBlockEntity.BLOCKSTACKER_ENTITY,
|
||||
(world1, pos, state1, be) -> BlockStackerEntity.tick(world1, pos, state1, be));
|
||||
}
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.BlockStackerEntity;
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.QuickieFabricBlockEntity;
|
||||
import de.jottyfan.minecraft.quickiefabric.blocks.help.BlockStacker;
|
||||
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.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jotty
|
||||
*
|
||||
*/
|
||||
public class BlockStackerSouth extends BlockWithEntity implements BlockStacker {
|
||||
|
||||
public BlockStackerSouth() {
|
||||
super(FabricBlockSettings.of(Material.STONE).hardness(2.5f));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Direction getSourceOffset() {
|
||||
return Direction.NORTH;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Direction getDestOffset() {
|
||||
return Direction.SOUTH;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockPos pos, BlockState state) {
|
||||
return new BlockStackerEntity(pos, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockRenderType getRenderType(BlockState state) {
|
||||
return BlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDroppedStacks(BlockState state, Builder builder) {
|
||||
List<ItemStack> list = new ArrayList<>();
|
||||
list.add(new ItemStack(QuickieBlocks.BLOCKSTACKERSOUTH.asItem()));
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state,
|
||||
BlockEntityType<T> type) {
|
||||
return checkType(type, QuickieFabricBlockEntity.BLOCKSTACKER_ENTITY,
|
||||
(world1, pos, state1, be) -> BlockStackerEntity.tick(world1, pos, state1, be));
|
||||
}
|
||||
}
|
@ -1,7 +1,11 @@
|
||||
package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.BlockStackerEntity;
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.QuickieFabricBlockEntity;
|
||||
import de.jottyfan.minecraft.quickiefabric.blocks.help.BlockStacker;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
@ -10,7 +14,10 @@ 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.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
@ -18,12 +25,22 @@ import net.minecraft.world.World;
|
||||
* @author jotty
|
||||
*
|
||||
*/
|
||||
public class BlockStacker extends BlockWithEntity {
|
||||
public class BlockStackerUp extends BlockWithEntity implements BlockStacker {
|
||||
|
||||
public BlockStacker() {
|
||||
public BlockStackerUp() {
|
||||
super(FabricBlockSettings.of(Material.STONE).hardness(2.5f));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Direction getSourceOffset() {
|
||||
return Direction.DOWN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Direction getDestOffset() {
|
||||
return Direction.UP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockPos pos, BlockState state) {
|
||||
return new BlockStackerEntity(pos, state);
|
||||
@ -34,6 +51,13 @@ public class BlockStacker extends BlockWithEntity {
|
||||
return BlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDroppedStacks(BlockState state, Builder builder) {
|
||||
List<ItemStack> list = new ArrayList<>();
|
||||
list.add(new ItemStack(QuickieBlocks.BLOCKSTACKERUP.asItem()));
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state,
|
||||
BlockEntityType<T> type) {
|
@ -0,0 +1,67 @@
|
||||
package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.BlockStackerEntity;
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.QuickieFabricBlockEntity;
|
||||
import de.jottyfan.minecraft.quickiefabric.blocks.help.BlockStacker;
|
||||
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.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jotty
|
||||
*
|
||||
*/
|
||||
public class BlockStackerWest extends BlockWithEntity implements BlockStacker {
|
||||
|
||||
public BlockStackerWest() {
|
||||
super(FabricBlockSettings.of(Material.STONE).hardness(2.5f));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Direction getSourceOffset() {
|
||||
return Direction.EAST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Direction getDestOffset() {
|
||||
return Direction.WEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockPos pos, BlockState state) {
|
||||
return new BlockStackerEntity(pos, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockRenderType getRenderType(BlockState state) {
|
||||
return BlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDroppedStacks(BlockState state, Builder builder) {
|
||||
List<ItemStack> list = new ArrayList<>();
|
||||
list.add(new ItemStack(QuickieBlocks.BLOCKSTACKERWEST.asItem()));
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state,
|
||||
BlockEntityType<T> type) {
|
||||
return checkType(type, QuickieFabricBlockEntity.BLOCKSTACKER_ENTITY,
|
||||
(world1, pos, state1, be) -> BlockStackerEntity.tick(world1, pos, state1, be));
|
||||
}
|
||||
}
|
@ -25,6 +25,11 @@ public class QuickieBlocks {
|
||||
public static final BlockDrillWest DRILL_WEST = new BlockDrillWest();
|
||||
public static final BlockDrillNorth DRILL_NORTH = new BlockDrillNorth();
|
||||
public static final BlockDrillstop DRILLSTOP = new BlockDrillstop();
|
||||
public static final BlockStacker BLOCKSTACKER = new BlockStacker();
|
||||
public static final BlockStackerUp BLOCKSTACKERUP = new BlockStackerUp();
|
||||
public static final BlockStackerDown BLOCKSTACKERDOWN = new BlockStackerDown();
|
||||
public static final BlockStackerEast BLOCKSTACKEREAST = new BlockStackerEast();
|
||||
public static final BlockStackerWest BLOCKSTACKERWEST = new BlockStackerWest();
|
||||
public static final BlockStackerNorth BLOCKSTACKERNORTH = new BlockStackerNorth();
|
||||
public static final BlockStackerSouth BLOCKSTACKERSOUTH = new BlockStackerSouth();
|
||||
public static final BlockSpreader BLOCKSPREADER = new BlockSpreader();
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
package de.jottyfan.minecraft.quickiefabric.blocks.help;
|
||||
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jotty
|
||||
*
|
||||
*/
|
||||
public interface BlockStacker {
|
||||
/**
|
||||
* define the source offset
|
||||
*
|
||||
* @return the direction of the source offset (1 block beside)
|
||||
*/
|
||||
public Direction getSourceOffset();
|
||||
|
||||
/**
|
||||
* define the dest offset
|
||||
*
|
||||
* @return the direction of the dest offset (1 block beside)
|
||||
*/
|
||||
public Direction getDestOffset();
|
||||
}
|
@ -165,7 +165,12 @@ public class RegistryManager {
|
||||
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.BLOCKSTACKER));
|
||||
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();
|
||||
|
||||
@ -208,7 +213,9 @@ public class RegistryManager {
|
||||
QuickieFabricBlockEntity.DRILL_NORTH = (BlockEntityType<DrillBlockNorthEntity>) registerBlockEntity(
|
||||
"drillblocknorthentity", DrillBlockNorthEntity::new, QuickieBlocks.DRILL_NORTH);
|
||||
QuickieFabricBlockEntity.BLOCKSTACKER_ENTITY = (BlockEntityType<BlockStackerEntity>) registerBlockEntity(
|
||||
"blockstackerentity", BlockStackerEntity::new, QuickieBlocks.BLOCKSTACKER);
|
||||
"blockstackerentity", BlockStackerEntity::new, QuickieBlocks.BLOCKSTACKERUP, QuickieBlocks.BLOCKSTACKERDOWN,
|
||||
QuickieBlocks.BLOCKSTACKEREAST, QuickieBlocks.BLOCKSTACKERWEST, QuickieBlocks.BLOCKSTACKERNORTH,
|
||||
QuickieBlocks.BLOCKSTACKERSOUTH);
|
||||
QuickieFabricBlockEntity.BLOCKSPREADER_ENTITY = (BlockEntityType<BlockSpreaderEntity>) registerBlockEntity(
|
||||
"blockspreaderentity", BlockSpreaderEntity::new, QuickieBlocks.BLOCKSPREADER);
|
||||
}
|
||||
@ -234,7 +241,12 @@ public class RegistryManager {
|
||||
registerBlock(QuickieBlocks.DRILL_WEST, "drillwest");
|
||||
registerBlock(QuickieBlocks.DRILL_NORTH, "drillnorth");
|
||||
registerBlock(QuickieBlocks.DRILLSTOP, "drillstop");
|
||||
registerBlock(QuickieBlocks.BLOCKSTACKER, "blockstacker");
|
||||
registerBlock(QuickieBlocks.BLOCKSTACKERUP, "blockstackerup");
|
||||
registerBlock(QuickieBlocks.BLOCKSTACKERDOWN, "blockstackerdown");
|
||||
registerBlock(QuickieBlocks.BLOCKSTACKEREAST, "blockstackereast");
|
||||
registerBlock(QuickieBlocks.BLOCKSTACKERWEST, "blockstackerwest");
|
||||
registerBlock(QuickieBlocks.BLOCKSTACKERNORTH, "blockstackernorth");
|
||||
registerBlock(QuickieBlocks.BLOCKSTACKERSOUTH, "blockstackersouth");
|
||||
registerBlock(QuickieBlocks.BLOCKSPREADER, "blockspreader");
|
||||
}
|
||||
|
||||
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "quickiefabric:block/blockstacker"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "quickiefabric:block/blockstackerdown"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "quickiefabric:block/blockstackereast"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "quickiefabric:block/blockstackernorth"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "quickiefabric:block/blockstackersouth"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "quickiefabric:block/blockstackerup"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "quickiefabric:block/blockstackerwest"
|
||||
}
|
||||
}
|
||||
}
|
@ -62,7 +62,12 @@
|
||||
"block.quickiefabric.drillwest": "West-Bohrer",
|
||||
"block.quickiefabric.drillnorth": "Nord-Bohrer",
|
||||
"block.quickiefabric.drillstop": "Bohrerstopper",
|
||||
"block.quickiefabric.blockstacker": "Blockstapler",
|
||||
"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.blockspreader": "Blockverteiler",
|
||||
"container.quickiefabric.backpack": "Rucksack",
|
||||
"container.quickiefabric.blockstacker": "Blockstapler",
|
||||
|
@ -62,7 +62,12 @@
|
||||
"block.quickiefabric.drillwest": "west drill",
|
||||
"block.quickiefabric.drillnorth": "north drill",
|
||||
"block.quickiefabric.drillstop": "drill stopper",
|
||||
"block.quickiefabric.blockstacker": "block stacker",
|
||||
"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.blockspreader": "block spreader",
|
||||
"container.quickiefabric.backpack": "backpack",
|
||||
"container.quickiefabric.blockstacker": "block stacker",
|
||||
|
@ -1,8 +0,0 @@
|
||||
{
|
||||
"parent": "block/cube_bottom_top",
|
||||
"textures": {
|
||||
"bottom": "quickiefabric:block/blockstackerbottom",
|
||||
"side": "quickiefabric:block/blockstacker",
|
||||
"top": "quickiefabric:block/blockstackertop"
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"parent": "block/cube_bottom_top",
|
||||
"textures": {
|
||||
"bottom": "quickiefabric:block/blockstackerout",
|
||||
"side": "quickiefabric:block/blockstackerdown",
|
||||
"top": "quickiefabric:block/blockstackerin"
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
{
|
||||
"parent": "block/cube_directional",
|
||||
"textures": {
|
||||
"up": "quickiefabric:block/blockstackerright",
|
||||
"down": "quickiefabric:block/blockstackerleft",
|
||||
"north": "quickiefabric:block/blockstackerleft",
|
||||
"east": "quickiefabric:block/blockstackerout",
|
||||
"south": "quickiefabric:block/blockstackerright",
|
||||
"west": "quickiefabric:block/blockstackerin"
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
{
|
||||
"parent": "block/cube_directional",
|
||||
"textures": {
|
||||
"up": "quickiefabric:block/blockstackerup",
|
||||
"down": "quickiefabric:block/blockstackerup",
|
||||
"north": "quickiefabric:block/blockstackerout",
|
||||
"east": "quickiefabric:block/blockstackerup",
|
||||
"south": "quickiefabric:block/blockstackerin",
|
||||
"west": "quickiefabric:block/blockstackerup"
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
{
|
||||
"parent": "block/cube_directional",
|
||||
"textures": {
|
||||
"up": "quickiefabric:block/blockstackerdown",
|
||||
"down": "quickiefabric:block/blockstackerdown",
|
||||
"north": "quickiefabric:block/blockstackerin",
|
||||
"east": "quickiefabric:block/blockstackerdown",
|
||||
"south": "quickiefabric:block/blockstackerout",
|
||||
"west": "quickiefabric:block/blockstackerdown"
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"parent": "block/cube_bottom_top",
|
||||
"textures": {
|
||||
"bottom": "quickiefabric:block/blockstackerin",
|
||||
"side": "quickiefabric:block/blockstackerup",
|
||||
"top": "quickiefabric:block/blockstackerout"
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
{
|
||||
"parent": "block/cube_directional",
|
||||
"textures": {
|
||||
"up": "quickiefabric:block/blockstackerleft",
|
||||
"down": "quickiefabric:block/blockstackerright",
|
||||
"north": "quickiefabric:block/blockstackerright",
|
||||
"east": "quickiefabric:block/blockstackerin",
|
||||
"south": "quickiefabric:block/blockstackerleft",
|
||||
"west": "quickiefabric:block/blockstackerout"
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
{
|
||||
"parent": "quickiefabric:block/blockstackerdown",
|
||||
"display": {
|
||||
"thirdperson": {
|
||||
"rotation": [ 10, -45, 170 ],
|
||||
"translation": [ 0, 1.5, -2.75 ],
|
||||
"scale": [ 0.375, 0.375, 0.375 ]
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
{
|
||||
"parent": "quickiefabric:block/blockstackerwest",
|
||||
"display": {
|
||||
"thirdperson": {
|
||||
"rotation": [ 10, -45, 170 ],
|
||||
"translation": [ 0, 1.5, -2.75 ],
|
||||
"scale": [ 0.375, 0.375, 0.375 ]
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
{
|
||||
"parent": "quickiefabric:block/blockstackernorth",
|
||||
"display": {
|
||||
"thirdperson": {
|
||||
"rotation": [ 10, -45, 170 ],
|
||||
"translation": [ 0, 1.5, -2.75 ],
|
||||
"scale": [ 0.375, 0.375, 0.375 ]
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
{
|
||||
"parent": "quickiefabric:block/blockstackersouth",
|
||||
"display": {
|
||||
"thirdperson": {
|
||||
"rotation": [ 10, -45, 170 ],
|
||||
"translation": [ 0, 1.5, -2.75 ],
|
||||
"scale": [ 0.375, 0.375, 0.375 ]
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"parent": "quickiefabric:block/blockstacker",
|
||||
"parent": "quickiefabric:block/blockstackerup",
|
||||
"display": {
|
||||
"thirdperson": {
|
||||
"rotation": [ 10, -45, 170 ],
|
@ -0,0 +1,10 @@
|
||||
{
|
||||
"parent": "quickiefabric:block/blockstackereast",
|
||||
"display": {
|
||||
"thirdperson": {
|
||||
"rotation": [ 10, -45, 170 ],
|
||||
"translation": [ 0, 1.5, -2.75 ],
|
||||
"scale": [ 0.375, 0.375, 0.375 ]
|
||||
}
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
@ -0,0 +1,20 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"w w",
|
||||
"wsw",
|
||||
" w "
|
||||
],
|
||||
"key": {
|
||||
"s": {
|
||||
"item": "quickiefabric:speedpowder"
|
||||
},
|
||||
"w": {
|
||||
"item": "minecraft:planks"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "quickiefabric:blockstackerdown",
|
||||
"count": 1
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "quickiefabric:blockstackerup"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"item": "quickiefabric:blockstackerdown",
|
||||
"count": 1
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"www",
|
||||
" sw",
|
||||
" w"
|
||||
],
|
||||
"key": {
|
||||
"s": {
|
||||
"item": "quickiefabric:speedpowder"
|
||||
},
|
||||
"w": {
|
||||
"item": "minecraft:planks"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "quickiefabric:blockstackereast",
|
||||
"count": 1
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "quickiefabric:blockstackerdown"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"item": "quickiefabric:blockstackereast",
|
||||
"count": 1
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"www",
|
||||
"ws ",
|
||||
"w "
|
||||
],
|
||||
"key": {
|
||||
"s": {
|
||||
"item": "quickiefabric:speedpowder"
|
||||
},
|
||||
"w": {
|
||||
"item": "minecraft:planks"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "quickiefabric:blockstackernorth",
|
||||
"count": 1
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "quickiefabric:blockstackerwest"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"item": "quickiefabric:blockstackernorth",
|
||||
"count": 1
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
" w",
|
||||
" sw",
|
||||
"www"
|
||||
],
|
||||
"key": {
|
||||
"s": {
|
||||
"item": "quickiefabric:speedpowder"
|
||||
},
|
||||
"w": {
|
||||
"item": "minecraft:planks"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "quickiefabric:blockstackersouth",
|
||||
"count": 1
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "quickiefabric:blockstackereast"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"item": "quickiefabric:blockstackersouth",
|
||||
"count": 1
|
||||
}
|
||||
}
|
@ -14,7 +14,7 @@
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "quickiefabric:blockstacker",
|
||||
"item": "quickiefabric:blockstackerup",
|
||||
"count": 1
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "quickiefabric:blockstackernorth"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"item": "quickiefabric:blockstackerup",
|
||||
"count": 1
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"w ",
|
||||
"ws ",
|
||||
"www"
|
||||
],
|
||||
"key": {
|
||||
"s": {
|
||||
"item": "quickiefabric:speedpowder"
|
||||
},
|
||||
"w": {
|
||||
"item": "minecraft:planks"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "quickiefabric:blockstackerwest",
|
||||
"count": 1
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "quickiefabric:blockstackersouth"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"item": "quickiefabric:blockstackerwest",
|
||||
"count": 1
|
||||
}
|
||||
}
|