repo for my hex addons :3
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

did you know? entities

+14 -1
+14 -1
project/hexic/src/main/scala/org/eu/net/pool/hexic/views.scala
··· 3 3 import at.petrak.hexcasting.api.casting.arithmetic.Arithmetic 4 4 import at.petrak.hexcasting.api.casting.circles.BlockEntityAbstractImpetus 5 5 import at.petrak.hexcasting.api.casting.eval.CastingEnvironment 6 + import at.petrak.hexcasting.api.casting.eval.env.PlayerBasedCastEnv 6 7 import at.petrak.hexcasting.api.casting.iota.* 7 - import at.petrak.hexcasting.api.casting.mishaps.{Mishap, MishapInvalidIota} 8 + import at.petrak.hexcasting.api.casting.mishaps.{Mishap, MishapInvalidIota, MishapOthersName} 8 9 import com.mojang.serialization.Codec 9 10 import com.samsthenerd.inline.api.InlineAPI 10 11 import com.samsthenerd.inline.api.data.ItemInlineData ··· 19 20 import net.minecraft.block.BlockState 20 21 import net.minecraft.block.entity.AbstractFurnaceBlockEntity 21 22 import net.minecraft.entity.Entity 23 + import net.minecraft.entity.player.PlayerEntity 22 24 import net.minecraft.fluid.Fluid 23 25 import net.minecraft.item.Item 24 26 import net.minecraft.nbt.{NbtCompound, NbtElement, NbtList, NbtLong} ··· 274 276 val pos = BlockPos.ofFloored(block.getVec3) 275 277 summon[CastingEnvironment].assertPosInRangeForEditing(pos) 276 278 InventoryView.OfBlock(pos) 279 + case entity: EntityIota => 280 + given MinecraftServer = summon[CastingEnvironment].getWorld.getServer 281 + entity.getEntity match 282 + case p: PlayerEntity => 283 + summon[CastingEnvironment] match 284 + case env: PlayerBasedCastEnv => 285 + if env.getCaster == p then 286 + InventoryView.OfEntity(p.getUuid) 287 + else 288 + throw MishapOthersName(p) 289 + case e => InventoryView.OfEntity(e.getUuid) 277 290 hexXplat.getArithmeticRegistry("view") = arith("view", 278 291 Arithmetic.ADD -> { 279 292 (view1: BoxedView.Instance, view2: BoxedView.Instance) => Seq(BoxedView.Instance(InventoryView.OfSum(view1.view, view2.view)))