diff --git a/src/main/java/carpet/mixins/PointOfInterest_scarpetMixin.java b/src/main/java/carpet/mixins/PointOfInterest_scarpetMixin.java index 6956788b..02780344 100644 --- a/src/main/java/carpet/mixins/PointOfInterest_scarpetMixin.java +++ b/src/main/java/carpet/mixins/PointOfInterest_scarpetMixin.java @@ -3,10 +3,14 @@ package carpet.mixins; import net.minecraft.village.PointOfInterest; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Accessor; +import org.spongepowered.asm.mixin.gen.Invoker; @Mixin(PointOfInterest.class) public interface PointOfInterest_scarpetMixin { @Accessor("freeTickets") int getFreeTickets(); + + @Invoker + boolean callReserveTicket(); } diff --git a/src/main/java/carpet/script/CarpetExpression.java b/src/main/java/carpet/script/CarpetExpression.java index 6bd82b67..e7e24fc9 100644 --- a/src/main/java/carpet/script/CarpetExpression.java +++ b/src/main/java/carpet/script/CarpetExpression.java @@ -497,8 +497,16 @@ public class CarpetExpression * place_item('piston,x,y,z,'down') // places a piston facing down * place_item('carrot',x,y,z) // attempts to plant a carrot plant. Returns true if could place carrots at that position. * - *
biome(pos)returns biome at that block position.
+ *set_poi(pos, type, occupancy?)Sets a Point of Interest (POI) of a specified type with optional custom occupancy. By default new POIs are not
+ * occupied. If type is null, POI at position is removed. In any case, previous POI is also removed.
+ * Available POI types are:
'unemployed', 'armorer', 'butcher', 'cartographer', 'cleric', 'farmer', 'fisherman', 'fletcher', 'leatherworker',
+ * 'librarian', 'mason', 'nitwit', 'shepherd', 'toolsmith', 'weaponsmith', 'home', 'meeting'Interestingly, unemployed, and nitwit are not used in the game, meaning, they could be used
+ * as permanent spatial markers for scarpet apps. meeting is the only one with increased max occupancy of 6.
set_biome(pos, biome_name)changes biome at that block position.
*update(pos)
* block_data(x,y,z) => '{TransferCooldown:0,x:450,y:68, ... }'
*
+ * poi(pos), poi(pos, radius), poi(pos, radius, status)Queries a POI (Point of Interest) at a given position, returning null if none is found, or tuple of
+ * poi type and its occupancy load. With optional radius and status, returns a list of POIs
+ * around pos within a given radius. If status is specified (either 'available',
+ * or 'occupied') returns only POIs with that status. The return format is again, poi type, occupancy load, and extra tripple of
+ * coordinates.
Querying for POIs using the radius is intended use of POI mechanics and ability of accessing individual POIs via
+ * poi(pos) in only provided for completness.
+ * poi(x,y,z) => null // nothing set at position + * poi(x,y,z) => ['meeting',3] // its a bell-type meeting point occupied by 3 villagers + * poi(x,y,z,5) => [] // nothing around + * poi(x,y,z,5) => [['nether_portal',0,[7,8,9]],['nether_portal',0,[7,9,9]]] // two portal blocks in the range + *+ *
biome(pos)returns biome at that block position.
*solid(pos)Boolean function, true if the block is solid
*air(pos)