Skip to content

#94 feature portal port#334

Open
timplay33 wants to merge 4 commits into
mc1.21.1/devfrom
94-feature-portal-port
Open

#94 feature portal port#334
timplay33 wants to merge 4 commits into
mc1.21.1/devfrom
94-feature-portal-port

Conversation

@timplay33

@timplay33 timplay33 commented Apr 30, 2026

Copy link
Copy Markdown
Owner
  • Testing on Multiplayer
  • Testing with sable
  • Recipe

What is the portal port?

The portal port is a block that can be linked to a logistics network. The linked block can then be placed into one dimension. Another one with the same logistics network linked can then be placed in a different dimension. A bee will try to find a target in the current dimension. If not found, it will take a look into the other ones. Portal ports then allow the bee to travel from the current dimension to the target dimension.

What happens if I have multiple portal ports in one dimension within the same logistics network?

If you have multiple portal ports linked to the same logistics network in one dimension. Then the bee will take the portal port closest to the target.

This comment was marked as outdated.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 22 changed files in this pull request and generated 6 comments.

double dist = dir.length();
double totalDist = 2.0;
float progress = (float) Math.max(0.0, Math.min(1.0, 1.0 - (dist / totalDist)));
float progress = (float) Math.clamp(1.0 - (dist / totalDist), 0.0, 1.0);
Comment on lines +175 to +178
public static Set<BlockPos> getPortalPortPositions(ServerLevel serverLevel) {
return PortalPortTracker.get(serverLevel).getAll();
}

Comment on lines +179 to +190
private static @Nullable RoboTarget findCrossLevelTarget(ServerLevel level, String address, VirtualRobo robo, UUID logisticsNetworkId) {
PlayerTarget playerTarget = PlayerTarget.fromAddress(level, address, logisticsNetworkId);
if (playerTarget != null) {
CreateMobilePackages.LOGGER.debug(" found player target: {}", address);
return playerTarget;
}

BeePortBlockEntity addressedPort = CMPHelper.getClosestBeePort(level, address, BlockPos.containing(robo.getCurrentPos()), robo, logisticsNetworkId);
if (addressedPort != null) {
CreateMobilePackages.LOGGER.debug(" found addressed port: {} at {}", address, addressedPort.getBlockPos());
return new BeePortBlockEntityTarget(addressedPort);
}
Comment on lines +355 to +366
// Check if the item can be sent to a player (search all levels).
if (level instanceof ServerLevel serverLevel && serverLevel.getServer() != null) {
for (ServerLevel candidateLevel : serverLevel.getServer().getAllLevels()) {
for (Player player : candidateLevel.players()) {
if (!playerUUIDs.contains(player.getUUID())) {
continue; // skip players not in the logistics network
}
if (CMPHelper.doesAddressMatchPlayer(player, address) && CMPHelper.isWithinRange(candidateLevel, player.blockPosition(), this.getBlockPos())) {
sendToPlayer(player, itemStack, slot);
return;
}
}
@Override
public @Nullable BlockState getStateForPlacement(BlockPlaceContext context) {
return this.defaultBlockState()
.setValue(IS_OPEN_TEXTURE, true)
Comment on lines +427 to +437
ServerLevel destinationLevel = serverLevel.getServer().getLevel(transferDestinationDimension);
if (destinationLevel == null) {
CreateMobilePackages.LOGGER.warn("Robo {} transfer failed: destination dimension no longer loaded", getId());
invalidateTarget();
return false;
}
if (!destinationLevel.getBlockState(transferDestinationPortalPos).is(de.theidler.create_mobile_packages.index.CMPBlocks.PORTAL_PORT.get())) {
CreateMobilePackages.LOGGER.warn("Robo {} transfer failed: destination portal at {} no longer exists", getId(), transferDestinationPortalPos);
invalidateTarget();
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.21.1 enhancement New feature or request

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

[feature] Portal Port?

2 participants