Skip to content

Commit a783ef2

Browse files
Merge pull request #25 from NightPotato/main
feat: make inventory of chicken roost configurable.
2 parents 45efc37 + d56da61 commit a783ef2

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

src/main/java/plus/dragons/createintegratedfarming/common/ranching/roost/chicken/ChickenRoostBlockEntity.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import org.jetbrains.annotations.Nullable;
5151
import plus.dragons.createintegratedfarming.common.registry.CIFDataMaps;
5252
import plus.dragons.createintegratedfarming.common.registry.CIFLootTables;
53+
import plus.dragons.createintegratedfarming.config.CIFConfig;
5354

5455
public class ChickenRoostBlockEntity extends SmartBlockEntity {
5556
protected final ItemStackHandler inventory;
@@ -60,10 +61,10 @@ public class ChickenRoostBlockEntity extends SmartBlockEntity {
6061
public ChickenRoostBlockEntity(BlockEntityType<?> type, BlockPos pos, BlockState state) {
6162
super(type, pos, state);
6263
setLazyTickRate(20);
63-
this.inventory = new ItemStackHandler(9) {
64+
this.inventory = new ItemStackHandler(CIFConfig.server().roostingInventorySlotCount.get()) {
6465
@Override
6566
public int getSlotLimit(int slot) {
66-
return 1;
67+
return CIFConfig.server().roostingInventorySlotSize.get();
6768
}
6869
};
6970
this.outputHandler = new ItemHandlerWrapper(inventory) {

src/main/java/plus/dragons/createintegratedfarming/config/CIFServerConfig.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ public class CIFServerConfig extends ConfigBase {
4949
public final ConfigBool leashedEntitySitsAutomatically = b(false,
5050
"leashedEntitySitsAutomatically",
5151
Comments.leashedEntitySitsAutomatically);
52+
public final ConfigInt roostingInventorySlotCount = i(9, 1, 27,
53+
"roostingInventorySlotCount",
54+
Comments.roostingInventorySlotCount);
55+
public final ConfigInt roostingInventorySlotSize = i(1, 1, 16,
56+
"roostingInventorySlotSize",
57+
Comments.roostingInventorySlotSize);
5258

5359
@Override
5460
public String getName() {
@@ -90,5 +96,7 @@ static class Comments {
9096
"When enabled, falls back to vanilla Create behaviour.",
9197
"When disabled, seated leashable entity can be dismounted by lead."
9298
};
99+
static final String roostingInventorySlotCount = "The amount of Inventory Slot that the Chicken Roost has available.";
100+
static final String roostingInventorySlotSize = "The amount of items per Inventory slot that the Chicken Roost can hold.";
93101
}
94102
}

0 commit comments

Comments
 (0)