Fixed not sanitizing stack when handling knowledge, fixes #1450
This commit is contained in:
@@ -68,9 +68,7 @@ public class StorageItemTransmutationTable extends StorageItemExternal {
|
||||
if (!simulate) {
|
||||
provider.setEmc(provider.getEmc() + emc);
|
||||
|
||||
if (!provider.hasKnowledge(stack)) {
|
||||
provider.addKnowledge(stack);
|
||||
}
|
||||
handleKnowledge(provider, stack.copy());
|
||||
|
||||
EntityPlayer player = externalStorage.getWorld().getPlayerEntityByUUID(externalStorage.getOwner());
|
||||
|
||||
@@ -86,6 +84,23 @@ public class StorageItemTransmutationTable extends StorageItemExternal {
|
||||
return actualStack;
|
||||
}
|
||||
|
||||
// @todo: https://github.com/sinkillerj/ProjectE/issues/1592
|
||||
private void handleKnowledge(IKnowledgeProvider provider, ItemStack stack) {
|
||||
if (stack.getCount() > 1) {
|
||||
stack.setCount(1);
|
||||
}
|
||||
|
||||
if (!stack.getHasSubtypes() && stack.getMaxDamage() != 0) {
|
||||
stack.setItemDamage(0);
|
||||
}
|
||||
|
||||
if (!provider.hasKnowledge(stack)) {
|
||||
stack.setTagCompound(null);
|
||||
|
||||
provider.addKnowledge(stack);
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ItemStack extract(@Nonnull ItemStack stack, int size, int flags, boolean simulate) {
|
||||
|
||||
Reference in New Issue
Block a user