mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-13 05:54:17 +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;
|
return returned;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!simulate) {
|
ItemStack returned = ItemStack.EMPTY;
|
||||||
if (this.isEmpty()) {
|
int maxCount = heldItem.stack.getMaxStackSize();
|
||||||
if (heldItem.insertedFrom.getAxis()
|
if (maxCount < heldItem.stack.getCount())
|
||||||
.isHorizontal())
|
returned = ItemHandlerHelper.copyStackWithSize(heldItem.stack, heldItem.stack.getCount() - maxCount);
|
||||||
AllSoundEvents.DEPOT_SLIDE.playOnServer(getWorld(), getPos());
|
|
||||||
else
|
if (simulate)
|
||||||
AllSoundEvents.DEPOT_PLOP.playOnServer(getWorld(), getPos());
|
return returned;
|
||||||
}
|
|
||||||
this.heldItem = heldItem;
|
if (this.isEmpty()) {
|
||||||
onHeldInserted.accept(heldItem.stack);
|
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) {
|
public void setHeldItem(TransportedItemStack heldItem) {
|
||||||
|
@ -23,6 +23,10 @@ public class FilterItemStack {
|
|||||||
|
|
||||||
public static FilterItemStack of(ItemStack filter) {
|
public static FilterItemStack of(ItemStack filter) {
|
||||||
if (filter.hasTag()) {
|
if (filter.hasTag()) {
|
||||||
|
CompoundTag stackTag = filter.getTag();
|
||||||
|
stackTag.remove("Enchantments");
|
||||||
|
stackTag.remove("AttributeModifiers");
|
||||||
|
|
||||||
if (AllItems.FILTER.isIn(filter))
|
if (AllItems.FILTER.isIn(filter))
|
||||||
return new ListFilterItemStack(filter);
|
return new ListFilterItemStack(filter);
|
||||||
if (AllItems.ATTRIBUTE_FILTER.isIn(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);
|
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
|
filter = null; // Do not test spout outputs against the recipe filter
|
||||||
|
|
||||||
IItemHandler targetInv = be == null ? null
|
IItemHandler targetInv = be == null ? null
|
||||||
|
@ -387,5 +387,9 @@ public class FilteringBehaviour extends BlockEntityBehaviour implements ValueSet
|
|||||||
|
|
||||||
return setFilter(side, copied);
|
return setFilter(side, copied);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isRecipeFilter() {
|
||||||
|
return recipeFilter;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user