bumped required infinity version

fixed server client split issue fr this time
Buffed frying pan
Fixed prince princess anim bug
This commit is contained in:
craisinlord committed 2026-09-23 20:49:57 -05:00
1 parent 5010b6b7e1
commit 23599c4c59
52 files changed
+653 -62

No files matched your search

@@ -1,5 +1,6 @@
package com.craisinlord.antarchy; package com.craisinlord.antarchy;
import com.craisinlord.antarchy.content.computer.AntarchyArchiveLocators;
import com.craisinlord.antarchy.content.util.AttributeRangeInit; import com.craisinlord.antarchy.content.util.AttributeRangeInit;
import com.craisinlord.antarchy.content.worldgen.VillagePoolAdditions; import com.craisinlord.antarchy.content.worldgen.VillagePoolAdditions;
import com.craisinlord.integrated_api.events.lifecycle.ServerGoingToStartEvent; import com.craisinlord.integrated_api.events.lifecycle.ServerGoingToStartEvent;
@@ -15,6 +16,7 @@ public class Antarchy {
public static void init() { public static void init() {
AttributeRangeInit.apply(); AttributeRangeInit.apply();
AntarchyArchiveLocators.register();
ServerGoingToStartEvent.EVENT.addListener(Antarchy::serverAboutToStart); ServerGoingToStartEvent.EVENT.addListener(Antarchy::serverAboutToStart);
} }
private static void serverAboutToStart(final ServerGoingToStartEvent event) { private static void serverAboutToStart(final ServerGoingToStartEvent event) {
@@ -7,7 +7,7 @@ public final class InfinityCompatVersion {
private static final Pattern VERSION_PARTS = Pattern.compile("(\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))?"); private static final Pattern VERSION_PARTS = Pattern.compile("(\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))?");
private static final int REQUIRED_MAJOR = 2; private static final int REQUIRED_MAJOR = 2;
private static final int REQUIRED_MINOR = 7; private static final int REQUIRED_MINOR = 7;
private static final int REQUIRED_PATCH = 2; private static final int REQUIRED_PATCH = 3;
private InfinityCompatVersion() { private InfinityCompatVersion() {
} }
@@ -0,0 +1,82 @@
package com.craisinlord.antarchy.compat.infinity;
import com.craisinlord.antarchy.Antarchy;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceLocation;
import java.io.Reader;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public final class InfinityConfigRefresh {
private static final Map<String, Registry<?>> CHECKED_FILES = Map.of(
"mobs.json", BuiltInRegistries.ENTITY_TYPE,
"items.json", BuiltInRegistries.ITEM,
"effects.json", BuiltInRegistries.MOB_EFFECT
);
private InfinityConfigRefresh() {
}
public static void refreshIfStale(Path configDir) {
Path modularDir = configDir.resolve("infinity").resolve("modular");
Path invocationLock = modularDir.resolve("invocation.lock");
if (!Files.exists(invocationLock)) {
return;
}
Path antarchyDir = modularDir.resolve(Antarchy.MODID);
List<String> staleIds = new ArrayList<>();
CHECKED_FILES.forEach((fileName, registry) -> collectStaleIds(antarchyDir.resolve(fileName), registry, staleIds));
if (staleIds.isEmpty()) {
return;
}
try {
Files.delete(invocationLock);
Antarchy.LOGGER.info(
"[Antarchy] Infinite Dimensions config lists unregistered Antarchy content {}; its config will regenerate on next world join",
staleIds
);
} catch (Exception exception) {
Antarchy.LOGGER.warn("[Antarchy] Failed to reset stale Infinite Dimensions config at {}", invocationLock, exception);
}
}
private static void collectStaleIds(Path file, Registry<?> registry, List<String> staleIds) {
if (!Files.exists(file)) {
return;
}
try (Reader reader = Files.newBufferedReader(file, StandardCharsets.UTF_8)) {
JsonElement root = JsonParser.parseReader(reader);
if (!root.isJsonObject() || !root.getAsJsonObject().has("elements")) {
return;
}
for (JsonElement element : root.getAsJsonObject().getAsJsonArray("elements")) {
if (!element.isJsonObject()) {
continue;
}
JsonObject entry = element.getAsJsonObject();
if (!entry.has("key")) {
continue;
}
String key = entry.get("key").getAsString();
ResourceLocation id = ResourceLocation.tryParse(key);
if (id != null && Antarchy.MODID.equals(id.getNamespace()) && !registry.containsKey(id)) {
staleIds.add(key);
}
}
} catch (Exception exception) {
Antarchy.LOGGER.warn("[Antarchy] Failed to read Infinite Dimensions config {}", file, exception);
}
}
}
@@ -50,24 +50,10 @@ public final class QueenLocateCommand {
int originX = Mth.floor(source.getPosition().x); int originX = Mth.floor(source.getPosition().x);
int originZ = Mth.floor(source.getPosition().z); int originZ = Mth.floor(source.getPosition().z);
int cellX = Math.floorDiv(originX, QueenTrailGrid.SPACING); NearestSite nearest = findNearestSite(thoraxis, originX, originZ);
int cellZ = Math.floorDiv(originZ, QueenTrailGrid.SPACING); if (nearest != null) {
List<QueenTrailGrid.Site> sites = new ArrayList<>(); QueenTrailGrid.Site site = nearest.site();
for (int x = cellX - SEARCH_RADIUS_CELLS; x <= cellX + SEARCH_RADIUS_CELLS; x++) { QueenTrailSpawnMarkerBlockEntity marker = nearest.marker();
for (int z = cellZ - SEARCH_RADIUS_CELLS; z <= cellZ + SEARCH_RADIUS_CELLS; z++) {
sites.add(QueenTrailGrid.site(thoraxis.getSeed(), x, z));
}
}
sites.sort(Comparator.comparingDouble(site -> distanceSquared(originX, originZ, site)));
int checks = Math.min(MAX_SITE_CHECKS, sites.size());
for (int index = 0; index < checks; index++) {
QueenTrailGrid.Site site = sites.get(index);
thoraxis.getChunk(site.terminalX() >> 4, site.terminalZ() >> 4);
QueenTrailSpawnMarkerBlockEntity marker = findMarker(thoraxis, site);
if (marker == null) {
continue;
}
QueenEntity queen = marker.spawnNow(thoraxis); QueenEntity queen = marker.spawnNow(thoraxis);
if (queen == null && !marker.isConsumed()) { if (queen == null && !marker.isConsumed()) {
source.sendFailure(Component.literal("A Queen spawn site was found, but the Queen could not spawn at a clear location. The site can be retried later.")); source.sendFailure(Component.literal("A Queen spawn site was found, but the Queen could not spawn at a clear location. The site can be retried later."));
@@ -96,6 +82,33 @@ public final class QueenLocateCommand {
return 0; return 0;
} }
/** Finds the nearest generated Queen spawn site without spawning her. Loads (and may generate) the checked chunks. */
public static NearestSite findNearestSite(ServerLevel thoraxis, int originX, int originZ) {
int cellX = Math.floorDiv(originX, QueenTrailGrid.SPACING);
int cellZ = Math.floorDiv(originZ, QueenTrailGrid.SPACING);
List<QueenTrailGrid.Site> sites = new ArrayList<>();
for (int x = cellX - SEARCH_RADIUS_CELLS; x <= cellX + SEARCH_RADIUS_CELLS; x++) {
for (int z = cellZ - SEARCH_RADIUS_CELLS; z <= cellZ + SEARCH_RADIUS_CELLS; z++) {
sites.add(QueenTrailGrid.site(thoraxis.getSeed(), x, z));
}
}
sites.sort(Comparator.comparingDouble(site -> distanceSquared(originX, originZ, site)));
int checks = Math.min(MAX_SITE_CHECKS, sites.size());
for (int index = 0; index < checks; index++) {
QueenTrailGrid.Site site = sites.get(index);
thoraxis.getChunk(site.terminalX() >> 4, site.terminalZ() >> 4);
QueenTrailSpawnMarkerBlockEntity marker = findMarker(thoraxis, site);
if (marker != null) {
return new NearestSite(site, marker);
}
}
return null;
}
public record NearestSite(QueenTrailGrid.Site site, QueenTrailSpawnMarkerBlockEntity marker) {
}
private static QueenTrailSpawnMarkerBlockEntity findMarker(ServerLevel level, QueenTrailGrid.Site site) { private static QueenTrailSpawnMarkerBlockEntity findMarker(ServerLevel level, QueenTrailGrid.Site site) {
BlockPos.MutableBlockPos cursor = new BlockPos.MutableBlockPos(site.terminalX(), level.getMinBuildHeight(), site.terminalZ()); BlockPos.MutableBlockPos cursor = new BlockPos.MutableBlockPos(site.terminalX(), level.getMinBuildHeight(), site.terminalZ());
for (int y = level.getMinBuildHeight(); y < level.getMaxBuildHeight(); y++) { for (int y = level.getMinBuildHeight(); y < level.getMaxBuildHeight(); y++) {
@@ -0,0 +1,32 @@
package com.craisinlord.antarchy.content.computer;
import com.craisinlord.antarchy.Antarchy;
import com.craisinlord.antarchy.content.command.QueenLocateCommand;
import com.craisinlord.antarchy.content.worldgen.elythia.KingsTreeGrid;
import com.craisinlord.antos.api.archive.ArchiveLocatorRegistry;
import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.levelgen.Heightmap;
/** Archive coordinate lookups for royals that live on grids rather than in vanilla structures. */
public final class AntarchyArchiveLocators {
private AntarchyArchiveLocators() {
}
public static void register() {
ArchiveLocatorRegistry.register(id("queen"), (level, origin) -> {
QueenLocateCommand.NearestSite nearest = QueenLocateCommand.findNearestSite(level, origin.getX(), origin.getZ());
return nearest == null ? null : nearest.marker().getSpawnPos();
});
ArchiveLocatorRegistry.register(id("kings_tree"), (level, origin) -> {
BlockPos center = KingsTreeGrid.nearestTreeCenter(origin);
int surfaceY = level.getChunkSource().getGenerator().getBaseHeight(center.getX(), center.getZ(),
Heightmap.Types.WORLD_SURFACE_WG, level, level.getChunkSource().randomState());
return new BlockPos(center.getX(), surfaceY, center.getZ());
});
}
private static ResourceLocation id(String path) {
return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, path);
}
}
@@ -646,7 +646,7 @@ public final class CreativeTabContents {
acceptPotionFamily(output, potionPath); acceptPotionFamily(output, potionPath);
} }
for (String diskId : List.of("antarchy:introduction", "antarchy:toreterror_arena", "antarchy:high_fructose_corn_syrup", for (String diskId : List.of("antarchy:introduction", "antarchy:toreterror_arena", "antarchy:high_fructose_corn_syrup",
"antarchy:elythia", "antarchy:flying_squirrel", "antarchy:brutalfly", "antarchy:rainbow_ant", "antarchy:cavaryn", "antarchy:hercules_beetle", "antarchy:thoraxis", "antarchy:temporal_fields", "antarchy:bloodglass", "antarchy:vortex")) { "antarchy:elythia", "antarchy:flying_squirrel", "antarchy:brutalfly", "antarchy:rainbow_ant", "antarchy:kraken", "antarchy:cavaryn", "antarchy:hercules_beetle", "antarchy:thoraxis", "antarchy:temporal_fields", "antarchy:bloodglass", "antarchy:vortex")) {
ItemStack disk = new ItemStack(com.craisinlord.antos.content.AntOSObjects.FLOPPY_DISK.get()); ItemStack disk = new ItemStack(com.craisinlord.antos.content.AntOSObjects.FLOPPY_DISK.get());
disk.set(com.craisinlord.antos.content.AntOSObjects.FLOPPY_DISK_COMPONENT.get(), ResourceLocation.parse(diskId)); disk.set(com.craisinlord.antos.content.AntOSObjects.FLOPPY_DISK_COMPONENT.get(), ResourceLocation.parse(diskId));
output.accept(disk); output.accept(disk);
@@ -26,7 +26,7 @@ public final class ComputerScientistTradeManager extends SimpleJsonResourceReloa
private static final String DIRECTORY = "computer_scientist_trades"; private static final String DIRECTORY = "computer_scientist_trades";
private static final List<ResourceLocation> GENERAL_DISKS = List.of( private static final List<ResourceLocation> GENERAL_DISKS = List.of(
id("introduction"), id("high_fructose_corn_syrup"), id("introduction"), id("high_fructose_corn_syrup"),
id("elythia"), id("flying_squirrel"), id("rainbow_ant"), id("cavaryn"), id("thoraxis"), id("elythia"), id("flying_squirrel"), id("rainbow_ant"), id("kraken"), id("cavaryn"), id("thoraxis"),
id("temporal_fields"), id("bloodglass"), id("vortex")); id("temporal_fields"), id("bloodglass"), id("vortex"));
private static volatile List<TradeEntry> loadedTrades = List.of(); private static volatile List<TradeEntry> loadedTrades = List.of();
@@ -31,7 +31,6 @@ import net.minecraft.world.entity.SlotAccess;
import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.inventory.ClickAction; import net.minecraft.world.inventory.ClickAction;
import net.minecraft.world.inventory.Slot; import net.minecraft.world.inventory.Slot;
import com.craisinlord.antarchy.Antarchy;
import com.craisinlord.antarchy.content.menu.GiantFryingPanMenu; import com.craisinlord.antarchy.content.menu.GiantFryingPanMenu;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.EquipmentSlot;
@@ -133,14 +132,11 @@ public class GiantFryingPanItem extends SwordItem implements GeoItem {
ItemStack pan = player.getItemInHand(hand); ItemStack pan = player.getItemInHand(hand);
InteractionHand foodHand = hand == InteractionHand.MAIN_HAND ? InteractionHand.OFF_HAND : InteractionHand.MAIN_HAND; InteractionHand foodHand = hand == InteractionHand.MAIN_HAND ? InteractionHand.OFF_HAND : InteractionHand.MAIN_HAND;
ItemStack food = player.getItemInHand(foodHand); ItemStack food = player.getItemInHand(foodHand);
Antarchy.LOGGER.info("[FryingPan] use client={} hand={} shift={} pan={} otherHand={}",
level.isClientSide, hand, player.isShiftKeyDown(), pan, food);
if (player.isShiftKeyDown()) { if (player.isShiftKeyDown()) {
openMenu(level, player, hand); openMenu(level, player, hand);
return InteractionResultHolder.sidedSuccess(pan, level.isClientSide); return InteractionResultHolder.sidedSuccess(pan, level.isClientSide);
} }
if (!GiantFryingPanStorage.isCampfireInput(player, food)) { if (!GiantFryingPanStorage.isCampfireInput(player, food)) {
Antarchy.LOGGER.info("[FryingPan] use client={} other hand item is not a campfire input", level.isClientSide);
return InteractionResultHolder.pass(pan); return InteractionResultHolder.pass(pan);
} }
return insertFromHand(level, player, pan, food) return insertFromHand(level, player, pan, food)
@@ -154,19 +150,25 @@ public class GiantFryingPanItem extends SwordItem implements GeoItem {
ItemStack held = player.getMainHandItem(); ItemStack held = player.getMainHandItem();
if (!(pan.getItem() instanceof GiantFryingPanItem) || held.getItem() instanceof GiantFryingPanItem) return InteractionResult.PASS; if (!(pan.getItem() instanceof GiantFryingPanItem) || held.getItem() instanceof GiantFryingPanItem) return InteractionResult.PASS;
if (player.isShiftKeyDown()) { if (player.isShiftKeyDown()) {
Antarchy.LOGGER.info("[FryingPan] offhand pan shift-use client={} mainHand={}", level.isClientSide, held);
openMenu(level, player, InteractionHand.OFF_HAND); openMenu(level, player, InteractionHand.OFF_HAND);
return InteractionResult.sidedSuccess(level.isClientSide); return InteractionResult.sidedSuccess(level.isClientSide);
} }
if (!GiantFryingPanStorage.isCampfireInput(player, held)) return InteractionResult.PASS; if (!GiantFryingPanStorage.isCampfireInput(player, held)) return InteractionResult.PASS;
Antarchy.LOGGER.info("[FryingPan] offhand pan insert client={} mainHand={}", level.isClientSide, held);
return insertFromHand(level, player, pan, held) ? InteractionResult.sidedSuccess(level.isClientSide) : InteractionResult.FAIL; return insertFromHand(level, player, pan, held) ? InteractionResult.sidedSuccess(level.isClientSide) : InteractionResult.FAIL;
} }
public static void openHeldMenu(Player player) {
if (!player.isShiftKeyDown()) return;
if (player.getMainHandItem().getItem() instanceof GiantFryingPanItem) {
openMenu(player.level(), player, InteractionHand.MAIN_HAND);
} else if (player.getOffhandItem().getItem() instanceof GiantFryingPanItem) {
openMenu(player.level(), player, InteractionHand.OFF_HAND);
}
}
private static void openMenu(Level level, Player player, InteractionHand hand) { private static void openMenu(Level level, Player player, InteractionHand hand) {
if (level.isClientSide) return; if (level.isClientSide || player.containerMenu instanceof GiantFryingPanMenu) return;
int panSlot = hand == InteractionHand.MAIN_HAND ? player.getInventory().selected : Inventory.SLOT_OFFHAND; int panSlot = hand == InteractionHand.MAIN_HAND ? player.getInventory().selected : Inventory.SLOT_OFFHAND;
Antarchy.LOGGER.info("[FryingPan] opening menu for {} panSlot={}", player.getName().getString(), panSlot);
player.openMenu(new SimpleMenuProvider( player.openMenu(new SimpleMenuProvider(
(containerId, inventory, ignored) -> new GiantFryingPanMenu(containerId, inventory, panSlot), (containerId, inventory, ignored) -> new GiantFryingPanMenu(containerId, inventory, panSlot),
Component.translatable("item.antarchy.giant_frying_pan"))); Component.translatable("item.antarchy.giant_frying_pan")));
@@ -176,11 +178,9 @@ public class GiantFryingPanItem extends SwordItem implements GeoItem {
GiantFryingPanStorage storage = new GiantFryingPanStorage(pan, player); GiantFryingPanStorage storage = new GiantFryingPanStorage(pan, player);
ItemStack single = food.copyWithCount(1); ItemStack single = food.copyWithCount(1);
if (!storage.insertOne(single)) { if (!storage.insertOne(single)) {
Antarchy.LOGGER.info("[FryingPan] insert failed client={} food={} (pan full or not cookable)", level.isClientSide, food);
return false; return false;
} }
if (!player.getAbilities().instabuild) food.shrink(1); if (!player.getAbilities().instabuild) food.shrink(1);
Antarchy.LOGGER.info("[FryingPan] inserted client={} food={}", level.isClientSide, single.getItem());
if (!level.isClientSide) { if (!level.isClientSide) {
level.playSound(null, player.blockPosition(), SoundEvents.CAMPFIRE_CRACKLE, SoundSource.PLAYERS, 0.8F, 1.0F); level.playSound(null, player.blockPosition(), SoundEvents.CAMPFIRE_CRACKLE, SoundSource.PLAYERS, 0.8F, 1.0F);
} }
@@ -194,7 +194,6 @@ public class GiantFryingPanItem extends SwordItem implements GeoItem {
if (!GiantFryingPanStorage.isCampfireInput(player, food) || !slot.mayPickup(player)) return false; if (!GiantFryingPanStorage.isCampfireInput(player, food) || !slot.mayPickup(player)) return false;
GiantFryingPanStorage storage = new GiantFryingPanStorage(pan, player); GiantFryingPanStorage storage = new GiantFryingPanStorage(pan, player);
boolean inserted = storage.hasSpace(food) && storage.insertOne(slot.safeTake(1, 1, player)); boolean inserted = storage.hasSpace(food) && storage.insertOne(slot.safeTake(1, 1, player));
Antarchy.LOGGER.info("[FryingPan] cursor pan onto slot client={} food={} inserted={}", player.level().isClientSide, food.getItem(), inserted);
if (inserted) player.playSound(SoundEvents.CAMPFIRE_CRACKLE, 0.8F, 1.0F); if (inserted) player.playSound(SoundEvents.CAMPFIRE_CRACKLE, 0.8F, 1.0F);
return true; return true;
} }
@@ -210,7 +209,6 @@ public class GiantFryingPanItem extends SwordItem implements GeoItem {
other.shrink(1); other.shrink(1);
player.playSound(SoundEvents.CAMPFIRE_CRACKLE, 0.8F, 1.0F); player.playSound(SoundEvents.CAMPFIRE_CRACKLE, 0.8F, 1.0F);
} }
Antarchy.LOGGER.info("[FryingPan] cursor food onto pan client={} food={} inserted={}", player.level().isClientSide, single.getItem(), inserted);
return true; return true;
} }
@@ -1,6 +1,5 @@
package com.craisinlord.antarchy.content.menu; package com.craisinlord.antarchy.content.menu;
import com.craisinlord.antarchy.Antarchy;
import com.craisinlord.antarchy.content.AntarchyObjects; import com.craisinlord.antarchy.content.AntarchyObjects;
import com.craisinlord.antarchy.content.item.GiantFryingPanStorage; import com.craisinlord.antarchy.content.item.GiantFryingPanStorage;
import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Inventory;
@@ -26,8 +25,6 @@ public final class GiantFryingPanMenu extends AbstractContainerMenu {
Player player = inventory.player; Player player = inventory.player;
this.panSlot = panSlot; this.panSlot = panSlot;
this.panStorage = new GiantFryingPanStorage(player, panSlot); this.panStorage = new GiantFryingPanStorage(player, panSlot);
Antarchy.LOGGER.info("[FryingPan] Menu created client={} containerId={} panSlot={} pan={}",
player.level().isClientSide, containerId, panSlot, this.panStorage.pan());
for (int slot = 0; slot < GiantFryingPanStorage.SLOT_COUNT; slot++) { for (int slot = 0; slot < GiantFryingPanStorage.SLOT_COUNT; slot++) {
this.addSlot(new Slot(this.panStorage, slot, 8 + slot * 18, PAN_ROW_Y) { this.addSlot(new Slot(this.panStorage, slot, 8 + slot * 18, PAN_ROW_Y) {
@Override @Override
@@ -0,0 +1,19 @@
package com.craisinlord.antarchy.content.network;
import com.craisinlord.antarchy.Antarchy;
import io.netty.buffer.ByteBuf;
import net.minecraft.network.codec.StreamCodec;
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
import net.minecraft.resources.ResourceLocation;
public record OpenGiantFryingPanPayload() implements CustomPacketPayload {
public static final OpenGiantFryingPanPayload INSTANCE = new OpenGiantFryingPanPayload();
public static final Type<OpenGiantFryingPanPayload> TYPE =
new Type<>(ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "open_giant_frying_pan"));
public static final StreamCodec<ByteBuf, OpenGiantFryingPanPayload> STREAM_CODEC = StreamCodec.unit(INSTANCE);
@Override
public Type<OpenGiantFryingPanPayload> type() {
return TYPE;
}
}
@@ -17,6 +17,7 @@ import net.minecraft.util.Mth;
import net.minecraft.util.RandomSource; import net.minecraft.util.RandomSource;
import net.minecraft.world.level.WorldGenLevel; import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.LeavesBlock; import net.minecraft.world.level.block.LeavesBlock;
import net.minecraft.world.level.block.RotatedPillarBlock;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.Feature; import net.minecraft.world.level.levelgen.feature.Feature;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
@@ -105,7 +106,7 @@ public class RoyalTreeFeature extends Feature<RoyalTreeConfiguration> {
if (s % 2 == 0) { if (s % 2 == 0) {
cursor = cursor.above(); cursor = cursor.above();
} }
placeLog(level, random, config, cursor, logs); placeLog(level, random, config, cursor, logs, branchDir.getAxis());
} }
int padRadius = 2 + random.nextInt(3); int padRadius = 2 + random.nextInt(3);
placeCanopy(level, random, config, cursor.above(), padRadius, Math.max(2, padRadius - 1), 1, 0, leaves); placeCanopy(level, random, config, cursor.above(), padRadius, Math.max(2, padRadius - 1), 1, 0, leaves);
@@ -188,10 +189,18 @@ public class RoyalTreeFeature extends Feature<RoyalTreeConfiguration> {
} }
private void placeLog(WorldGenLevel level, RandomSource random, RoyalTreeConfiguration config, BlockPos pos, Set<BlockPos> logs) { private void placeLog(WorldGenLevel level, RandomSource random, RoyalTreeConfiguration config, BlockPos pos, Set<BlockPos> logs) {
placeLog(level, random, config, pos, logs, Direction.Axis.Y);
}
private void placeLog(WorldGenLevel level, RandomSource random, RoyalTreeConfiguration config, BlockPos pos, Set<BlockPos> logs, Direction.Axis axis) {
if (!canReplace(level, pos)) { if (!canReplace(level, pos)) {
return; return;
} }
setBlock(level, pos, config.trunkProvider().getState(random, pos)); BlockState state = config.trunkProvider().getState(random, pos);
if (state.hasProperty(RotatedPillarBlock.AXIS)) {
state = state.setValue(RotatedPillarBlock.AXIS, axis);
}
setBlock(level, pos, state);
logs.add(pos.immutable()); logs.add(pos.immutable());
} }
@@ -37,6 +37,10 @@ public final class AntarchyMixinPlugin implements IMixinConfigPlugin {
if (mixinClassName.startsWith("com.craisinlord.antarchy.mixins.compat.ars_nouveau.")) { if (mixinClassName.startsWith("com.craisinlord.antarchy.mixins.compat.ars_nouveau.")) {
return classPresent("com.hollingsworth.arsnouveau.common.entity.EntityProjectileSpell"); return classPresent("com.hollingsworth.arsnouveau.common.entity.EntityProjectileSpell");
} }
if (mixinClassName.startsWith("com.craisinlord.antarchy.mixins.compat.biolith.")) {
return classPresent("com.terraformersmc.biolith.api.biome.BiolithFittestNodes")
&& classPresent("com.llamalad7.mixinextras.injector.wrapmethod.WrapMethod");
}
if (mixinClassName.startsWith("com.craisinlord.antarchy.mixins.compat.alexscaves.")) { if (mixinClassName.startsWith("com.craisinlord.antarchy.mixins.compat.alexscaves.")) {
// The target class was found above. Checking the target itself avoids depending on // The target class was found above. Checking the target itself avoids depending on
// whether a loader exposes Alex's Caves' entrypoint resource to this classloader. // whether a loader exposes Alex's Caves' entrypoint resource to this classloader.
@@ -0,0 +1,37 @@
package com.craisinlord.antarchy.mixins.compat.biolith;
import com.llamalad7.mixinextras.injector.wrapmethod.WrapMethod;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import net.minecraft.core.Holder;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.biome.Climate;
import net.minecraft.world.level.biome.MultiNoiseBiomeSource;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
@Mixin(MultiNoiseBiomeSource.class)
public abstract class MultiNoiseBiomeSourceNullGuardMixin {
@Shadow
protected abstract Climate.ParameterList<Holder<Biome>> parameters();
@WrapMethod(method = "getNoiseBiome(IIILnet/minecraft/world/level/biome/Climate$Sampler;)Lnet/minecraft/core/Holder;")
private Holder<Biome> antarchy$neverReturnNullBiome(int x, int y, int z, Climate.Sampler sampler, Operation<Holder<Biome>> original) {
Holder<Biome> biome = original.call(x, y, z, sampler);
if (biome != null) {
return biome;
}
Climate.ParameterList<Holder<Biome>> parameters = this.parameters();
biome = parameters.findValue(sampler.sample(x, y, z));
if (biome != null) {
return biome;
}
for (var entry : parameters.values()) {
if (entry.getSecond() != null) {
return entry.getSecond();
}
}
return null;
}
}
@@ -95,6 +95,7 @@
"gravity.ServerPlayerGravityMixin", "gravity.ServerPlayerGravityMixin",
"gravity.ThrowableProjectileGravityMixin", "gravity.ThrowableProjectileGravityMixin",
"gravity.TrackedEntityAccessor", "gravity.TrackedEntityAccessor",
"compat.biolith.MultiNoiseBiomeSourceNullGuardMixin",
"compat.scguns.ScgunsProjectileEntityGravityMixin", "compat.scguns.ScgunsProjectileEntityGravityMixin",
"compat.scguns.ScgunsArrowGravityMixin", "compat.scguns.ScgunsArrowGravityMixin",
"compat.irons_spellbooks.IronsSpellbooksProjectileGravityMixin", "compat.irons_spellbooks.IronsSpellbooksProjectileGravityMixin",
@@ -1606,21 +1606,28 @@
,"guide.antarchy.entry.duplicator_tree.description2": "Fluids, block entities, and other Duplicator Tree blocks will not copy, and duplication happens occasionally, not on a fixed timer." ,"guide.antarchy.entry.duplicator_tree.description2": "Fluids, block entities, and other Duplicator Tree blocks will not copy, and duplication happens occasionally, not on a fixed timer."
,"guide.antarchy.disk.kraken.title": "KRAKEN SIGHTING NOTES" ,"guide.antarchy.disk.kraken.title": "KRAKEN SIGHTING NOTES"
,"guide.antarchy.entry.kraken.title": "Kraken" ,"guide.antarchy.entry.kraken.title": "Kraken"
,"guide.antarchy.entry.kraken.subtitle": "Overworld aquatic encounter" ,"guide.antarchy.entry.kraken.subtitle": "Guardian of the sea record"
,"guide.antarchy.entry.kraken.description": "Kill a Squid while under Bad Omen to summon a Kraken where it died. Higher Bad Omen levels raise the odds." ,"guide.antarchy.entry.kraken.description": "An absurdly huge squid acting as a guardian of the sea. It holds almost complete control over the weather and the sea, and commands other cephalopods with great ease."
,"guide.antarchy.entry.kraken.description2": "It only spawns in open water, so pick your fight where it can actually surface." ,"guide.antarchy.entry.kraken.description2": "If you're feeling unlucky, whatever you do, do not attack its younger cousins. Killing a Squid while under Bad Omen may summon a Kraken where it died. Each level of Bad Omen raises the odds, about one percent per level."
,"guide.antarchy.entry.kraken.description3": "It rises from nearby water, so pick your fight at sea. On very rare occasions, a single slain Squid calls ten of them at once."
,"guide.antarchy.entry.kraken.description4": "A creature of mass destruction that will stop at NOTHING to finish off those who aggravated it."
,"guide.antarchy.disk.king.title": "KING'S TREE FIELD NOTES" ,"guide.antarchy.disk.king.title": "KING'S TREE FIELD NOTES"
,"guide.antarchy.entry.king.title": "King" ,"guide.antarchy.entry.king.title": "King"
,"guide.antarchy.entry.king.subtitle": "Elythia royal entity record" ,"guide.antarchy.entry.king.subtitle": "Elythia royal record"
,"guide.antarchy.entry.king.description": "Find the massive King's Tree in Elythia. The King spawns and patrols near it." ,"guide.antarchy.entry.king.description": "The King once ruled Elythia alongside his other half, until one day he struck her down and banished her. Since that day he has remained alone at their royal tree, found at the coordinates below."
,"guide.antarchy.entry.king.description2": "Mid-fight he issues a decree, such as KNEEL, COME NO CLOSER, or SHOW NO MERCY. Obey quickly." ,"guide.antarchy.entry.king.description2": "Rule and order are all he has left, and he clings to them. He has grown dull and bitter, and the only thing that brings him any semblance of joy is the torment of others. He's aggressive, he's egotistical, he's sadistic, and he's powerful."
,"guide.antarchy.entry.king.description3": "Breaking a decree halves your hearts for 30 seconds and calls down his judgment." ,"guide.antarchy.entry.king.description3": "He will attack you on sight, and he will toy with you. Mid-battle he issues Decrees: KNEEL, DO NOT RUN, COME NO CLOSER, SHOW NO MERCY. His word is law, and he expects it obeyed at once."
,"guide.antarchy.entry.king.description4": "Break a Decree and your hearts are halved for thirty seconds while you face his judgment. He harnesses the elements of thunder, frost, and flame to deliver it."
,"guide.antarchy.entry.king.description5": "He is not as powerful as his other half, but if you aren't properly prepared for him, he will tear you apart."
,"guide.antarchy.disk.queen.title": "QUEEN HAVOC TRAIL NOTES" ,"guide.antarchy.disk.queen.title": "QUEEN HAVOC TRAIL NOTES"
,"guide.antarchy.entry.queen.title": "Queen" ,"guide.antarchy.entry.queen.title": "Queen"
,"guide.antarchy.entry.queen.subtitle": "Thoraxis royal entity record" ,"guide.antarchy.entry.queen.subtitle": "Thoraxis royal record"
,"guide.antarchy.entry.queen.description": "Follow a Queen Havoc Trail through Thoraxis's underside to find her chamber." ,"guide.antarchy.entry.queen.description": "No longer seen by the side of her other half, she has grown bitter and angry. She was thrown from Elythia, and her trip through the dimensions seems to have imbued her with dimensional capabilities."
,"guide.antarchy.entry.queen.description2": "She fights with gravity: a ground stomp with an expanding shockwave, black holes that pull you toward their center, and a crushing field that pins you along the current gravity direction." ,"guide.antarchy.entry.queen.description2": "She's powerful and aggressive. Do not approach her unless you're absolutely sure. The Queen holds no grudge against any human, but if you're in her way, she will wipe you from this life."
,"guide.antarchy.entry.queen.description3": "In her final phase she also casts her own time dilation field, slowing anyone caught inside it." ,"guide.antarchy.entry.queen.description3": "Once the Queen is through with you, she will let her loyal Manticores have the rest."
,"guide.antarchy.entry.queen.description4": "She can be found in the underside of Thoraxis, at the coordinates below. Good luck."
,"guide.antarchy.entry.queen.description5": "She fights with gravity: a ground stomp with an expanding shockwave, black holes that pull you toward their center, and a crushing field that pins you along the current gravity direction."
,"guide.antarchy.entry.queen.description6": "In her final phase she also casts her own time dilation field, slowing anyone caught inside it."
,"guide.antarchy.entry.prince.title": "Prince" ,"guide.antarchy.entry.prince.title": "Prince"
,"guide.antarchy.entry.prince.subtitle": "Royal mount record" ,"guide.antarchy.entry.prince.subtitle": "Royal mount record"
,"guide.antarchy.entry.prince.description": "Prince Eggs hatch into small Princes that grow when fed golden items." ,"guide.antarchy.entry.prince.description": "Prince Eggs hatch into small Princes that grow when fed golden items."
Binary file not shown.

After

Width:  |  Height:  |  Size: 471 B

@@ -3,9 +3,17 @@
"category": "elythia", "category": "elythia",
"title": "guide.antarchy.entry.king.title", "title": "guide.antarchy.entry.king.title",
"subtitle": "guide.antarchy.entry.king.subtitle", "subtitle": "guide.antarchy.entry.king.subtitle",
"description": ["guide.antarchy.entry.king.description", "guide.antarchy.entry.king.description2", "guide.antarchy.entry.king.description3"], "description": [
"guide.antarchy.entry.king.description",
"guide.antarchy.entry.king.description2",
"guide.antarchy.entry.king.description3",
"guide.antarchy.entry.king.description4",
"guide.antarchy.entry.king.description5"
],
"entity": "antarchy:king", "entity": "antarchy:king",
"cover_entity": "antarchy:king", "cover_entity": "antarchy:king",
"locator": "antarchy:kings_tree",
"dimension": "antarchy:elythia",
"rotation": 45, "rotation": 45,
"render_scale": 0.5 "render_scale": 0.5
} }
@@ -3,7 +3,12 @@
"category": "general", "category": "general",
"title": "guide.antarchy.entry.kraken.title", "title": "guide.antarchy.entry.kraken.title",
"subtitle": "guide.antarchy.entry.kraken.subtitle", "subtitle": "guide.antarchy.entry.kraken.subtitle",
"description": ["guide.antarchy.entry.kraken.description", "guide.antarchy.entry.kraken.description2"], "description": [
"guide.antarchy.entry.kraken.description",
"guide.antarchy.entry.kraken.description2",
"guide.antarchy.entry.kraken.description3",
"guide.antarchy.entry.kraken.description4"
],
"entity": "antarchy:kraken", "entity": "antarchy:kraken",
"cover_entity": "antarchy:kraken", "cover_entity": "antarchy:kraken",
"render_scale": 0.5 "render_scale": 0.5
@@ -3,9 +3,18 @@
"category": "thoraxis", "category": "thoraxis",
"title": "guide.antarchy.entry.queen.title", "title": "guide.antarchy.entry.queen.title",
"subtitle": "guide.antarchy.entry.queen.subtitle", "subtitle": "guide.antarchy.entry.queen.subtitle",
"description": ["guide.antarchy.entry.queen.description", "guide.antarchy.entry.queen.description2", "guide.antarchy.entry.queen.description3"], "description": [
"guide.antarchy.entry.queen.description",
"guide.antarchy.entry.queen.description2",
"guide.antarchy.entry.queen.description3",
"guide.antarchy.entry.queen.description5",
"guide.antarchy.entry.queen.description6",
"guide.antarchy.entry.queen.description4"
],
"entity": "antarchy:queen", "entity": "antarchy:queen",
"cover_entity": "antarchy:queen", "cover_entity": "antarchy:queen",
"locator": "antarchy:queen",
"dimension": "antarchy:thoraxis",
"rotation": 45, "rotation": 45,
"render_scale": 0.5 "render_scale": 0.5
} }
@@ -162,6 +162,19 @@
} }
] ]
}, },
{
"type": "minecraft:item",
"name": "antos:floppy_disk",
"weight": 4,
"functions": [
{
"function": "minecraft:set_components",
"components": {
"antos:floppy_disk": "antarchy:kraken"
}
}
]
},
{ {
"type": "minecraft:item", "type": "minecraft:item",
"name": "antos:floppy_disk", "name": "antos:floppy_disk",
@@ -60,6 +60,19 @@
} }
] ]
}, },
{
"type": "minecraft:item",
"name": "antos:floppy_disk",
"weight": 3,
"functions": [
{
"function": "minecraft:set_components",
"components": {
"antos:floppy_disk": "antarchy:kraken"
}
}
]
},
{ {
"type": "minecraft:item", "type": "minecraft:item",
"name": "antos:floppy_disk", "name": "antos:floppy_disk",
@@ -205,6 +205,19 @@
} }
} }
] ]
},
{
"type": "minecraft:item",
"name": "antos:floppy_disk",
"weight": 5,
"functions": [
{
"function": "minecraft:set_components",
"components": {
"antos:floppy_disk": "antarchy:kraken"
}
}
]
} }
], ],
"rolls": { "rolls": {
@@ -111,6 +111,19 @@
} }
} }
] ]
},
{
"type": "minecraft:item",
"name": "antos:floppy_disk",
"weight": 6,
"functions": [
{
"function": "minecraft:set_components",
"components": {
"antos:floppy_disk": "antarchy:kraken"
}
}
]
} }
], ],
"rolls": { "rolls": {
@@ -238,6 +238,19 @@
} }
] ]
}, },
{
"type": "minecraft:item",
"name": "antos:floppy_disk",
"weight": 5,
"functions": [
{
"function": "minecraft:set_components",
"components": {
"antos:floppy_disk": "antarchy:kraken"
}
}
]
},
{ {
"type": "minecraft:item", "type": "minecraft:item",
"name": "antos:floppy_disk", "name": "antos:floppy_disk",
@@ -240,6 +240,19 @@
} }
} }
] ]
},
{
"type": "minecraft:item",
"name": "antos:floppy_disk",
"weight": 5,
"functions": [
{
"function": "minecraft:set_components",
"components": {
"antos:floppy_disk": "antarchy:kraken"
}
}
]
} }
], ],
"rolls": { "rolls": {
@@ -225,6 +225,19 @@
} }
} }
] ]
},
{
"type": "minecraft:item",
"name": "antos:floppy_disk",
"weight": 5,
"functions": [
{
"function": "minecraft:set_components",
"components": {
"antos:floppy_disk": "antarchy:kraken"
}
}
]
} }
], ],
"rolls": { "rolls": {
@@ -176,6 +176,19 @@
} }
} }
] ]
},
{
"type": "minecraft:item",
"name": "antos:floppy_disk",
"weight": 5,
"functions": [
{
"function": "minecraft:set_components",
"components": {
"antos:floppy_disk": "antarchy:kraken"
}
}
]
} }
], ],
"rolls": { "rolls": {
@@ -171,6 +171,19 @@
} }
} }
] ]
},
{
"type": "minecraft:item",
"name": "antos:floppy_disk",
"weight": 5,
"functions": [
{
"function": "minecraft:set_components",
"components": {
"antos:floppy_disk": "antarchy:kraken"
}
}
]
} }
], ],
"rolls": { "rolls": {
@@ -141,6 +141,19 @@
} }
} }
] ]
},
{
"type": "minecraft:item",
"name": "antos:floppy_disk",
"weight": 5,
"functions": [
{
"function": "minecraft:set_components",
"components": {
"antos:floppy_disk": "antarchy:kraken"
}
}
]
} }
], ],
"rolls": { "rolls": {
@@ -449,6 +449,19 @@
} }
} }
] ]
},
{
"type": "minecraft:item",
"name": "antos:floppy_disk",
"weight": 4,
"functions": [
{
"function": "minecraft:set_components",
"components": {
"antos:floppy_disk": "antarchy:kraken"
}
}
]
} }
], ],
"rolls": { "rolls": {
@@ -0,0 +1,16 @@
{
"type": "minecraft:crafting_shaped",
"category": "building",
"key": {
"#": {
"item": "antarchy:polished_typhonite_slab"
}
},
"pattern": [
"#",
"#"
],
"result": {
"id": "antarchy:chiseled_typhonite"
}
}
@@ -0,0 +1,9 @@
{
"type": "minecraft:stonecutting",
"ingredient": {
"item": "antarchy:polished_typhonite"
},
"result": {
"id": "antarchy:chiseled_typhonite"
}
}
@@ -0,0 +1,17 @@
{
"type": "minecraft:crafting_shaped",
"category": "building",
"key": {
"#": {
"item": "antarchy:typhonite"
}
},
"pattern": [
"##",
"##"
],
"result": {
"count": 4,
"id": "antarchy:polished_typhonite"
}
}
@@ -0,0 +1,9 @@
{
"type": "minecraft:stonecutting",
"ingredient": {
"item": "antarchy:typhonite"
},
"result": {
"id": "antarchy:polished_typhonite"
}
}
@@ -0,0 +1,17 @@
{
"type": "minecraft:crafting_shaped",
"category": "building",
"key": {
"#": {
"item": "antarchy:polished_typhonite"
}
},
"pattern": [
"##",
"##"
],
"result": {
"count": 4,
"id": "antarchy:typhonite_bricks"
}
}
@@ -0,0 +1,9 @@
{
"type": "minecraft:stonecutting",
"ingredient": {
"item": "antarchy:polished_typhonite"
},
"result": {
"id": "antarchy:typhonite_bricks"
}
}
@@ -0,0 +1,41 @@
{
"attributes": {
"attack_range": 4.5,
"category": "greathammer",
"attacks": [
{
"hitbox": "HORIZONTAL_PLANE",
"damage_multiplier": 1,
"angle": 150,
"upswing": 0.55,
"animation": "bettercombat:two_handed_slash_horizontal_right",
"swing_sound": {
"id": "bettercombat:double_axe_swing",
"pitch": 0.8
}
},
{
"hitbox": "HORIZONTAL_PLANE",
"damage_multiplier": 1,
"angle": 150,
"upswing": 0.55,
"animation": "bettercombat:two_handed_slash_horizontal_left",
"swing_sound": {
"id": "bettercombat:double_axe_swing",
"pitch": 0.8
}
},
{
"hitbox": "FORWARD_BOX",
"damage_multiplier": 1.5,
"angle": 0,
"upswing": 0.6,
"animation": "bettercombat:two_handed_slam",
"swing_sound": {
"id": "bettercombat:hammer_slam",
"pitch": 0.9
}
}
]
}
}
@@ -4,7 +4,7 @@
"trunk_provider": { "trunk_provider": {
"type": "minecraft:simple_state_provider", "type": "minecraft:simple_state_provider",
"state": { "state": {
"Name": "antarchy:royal_wood", "Name": "antarchy:royal_log",
"Properties": { "Properties": {
"axis": "y" "axis": "y"
} }
@@ -4,7 +4,7 @@
"trunk_provider": { "trunk_provider": {
"type": "minecraft:simple_state_provider", "type": "minecraft:simple_state_provider",
"state": { "state": {
"Name": "antarchy:royal_wood", "Name": "antarchy:royal_log",
"Properties": { "Properties": {
"axis": "y" "axis": "y"
} }
@@ -4,7 +4,7 @@
"trunk_provider": { "trunk_provider": {
"type": "minecraft:simple_state_provider", "type": "minecraft:simple_state_provider",
"state": { "state": {
"Name": "antarchy:royal_wood", "Name": "antarchy:royal_log",
"Properties": { "Properties": {
"axis": "y" "axis": "y"
} }
+2 -2
View File
@@ -38,7 +38,7 @@ dependencies {
modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version_1_21_1}" modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version_1_21_1}"
modApi "net.fabricmc.fabric-api:fabric-api:${fabric_api_version_1_21_1}" modApi "net.fabricmc.fabric-api:fabric-api:${fabric_api_version_1_21_1}"
modImplementation "software.bernie.geckolib:geckolib-fabric-1.21.1:${geckolib_version}" modImplementation "software.bernie.geckolib:geckolib-fabric-1.21.1:${geckolib_version}"
modImplementation("curse.maven:antos-${antos_curseforge_id}:${antos_curseforge_file_id_fabric}") modImplementation(files("$rootDir/infinite_dimensions_jars/antos-fabric-1.21.1-${antos_version}.jar"))
modCompileOnly("curse.maven:intapi-${intapi_curseforge_id}:${intapi_curseforge_file_id_fabric}") modCompileOnly("curse.maven:intapi-${intapi_curseforge_id}:${intapi_curseforge_file_id_fabric}")
modLocalRuntime("curse.maven:intapi-${intapi_curseforge_id}:${intapi_curseforge_file_id_fabric}") modLocalRuntime("curse.maven:intapi-${intapi_curseforge_id}:${intapi_curseforge_file_id_fabric}")
modLocalRuntime("dev.architectury:architectury-fabric:${architectury_api_version}") modLocalRuntime("dev.architectury:architectury-fabric:${architectury_api_version}")
@@ -74,7 +74,7 @@ dependencies {
runtimeOnly(files("$rootDir/sizeable_foliage_jars/sizeable_foliage-fabric-1.21.1-1.0.0.jar")) runtimeOnly(files("$rootDir/sizeable_foliage_jars/sizeable_foliage-fabric-1.21.1-1.0.0.jar"))
annotationProcessor "org.spongepowered:mixin:0.8.7:processor" annotationProcessor "org.spongepowered:mixin:0.8.7:processor"
implementation(annotationProcessor("io.github.llamalad7:mixinextras-common:${mixin_extras}")) implementation(annotationProcessor("io.github.llamalad7:mixinextras-common:${mixin_extras_1_21_1}"))
} }
loom { loom {
@@ -2,6 +2,7 @@ package com.craisinlord.antarchy.fabric;
import com.craisinlord.antarchy.Antarchy; import com.craisinlord.antarchy.Antarchy;
import com.craisinlord.antarchy.compat.infinity.InfinityCompat; import com.craisinlord.antarchy.compat.infinity.InfinityCompat;
import com.craisinlord.antarchy.compat.infinity.InfinityConfigRefresh;
import com.craisinlord.antarchy.compat.infinity.InfinityCompatVersion; import com.craisinlord.antarchy.compat.infinity.InfinityCompatVersion;
import com.craisinlord.antarchy.content.AntarchyObjects; import com.craisinlord.antarchy.content.AntarchyObjects;
import com.craisinlord.antarchy.content.block.*; import com.craisinlord.antarchy.content.block.*;
@@ -572,6 +573,7 @@ public final class AntarchyFabricContent {
if (isSupportedInfinityLoaded()) { if (isSupportedInfinityLoaded()) {
InfinityCompat.bind(new FabricInfinityCompat()); InfinityCompat.bind(new FabricInfinityCompat());
InfinityConfigRefresh.refreshIfStale(FabricLoader.getInstance().getConfigDir());
} }
} }
@@ -580,6 +580,7 @@ public final class AntarchyFabricClientBootstrap {
DorrieJumpClientHandler.tick(); DorrieJumpClientHandler.tick();
HerculesBeetleClientHandler.tick(); HerculesBeetleClientHandler.tick();
RoyalMountClientHandler.tick(); RoyalMountClientHandler.tick();
GiantFryingPanClientHandler.tick();
SizeRaySoundHandler.tick(client); SizeRaySoundHandler.tick(client);
if (client.level != null) { if (client.level != null) {
com.craisinlord.antarchy.content.client.ClientTimeDilationTicker.tick(client.level); com.craisinlord.antarchy.content.client.ClientTimeDilationTicker.tick(client.level);
@@ -0,0 +1,30 @@
package com.craisinlord.antarchy.fabric.client;
import com.craisinlord.antarchy.content.item.GiantFryingPanItem;
import com.craisinlord.antarchy.content.network.OpenGiantFryingPanPayload;
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
import net.minecraft.client.Minecraft;
import net.minecraft.client.player.LocalPlayer;
public final class GiantFryingPanClientHandler {
private static boolean wasUse;
private GiantFryingPanClientHandler() {
}
public static void tick() {
Minecraft mc = Minecraft.getInstance();
LocalPlayer player = mc.player;
if (player == null || mc.screen != null) {
wasUse = false;
return;
}
boolean use = mc.options.keyUse.isDown();
if (use && !wasUse && player.isShiftKeyDown()
&& (player.getMainHandItem().getItem() instanceof GiantFryingPanItem
|| player.getOffhandItem().getItem() instanceof GiantFryingPanItem)) {
ClientPlayNetworking.send(OpenGiantFryingPanPayload.INSTANCE);
}
wasUse = use;
}
}
@@ -89,6 +89,7 @@ public final class AntarchyFabricNetworking {
PayloadTypeRegistry.playC2S().register(GravityGunPrimaryPayload.TYPE, GravityGunPrimaryPayload.STREAM_CODEC); PayloadTypeRegistry.playC2S().register(GravityGunPrimaryPayload.TYPE, GravityGunPrimaryPayload.STREAM_CODEC);
PayloadTypeRegistry.playC2S().register(PortalGunPrimaryPayload.TYPE, PortalGunPrimaryPayload.STREAM_CODEC); PayloadTypeRegistry.playC2S().register(PortalGunPrimaryPayload.TYPE, PortalGunPrimaryPayload.STREAM_CODEC);
PayloadTypeRegistry.playC2S().register(EyeOfStormPrimaryPayload.TYPE, EyeOfStormPrimaryPayload.STREAM_CODEC); PayloadTypeRegistry.playC2S().register(EyeOfStormPrimaryPayload.TYPE, EyeOfStormPrimaryPayload.STREAM_CODEC);
PayloadTypeRegistry.playC2S().register(OpenGiantFryingPanPayload.TYPE, OpenGiantFryingPanPayload.STREAM_CODEC);
PayloadTypeRegistry.playC2S().register(RoyalMountActionPayload.TYPE, RoyalMountActionPayload.STREAM_CODEC); PayloadTypeRegistry.playC2S().register(RoyalMountActionPayload.TYPE, RoyalMountActionPayload.STREAM_CODEC);
PayloadTypeRegistry.playC2S().register(RoyalMountVerticalPayload.TYPE, RoyalMountVerticalPayload.STREAM_CODEC); PayloadTypeRegistry.playC2S().register(RoyalMountVerticalPayload.TYPE, RoyalMountVerticalPayload.STREAM_CODEC);
PayloadTypeRegistry.playC2S().register(GravityGunScrollPayload.TYPE, GravityGunScrollPayload.STREAM_CODEC); PayloadTypeRegistry.playC2S().register(GravityGunScrollPayload.TYPE, GravityGunScrollPayload.STREAM_CODEC);
@@ -122,6 +123,8 @@ public final class AntarchyFabricNetworking {
context.server().execute(() -> handlePortalGunPrimary(context.player(), payload))); context.server().execute(() -> handlePortalGunPrimary(context.player(), payload)));
ServerPlayNetworking.registerGlobalReceiver(EyeOfStormPrimaryPayload.TYPE, (payload, context) -> ServerPlayNetworking.registerGlobalReceiver(EyeOfStormPrimaryPayload.TYPE, (payload, context) ->
context.server().execute(() -> handleEyeOfStormPrimary(context.player(), payload))); context.server().execute(() -> handleEyeOfStormPrimary(context.player(), payload)));
ServerPlayNetworking.registerGlobalReceiver(OpenGiantFryingPanPayload.TYPE, (payload, context) ->
context.server().execute(() -> com.craisinlord.antarchy.content.item.GiantFryingPanItem.openHeldMenu(context.player())));
ServerPlayNetworking.registerGlobalReceiver(RoyalMountActionPayload.TYPE, (payload, context) -> ServerPlayNetworking.registerGlobalReceiver(RoyalMountActionPayload.TYPE, (payload, context) ->
context.server().execute(() -> handleRoyalMountAction(context.player(), payload))); context.server().execute(() -> handleRoyalMountAction(context.player(), payload)));
ServerPlayNetworking.registerGlobalReceiver(RoyalMountVerticalPayload.TYPE, (payload, context) -> ServerPlayNetworking.registerGlobalReceiver(RoyalMountVerticalPayload.TYPE, (payload, context) ->
@@ -31,7 +31,7 @@
"antarchy-fabric.mixins.json" "antarchy-fabric.mixins.json"
], ],
"depends": { "depends": {
"antos": "*", "antos": ">=1.2.1",
"fabricloader": ">=${fabric_loader_version}", "fabricloader": ">=${fabric_loader_version}",
"minecraft": "~${minecraft_version}", "minecraft": "~${minecraft_version}",
"java": ">=21", "java": ">=21",
+2
View File
@@ -37,6 +37,7 @@ intapi_curseforge_file_id_1_20_1_fabric=7921667
# Libraries # Libraries
midnightlib=1.5.7-fabric midnightlib=1.5.7-fabric
mixin_extras=0.3.6 mixin_extras=0.3.6
mixin_extras_1_21_1=0.4.1
# Libraries # Libraries
mod_menu=11.0.0-beta.1 mod_menu=11.0.0-beta.1
@@ -57,6 +58,7 @@ intapi_curseforge_file_id_neoforge = 7921681
intapi_curseforge_file_id_fabric = 7921674 intapi_curseforge_file_id_fabric = 7921674
intapi_curseforge_file_id_common = 5178461 intapi_curseforge_file_id_common = 5178461
antos_version = 1.2.1
antos_curseforge_id = 1700593 antos_curseforge_id = 1700593
antos_curseforge_file_id_neoforge = 8936372 antos_curseforge_file_id_neoforge = 8936372
antos_curseforge_file_id_fabric = 8936369 antos_curseforge_file_id_fabric = 8936369
+3 -3
View File
@@ -46,8 +46,8 @@ neoForge {
} }
dependencies { dependencies {
compileOnly("curse.maven:antos-${antos_curseforge_id}:${antos_curseforge_file_id_neoforge}") compileOnly(files(rootProject.file("infinite_dimensions_jars/antos-neoforge-1.21.1-${antos_version}.jar")))
runtimeOnly("curse.maven:antos-${antos_curseforge_id}:${antos_curseforge_file_id_neoforge}") runtimeOnly(files(rootProject.file("infinite_dimensions_jars/antos-neoforge-1.21.1-${antos_version}.jar")))
compileOnly("curse.maven:intapi-${intapi_curseforge_id}:${intapi_curseforge_file_id_neoforge}") compileOnly("curse.maven:intapi-${intapi_curseforge_id}:${intapi_curseforge_file_id_neoforge}")
runtimeOnly("curse.maven:intapi-${intapi_curseforge_id}:${intapi_curseforge_file_id_neoforge}") runtimeOnly("curse.maven:intapi-${intapi_curseforge_id}:${intapi_curseforge_file_id_neoforge}")
implementation "software.bernie.geckolib:geckolib-neoforge-1.21.1:${geckolib_version}" implementation "software.bernie.geckolib:geckolib-neoforge-1.21.1:${geckolib_version}"
@@ -72,7 +72,7 @@ dependencies {
// Has no Modrinth release, hence cursemaven (repo already declared in the root build.gradle). // Has no Modrinth release, hence cursemaven (repo already declared in the root build.gradle).
runtimeOnly("curse.maven:configured-${configured_curseforge_id}:${configured_curseforge_file_id_neoforge}") runtimeOnly("curse.maven:configured-${configured_curseforge_id}:${configured_curseforge_file_id_neoforge}")
implementation(annotationProcessor("io.github.llamalad7:mixinextras-common:${mixin_extras}")) implementation(annotationProcessor("io.github.llamalad7:mixinextras-common:${mixin_extras_1_21_1}"))
} }
tasks.withType(ProcessResources).configureEach { tasks.withType(ProcessResources).configureEach {
@@ -0,0 +1,37 @@
package com.craisinlord.antarchy.neoforge.client;
import com.craisinlord.antarchy.Antarchy;
import com.craisinlord.antarchy.content.item.GiantFryingPanItem;
import com.craisinlord.antarchy.content.network.OpenGiantFryingPanPayload;
import net.minecraft.client.Minecraft;
import net.minecraft.client.player.LocalPlayer;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.common.EventBusSubscriber;
import net.neoforged.neoforge.client.event.ClientTickEvent;
import net.neoforged.neoforge.network.PacketDistributor;
@EventBusSubscriber(modid = Antarchy.MODID, value = Dist.CLIENT)
public final class GiantFryingPanClientHandler {
private static boolean wasUse;
private GiantFryingPanClientHandler() {
}
@SubscribeEvent
public static void onClientTick(ClientTickEvent.Post event) {
Minecraft mc = Minecraft.getInstance();
LocalPlayer player = mc.player;
if (player == null || mc.screen != null) {
wasUse = false;
return;
}
boolean use = mc.options.keyUse.isDown();
if (use && !wasUse && player.isShiftKeyDown()
&& (player.getMainHandItem().getItem() instanceof GiantFryingPanItem
|| player.getOffhandItem().getItem() instanceof GiantFryingPanItem)) {
PacketDistributor.sendToServer(OpenGiantFryingPanPayload.INSTANCE);
}
wasUse = use;
}
}
@@ -1425,11 +1425,34 @@ public final class AntarchyNeoForgeEvents {
if (state.is(AntarchyNeoforgeBlocks.PEACH_WOOD.get())) { if (state.is(AntarchyNeoforgeBlocks.PEACH_WOOD.get())) {
event.setFinalState(AntarchyNeoforgeBlocks.STRIPPED_PEACH_WOOD.get().defaultBlockState().setValue(RotatedPillarBlock.AXIS, state.getValue(RotatedPillarBlock.AXIS))); event.setFinalState(AntarchyNeoforgeBlocks.STRIPPED_PEACH_WOOD.get().defaultBlockState().setValue(RotatedPillarBlock.AXIS, state.getValue(RotatedPillarBlock.AXIS)));
return;
}
if (state.is(AntarchyNeoforgeBlocks.NADIR_LOG.get())) {
event.setFinalState(AntarchyNeoforgeBlocks.STRIPPED_NADIR_LOG.get().defaultBlockState().setValue(RotatedPillarBlock.AXIS, state.getValue(RotatedPillarBlock.AXIS)));
return;
}
if (state.is(AntarchyNeoforgeBlocks.NADIR_WOOD.get())) {
event.setFinalState(AntarchyNeoforgeBlocks.STRIPPED_NADIR_WOOD.get().defaultBlockState().setValue(RotatedPillarBlock.AXIS, state.getValue(RotatedPillarBlock.AXIS)));
return;
}
if (state.is(AntarchyNeoforgeBlocks.ROYAL_LOG.get())) {
event.setFinalState(AntarchyNeoforgeBlocks.STRIPPED_ROYAL_LOG.get().defaultBlockState().setValue(RotatedPillarBlock.AXIS, state.getValue(RotatedPillarBlock.AXIS)));
return;
}
if (state.is(AntarchyNeoforgeBlocks.ROYAL_WOOD.get())) {
event.setFinalState(AntarchyNeoforgeBlocks.STRIPPED_ROYAL_WOOD.get().defaultBlockState().setValue(RotatedPillarBlock.AXIS, state.getValue(RotatedPillarBlock.AXIS)));
} }
} }
static void onCommonSetup(FMLCommonSetupEvent event) { static void onCommonSetup(FMLCommonSetupEvent event) {
BloodCrystalShardItem.SYNC_BLOODGLASS = AntarchyNeoForgeEvents::syncBloodglass; BloodCrystalShardItem.SYNC_BLOODGLASS = AntarchyNeoForgeEvents::syncBloodglass;
if (com.craisinlord.antarchy.compat.infinity.InfinityCompat.get().isAvailable()) {
com.craisinlord.antarchy.compat.infinity.InfinityConfigRefresh.refreshIfStale(net.neoforged.fml.loading.FMLPaths.CONFIGDIR.get());
}
event.enqueueWork(() -> { event.enqueueWork(() -> {
Holder<PoiType> computerPoi = BuiltInRegistries.POINT_OF_INTEREST_TYPE.getHolderOrThrow( Holder<PoiType> computerPoi = BuiltInRegistries.POINT_OF_INTEREST_TYPE.getHolderOrThrow(
ResourceKey.create(Registries.POINT_OF_INTEREST_TYPE, ResourceKey.create(Registries.POINT_OF_INTEREST_TYPE,
@@ -84,6 +84,15 @@ public class AntarchyNeoforgePayloadHandlers {
} }
}) })
); );
registrar.playToServer(
com.craisinlord.antarchy.content.network.OpenGiantFryingPanPayload.TYPE,
com.craisinlord.antarchy.content.network.OpenGiantFryingPanPayload.STREAM_CODEC,
(payload, ctx) -> ctx.enqueueWork(() -> {
if (ctx.player() instanceof net.minecraft.server.level.ServerPlayer player) {
com.craisinlord.antarchy.content.item.GiantFryingPanItem.openHeldMenu(player);
}
})
);
registrar.playToServer( registrar.playToServer(
com.craisinlord.antarchy.content.network.RoyalMountActionPayload.TYPE, com.craisinlord.antarchy.content.network.RoyalMountActionPayload.TYPE,
com.craisinlord.antarchy.content.network.RoyalMountActionPayload.STREAM_CODEC, com.craisinlord.antarchy.content.network.RoyalMountActionPayload.STREAM_CODEC,
@@ -35,7 +35,7 @@ displayURL="https://www.curseforge.com/minecraft/mc-mods/antarchy"
[[dependencies.antarchy]] [[dependencies.antarchy]]
modId="antos" modId="antos"
type="required" type="required"
versionRange="*" versionRange="[1.2.1,)"
ordering="AFTER" ordering="AFTER"
side="BOTH" side="BOTH"