Conversation
There was a problem hiding this comment.
is this really needed, I feel like it is kind of unnecessary?
There was a problem hiding this comment.
It's not strictly necessary, however it does make it feel a bit nicer imo
| import net.minecraft.world.inventory.Slot | ||
| import net.silkmc.silk.core.mixin.client.AbstractContainerScreenAccessor | ||
|
|
||
| val AbstractContainerScreen<*>.focusedSlot: Slot? |
There was a problem hiding this comment.
is there a reason the extension is not called hoveredSlot as well?
There was a problem hiding this comment.
the reason is I forgored to update it
| fun CollisionGetter.entityCollisions( | ||
| entity: Entity? = null, | ||
| box: AABB, | ||
| ): List<VoxelShape> { | ||
| return getEntityCollisions(entity, box) | ||
| } | ||
|
|
||
| fun CollisionGetter.collisions( | ||
| entity: Entity? = null, | ||
| box: AABB, | ||
| ): Iterable<VoxelShape> { | ||
| return getCollisions(entity, box) | ||
| } | ||
|
|
||
| fun CollisionGetter.blockCollisions( | ||
| entity: Entity? = null, | ||
| box: AABB, | ||
| ): Iterable<VoxelShape> { | ||
| return getBlockCollisions(entity, box) | ||
| } | ||
|
|
||
| fun EntityGetter.entityCollisions( | ||
| entity: Entity? = null, | ||
| box: AABB, | ||
| ): List<VoxelShape> { | ||
| return getEntityCollisions(entity, box) | ||
| } | ||
|
|
||
| fun EntityGetter.entities( | ||
| except: Entity? = null, | ||
| box: AABB, | ||
| predicate: (Entity) -> Boolean = EntitySelector.NO_SPECTATORS::test, | ||
| ): List<Entity> { | ||
| return getEntities(except, box, predicate) | ||
| } |
There was a problem hiding this comment.
don't these functions just remove "get" from the name of the original function?
There was a problem hiding this comment.
yeah basically, though it does also make them have an optional parameter for the Entity, which for all those methods if none is provided then it's ignored (I forget if there is an overload for this or not by default. I'd have to check.)
also, imo it feels a lot nicer without the get, but that's just me
Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
60536c4 to
51538bf
Compare
A bunch of misc additions split off from #59 that I wasn't sure how else to group.
Adds:
Worldfor getting entities by class/type/collision withAABBMinecraftServerfor getting a world by their identifier (ResourceLocation)AbstractContainerScreento get the focused slotIngredientContainercontains & iterating through themthe
.iterator()extension allows for