mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-10 12:33:57 +01:00
It takes a special kind of player
- Fixed Depot accepting item stacks with invalid amounts - Fixed filter slots containing enchantment and attribute data of filter items
This commit is contained in:
parent
c267a413d9
commit
fa5b71b7eb
@ -307,18 +307,27 @@ public class DepotBehaviour extends BlockEntityBehaviour {
|
||||
return returned;
|
||||
}
|
||||
|
||||
if (!simulate) {
|
||||
if (this.isEmpty()) {
|
||||
if (heldItem.insertedFrom.getAxis()
|
||||
.isHorizontal())
|
||||
AllSoundEvents.DEPOT_SLIDE.playOnServer(getWorld(), getPos());
|
||||
else
|
||||
AllSoundEvents.DEPOT_PLOP.playOnServer(getWorld(), getPos());
|
||||
}
|
||||
this.heldItem = heldItem;
|
||||
onHeldInserted.accept(heldItem.stack);
|
||||
ItemStack returned = ItemStack.EMPTY;
|
||||
int maxCount = heldItem.stack.getMaxStackSize();
|
||||
if (maxCount < heldItem.stack.getCount())
|
||||
returned = ItemHandlerHelper.copyStackWithSize(heldItem.stack, heldItem.stack.getCount() - maxCount);
|
||||
|
||||
if (simulate)
|
||||
return returned;
|
||||
|
||||
if (this.isEmpty()) {
|
||||
if (heldItem.insertedFrom.getAxis()
|
||||
.isHorizontal())
|
||||
AllSoundEvents.DEPOT_SLIDE.playOnServer(getWorld(), getPos());
|
||||
else
|
||||
AllSoundEvents.DEPOT_PLOP.playOnServer(getWorld(), getPos());
|
||||
}
|
||||
return ItemStack.EMPTY;
|
||||
|
||||
heldItem = heldItem.copy();
|
||||
heldItem.stack.setCount(maxCount);
|
||||
this.heldItem = heldItem;
|
||||
onHeldInserted.accept(heldItem.stack);
|
||||
return returned;
|
||||
}
|
||||
|
||||
public void setHeldItem(TransportedItemStack heldItem) {
|
||||
|
@ -23,6 +23,10 @@ public class FilterItemStack {
|
||||
|
||||
public static FilterItemStack of(ItemStack filter) {
|
||||
if (filter.hasTag()) {
|
||||
CompoundTag stackTag = filter.getTag();
|
||||
stackTag.remove("Enchantments");
|
||||
stackTag.remove("AttributeModifiers");
|
||||
|
||||
if (AllItems.FILTER.isIn(filter))
|
||||
return new ListFilterItemStack(filter);
|
||||
if (AllItems.ATTRIBUTE_FILTER.isIn(filter))
|
||||
|
@ -380,7 +380,7 @@ public class BasinBlockEntity extends SmartBlockEntity implements IHaveGoggleInf
|
||||
inserter = BlockEntityBehaviour.get(level, be.getBlockPos(), InvManipulationBehaviour.TYPE);
|
||||
}
|
||||
|
||||
if (be instanceof BasinBlockEntity)
|
||||
if (filter.isRecipeFilter())
|
||||
filter = null; // Do not test spout outputs against the recipe filter
|
||||
|
||||
IItemHandler targetInv = be == null ? null
|
||||
|
@ -387,5 +387,9 @@ public class FilteringBehaviour extends BlockEntityBehaviour implements ValueSet
|
||||
|
||||
return setFilter(side, copied);
|
||||
}
|
||||
|
||||
public boolean isRecipeFilter() {
|
||||
return recipeFilter;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user