public class GelTeleporter
extends net.minecraft.world.Teleporter
Modifier and Type | Class and Description |
---|---|
static class |
GelTeleporter.CreatePortalBehavior
Determins how the portal generated should be placed.
|
static interface |
GelTeleporter.ICreatePortalFuncion
Used to create a portal and get it's location.
|
Constructor and Description |
---|
GelTeleporter(net.minecraft.world.server.ServerWorld worldIn,
java.util.function.Supplier<net.minecraft.util.RegistryKey<net.minecraft.world.World>> dimension1,
java.util.function.Supplier<net.minecraft.util.RegistryKey<net.minecraft.world.World>> dimension2,
java.util.function.Supplier<net.minecraft.village.PointOfInterestType> portalPOI,
java.util.function.Supplier<GelPortalBlock> portalBlock,
java.util.function.Supplier<net.minecraft.block.BlockState> frameBlock,
GelTeleporter.CreatePortalBehavior placementBehavior) |
GelTeleporter(net.minecraft.world.server.ServerWorld world,
java.util.function.Supplier<net.minecraft.util.RegistryKey<net.minecraft.world.World>> dimension1,
java.util.function.Supplier<net.minecraft.util.RegistryKey<net.minecraft.world.World>> dimension2,
java.util.function.Supplier<net.minecraft.village.PointOfInterestType> portalPOI,
java.util.function.Supplier<GelPortalBlock> portalBlock,
java.util.function.Supplier<net.minecraft.block.BlockState> frameBlock,
GelTeleporter.ICreatePortalFuncion placementBehavior) |
Modifier and Type | Method and Description |
---|---|
static java.util.Optional<net.minecraft.util.TeleportationRepositioner.Result> |
createAndFindPortalNether(GelTeleporter teleporter,
net.minecraft.util.math.BlockPos startPos,
net.minecraft.util.Direction.Axis enterAxis)
Default code for the Teleporter with slight modification.
|
static java.util.Optional<net.minecraft.util.TeleportationRepositioner.Result> |
createAndFindPortalSurface(GelTeleporter teleporter,
net.minecraft.util.math.BlockPos startPos,
net.minecraft.util.Direction.Axis enterAxis)
Places this portal on highest block in the world, ignoring blocks specified
in
shouldIgnoreBlock(BlockState, BlockPos) . |
int |
getDefaultHeight()
Returns the default height to generate a portal if a position cannot be found
when placing on surface.
|
java.util.function.Supplier<net.minecraft.util.RegistryKey<net.minecraft.world.World>> |
getDimension1() |
java.util.function.Supplier<net.minecraft.util.RegistryKey<net.minecraft.world.World>> |
getDimension2() |
java.util.Optional<net.minecraft.util.TeleportationRepositioner.Result> |
getExistingPortal(net.minecraft.util.math.BlockPos startPos,
boolean toNether)
Locates a portal in the
getWorld() . |
java.util.function.Supplier<net.minecraft.block.BlockState> |
getFrameBlock() |
net.minecraft.util.RegistryKey<net.minecraft.world.World> |
getOpposite()
Returns the opposite world from the one in this instance, or
dimension1 by default. |
GelTeleporter.ICreatePortalFuncion |
getPlacementBehavior() |
java.util.function.Supplier<GelPortalBlock> |
getPortalBlock() |
net.minecraft.block.PortalInfo |
getPortalInfo(net.minecraft.entity.Entity entity,
net.minecraft.world.server.ServerWorld destWorld,
java.util.function.Function<net.minecraft.world.server.ServerWorld,net.minecraft.block.PortalInfo> defaultPortalInfo) |
java.util.function.Supplier<net.minecraft.village.PointOfInterestType> |
getPortalPOI() |
net.minecraft.world.server.ServerWorld |
getWorld()
Gets the destination world of this teleporter.
|
java.util.Optional<net.minecraft.util.TeleportationRepositioner.Result> |
makePortal(net.minecraft.util.math.BlockPos startPos,
net.minecraft.util.Direction.Axis enterAxis)
Places a new portal in the
getWorld() and locates it. |
boolean |
shouldIgnoreBlock(net.minecraft.block.BlockState state,
net.minecraft.util.math.BlockPos pos)
Returns if the block passed should be ignored when placing on the surface.
|
public GelTeleporter(net.minecraft.world.server.ServerWorld world, java.util.function.Supplier<net.minecraft.util.RegistryKey<net.minecraft.world.World>> dimension1, java.util.function.Supplier<net.minecraft.util.RegistryKey<net.minecraft.world.World>> dimension2, java.util.function.Supplier<net.minecraft.village.PointOfInterestType> portalPOI, java.util.function.Supplier<GelPortalBlock> portalBlock, java.util.function.Supplier<net.minecraft.block.BlockState> frameBlock, GelTeleporter.ICreatePortalFuncion placementBehavior)
public GelTeleporter(net.minecraft.world.server.ServerWorld worldIn, java.util.function.Supplier<net.minecraft.util.RegistryKey<net.minecraft.world.World>> dimension1, java.util.function.Supplier<net.minecraft.util.RegistryKey<net.minecraft.world.World>> dimension2, java.util.function.Supplier<net.minecraft.village.PointOfInterestType> portalPOI, java.util.function.Supplier<GelPortalBlock> portalBlock, java.util.function.Supplier<net.minecraft.block.BlockState> frameBlock, GelTeleporter.CreatePortalBehavior placementBehavior)
public net.minecraft.util.RegistryKey<net.minecraft.world.World> getOpposite()
dimension1
by default.RegistryKey
public java.util.function.Supplier<net.minecraft.util.RegistryKey<net.minecraft.world.World>> getDimension1()
public java.util.function.Supplier<net.minecraft.util.RegistryKey<net.minecraft.world.World>> getDimension2()
public java.util.function.Supplier<net.minecraft.village.PointOfInterestType> getPortalPOI()
public java.util.function.Supplier<GelPortalBlock> getPortalBlock()
public java.util.function.Supplier<net.minecraft.block.BlockState> getFrameBlock()
public GelTeleporter.ICreatePortalFuncion getPlacementBehavior()
public net.minecraft.world.server.ServerWorld getWorld()
ServerWorld
public boolean shouldIgnoreBlock(net.minecraft.block.BlockState state, net.minecraft.util.math.BlockPos pos)
state
- pos
- Boolean
public int getDefaultHeight()
Integer
public java.util.Optional<net.minecraft.util.TeleportationRepositioner.Result> getExistingPortal(net.minecraft.util.math.BlockPos startPos, boolean toNether)
getWorld()
.getExistingPortal
in class net.minecraft.world.Teleporter
public java.util.Optional<net.minecraft.util.TeleportationRepositioner.Result> makePortal(net.minecraft.util.math.BlockPos startPos, net.minecraft.util.Direction.Axis enterAxis)
getWorld()
and locates it.makePortal
in class net.minecraft.world.Teleporter
@Nullable public net.minecraft.block.PortalInfo getPortalInfo(net.minecraft.entity.Entity entity, net.minecraft.world.server.ServerWorld destWorld, java.util.function.Function<net.minecraft.world.server.ServerWorld,net.minecraft.block.PortalInfo> defaultPortalInfo)
public static java.util.Optional<net.minecraft.util.TeleportationRepositioner.Result> createAndFindPortalSurface(GelTeleporter teleporter, net.minecraft.util.math.BlockPos startPos, net.minecraft.util.Direction.Axis enterAxis)
shouldIgnoreBlock(BlockState, BlockPos)
.teleporter
- startPos
- enterAxis
- Optional
public static java.util.Optional<net.minecraft.util.TeleportationRepositioner.Result> createAndFindPortalNether(GelTeleporter teleporter, net.minecraft.util.math.BlockPos startPos, net.minecraft.util.Direction.Axis enterAxis)
teleporter
- startPos
- enterAxis
- Optional