Compare commits
No commits in common. "decb0d3921672c60fbb2128878d78809d5c84c4f" and "ed6776f9dffd2becb8b177e68f981af3b23ae049" have entirely different histories.
decb0d3921
...
ed6776f9df
@ -33,7 +33,7 @@ object Quaedam {
|
||||
|
||||
val creativeModeTab: RegistrySupplier<CreativeModeTab> = creativeModeTabs.register("quaedam") {
|
||||
CreativeTabRegistry.create(Component.translatable("category.quaedam")) {
|
||||
ItemStack(Projector.item.get())
|
||||
ItemStack(Items.TORCH)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ class ExchangeItem<E> : Behavior<E>(
|
||||
val container = level.getBlockEntity(target!!) as Container
|
||||
val inventory = entity.inventory
|
||||
for (i in 1..6) {
|
||||
val maxCount = 1 + level.random.nextInt(16)
|
||||
val maxCount = level.random.nextInt(16)
|
||||
if (level.random.nextBoolean()) {
|
||||
// take
|
||||
val slot = level.random.nextInt(container.containerSize)
|
||||
@ -78,7 +78,7 @@ class ExchangeItem<E> : Behavior<E>(
|
||||
val takeCount = min(item.count, maxCount)
|
||||
val takeItem = item.copyWithCount(takeCount)
|
||||
if (inventory.canTakeItem(container, slot, takeItem) && entity.canHoldItem(takeItem)) {
|
||||
val remaining = inventory.addItem(/*entity.equipItemIfPossible(takeItem)*/ takeItem)
|
||||
val remaining = entity.inventory.addItem(entity.equipItemIfPossible(takeItem))
|
||||
val actualCount = takeCount - remaining.count
|
||||
item.shrink(actualCount)
|
||||
container.setItem(slot, item)
|
||||
@ -116,13 +116,11 @@ class ExchangeItem<E> : Behavior<E>(
|
||||
}
|
||||
val putCount = takeCount - takeItem.count
|
||||
item.shrink(putCount)
|
||||
inventory.setItem(slot, item)
|
||||
container.setItem(slot, item)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
container.setChanged()
|
||||
inventory.setChanged()
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user