mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-03-04 06:44:40 +01:00
Belt smelts
- Fixed items processed by spout/press/deployer not able to be processed by fan afterwards #7012 #6559 #7013 - Fixed belt items resetting fan processing progress on reload
This commit is contained in:
parent
ae185b875a
commit
7a0ebd96d1
4 changed files with 24 additions and 0 deletions
|
@ -113,6 +113,7 @@ public class SpoutBlockEntity extends SmartBlockEntity implements IHaveGoggleInf
|
|||
// Process finished
|
||||
ItemStack out = FillingBySpout.fillItem(level, requiredAmountForItem, transported.stack, fluid);
|
||||
if (!out.isEmpty()) {
|
||||
transported.clearFanProcessingData();
|
||||
List<TransportedItemStack> outList = new ArrayList<>();
|
||||
TransportedItemStack held = null;
|
||||
TransportedItemStack result = transported.copy();
|
||||
|
|
|
@ -3,7 +3,9 @@ package com.simibubi.create.content.kinetics.belt.transport;
|
|||
import java.util.Random;
|
||||
|
||||
import com.simibubi.create.content.kinetics.belt.BeltHelper;
|
||||
import com.simibubi.create.content.kinetics.fan.processing.AllFanProcessingTypes;
|
||||
import com.simibubi.create.content.kinetics.fan.processing.FanProcessingType;
|
||||
import com.simibubi.create.content.kinetics.fan.processing.FanProcessingTypeRegistry;
|
||||
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
|
@ -74,6 +76,12 @@ public class TransportedItemStack implements Comparable<TransportedItemStack> {
|
|||
nbt.putInt("InSegment", insertedAt);
|
||||
nbt.putInt("Angle", angle);
|
||||
nbt.putInt("InDirection", insertedFrom.get3DDataValue());
|
||||
|
||||
if (processedBy != null && processedBy != AllFanProcessingTypes.NONE) {
|
||||
nbt.putString("FanProcessingType", FanProcessingTypeRegistry.getIdOrThrow(processedBy).toString());
|
||||
nbt.putInt("FanProcessingTime", processingTime);
|
||||
}
|
||||
|
||||
if (locked)
|
||||
nbt.putBoolean("Locked", locked);
|
||||
if (lockedExternally)
|
||||
|
@ -92,7 +100,18 @@ public class TransportedItemStack implements Comparable<TransportedItemStack> {
|
|||
stack.insertedFrom = Direction.from3DDataValue(nbt.getInt("InDirection"));
|
||||
stack.locked = nbt.getBoolean("Locked");
|
||||
stack.lockedExternally = nbt.getBoolean("LockedExternally");
|
||||
|
||||
if (nbt.contains("FanProcessingType")) {
|
||||
stack.processedBy = AllFanProcessingTypes.parseLegacy(nbt.getString("FanProcessingType"));
|
||||
stack.processingTime = nbt.getInt("FanProcessingTime");
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
public void clearFanProcessingData() {
|
||||
processedBy = null;
|
||||
processingTime = 0;
|
||||
}
|
||||
|
||||
}
|
|
@ -113,6 +113,8 @@ public class BeltDeployerCallbacks {
|
|||
.collect(Collectors.toList());
|
||||
|
||||
blockEntity.award(AllAdvancements.DEPLOYER);
|
||||
|
||||
transported.clearFanProcessingData();
|
||||
|
||||
TransportedItemStack left = transported.copy();
|
||||
blockEntity.player.spawnedItemEffects = transported.stack.copy();
|
||||
|
|
|
@ -49,6 +49,8 @@ public class BeltPressingCallbacks {
|
|||
|
||||
boolean bulk = behaviour.specifics.canProcessInBulk() || transported.stack.getCount() == 1;
|
||||
|
||||
transported.clearFanProcessingData();
|
||||
|
||||
List<TransportedItemStack> collect = results.stream()
|
||||
.map(stack -> {
|
||||
TransportedItemStack copy = transported.copy();
|
||||
|
|
Loading…
Add table
Reference in a new issue