use of org.spongepowered.mod.mixin.core.forge.common.MixinForgeChunkManager$Ticket in project SpongeForge by SpongePowered.
the class SpongeChunkTicketManager method createPlayerEntityTicket.
@Override
public Optional<PlayerEntityLoadingTicket> createPlayerEntityTicket(Object plugin, World world, UUID player) {
Optional<Player> spongePlayer = SpongeImpl.getGame().getServer().getPlayer(player);
if (!spongePlayer.isPresent()) {
return Optional.empty();
}
Ticket forgeTicket = ForgeChunkManager.requestPlayerTicket(plugin, spongePlayer.get().getName(), (net.minecraft.world.World) world, ForgeChunkManager.Type.ENTITY);
if (forgeTicket == null) {
return Optional.empty();
}
return Optional.of((PlayerEntityLoadingTicket) new SpongePlayerEntityLoadingTicket(forgeTicket));
}
use of org.spongepowered.mod.mixin.core.forge.common.MixinForgeChunkManager$Ticket in project SpongeForge by SpongePowered.
the class SpongeChunkTicketManager method getForcedChunks.
@Override
public ImmutableSetMultimap<Vector3i, LoadingTicket> getForcedChunks(World world) {
ImmutableSetMultimap<ChunkPos, Ticket> forgeForcedChunks = ForgeChunkManager.getPersistentChunksFor((net.minecraft.world.World) world);
ImmutableSetMultimap.Builder<Vector3i, LoadingTicket> spongeForcedChunks = ImmutableSetMultimap.builder();
for (Map.Entry<ChunkPos, Ticket> ticketPair : forgeForcedChunks.entries()) {
spongeForcedChunks.put(new Vector3i(ticketPair.getKey().x, 0, ticketPair.getKey().z), new SpongeLoadingTicket(ticketPair.getValue()));
}
return spongeForcedChunks.build();
}
use of org.spongepowered.mod.mixin.core.forge.common.MixinForgeChunkManager$Ticket in project SpongeForge by SpongePowered.
the class SpongeChunkTicketManager method createPlayerTicket.
@Override
public Optional<PlayerLoadingTicket> createPlayerTicket(Object plugin, World world, UUID player) {
Optional<Player> spongePlayer = SpongeImpl.getGame().getServer().getPlayer(player);
if (!spongePlayer.isPresent()) {
return Optional.empty();
}
Ticket forgeTicket = ForgeChunkManager.requestPlayerTicket(plugin, spongePlayer.get().getName(), (net.minecraft.world.World) world, ForgeChunkManager.Type.NORMAL);
if (forgeTicket == null) {
return Optional.empty();
}
return Optional.of((PlayerLoadingTicket) new SpongePlayerLoadingTicket(forgeTicket));
}
Aggregations