Compare commits
2 Commits
itemhoarde
...
50dc4e142d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
50dc4e142d | ||
|
|
8dda7a8ded |
@@ -56,6 +56,10 @@ public class QuicklyBlocks {
|
||||
properties -> new Monsterhoarder(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);
|
||||
|
||||
private static final BlockEntityType<? extends BlockEntity> registerBlockEntity(String name, Factory<? extends BlockEntity> factory, Block block) {
|
||||
|
||||
@@ -127,28 +127,45 @@ public class ItemHoarderBlockEntity extends BlockEntity implements Container {
|
||||
return stacks.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use getStack(String key) instead
|
||||
*/
|
||||
@Deprecated
|
||||
@Override
|
||||
public ItemStack getItem(int slot) {
|
||||
// buggy; do not use this. The map wants to have an item name instead
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use getStack(String key).setCount(0) or such instead
|
||||
*/
|
||||
@Deprecated
|
||||
@Override
|
||||
public ItemStack removeItem(int slot, int count) {
|
||||
// buggy; do not use this. The map wants to have an item name instead
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use getStack(String key).setCount(0) or such instead
|
||||
*/
|
||||
@Deprecated
|
||||
@Override
|
||||
public ItemStack removeItemNoUpdate(int slot) {
|
||||
// buggy; do not use this. The map wants to have an item name instead
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param slot is ignored; the right slot is found by itemStack's name
|
||||
* @param itemStack the itemStack to add
|
||||
*/
|
||||
@Override
|
||||
public void setItem(int slot, ItemStack itemStack) {
|
||||
if (slot < stacks.size()) {
|
||||
stacks.get(itemStack.getItem().getName().getString()).grow(itemStack.getCount());
|
||||
ItemStack found = stacks.get(itemStack.getItem().getName().getString());
|
||||
if (found != null) {
|
||||
found.grow(itemStack.getCount());
|
||||
} else if (!itemStack.isEmpty()) {
|
||||
stacks.put(itemStack.getItem().getName().getString(), itemStack);
|
||||
}
|
||||
|
||||
@@ -44,6 +44,10 @@ public class QuicklyItems {
|
||||
public static final Item SPEEDINGOT = registerItem("speedingot");
|
||||
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_HELMET = registerItem("turquoise_helmet", ArmorType.HELMET);
|
||||
public static final Item ARMOR_TURQUOISE_LEGGINGS = registerItem("turquoise_leggings", ArmorType.LEGGINGS);
|
||||
|
||||
Reference in New Issue
Block a user