Compare commits

2 Commits

Author SHA1 Message Date
Jottyfan
50dc4e142d added todos 2025-12-31 00:26:09 +01:00
Jottyfan
8dda7a8ded finetuning 2025-12-30 19:24:21 +01:00
3 changed files with 27 additions and 2 deletions

View File

@@ -56,6 +56,10 @@ public class QuicklyBlocks {
properties -> new Monsterhoarder(properties)); properties -> new Monsterhoarder(properties));
public static final Block ITEMHOARDER = registerBlock("itemhoarder", properties -> new Itemhoarder(properties)); public static final Block ITEMHOARDER = registerBlock("itemhoarder", properties -> new Itemhoarder(properties));
// TODO: drill, blockstacker
// TODO: salpeter ore, sulfor ore
// TODO: merge lavahoarder and emptylavahoarder into one block using a BooleanProperty for the lava fill state
public static final BlockEntityType<ItemHoarderBlockEntity> BLOCKENTITY_ITEMHOARDER = (BlockEntityType<ItemHoarderBlockEntity>) registerBlockEntity("itemhoarderblockentity", ItemHoarderBlockEntity::new, ITEMHOARDER); public static final BlockEntityType<ItemHoarderBlockEntity> BLOCKENTITY_ITEMHOARDER = (BlockEntityType<ItemHoarderBlockEntity>) registerBlockEntity("itemhoarderblockentity", ItemHoarderBlockEntity::new, ITEMHOARDER);
private static final BlockEntityType<? extends BlockEntity> registerBlockEntity(String name, Factory<? extends BlockEntity> factory, Block block) { private static final BlockEntityType<? extends BlockEntity> registerBlockEntity(String name, Factory<? extends BlockEntity> factory, Block block) {

View File

@@ -127,28 +127,45 @@ public class ItemHoarderBlockEntity extends BlockEntity implements Container {
return stacks.isEmpty(); return stacks.isEmpty();
} }
/**
* @deprecated use getStack(String key) instead
*/
@Deprecated
@Override @Override
public ItemStack getItem(int slot) { public ItemStack getItem(int slot) {
// buggy; do not use this. The map wants to have an item name instead // buggy; do not use this. The map wants to have an item name instead
return ItemStack.EMPTY; return ItemStack.EMPTY;
} }
/**
* @deprecated use getStack(String key).setCount(0) or such instead
*/
@Deprecated
@Override @Override
public ItemStack removeItem(int slot, int count) { public ItemStack removeItem(int slot, int count) {
// buggy; do not use this. The map wants to have an item name instead // buggy; do not use this. The map wants to have an item name instead
return ItemStack.EMPTY; return ItemStack.EMPTY;
} }
/**
* @deprecated use getStack(String key).setCount(0) or such instead
*/
@Deprecated
@Override @Override
public ItemStack removeItemNoUpdate(int slot) { public ItemStack removeItemNoUpdate(int slot) {
// buggy; do not use this. The map wants to have an item name instead // buggy; do not use this. The map wants to have an item name instead
return ItemStack.EMPTY; return ItemStack.EMPTY;
} }
/**
* @param slot is ignored; the right slot is found by itemStack's name
* @param itemStack the itemStack to add
*/
@Override @Override
public void setItem(int slot, ItemStack itemStack) { public void setItem(int slot, ItemStack itemStack) {
if (slot < stacks.size()) { ItemStack found = stacks.get(itemStack.getItem().getName().getString());
stacks.get(itemStack.getItem().getName().getString()).grow(itemStack.getCount()); if (found != null) {
found.grow(itemStack.getCount());
} else if (!itemStack.isEmpty()) { } else if (!itemStack.isEmpty()) {
stacks.put(itemStack.getItem().getName().getString(), itemStack); stacks.put(itemStack.getItem().getName().getString(), itemStack);
} }

View File

@@ -44,6 +44,10 @@ public class QuicklyItems {
public static final Item SPEEDINGOT = registerItem("speedingot"); public static final Item SPEEDINGOT = registerItem("speedingot");
public static final Item QUICKIEINGOT = registerItem("quickieingot"); public static final Item QUICKIEINGOT = registerItem("quickieingot");
// TODO: salpeter, sulfor
// TODO: carrot stack
// TODO: tools
public static final Item ARMOR_TURQUOISE_BOOTS = registerItem("turquoise_boots", ArmorType.BOOTS); public static final Item ARMOR_TURQUOISE_BOOTS = registerItem("turquoise_boots", ArmorType.BOOTS);
public static final Item ARMOR_TURQUOISE_HELMET = registerItem("turquoise_helmet", ArmorType.HELMET); public static final Item ARMOR_TURQUOISE_HELMET = registerItem("turquoise_helmet", ArmorType.HELMET);
public static final Item ARMOR_TURQUOISE_LEGGINGS = registerItem("turquoise_leggings", ArmorType.LEGGINGS); public static final Item ARMOR_TURQUOISE_LEGGINGS = registerItem("turquoise_leggings", ArmorType.LEGGINGS);