Fix screwdriver duplicating terminal buffered items

This commit is contained in:
Shadowfacts 2021-03-04 22:15:18 -05:00
parent f321b2a06a
commit 74aae99b36
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 6 additions and 0 deletions

View File

@ -11,6 +11,7 @@ import net.minecraft.util.ActionResult
import net.minecraft.util.Identifier import net.minecraft.util.Identifier
import net.shadowfacts.phycon.PhysicalConnectivity import net.shadowfacts.phycon.PhysicalConnectivity
import net.shadowfacts.phycon.block.DeviceBlock import net.shadowfacts.phycon.block.DeviceBlock
import net.shadowfacts.phycon.init.PhyBlocks
/** /**
* @author shadowfacts * @author shadowfacts
@ -35,6 +36,11 @@ class ScrewdriverItem: Item(Settings()) {
beTag.remove("y") beTag.remove("y")
beTag.remove("z") beTag.remove("z")
if (block === PhyBlocks.TERMINAL) {
// remove the terminal's internal buffer since it drops its items
beTag.remove("InternalBuffer")
}
val entity = ItemEntity(context.world, context.blockPos.x.toDouble(), context.blockPos.y.toDouble(), context.blockPos.z.toDouble(), stack) val entity = ItemEntity(context.world, context.blockPos.x.toDouble(), context.blockPos.y.toDouble(), context.blockPos.z.toDouble(), stack)
context.world.spawnEntity(entity) context.world.spawnEntity(entity)