Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/scala/li/cil/oc/common/blockentity/Assembler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import net.neoforged.neoforge.common.extensions.IBlockEntityExtension

import scala.jdk.CollectionConverters._

class Assembler(pos: BlockPos, state: BlockState)
class Assembler(pos: BlockPos, state: BlockState)
extends BlockEntity(BlockEntityTypes.ASSEMBLER.get(), pos, state) with traits.Environment with traits.PowerAcceptor
with traits.Inventory with SidedEnvironment with traits.StateAware with traits.Tickable with DeviceInfo with MenuProvider
with IBlockEntityExtension {
Expand Down Expand Up @@ -172,7 +172,7 @@ class Assembler(pos: BlockPos, state: BlockState)
override def saveForServer(nbt: CompoundTag, provider: HolderLookup.Provider): Unit = {
super.saveForServer(nbt, provider)
if (!output.isEmpty) {
nbt.setNewCompoundTag(OutputTag, _ => output.get.save(provider))
nbt.put(OutputTag, output.get.save(provider))
}
else {
nbt.remove(OutputTag)
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/li/cil/oc/common/blockentity/Printer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import net.neoforged.neoforge.common.extensions.IBlockEntityExtension
import java.util
import scala.collection.convert.ImplicitConversionsToJava._

class Printer(pos: BlockPos, state: BlockState)
class Printer(pos: BlockPos, state: BlockState)
extends BlockEntity(BlockEntityTypes.PRINTER.get(), pos, state) with traits.Environment with traits.Inventory with traits.Rotatable
with SidedEnvironment with traits.StateAware with traits.Tickable with WorldlyContainer with DeviceInfo with MenuProvider
with IBlockEntityExtension {
Expand Down Expand Up @@ -339,7 +339,7 @@ class Printer(pos: BlockPos, state: BlockState)
nbt.setNewCompoundTag(DataTag, (nbt: CompoundTag) => data.saveData(nbt, provider))
nbt.putBoolean(IsActiveTag, isActive)
nbt.putInt(LimitTag, limit)
output.foreach(stack => nbt.setNewCompoundTag(OutputTag, _ => stack.save(provider)))
output.foreach(stack => nbt.put(OutputTag, stack.save(provider)))
nbt.putDouble(TotalTag, totalRequiredEnergy)
nbt.putDouble(RemainingTag, requiredEnergy)
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/li/cil/oc/util/ExtendedNBT.scala
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ object ExtendedNBT {
}

class ExtendedCompoundTag(val nbt: CompoundTag) {
def setNewCompoundTag(name: String, f: CompoundTag => Any) = {
def setNewCompoundTag(name: String, f: CompoundTag => Unit) = {
val t = new CompoundTag()
f(t)
nbt.put(name, t)
Expand Down
Loading