mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-03-04 06:44:40 +01:00
Relax, IHandler it
- Fixed belts not invalidating/initialising their item handler correctly - Fixed restocker gauges crashing when moved by contraption
This commit is contained in:
parent
f4baa9bc77
commit
1955417333
4 changed files with 15 additions and 1 deletions
|
@ -177,6 +177,7 @@ public class BeltBlockEntity extends KineticBlockEntity {
|
|||
if (inventory == null)
|
||||
return;
|
||||
itemHandler = new ItemHandlerBeltSegment(inventory, index);
|
||||
invalidateCapabilities();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -553,6 +554,7 @@ public class BeltBlockEntity extends KineticBlockEntity {
|
|||
|
||||
public void invalidateItemHandler() {
|
||||
invalidateCapabilities();
|
||||
itemHandler = null;
|
||||
}
|
||||
|
||||
public boolean shouldRenderNormally() {
|
||||
|
|
|
@ -356,6 +356,13 @@ public class BeltSlicer {
|
|||
player.getInventory().placeItemBackInInventory(AllItems.BELT_CONNECTOR.asStack());
|
||||
}
|
||||
|
||||
for (BlockPos blockPos : BeltBlock.getBeltChain(world, controllerBE.getBlockPos())) {
|
||||
BeltBlockEntity belt = BeltHelper.getSegmentBE(world, blockPos);
|
||||
if (belt == null)
|
||||
continue;
|
||||
belt.invalidateItemHandler();
|
||||
}
|
||||
|
||||
// Transfer items to other controller
|
||||
BlockPos search = controllerBE.getBlockPos();
|
||||
for (int i = 0; i < 10000; i++) {
|
||||
|
|
|
@ -752,11 +752,16 @@ public class FactoryPanelBehaviour extends FilteringBehaviour implements MenuPro
|
|||
|
||||
CompoundTag panelTag = new CompoundTag();
|
||||
panelTag.put("Filter", getFilter().saveOptional(registries));
|
||||
panelTag.putBoolean("UpTo", upTo);
|
||||
panelTag.putInt("FilterAmount", count);
|
||||
panelTag.putUUID("Freq", network);
|
||||
panelTag.putString("RecipeAddress", recipeAddress);
|
||||
panelTag.putInt("PromiseClearingInterval", -1);
|
||||
panelTag.putInt("RecipeOutput", 1);
|
||||
|
||||
if (panelBE().restocker)
|
||||
panelTag.put("Promises", restockerPromises.write());
|
||||
|
||||
nbt.put(CreateLang.asId(slot.name()), panelTag);
|
||||
}
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ public class RequestPromiseQueue {
|
|||
|
||||
public static RequestPromiseQueue read(CompoundTag tag, Runnable onChanged) {
|
||||
RequestPromiseQueue queue = new RequestPromiseQueue(onChanged);
|
||||
List<RequestPromise> promises = CatnipCodecUtils.decode(Codec.list(RequestPromise.CODEC), tag.get("List")).orElseThrow();
|
||||
List<RequestPromise> promises = CatnipCodecUtils.decode(Codec.list(RequestPromise.CODEC), tag.get("List")).orElse(List.of());
|
||||
for (RequestPromise promise : promises) {
|
||||
queue.add(promise);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue