Beta 7 Commit
This commit is contained in:
1 parent
e74ee5733a
commit
89d9aff0b9
8 files changed
+48
-31
No files matched your search
-6
@@ -25,10 +25,4 @@ public final class AppleCowEntityVariants {
|
|||||||
super(entityType, level);
|
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 y = -1; y <= 3; y++) {
|
||||||
for (int x = -1; x <= 2; x++) {
|
for (int x = -1; x <= 2; x++) {
|
||||||
BlockPos pos = bottomLeft.relative(widthDirection, x).above(y);
|
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) {
|
if (x == -1 || x == 2 || y == -1 || y == 3) {
|
||||||
level.setBlock(pos, frameState, Block.UPDATE_ALL);
|
level.setBlock(pos, frameState, Block.UPDATE_ALL);
|
||||||
} else {
|
} else {
|
||||||
@@ -233,6 +237,10 @@ public final class PermanentPortalShape {
|
|||||||
BlockPos pos = bottomLeft.relative(widthDirection, x).above(y);
|
BlockPos pos = bottomLeft.relative(widthDirection, x).above(y);
|
||||||
BlockState state = level.getBlockState(pos);
|
BlockState state = level.getBlockState(pos);
|
||||||
boolean frameSpot = x == -1 || x == 2 || y == -1 || y == 3;
|
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 (frameSpot) {
|
||||||
if (!state.isAir() && !state.is(frameBlock) && !state.canBeReplaced()) {
|
if (!state.isAir() && !state.is(frameBlock) && !state.canBeReplaced()) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
+33
@@ -22,6 +22,7 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
public final class PermanentPortalTeleporter {
|
public final class PermanentPortalTeleporter {
|
||||||
private static final int SEARCH_RADIUS = 24;
|
private static final int SEARCH_RADIUS = 24;
|
||||||
private static final int VERTICAL_SEARCH = 24;
|
private static final int VERTICAL_SEARCH = 24;
|
||||||
|
private static final int EXISTING_PORTAL_SEARCH_RADIUS = 48;
|
||||||
|
|
||||||
private PermanentPortalTeleporter() {
|
private PermanentPortalTeleporter() {
|
||||||
}
|
}
|
||||||
@@ -64,6 +65,11 @@ public final class PermanentPortalTeleporter {
|
|||||||
|
|
||||||
Vec3 safe = findSafeArrivalPosition(entity, destination, preferredPos);
|
Vec3 safe = findSafeArrivalPosition(entity, destination, preferredPos);
|
||||||
if (safe != null) {
|
if (safe != null) {
|
||||||
|
PermanentPortalShape nearbyActive = findActiveNearby(destination, BlockPos.containing(safe), type);
|
||||||
|
if (nearbyActive != null) {
|
||||||
|
return nearbyActive.center();
|
||||||
|
}
|
||||||
|
|
||||||
PermanentPortalShape created = createReturnPortal(destination, safe, type);
|
PermanentPortalShape created = createReturnPortal(destination, safe, type);
|
||||||
if (created != null) {
|
if (created != null) {
|
||||||
return created.center();
|
return created.center();
|
||||||
@@ -74,6 +80,33 @@ public final class PermanentPortalTeleporter {
|
|||||||
return createFallbackPlatform(destination, preferredPos, type.platformBlock().defaultBlockState());
|
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
|
@Nullable
|
||||||
private static Vec3 findSafeArrivalPosition(Entity entity, ServerLevel destination, BlockPos preferredPos) {
|
private static Vec3 findSafeArrivalPosition(Entity entity, ServerLevel destination, BlockPos preferredPos) {
|
||||||
int[] yRange = getDimensionYRange(destination);
|
int[] yRange = getDimensionYRange(destination);
|
||||||
|
|||||||
@@ -134,7 +134,6 @@
|
|||||||
"entity.antarchy.apple_cow": "Apple Cow",
|
"entity.antarchy.apple_cow": "Apple Cow",
|
||||||
"entity.antarchy.golden_apple_cow": "Golden Apple Cow",
|
"entity.antarchy.golden_apple_cow": "Golden Apple Cow",
|
||||||
"entity.antarchy.enchanted_golden_apple_cow": "Enchanted 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.easter_bunny": "Easter Bunny",
|
||||||
"entity.antarchy.glimmer": "Glimmer",
|
"entity.antarchy.glimmer": "Glimmer",
|
||||||
"entity.antarchy.flying_squirrel": "Flying Squirrel",
|
"entity.antarchy.flying_squirrel": "Flying Squirrel",
|
||||||
@@ -356,7 +355,6 @@
|
|||||||
"item.antarchy.rainbow_ant_spawn_egg": "Rainbow Ant Spawn Egg",
|
"item.antarchy.rainbow_ant_spawn_egg": "Rainbow Ant Spawn Egg",
|
||||||
"item.antarchy.golden_apple_cow_spawn_egg": "Golden Apple Cow 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.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.dr_trayaurus_spawn_egg": "Dr. Trayaurus Spawn Egg",
|
||||||
"item.antarchy.easter_bunny_spawn_egg": "Easter Bunny Spawn Egg",
|
"item.antarchy.easter_bunny_spawn_egg": "Easter Bunny Spawn Egg",
|
||||||
"item.antarchy.glimmer_spawn_egg": "Glimmer Spawn Egg",
|
"item.antarchy.glimmer_spawn_egg": "Glimmer Spawn Egg",
|
||||||
|
|||||||
@@ -1974,7 +1974,7 @@ public final class AntarchyFabricContent {
|
|||||||
"red_ant_spawn_egg", "brown_ant_spawn_egg", "rainbow_ant_spawn_egg", "termite_spawn_egg",
|
"red_ant_spawn_egg", "brown_ant_spawn_egg", "rainbow_ant_spawn_egg", "termite_spawn_egg",
|
||||||
"moleworm_spawn_egg", "mantis_spawn_egg", "alpha_mantis_spawn_egg", "rolly_polly_spawn_egg", "molevore_spawn_egg", "triffid_spawn_egg",
|
"moleworm_spawn_egg", "mantis_spawn_egg", "alpha_mantis_spawn_egg", "rolly_polly_spawn_egg", "molevore_spawn_egg", "triffid_spawn_egg",
|
||||||
"apple_cow_spawn_egg", "golden_apple_cow_spawn_egg", "enchanted_golden_apple_cow_spawn_egg",
|
"apple_cow_spawn_egg", "golden_apple_cow_spawn_egg", "enchanted_golden_apple_cow_spawn_egg",
|
||||||
"honeyed_apple_cow_spawn_egg", "dr_trayaurus_spawn_egg", "wasp_spawn_egg",
|
"dr_trayaurus_spawn_egg", "wasp_spawn_egg",
|
||||||
"bomber_spawn_egg", "jumpy_bug_spawn_egg", "stink_bug_spawn_egg", "cloud_shark_spawn_egg", "kraken_spawn_egg", "missile_squid_spawn_egg", "octopus_bomb_spawn_egg",
|
"bomber_spawn_egg", "jumpy_bug_spawn_egg", "stink_bug_spawn_egg", "cloud_shark_spawn_egg", "kraken_spawn_egg", "missile_squid_spawn_egg", "octopus_bomb_spawn_egg",
|
||||||
"nightmare_spawn_egg", "bed_bug_spawn_egg", "lucid_spawn_egg", "scorpion_spawn_egg",
|
"nightmare_spawn_egg", "bed_bug_spawn_egg", "lucid_spawn_egg", "scorpion_spawn_egg",
|
||||||
"basilisk_spawn_egg", "emperor_scorpion_spawn_egg", "toreterror_spawn_egg",
|
"basilisk_spawn_egg", "emperor_scorpion_spawn_egg", "toreterror_spawn_egg",
|
||||||
|
|||||||
-4
@@ -4,7 +4,6 @@ import com.craisinlord.antarchy.Antarchy;
|
|||||||
import com.craisinlord.antarchy.content.entity.AppleCowEntityVariants.AppleCow;
|
import com.craisinlord.antarchy.content.entity.AppleCowEntityVariants.AppleCow;
|
||||||
import com.craisinlord.antarchy.content.entity.AppleCowEntityVariants.EnchantedGoldenAppleCow;
|
import com.craisinlord.antarchy.content.entity.AppleCowEntityVariants.EnchantedGoldenAppleCow;
|
||||||
import com.craisinlord.antarchy.content.entity.AppleCowEntityVariants.GoldenAppleCow;
|
import com.craisinlord.antarchy.content.entity.AppleCowEntityVariants.GoldenAppleCow;
|
||||||
import com.craisinlord.antarchy.content.entity.AppleCowEntityVariants.HoneyedAppleCow;
|
|
||||||
import com.craisinlord.antarchy.content.entity.cloud_shark.CloudSharkEntity;
|
import com.craisinlord.antarchy.content.entity.cloud_shark.CloudSharkEntity;
|
||||||
import com.craisinlord.antarchy.content.entity.BedBugEntity;
|
import com.craisinlord.antarchy.content.entity.BedBugEntity;
|
||||||
import com.craisinlord.antarchy.content.entity.BomberEntity;
|
import com.craisinlord.antarchy.content.entity.BomberEntity;
|
||||||
@@ -194,9 +193,6 @@ public final class AntarchyNeoforgeEntites {
|
|||||||
() -> buildCowType(GoldenAppleCow::new, "golden_apple_cow"));
|
() -> buildCowType(GoldenAppleCow::new, "golden_apple_cow"));
|
||||||
public static final DeferredHolder<EntityType<?>, EntityType<EnchantedGoldenAppleCow>> ENCHANTED_GOLDEN_APPLE_COW = ENTITY_TYPES.register("enchanted_golden_apple_cow",
|
public static final DeferredHolder<EntityType<?>, EntityType<EnchantedGoldenAppleCow>> ENCHANTED_GOLDEN_APPLE_COW = ENTITY_TYPES.register("enchanted_golden_apple_cow",
|
||||||
() -> buildCowType(EnchantedGoldenAppleCow::new, "enchanted_golden_apple_cow"));
|
() -> buildCowType(EnchantedGoldenAppleCow::new, "enchanted_golden_apple_cow"));
|
||||||
public static final DeferredHolder<EntityType<?>, EntityType<HoneyedAppleCow>> HONEYED_APPLE_COW = CREATE_LOADED
|
|
||||||
? ENTITY_TYPES.register("honeyed_apple_cow", () -> buildCowType(HoneyedAppleCow::new, "honeyed_apple_cow"))
|
|
||||||
: null;
|
|
||||||
public static final DeferredHolder<EntityType<?>, EntityType<DrTrayaurusEntity>> DR_TRAYAURUS = ENTITY_TYPES.register("dr_trayaurus",
|
public static final DeferredHolder<EntityType<?>, EntityType<DrTrayaurusEntity>> DR_TRAYAURUS = ENTITY_TYPES.register("dr_trayaurus",
|
||||||
() -> EntityType.Builder.of(DrTrayaurusEntity::new, MobCategory.MISC)
|
() -> EntityType.Builder.of(DrTrayaurusEntity::new, MobCategory.MISC)
|
||||||
.sized(0.6F, 1.95F)
|
.sized(0.6F, 1.95F)
|
||||||
|
|||||||
+6
@@ -40,6 +40,12 @@ public class AntarchyNeoforgeEntityAttributes {
|
|||||||
event.put(AntarchyNeoforgeEntites.APPLE_COW.get(), cowAttributes);
|
event.put(AntarchyNeoforgeEntites.APPLE_COW.get(), cowAttributes);
|
||||||
event.put(AntarchyNeoforgeEntites.GOLDEN_APPLE_COW.get(), cowAttributes);
|
event.put(AntarchyNeoforgeEntites.GOLDEN_APPLE_COW.get(), cowAttributes);
|
||||||
event.put(AntarchyNeoforgeEntites.ENCHANTED_GOLDEN_APPLE_COW.get(), cowAttributes);
|
event.put(AntarchyNeoforgeEntites.ENCHANTED_GOLDEN_APPLE_COW.get(), cowAttributes);
|
||||||
|
event.put(AntarchyNeoforgeEntites.TERMITE.get(), buildAntAttributes(
|
||||||
|
AntarchySettings.termiteHealth(),
|
||||||
|
AntarchySettings.termiteMovementSpeed(),
|
||||||
|
AntarchySettings.termiteAttackDamage()
|
||||||
|
).build());
|
||||||
|
event.put(AntarchyNeoforgeEntites.ROLLY_POLLY.get(), RollyPollyEntity.createAttributes().build());
|
||||||
event.put(AntarchyNeoforgeEntites.DR_TRAYAURUS.get(), Villager.createAttributes().build());
|
event.put(AntarchyNeoforgeEntites.DR_TRAYAURUS.get(), Villager.createAttributes().build());
|
||||||
event.put(AntarchyNeoforgeEntites.CLOUD_SHARK.get(), CloudSharkEntity.createAttributes().build());
|
event.put(AntarchyNeoforgeEntites.CLOUD_SHARK.get(), CloudSharkEntity.createAttributes().build());
|
||||||
event.put(AntarchyNeoforgeEntites.KRAKEN.get(), KrakenEntity.createAttributes().build());
|
event.put(AntarchyNeoforgeEntites.KRAKEN.get(), KrakenEntity.createAttributes().build());
|
||||||
|
|||||||
-18
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"neoforge:conditions": [
|
|
||||||
{
|
|
||||||
"type": "neoforge:mod_loaded",
|
|
||||||
"modid": "create"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "neoforge:add_spawns",
|
|
||||||
"biomes": "#antarchy:honeyed_apple_cow_spawn_biomes",
|
|
||||||
"spawners": [
|
|
||||||
{
|
|
||||||
"type": "antarchy:honeyed_apple_cow",
|
|
||||||
"weight": 2,
|
|
||||||
"minCount": 1,
|
|
||||||
"maxCount": 2
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
Reference in new issue
Block a user