public interface PortalAgent
Modifier and Type | Method and Description |
---|---|
Optional<Location<World>> |
createPortal(Location<World> targetLocation)
Tells this agent to create a new "portal" location at the suggested
Location . |
Optional<Location<World>> |
findOrCreatePortal(Location<World> targetLocation)
Attempts to find a "portal" location, or if none are available, creates
one.
|
Optional<Location<World>> |
findPortal(Location<World> targetLocation)
Attempts to find a "portal" location.
|
int |
getCreationRadius()
Gets the radius of where a "portal" can be created.
|
int |
getSearchRadius()
Gets the search radius before a new acceptable "portal" location is
created.
|
PortalAgentType |
getType()
Gets the type of
PortalAgent . |
PortalAgent |
setCreationRadius(int radius)
Sets the creation radius of where a portal may be created.
|
PortalAgent |
setSearchRadius(int radius)
Sets the search radius before a new acceptable "portal" location is
created.
|
int getSearchRadius()
PortalAgent setSearchRadius(int radius)
radius
- The new radiusint getCreationRadius()
PortalAgent setCreationRadius(int radius)
radius
- The new radiusOptional<Location<World>> findOrCreatePortal(Location<World> targetLocation)
Optional.empty()
if none are found.targetLocation
- The suggested locationOptional<Location<World>> findPortal(Location<World> targetLocation)
Optional.empty()
if
none are found.targetLocation
- The suggested locationOptional<Location<World>> createPortal(Location<World> targetLocation)
Location
.
If ChangeBlockEvent.Place
is cancelled, Optional.empty()
is returned.
Note: In order to adjust or prevent the Location
's of each
BlockState
set, listen to
ChangeBlockEvent.Place
and
check for the root cause of this portal agent.targetLocation
- The targeted locationPortalAgentType getType()
PortalAgent
.