Beta 7 Commit

This commit is contained in:
craisinlord committed 2026-07-09 16:39:59 -05:00
1 parent e74ee5733a
commit 89d9aff0b9
8 files changed
+48 -31

No files matched your search

@@ -25,10 +25,4 @@ public final class AppleCowEntityVariants {
super(entityType, level);
}
}
public static class HoneyedAppleCow extends AppleCowEntity {
public HoneyedAppleCow(EntityType<? extends Cow> entityType, Level level) {
super(entityType, level);
}
}
}
@@ -214,6 +214,10 @@ public final class PermanentPortalShape {
for (int y = -1; y <= 3; y++) {
for (int x = -1; x <= 2; x++) {
BlockPos pos = bottomLeft.relative(widthDirection, x).above(y);
boolean cornerSpot = (x == -1 || x == 2) && (y == -1 || y == 3);
if (cornerSpot) {
continue;
}
if (x == -1 || x == 2 || y == -1 || y == 3) {
level.setBlock(pos, frameState, Block.UPDATE_ALL);
} else {
@@ -233,6 +237,10 @@ public final class PermanentPortalShape {
BlockPos pos = bottomLeft.relative(widthDirection, x).above(y);
BlockState state = level.getBlockState(pos);
boolean frameSpot = x == -1 || x == 2 || y == -1 || y == 3;
boolean cornerSpot = (x == -1 || x == 2) && (y == -1 || y == 3);
if (cornerSpot) {
continue;
}
if (frameSpot) {
if (!state.isAir() && !state.is(frameBlock) && !state.canBeReplaced()) {
return false;
@@ -22,6 +22,7 @@ import org.jetbrains.annotations.Nullable;
public final class PermanentPortalTeleporter {
private static final int SEARCH_RADIUS = 24;
private static final int VERTICAL_SEARCH = 24;
private static final int EXISTING_PORTAL_SEARCH_RADIUS = 48;
private PermanentPortalTeleporter() {
}
@@ -64,6 +65,11 @@ public final class PermanentPortalTeleporter {
Vec3 safe = findSafeArrivalPosition(entity, destination, preferredPos);
if (safe != null) {
PermanentPortalShape nearbyActive = findActiveNearby(destination, BlockPos.containing(safe), type);
if (nearbyActive != null) {
return nearbyActive.center();
}
PermanentPortalShape created = createReturnPortal(destination, safe, type);
if (created != null) {
return created.center();
@@ -74,6 +80,33 @@ public final class PermanentPortalTeleporter {
return createFallbackPlatform(destination, preferredPos, type.platformBlock().defaultBlockState());
}
@Nullable
private static PermanentPortalShape findActiveNearby(ServerLevel level, BlockPos center, PermanentPortalType type) {
for (int radius = 0; radius <= EXISTING_PORTAL_SEARCH_RADIUS; radius++) {
for (int xOff = -radius; xOff <= radius; xOff++) {
for (int yOff = -radius; yOff <= radius; yOff++) {
for (int zOff = -radius; zOff <= radius; zOff++) {
if (radius > 0 && Math.abs(xOff) != radius && Math.abs(yOff) != radius && Math.abs(zOff) != radius) {
continue;
}
BlockPos candidate = center.offset(xOff, yOff, zOff);
PermanentPortalShape xShape = PermanentPortalShape.findActive(level, candidate, type, Direction.Axis.X);
if (xShape != null) {
return xShape;
}
PermanentPortalShape zShape = PermanentPortalShape.findActive(level, candidate, type, Direction.Axis.Z);
if (zShape != null) {
return zShape;
}
}
}
}
}
return null;
}
@Nullable
private static Vec3 findSafeArrivalPosition(Entity entity, ServerLevel destination, BlockPos preferredPos) {
int[] yRange = getDimensionYRange(destination);
@@ -134,7 +134,6 @@
"entity.antarchy.apple_cow": "Apple Cow",
"entity.antarchy.golden_apple_cow": "Golden Apple Cow",
"entity.antarchy.enchanted_golden_apple_cow": "Enchanted Golden Apple Cow",
"entity.antarchy.honeyed_apple_cow": "Honeyed Apple Cow",
"entity.antarchy.easter_bunny": "Easter Bunny",
"entity.antarchy.glimmer": "Glimmer",
"entity.antarchy.flying_squirrel": "Flying Squirrel",
@@ -356,7 +355,6 @@
"item.antarchy.rainbow_ant_spawn_egg": "Rainbow Ant Spawn Egg",
"item.antarchy.golden_apple_cow_spawn_egg": "Golden Apple Cow Spawn Egg",
"item.antarchy.enchanted_golden_apple_cow_spawn_egg": "Enchanted Golden Apple Cow Spawn Egg",
"item.antarchy.honeyed_apple_cow_spawn_egg": "Honeyed Apple Cow Spawn Egg",
"item.antarchy.dr_trayaurus_spawn_egg": "Dr. Trayaurus Spawn Egg",
"item.antarchy.easter_bunny_spawn_egg": "Easter Bunny Spawn Egg",
"item.antarchy.glimmer_spawn_egg": "Glimmer Spawn Egg",