kings tree implementation

tons of 1.20 files
This commit is contained in:
craisinlord committed 2026-09-10 09:51:32 -05:00
1 parent f4f4e0c717
commit 326c503ddb
3734 files changed
+121959 -8

No files matched your search

-1
View File
@@ -6,7 +6,6 @@ base {
archivesName = "${mod_id}-common-1.21.1"
}
// Source-only module — each loader module compiles these sources itself.
tasks.named('compileJava').configure {
enabled = false
}
@@ -0,0 +1,90 @@
package com.craisinlord.antarchy.content.client;
import com.craisinlord.antarchy.content.effect.RoyalEffectHooks;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Iterator;
import java.util.Map;
import java.util.WeakHashMap;
import net.minecraft.core.Holder;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
public final class ContractionAfterimages {
public static final int MAX_SAMPLES = 10;
public static final int SAMPLE_LIFETIME_TICKS = 13;
private static final Map<LivingEntity, Deque<Sample>> HISTORY = new WeakHashMap<>();
private ContractionAfterimages() {
}
public static void tick(ClientLevel level) {
Holder<MobEffect> holder = RoyalEffectHooks.contractedHolder();
int now = (int) (level.getGameTime() & 0x7fffffffL);
Iterator<Map.Entry<LivingEntity, Deque<Sample>>> iterator = HISTORY.entrySet().iterator();
while (iterator.hasNext()) {
LivingEntity tracked = iterator.next().getKey();
if (tracked == null || holder == null || tracked.isRemoved() || !tracked.isAlive()
|| !tracked.hasEffect(holder)) {
iterator.remove();
}
}
if (holder == null) {
return;
}
for (Entity entity : level.entitiesForRendering()) {
if (!(entity instanceof LivingEntity living) || living.isInvisible() || !living.hasEffect(holder)) {
continue;
}
Deque<Sample> samples = HISTORY.computeIfAbsent(living, ignored -> new ArrayDeque<>());
samples.addFirst(new Sample(living, now));
while (samples.size() > MAX_SAMPLES) {
samples.removeLast();
}
}
}
public static Deque<Sample> samples(LivingEntity entity) {
return HISTORY.get(entity);
}
public static float fade(Sample sample, int now) {
float elapsed = now - sample.recordedTick;
return Math.max(0.0F, 1.0F - elapsed / SAMPLE_LIFETIME_TICKS);
}
public static void clear() {
HISTORY.clear();
}
public static final class Sample {
public final double x;
public final double y;
public final double z;
public final float bodyYaw;
public final float headYaw;
public final float xRot;
public final float limbPos;
public final float limbSpeed;
public final float ageInTicks;
public final int recordedTick;
Sample(LivingEntity entity, int recordedTick) {
this.x = entity.getX();
this.y = entity.getY();
this.z = entity.getZ();
this.bodyYaw = entity.yBodyRot;
this.headYaw = entity.getYHeadRot();
this.xRot = entity.getXRot();
this.limbPos = entity.walkAnimation.position();
this.limbSpeed = Math.min(entity.walkAnimation.speed(), 1.0F);
this.ageInTicks = entity.tickCount;
this.recordedTick = recordedTick;
}
}
}
@@ -0,0 +1,86 @@
package com.craisinlord.antarchy.content.client.renderer;
import com.craisinlord.antarchy.content.item.RoyalAssailantBattleAxeItem;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.math.Axis;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.PlayerModel;
import net.minecraft.client.player.AbstractClientPlayer;
import net.minecraft.client.renderer.LightTexture;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.entity.LivingEntityRenderer;
import net.minecraft.client.renderer.entity.RenderLayerParent;
import net.minecraft.client.renderer.entity.layers.RenderLayer;
import net.minecraft.world.entity.HumanoidArm;
import net.minecraft.world.item.ItemDisplayContext;
import net.minecraft.world.item.ItemStack;
public final class RoyalAssailantAxeAfterimageLayer extends RenderLayer<AbstractClientPlayer, PlayerModel<AbstractClientPlayer>> {
private static final int[] TINTS = {
0x66FFD966,
0x4DFFC94D,
0x33FFB52E,
0x1FFF8C14
};
public RoyalAssailantAxeAfterimageLayer(RenderLayerParent<AbstractClientPlayer, PlayerModel<AbstractClientPlayer>> renderer) {
super(renderer);
}
@Override
public void render(PoseStack poseStack, MultiBufferSource buffer, int packedLight, AbstractClientPlayer player,
float limbSwing, float limbSwingAmount, float partialTick, float ageInTicks, float netHeadYaw,
float headPitch) {
if (player.isSpectator() || player.isInvisible() || player.getAttackAnim(partialTick) <= 0.01F) {
return;
}
ItemStack stack = player.getMainHandItem();
HumanoidArm arm = player.getMainArm();
if (!(stack.getItem() instanceof RoyalAssailantBattleAxeItem)) {
stack = player.getOffhandItem();
arm = player.getMainArm() == HumanoidArm.RIGHT ? HumanoidArm.LEFT : HumanoidArm.RIGHT;
}
if (!(stack.getItem() instanceof RoyalAssailantBattleAxeItem)) {
return;
}
VertexConsumer vertexConsumer = buffer.getBuffer(RenderType.entityTranslucent(this.getTextureLocation(player)));
float swing = player.getAttackAnim(partialTick);
for (int i = TINTS.length - 1; i >= 0; i--) {
poseStack.pushPose();
float offset = (i + 1) * 0.08F;
poseStack.translate(0.0D, 0.0D, offset);
poseStack.mulPose(Axis.YP.rotation((i + 1) * 0.12F * (swing < 0.5F ? -1.0F : 1.0F)));
this.getParentModel().renderToBuffer(
poseStack,
vertexConsumer,
LightTexture.FULL_BRIGHT,
LivingEntityRenderer.getOverlayCoords(player, 0.0F),
TINTS[i]
);
poseStack.popPose();
}
for (int i = TINTS.length - 1; i >= 0; i--) {
poseStack.pushPose();
this.getParentModel().translateToHand(arm, poseStack);
poseStack.mulPose(Axis.YP.rotation((i + 1) * 0.12F * (swing < 0.5F ? -1.0F : 1.0F)));
Minecraft.getInstance().getItemRenderer().renderStatic(
player,
stack,
arm == HumanoidArm.RIGHT ? ItemDisplayContext.THIRD_PERSON_RIGHT_HAND : ItemDisplayContext.THIRD_PERSON_LEFT_HAND,
arm == HumanoidArm.LEFT,
poseStack,
buffer,
player.level(),
packedLight,
LivingEntityRenderer.getOverlayCoords(player, 0.0F),
player.getId()
);
poseStack.popPose();
}
}
}
@@ -0,0 +1,32 @@
package com.craisinlord.antarchy.content.client.renderer;
import com.craisinlord.antarchy.content.client.model.RoyalBlackHoleModel;
import com.craisinlord.antarchy.content.entity.royal.RoyalAssailantBlackHoleEntity;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.resources.ResourceLocation;
import org.jetbrains.annotations.Nullable;
import software.bernie.geckolib.renderer.GeoEntityRenderer;
public final class RoyalAssailantBlackHoleRenderer extends GeoEntityRenderer<RoyalAssailantBlackHoleEntity> {
public RoyalAssailantBlackHoleRenderer(EntityRendererProvider.Context context) {
super(context, new RoyalBlackHoleModel<>());
this.shadowRadius = 0.0F;
}
@Override
public void render(RoyalAssailantBlackHoleEntity entity, float entityYaw, float partialTick,
PoseStack poseStack, MultiBufferSource bufferSource, int packedLight) {
super.render(entity, entityYaw, partialTick, poseStack, bufferSource, 0xF000F0);
}
@Override
public @Nullable RenderType getRenderType(RoyalAssailantBlackHoleEntity animatable,
ResourceLocation texture,
@Nullable MultiBufferSource bufferSource,
float partialTick) {
return RenderType.entityTranslucent(this.getTextureLocation(animatable));
}
}
@@ -3,6 +3,7 @@ package com.craisinlord.antarchy.content.client.renderer;
import com.craisinlord.antarchy.content.client.model.RoyalBossModel;
import com.craisinlord.antarchy.content.entity.royal.RoyalBossEntity;
import com.craisinlord.antarchy.content.entity.royal.KingEntity;
import com.craisinlord.antarchy.content.entity.royal.QueenEntity;
import com.craisinlord.antarchy.content.entity.royal.RoyalHead;
import com.craisinlord.antarchy.content.entity.royal.beam.RoyalBeamElement;
import com.craisinlord.antarchy.content.effect.RoyalEffectHooks;
@@ -62,7 +63,9 @@ public class RoyalBossRenderer extends GeoEntityRenderer<RoyalBossEntity> {
if (movement.lengthSqr() < 1.0E-5D) return;
RenderType afterimageType = RenderType.entityTranslucent(this.getRenderer().getTextureLocation(animatable));
VertexConsumer afterimageBuffer = bufferSource.getBuffer(afterimageType);
int[] colors = {0x66FF5F6F, 0x4DFF4D60, 0x33FF3B52, 0x1FFF2944};
int[] colors = animatable instanceof QueenEntity
? new int[]{0x66FF5F6F, 0x4DFF4D60, 0x33FF3B52, 0x1FFF2944}
: new int[]{0x66FFD966, 0x4DFFC94D, 0x33FFB52E, 0x1FFF8C14};
for (int i = colors.length - 1; i >= 0; i--) {
poseStack.pushPose();
Vec3 offset = movement.scale(-(i + 1) * 3.0D / RoyalBossEntity.MODEL_RENDER_SCALE);
@@ -0,0 +1,82 @@
package com.craisinlord.antarchy.content.client.renderer;
import com.craisinlord.antarchy.content.client.ContractionAfterimages;
import com.craisinlord.antarchy.content.effect.RoyalEffectHooks;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import java.util.Deque;
import net.minecraft.client.model.EntityModel;
import net.minecraft.client.renderer.LightTexture;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.entity.LivingEntityRenderer;
import net.minecraft.client.renderer.entity.RenderLayerParent;
import net.minecraft.client.renderer.entity.layers.RenderLayer;
import net.minecraft.util.Mth;
import net.minecraft.world.entity.LivingEntity;
import org.joml.Matrix4f;
import org.joml.Vector3f;
public final class TemporalContractionAfterimageLayer<T extends LivingEntity, M extends EntityModel<T>> extends RenderLayer<T, M> {
private static final int RGB = 0xFFD35A;
private static final float BASE_ALPHA = 0.42F;
private static final int SAMPLE_STRIDE = 2;
public TemporalContractionAfterimageLayer(RenderLayerParent<T, M> renderer) {
super(renderer);
}
@Override
public void render(PoseStack poseStack, MultiBufferSource buffer, int packedLight, T entity,
float limbSwing, float limbSwingAmount, float partialTick, float ageInTicks, float netHeadYaw,
float headPitch) {
if (entity.isSpectator() || entity.isInvisible() || RoyalEffectHooks.contractedHolder() == null
|| !entity.hasEffect(RoyalEffectHooks.contractedHolder())) {
return;
}
Deque<ContractionAfterimages.Sample> samples = ContractionAfterimages.samples(entity);
if (samples == null || samples.isEmpty()) {
return;
}
double curX = Mth.lerp(partialTick, entity.xo, entity.getX());
double curY = Mth.lerp(partialTick, entity.yo, entity.getY());
double curZ = Mth.lerp(partialTick, entity.zo, entity.getZ());
int now = (int) (entity.level().getGameTime() & 0x7fffffffL);
Matrix4f inverse = new Matrix4f(poseStack.last().pose()).invert();
M model = this.getParentModel();
VertexConsumer consumer = buffer.getBuffer(RenderType.entityTranslucent(this.getTextureLocation(entity)));
int index = 0;
for (ContractionAfterimages.Sample sample : samples) {
if (index++ % SAMPLE_STRIDE != 0) {
continue;
}
double dx = sample.x - curX;
double dy = sample.y - curY;
double dz = sample.z - curZ;
if (dx * dx + dy * dy + dz * dz < 0.0025D) {
continue;
}
float fade = ContractionAfterimages.fade(sample, now);
if (fade <= 0.02F) {
continue;
}
Vector3f local = inverse.transformDirection(new Vector3f((float) dx, (float) dy, (float) dz));
int alpha = (int) (BASE_ALPHA * fade * 255.0F) & 0xFF;
int color = alpha << 24 | RGB;
model.setupAnim(entity, sample.limbPos, sample.limbSpeed, sample.ageInTicks,
sample.headYaw - sample.bodyYaw, sample.xRot);
poseStack.pushPose();
poseStack.translate(local.x, local.y, local.z);
model.renderToBuffer(poseStack, consumer, LightTexture.FULL_BRIGHT,
LivingEntityRenderer.getOverlayCoords(entity, 0.0F), color);
poseStack.popPose();
}
model.setupAnim(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch);
}
}
@@ -0,0 +1,80 @@
package com.craisinlord.antarchy.content.client.renderer;
import com.craisinlord.antarchy.content.client.ContractionAfterimages;
import com.craisinlord.antarchy.content.effect.RoyalEffectHooks;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import java.util.Deque;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.util.Mth;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import org.jetbrains.annotations.Nullable;
import org.joml.Matrix4f;
import org.joml.Vector3f;
import software.bernie.geckolib.animatable.GeoAnimatable;
import software.bernie.geckolib.cache.object.BakedGeoModel;
import software.bernie.geckolib.renderer.GeoRenderer;
import software.bernie.geckolib.renderer.layer.GeoRenderLayer;
public final class TemporalContractionGeoLayer<T extends GeoAnimatable> extends GeoRenderLayer<T> {
private static final int RGB = 0xFFD35A;
private static final float BASE_ALPHA = 0.42F;
private static final int SAMPLE_STRIDE = 2;
public TemporalContractionGeoLayer(GeoRenderer<T> renderer) {
super(renderer);
}
@Override
public void render(PoseStack poseStack, T animatable, BakedGeoModel bakedModel, @Nullable RenderType renderType,
MultiBufferSource bufferSource, @Nullable VertexConsumer buffer, float partialTick,
int packedLight, int packedOverlay) {
if (!(animatable instanceof Entity entity) || !(entity instanceof LivingEntity living)
|| living.isInvisible() || RoyalEffectHooks.contractedHolder() == null
|| !living.hasEffect(RoyalEffectHooks.contractedHolder())) {
return;
}
Deque<ContractionAfterimages.Sample> samples = ContractionAfterimages.samples(living);
if (samples == null || samples.isEmpty()) {
return;
}
double curX = Mth.lerp(partialTick, entity.xo, entity.getX());
double curY = Mth.lerp(partialTick, entity.yo, entity.getY());
double curZ = Mth.lerp(partialTick, entity.zo, entity.getZ());
int now = (int) (entity.level().getGameTime() & 0x7fffffffL);
Matrix4f inverse = new Matrix4f(poseStack.last().pose()).invert();
RenderType afterimageType = RenderType.entityTranslucent(this.getRenderer().getTextureLocation(animatable));
VertexConsumer afterimageBuffer = bufferSource.getBuffer(afterimageType);
int index = 0;
for (ContractionAfterimages.Sample sample : samples) {
if (index++ % SAMPLE_STRIDE != 0) {
continue;
}
double dx = sample.x - curX;
double dy = sample.y - curY;
double dz = sample.z - curZ;
if (dx * dx + dy * dy + dz * dz < 0.0025D) {
continue;
}
float fade = ContractionAfterimages.fade(sample, now);
if (fade <= 0.02F) {
continue;
}
Vector3f local = inverse.transformDirection(new Vector3f((float) dx, (float) dy, (float) dz));
int alpha = (int) (BASE_ALPHA * fade * 255.0F) & 0xFF;
int color = alpha << 24 | RGB;
poseStack.pushPose();
poseStack.translate(local.x, local.y, local.z);
this.getRenderer().reRender(bakedModel, poseStack, bufferSource, animatable, afterimageType,
afterimageBuffer, partialTick, 0xF000F0, packedOverlay, color);
poseStack.popPose();
}
}
}
@@ -0,0 +1,32 @@
package com.craisinlord.antarchy.content.client.screen;
import com.craisinlord.antarchy.content.menu.RoyalJudgmentMenu;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Inventory;
public final class RoyalJudgmentScreen extends AbstractContainerScreen<RoyalJudgmentMenu> {
private static final ResourceLocation INVENTORY_TEXTURE =
ResourceLocation.withDefaultNamespace("textures/gui/container/inventory.png");
public RoyalJudgmentScreen(RoyalJudgmentMenu menu, Inventory inventory, Component title) {
super(menu, inventory, title);
this.imageWidth = 176;
this.imageHeight = 166;
this.inventoryLabelY = 84;
}
@Override
protected void renderBg(GuiGraphics graphics, float partialTick, int mouseX, int mouseY) {
graphics.blit(INVENTORY_TEXTURE, this.leftPos, this.topPos, 0, 0, this.imageWidth, this.imageHeight);
int gold = 0xD8E6B84A;
graphics.fill(this.leftPos - 2, this.topPos - 2, this.leftPos + this.imageWidth + 2, this.topPos, gold);
graphics.fill(this.leftPos - 2, this.topPos + this.imageHeight, this.leftPos + this.imageWidth + 2,
this.topPos + this.imageHeight + 2, gold);
graphics.fill(this.leftPos - 2, this.topPos - 2, this.leftPos, this.topPos + this.imageHeight + 2, gold);
graphics.fill(this.leftPos + this.imageWidth, this.topPos - 2, this.leftPos + this.imageWidth + 2,
this.topPos + this.imageHeight + 2, gold);
}
}
@@ -0,0 +1,71 @@
package com.craisinlord.antarchy.content.command;
import com.craisinlord.antarchy.content.entity.royal.KingEntity;
import com.craisinlord.antarchy.content.entity.royal.RoyalPunishmentType;
import com.craisinlord.antarchy.content.entity.royal.decree.RoyalDecree;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.context.CommandContext;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
import net.minecraft.network.chat.Component;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.phys.AABB;
public final class RoyalCommand {
private RoyalCommand() {
}
public static void register(CommandDispatcher<CommandSourceStack> dispatcher) {
dispatcher.register(Commands.literal("royal")
.requires(source -> source.hasPermission(2))
.then(Commands.literal("decree")
.then(Commands.argument("id", StringArgumentType.word())
.executes(RoyalCommand::activateDecree)))
.then(Commands.literal("punishment")
.then(Commands.argument("id", StringArgumentType.word())
.executes(RoyalCommand::triggerPunishment))));
}
private static int activateDecree(CommandContext<CommandSourceStack> context) throws CommandSyntaxException {
ServerPlayer player = context.getSource().getPlayerOrException();
KingEntity king = nearestKing(player);
if (king == null) {
context.getSource().sendFailure(Component.literal("No King found nearby."));
return 0;
}
String id = StringArgumentType.getString(context, "id");
if (!king.debugActivateDecree(id, player)) {
context.getSource().sendFailure(Component.literal("Unknown decree: " + id));
return 0;
}
context.getSource().sendSuccess(() -> Component.literal("Activated decree " + id), true);
return 1;
}
private static int triggerPunishment(CommandContext<CommandSourceStack> context) throws CommandSyntaxException {
ServerPlayer player = context.getSource().getPlayerOrException();
KingEntity king = nearestKing(player);
if (king == null) {
context.getSource().sendFailure(Component.literal("No King found nearby."));
return 0;
}
String id = StringArgumentType.getString(context, "id");
RoyalPunishmentType type = RoyalPunishmentType.fromId(id);
if (type == null || !king.debugTriggerPunishment(type, player)) {
context.getSource().sendFailure(Component.literal("Unknown or unavailable punishment: " + id));
return 0;
}
context.getSource().sendSuccess(() -> Component.literal("Triggered punishment " + type.id()), true);
return 1;
}
private static KingEntity nearestKing(ServerPlayer player) {
AABB area = player.getBoundingBox().inflate(128.0D);
return player.serverLevel().getEntitiesOfClass(KingEntity.class, area, LivingEntity::isAlive).stream()
.min((left, right) -> Double.compare(left.distanceToSqr(player), right.distanceToSqr(player)))
.orElse(null);
}
}
@@ -0,0 +1,28 @@
package com.craisinlord.antarchy.content.effect;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.effect.MobEffectCategory;
import net.minecraft.world.entity.LivingEntity;
public final class ContractedMobEffect extends MobEffect {
public static final double RATE = 2.0D;
public static final double STRONG_RATE = 3.0D;
public ContractedMobEffect() {
super(MobEffectCategory.BENEFICIAL, 0xD5A63A);
}
@Override
public boolean applyEffectTick(LivingEntity entity, int amplifier) {
return true;
}
@Override
public boolean shouldApplyEffectTickThisTick(int duration, int amplifier) {
return true;
}
public static double rateForAmplifier(int amplifier) {
return amplifier > 0 ? STRONG_RATE : RATE;
}
}
@@ -0,0 +1,49 @@
package com.craisinlord.antarchy.content.entity.royal;
import com.craisinlord.antarchy.config.AntarchySettings;
import com.craisinlord.antarchy.content.AntarchyObjects;
import java.util.UUID;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.Vec3;
import org.jetbrains.annotations.Nullable;
public final class RoyalAssailantBlackHoleEntity extends RoyalBlackHoleEntity {
public RoyalAssailantBlackHoleEntity(EntityType<? extends RoyalAssailantBlackHoleEntity> entityType, Level level) {
super(entityType, level);
}
public static RoyalAssailantBlackHoleEntity create(ServerLevel level, Vec3 center, @Nullable UUID ownerId) {
RoyalAssailantBlackHoleEntity hole = new RoyalAssailantBlackHoleEntity(
AntarchyObjects.ROYAL_ASSAILANT_BLACK_HOLE.get(), level);
hole.configure(center, AntarchySettings.queenBlackHoleRadius(),
AntarchySettings.queenBlackHoleActiveTicks(), ownerId);
return hole;
}
@Override
protected boolean risesWhileActive() {
return true;
}
@Override
protected double timeDilationRadius() {
return Math.max(2.0D, this.radius() * 0.55D);
}
@Override
protected boolean hasVisibleTimeDilationField() {
return false;
}
@Override
protected int collapseDurationTicks() {
return 12;
}
@Override
protected boolean pullsTerrainBlocks() {
return false;
}
}
@@ -0,0 +1,30 @@
package com.craisinlord.antarchy.content.entity.royal;
import java.util.Locale;
public enum RoyalPunishmentType {
ROYAL_EXILE("royal_exile"),
ROYAL_TITHE("royal_tithe"),
KINGS_TARGET("kings_target"),
KINGS_SEAL("kings_seal");
private final String id;
RoyalPunishmentType(String id) {
this.id = id;
}
public String id() {
return this.id;
}
public static RoyalPunishmentType fromId(String id) {
String normalized = id.toLowerCase(Locale.ROOT).replace('-', '_');
for (RoyalPunishmentType type : values()) {
if (type.id.equals(normalized)) {
return type;
}
}
return null;
}
}
@@ -0,0 +1,55 @@
package com.craisinlord.antarchy.content.fluid;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.BubbleColumnBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.FluidState;
/** Converts a full Antiwater cell next to a vanilla bubble-column source. */
public final class AntiwaterBubbleColumnUtil {
private AntiwaterBubbleColumnUtil() {
}
public static void update(LevelAccessor level, BlockPos pos, FluidState fluidState) {
if (!AntarchyFluidChecks.isAntiwater(fluidState)
|| (!fluidState.isSource() && fluidState.getAmount() < 7)) {
return;
}
BlockState below = level.getBlockState(pos.below());
if (isBubbleSource(below)) {
replaceColumn(level, pos, Direction.UP, below.is(Blocks.MAGMA_BLOCK));
return;
}
BlockState above = level.getBlockState(pos.above());
if (isBubbleSource(above)) {
replaceColumn(level, pos, Direction.DOWN, above.is(Blocks.MAGMA_BLOCK));
}
}
private static boolean isBubbleSource(BlockState state) {
return state.is(Blocks.MAGMA_BLOCK) || state.is(Blocks.SOUL_SAND);
}
private static void replaceColumn(LevelAccessor level, BlockPos start, Direction direction, boolean dragDown) {
BlockPos.MutableBlockPos cursor = start.mutable();
BlockState columnState = Blocks.BUBBLE_COLUMN.defaultBlockState()
.setValue(BubbleColumnBlock.DRAG_DOWN, dragDown);
while (true) {
BlockState state = level.getBlockState(cursor);
FluidState fluidState = state.getFluidState();
if (!AntarchyFluidChecks.isAntiwater(fluidState)
&& !state.is(Blocks.BUBBLE_COLUMN)) {
return;
}
level.setBlock(cursor, columnState, 3);
cursor.move(direction);
}
}
}
@@ -0,0 +1,66 @@
package com.craisinlord.antarchy.content.menu;
import com.craisinlord.antarchy.content.AntarchyObjects;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.inventory.Slot;
import net.minecraft.world.item.ItemStack;
public final class RoyalJudgmentMenu extends AbstractContainerMenu {
public RoyalJudgmentMenu(int containerId, Inventory inventory) {
super(AntarchyObjects.ROYAL_JUDGMENT_MENU.get(), containerId);
for (int row = 0; row < 3; row++) {
for (int column = 0; column < 9; column++) {
int inventorySlot = column + row * 9 + 9;
this.addSlot(new Slot(inventory, inventorySlot, 8 + column * 18, 18 + row * 18) {
@Override
public boolean mayPickup(Player player) {
return !RoyalJudgmentState.isSealed(player.getUUID(), this.getContainerSlot())
&& super.mayPickup(player);
}
@Override
public boolean mayPlace(ItemStack stack) {
return !RoyalJudgmentState.isSealed(inventory.player.getUUID(), this.getContainerSlot())
&& super.mayPlace(stack);
}
});
}
}
for (int column = 0; column < 9; column++) {
int inventorySlot = column;
this.addSlot(new Slot(inventory, inventorySlot, 8 + column * 18, 76) {
@Override
public boolean mayPickup(Player player) {
return !RoyalJudgmentState.isSealed(player.getUUID(), this.getContainerSlot())
&& super.mayPickup(player);
}
@Override
public boolean mayPlace(ItemStack stack) {
return !RoyalJudgmentState.isSealed(inventory.player.getUUID(), this.getContainerSlot())
&& super.mayPlace(stack);
}
});
}
}
@Override
public boolean stillValid(Player player) {
return player.isAlive();
}
@Override
public ItemStack quickMoveStack(Player player, int index) {
if (index < 0 || index >= this.slots.size()) return ItemStack.EMPTY;
Slot slot = this.slots.get(index);
if (!slot.hasItem()) return ItemStack.EMPTY;
ItemStack original = slot.getItem().copy();
ItemStack moved = slot.getItem().copy();
if (!this.moveItemStackTo(moved, 0, this.slots.size(), true)) return ItemStack.EMPTY;
slot.setByPlayer(moved.isEmpty() ? ItemStack.EMPTY : moved);
slot.onTake(player, moved);
return original;
}
}
@@ -0,0 +1,25 @@
package com.craisinlord.antarchy.content.menu;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
public final class RoyalJudgmentState {
private static final Map<UUID, Set<Integer>> SEALED_SLOTS = new HashMap<>();
private RoyalJudgmentState() {
}
public static void seal(UUID playerId, Set<Integer> slots) {
SEALED_SLOTS.put(playerId, Set.copyOf(slots));
}
public static boolean isSealed(UUID playerId, int inventorySlot) {
return SEALED_SLOTS.getOrDefault(playerId, Set.of()).contains(inventorySlot);
}
public static void clear(UUID playerId) {
SEALED_SLOTS.remove(playerId);
}
}
@@ -0,0 +1,40 @@
package com.craisinlord.antarchy.content.worldgen.elythia;
import com.craisinlord.antarchy.Antarchy;
import net.minecraft.core.BlockPos;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.levelgen.structure.Structure;
public final class KingsTreeGrid {
public static final int SPACING = 5_000;
public static final ResourceKey<Level> ELYTHIA = ResourceKey.create(
Registries.DIMENSION,
ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "elythia")
);
public static final ResourceKey<Structure> STRUCTURE_KEY = ResourceKey.create(
Registries.STRUCTURE,
ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "kings_tree")
);
private KingsTreeGrid() {
}
public static int nearestCoordinate(int coordinate, boolean permitZero) {
long gridIndex = Math.round(coordinate / (double) SPACING);
if (!permitZero && gridIndex == 0) {
gridIndex = coordinate < 0 ? -1 : 1;
}
return Math.toIntExact(gridIndex * SPACING);
}
public static BlockPos nearestTreeCenter(BlockPos origin) {
return new BlockPos(
nearestCoordinate(origin.getX(), false),
origin.getY(),
nearestCoordinate(origin.getZ(), false)
);
}
}
@@ -0,0 +1,110 @@
package com.craisinlord.antarchy.content.worldgen.elythia;
import com.craisinlord.antarchy.Antarchy;
import com.mojang.serialization.Codec;
import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.RandomSource;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.levelgen.Heightmap;
import net.minecraft.world.level.levelgen.feature.Feature;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.levelgen.structure.BoundingBox;
import net.minecraft.world.level.levelgen.structure.templatesystem.BlockIgnoreProcessor;
import net.minecraft.world.level.levelgen.structure.templatesystem.LiquidSettings;
import net.minecraft.world.level.levelgen.structure.templatesystem.StructurePlaceSettings;
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate;
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager;
import java.util.Optional;
/** Places the authored King's Tree as independently generated chunk slices on a fixed world grid. */
public final class KingsTreeGridFeature extends Feature<NoneFeatureConfiguration> {
private static final int TREE_MIN_X = -191;
private static final int TREE_MAX_X = 192;
private static final int TREE_MIN_Z = -227;
private static final int TREE_MAX_Z = 227;
private static final int TREE_BOTTOM_Y = -22;
private static final int TREE_TOP_Y = 335;
public KingsTreeGridFeature(Codec<NoneFeatureConfiguration> codec) {
super(codec);
}
@Override
public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> context) {
WorldGenLevel level = context.level();
ChunkPos chunk = new ChunkPos(context.origin());
int centerX = KingsTreeGrid.nearestCoordinate(chunk.getMiddleBlockX(), true);
int centerZ = KingsTreeGrid.nearestCoordinate(chunk.getMiddleBlockZ(), true);
if (centerX == 0 || centerZ == 0) {
return false;
}
int relativeMinX = chunk.getMinBlockX() - centerX;
int relativeMaxX = chunk.getMaxBlockX() - centerX;
int relativeMinZ = chunk.getMinBlockZ() - centerZ;
int relativeMaxZ = chunk.getMaxBlockZ() - centerZ;
if (relativeMaxX < TREE_MIN_X || relativeMinX > TREE_MAX_X
|| relativeMaxZ < TREE_MIN_Z || relativeMinZ > TREE_MAX_Z) {
return false;
}
int minTileX = Math.floorDiv(relativeMinX, 16);
int maxTileX = Math.floorDiv(relativeMaxX, 16);
int minTileZ = Math.floorDiv(relativeMinZ, 16);
int maxTileZ = Math.floorDiv(relativeMaxZ, 16);
int surfaceY = context.chunkGenerator().getBaseHeight(
centerX,
centerZ,
Heightmap.Types.WORLD_SURFACE_WG,
level,
level.getLevel().getChunkSource().randomState()
);
int minimumBaseY = level.getMinBuildHeight() - TREE_BOTTOM_Y;
int maximumBaseY = level.getMaxBuildHeight() - 1 - TREE_TOP_Y;
int baseY = Math.clamp(surfaceY, minimumBaseY, maximumBaseY);
BlockPos treeBottomOrigin = new BlockPos(0, baseY + TREE_BOTTOM_Y, 0);
BoundingBox chunkBounds = new BoundingBox(
chunk.getMinBlockX(),
level.getMinBuildHeight(),
chunk.getMinBlockZ(),
chunk.getMaxBlockX(),
level.getMaxBuildHeight() - 1,
chunk.getMaxBlockZ()
);
StructurePlaceSettings settings = new StructurePlaceSettings()
.setBoundingBox(chunkBounds)
.setLiquidSettings(LiquidSettings.IGNORE_WATERLOGGING)
.addProcessor(BlockIgnoreProcessor.STRUCTURE_BLOCK);
StructureTemplateManager templates = level.getLevel().getStructureManager();
RandomSource random = context.random();
boolean placed = false;
for (int tileX = minTileX; tileX <= maxTileX; tileX++) {
for (int tileZ = minTileZ; tileZ <= maxTileZ; tileZ++) {
Optional<StructureTemplate> template = templates.get(tileLocation(tileX, tileZ));
if (template.isEmpty()) {
continue;
}
BlockPos tileOrigin = treeBottomOrigin.offset(centerX + tileX * 16, 0, centerZ + tileZ * 16);
placed |= template.get().placeInWorld(level, tileOrigin, tileOrigin, settings, random, 2);
}
}
return placed;
}
private static ResourceLocation tileLocation(int tileX, int tileZ) {
return ResourceLocation.fromNamespaceAndPath(
Antarchy.MODID,
"kings_tree_tiles/" + coordinateName(tileX) + "_" + coordinateName(tileZ)
);
}
private static String coordinateName(int coordinate) {
return coordinate < 0 ? "m" + -coordinate : "p" + coordinate;
}
}
@@ -0,0 +1,49 @@
package com.craisinlord.antarchy.mixins;
import com.craisinlord.antarchy.content.worldgen.elythia.KingsTreeGrid;
import com.mojang.datafixers.util.Pair;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.arguments.ResourceOrTagKeyArgument;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
import net.minecraft.core.registries.Registries;
import net.minecraft.server.commands.LocateCommand;
import net.minecraft.world.level.levelgen.structure.Structure;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.time.Duration;
@Mixin(LocateCommand.class)
public abstract class KingsTreeLocateCommandMixin {
@Inject(method = "locateStructure", at = @At("HEAD"), cancellable = true)
private static void antarchy$locateKingsTree(
CommandSourceStack source,
ResourceOrTagKeyArgument.Result<Structure> requestedStructure,
CallbackInfoReturnable<Integer> callback
) {
boolean isKingsTree = requestedStructure.unwrap().map(KingsTreeGrid.STRUCTURE_KEY::equals, tag -> false);
if (!isKingsTree || !source.getLevel().dimension().equals(KingsTreeGrid.ELYTHIA)) {
return;
}
BlockPos origin = BlockPos.containing(source.getPosition());
BlockPos target = KingsTreeGrid.nearestTreeCenter(origin);
Holder.Reference<Structure> holder = source.getLevel()
.registryAccess()
.registryOrThrow(Registries.STRUCTURE)
.getHolderOrThrow(KingsTreeGrid.STRUCTURE_KEY);
int result = LocateCommand.showLocateResult(
source,
requestedStructure,
origin,
Pair.of(target, holder),
"commands.locate.structure.success",
false,
Duration.ZERO
);
callback.setReturnValue(result);
}
}
@@ -0,0 +1,12 @@
package com.craisinlord.antarchy.mixins.client;
import net.minecraft.client.resources.sounds.EntityBoundSoundInstance;
import net.minecraft.world.entity.Entity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
@Mixin(EntityBoundSoundInstance.class)
public interface EntityBoundSoundInstanceAccessor {
@Accessor("entity")
Entity antarchy$getEntity();
}
@@ -0,0 +1,21 @@
package com.craisinlord.antarchy.mixins.client;
import com.craisinlord.antarchy.content.time.TimeDilationApi;
import net.minecraft.client.gui.screens.inventory.InventoryScreen;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(InventoryScreen.class)
public abstract class InventoryScreenRotationBypassMixin {
@Inject(method = "renderEntityInInventoryFollowsMouse", at = @At("HEAD"))
private static void antarchy$enterRotationBypass(CallbackInfo callbackInfo) {
TimeDilationApi.enterRotationBypass();
}
@Inject(method = "renderEntityInInventoryFollowsMouse", at = @At("RETURN"))
private static void antarchy$exitRotationBypass(CallbackInfo callbackInfo) {
TimeDilationApi.exitRotationBypass();
}
}
@@ -0,0 +1,23 @@
package com.craisinlord.antarchy.mixins.time;
import com.craisinlord.antarchy.content.time.TimeDilationApi;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Pose;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(Entity.class)
public abstract class EntityCrouchTimeDilationMixin {
@Inject(method = "setPose", at = @At("HEAD"), cancellable = true)
private void antarchy$slowCrouchTransition(Pose pose, CallbackInfo callbackInfo) {
Entity entity = (Entity) (Object) this;
if (entity instanceof LivingEntity living
&& (pose == Pose.CROUCHING || living.getPose() == Pose.CROUCHING)
&& !TimeDilationApi.consumeTick(entity, "living_crouch")) {
callbackInfo.cancel();
}
}
}
@@ -0,0 +1,24 @@
package com.craisinlord.antarchy.mixins.time;
import com.craisinlord.antarchy.content.time.TimeDilationApi;
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import net.minecraft.world.entity.Entity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import software.bernie.geckolib.animatable.GeoAnimatable;
import software.bernie.geckolib.animation.AnimationController;
@Mixin(AnimationController.class)
public abstract class GeckoLibAnimationControllerTimeDilationMixin<T extends GeoAnimatable> {
@Shadow(remap = false)
protected T animatable;
@ModifyReturnValue(method = "adjustTick", at = @At("RETURN"), remap = false)
private double antarchy$scaleAnimationTick(double tick) {
if (this.animatable instanceof Entity entity) {
return tick * TimeDilationApi.getRate(entity);
}
return tick;
}
}
@@ -0,0 +1,21 @@
package com.craisinlord.antarchy.mixins.time;
import com.craisinlord.antarchy.content.time.TimeDilationApi;
import com.craisinlord.antarchy.content.time.TimeDilationManager;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.projectile.Projectile;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(Projectile.class)
public abstract class ProjectileTimeDilationMixin {
@Inject(method = "setOwner", at = @At("TAIL"))
private void antarchy$inheritTimeDilation(Entity owner, CallbackInfo callbackInfo) {
if (owner != null) {
TimeDilationApi.setInheritedRate((Entity) (Object) this, TimeDilationApi.getRate(owner));
TimeDilationManager.trackPotentiallyAffected((Entity) (Object) this);
}
}
}
@@ -27,6 +27,7 @@
"GlowSquidLumenSpawnMixin",
"GlowVinesUnderLeavesMixin",
"GrindstoneMenuMixin",
"KingsTreeLocateCommandMixin",
"LivingEntityJumpingAccessor",
"CommandedMobMixin",
"LivingEntityRoyalEffectsMixin",
@@ -0,0 +1,571 @@
{
"format_version": "1.8.0",
"animations": {
"idle": {
"loop": true,
"animation_length": 3,
"bones": {
"root": {
"rotation": {
"0.0": {
"post": {
"vector": [0, 0, -5]
},
"lerp_mode": "catmullrom"
},
"0.375": {
"post": {
"vector": [-5, 0, 0]
},
"lerp_mode": "catmullrom"
},
"0.75": {
"post": {
"vector": [0, 0, 5]
},
"lerp_mode": "catmullrom"
},
"1.125": {
"post": {
"vector": [5, 0, 0]
},
"lerp_mode": "catmullrom"
},
"1.5": {
"post": {
"vector": [0, 0, -5]
},
"lerp_mode": "catmullrom"
},
"1.875": {
"post": {
"vector": [-5, 0, 0]
},
"lerp_mode": "catmullrom"
},
"2.25": {
"post": {
"vector": [0, 0, 5]
},
"lerp_mode": "catmullrom"
},
"2.625": {
"post": {
"vector": [5, 0, 0]
},
"lerp_mode": "catmullrom"
},
"3.0": {
"post": {
"vector": [0, 0, -5]
},
"lerp_mode": "catmullrom"
}
},
"position": {
"0.0": {
"post": {
"vector": [0, 0, 0]
},
"lerp_mode": "catmullrom"
},
"0.75": {
"post": {
"vector": [0, -8, 0]
},
"lerp_mode": "catmullrom"
},
"1.5": {
"post": {
"vector": [0, 0, 0]
},
"lerp_mode": "catmullrom"
},
"2.25": {
"post": {
"vector": [0, -8, 0]
},
"lerp_mode": "catmullrom"
},
"3.0": {
"post": {
"vector": [0, 0, 0]
},
"lerp_mode": "catmullrom"
}
},
"scale": {
"0.0": {
"post": {
"vector": [1.1, 0.9, 1.1]
},
"lerp_mode": "catmullrom"
},
"1.5": {
"post": {
"vector": [0.9, 1.1, 0.9]
},
"lerp_mode": "catmullrom"
},
"3.0": {
"post": {
"vector": [1.1, 0.9, 1.1]
},
"lerp_mode": "catmullrom"
}
}
},
"body": {
"rotation": {
"0.0": {
"post": {
"vector": [10, 0, 0]
},
"lerp_mode": "catmullrom"
},
"0.375": {
"post": {
"vector": [0, 0, -10]
},
"lerp_mode": "catmullrom"
},
"0.75": {
"post": {
"vector": [-10, 0, 0]
},
"lerp_mode": "catmullrom"
},
"1.125": {
"post": {
"vector": [0, 0, 10]
},
"lerp_mode": "catmullrom"
},
"1.5": {
"post": {
"vector": [10, 0, 0]
},
"lerp_mode": "catmullrom"
},
"1.875": {
"post": {
"vector": [0, 0, -10]
},
"lerp_mode": "catmullrom"
},
"2.25": {
"post": {
"vector": [-10, 0, 0]
},
"lerp_mode": "catmullrom"
},
"2.625": {
"post": {
"vector": [0, 0, 10]
},
"lerp_mode": "catmullrom"
},
"3.0": {
"post": {
"vector": [10, 0, 0]
},
"lerp_mode": "catmullrom"
}
}
},
"tooth1": {
"rotation": {
"0.0": {
"post": {
"vector": [-45, 0, 0]
},
"lerp_mode": "catmullrom"
},
"0.25": {
"post": {
"vector": [20, 0, 0]
},
"lerp_mode": "catmullrom"
},
"0.5": {
"post": {
"vector": [-45, 0, 0]
},
"lerp_mode": "catmullrom"
},
"0.75": {
"post": {
"vector": [20, 0, 0]
},
"lerp_mode": "catmullrom"
},
"1.0": {
"post": {
"vector": [-45, 0, 0]
},
"lerp_mode": "catmullrom"
},
"1.25": {
"post": {
"vector": [20, 0, 0]
},
"lerp_mode": "catmullrom"
},
"1.5": {
"post": {
"vector": [-45, 0, 0]
},
"lerp_mode": "catmullrom"
},
"1.75": {
"post": {
"vector": [20, 0, 0]
},
"lerp_mode": "catmullrom"
},
"2.0": {
"post": {
"vector": [-45, 0, 0]
},
"lerp_mode": "catmullrom"
},
"2.25": {
"post": {
"vector": [20, 0, 0]
},
"lerp_mode": "catmullrom"
},
"2.5": {
"post": {
"vector": [-45, 0, 0]
},
"lerp_mode": "catmullrom"
},
"2.75": {
"post": {
"vector": [20, 0, 0]
},
"lerp_mode": "catmullrom"
},
"3.0": {
"post": {
"vector": [-45, 0, 0]
},
"lerp_mode": "catmullrom"
}
}
},
"tooth2": {
"rotation": {
"0.0": {
"post": {
"vector": [0, 0, -45]
},
"lerp_mode": "catmullrom"
},
"0.25": {
"post": {
"vector": [0, 0, 20]
},
"lerp_mode": "catmullrom"
},
"0.5": {
"post": {
"vector": [0, 0, -45]
},
"lerp_mode": "catmullrom"
},
"0.75": {
"post": {
"vector": [0, 0, 20]
},
"lerp_mode": "catmullrom"
},
"1.0": {
"post": {
"vector": [0, 0, -45]
},
"lerp_mode": "catmullrom"
},
"1.25": {
"post": {
"vector": [0, 0, 20]
},
"lerp_mode": "catmullrom"
},
"1.5": {
"post": {
"vector": [0, 0, -45]
},
"lerp_mode": "catmullrom"
},
"1.75": {
"post": {
"vector": [0, 0, 20]
},
"lerp_mode": "catmullrom"
},
"2.0": {
"post": {
"vector": [0, 0, -45]
},
"lerp_mode": "catmullrom"
},
"2.25": {
"post": {
"vector": [0, 0, 20]
},
"lerp_mode": "catmullrom"
},
"2.5": {
"post": {
"vector": [0, 0, -45]
},
"lerp_mode": "catmullrom"
},
"2.75": {
"post": {
"vector": [0, 0, 20]
},
"lerp_mode": "catmullrom"
},
"3.0": {
"post": {
"vector": [0, 0, -45]
},
"lerp_mode": "catmullrom"
}
}
},
"tooth3": {
"rotation": {
"0.0": {
"post": {
"vector": [0, 0, 45]
},
"lerp_mode": "catmullrom"
},
"0.25": {
"post": {
"vector": [0, 0, -20]
},
"lerp_mode": "catmullrom"
},
"0.5": {
"post": {
"vector": [0, 0, 45]
},
"lerp_mode": "catmullrom"
},
"0.75": {
"post": {
"vector": [0, 0, -20]
},
"lerp_mode": "catmullrom"
},
"1.0": {
"post": {
"vector": [0, 0, 45]
},
"lerp_mode": "catmullrom"
},
"1.25": {
"post": {
"vector": [0, 0, -20]
},
"lerp_mode": "catmullrom"
},
"1.5": {
"post": {
"vector": [0, 0, 45]
},
"lerp_mode": "catmullrom"
},
"1.75": {
"post": {
"vector": [0, 0, -20]
},
"lerp_mode": "catmullrom"
},
"2.0": {
"post": {
"vector": [0, 0, 45]
},
"lerp_mode": "catmullrom"
},
"2.25": {
"post": {
"vector": [0, 0, -20]
},
"lerp_mode": "catmullrom"
},
"2.5": {
"post": {
"vector": [0, 0, 45]
},
"lerp_mode": "catmullrom"
},
"2.75": {
"post": {
"vector": [0, 0, -20]
},
"lerp_mode": "catmullrom"
},
"3.0": {
"post": {
"vector": [0, 0, 45]
},
"lerp_mode": "catmullrom"
}
}
},
"tooth4": {
"rotation": {
"0.0": {
"post": {
"vector": [45, 0, 0]
},
"lerp_mode": "catmullrom"
},
"0.25": {
"post": {
"vector": [-20, 0, 0]
},
"lerp_mode": "catmullrom"
},
"0.5": {
"post": {
"vector": [45, 0, 0]
},
"lerp_mode": "catmullrom"
},
"0.75": {
"post": {
"vector": [-20, 0, 0]
},
"lerp_mode": "catmullrom"
},
"1.0": {
"post": {
"vector": [45, 0, 0]
},
"lerp_mode": "catmullrom"
},
"1.25": {
"post": {
"vector": [-20, 0, 0]
},
"lerp_mode": "catmullrom"
},
"1.5": {
"post": {
"vector": [45, 0, 0]
},
"lerp_mode": "catmullrom"
},
"1.75": {
"post": {
"vector": [-20, 0, 0]
},
"lerp_mode": "catmullrom"
},
"2.0": {
"post": {
"vector": [45, 0, 0]
},
"lerp_mode": "catmullrom"
},
"2.25": {
"post": {
"vector": [-20, 0, 0]
},
"lerp_mode": "catmullrom"
},
"2.5": {
"post": {
"vector": [45, 0, 0]
},
"lerp_mode": "catmullrom"
},
"2.75": {
"post": {
"vector": [-20, 0, 0]
},
"lerp_mode": "catmullrom"
},
"3.0": {
"post": {
"vector": [45, 0, 0]
},
"lerp_mode": "catmullrom"
}
}
}
}
},
"crawl": {
"loop": true,
"animation_length": 2,
"bones": {
"head": {
"rotation": {
"vector": ["-math.cos(q.anim_time*90*2+180)*4", 0, "math.cos(q.anim_time*90*4+130)*10"]
}
},
"tooth5": {
"rotation": {
"vector": [0, 0, "-math.cos(q.anim_time*90*2*3-80)*20"]
}
},
"tooth7": {
"rotation": {
"vector": ["-math.cos(q.anim_time*90*2*3-80)*20", 0, 0]
}
},
"tooth6": {
"rotation": {
"vector": ["math.cos(q.anim_time*90*2*3)*20", "-math.cos(q.anim_time*90*2*3-50)*10", "-math.cos(q.anim_time*90*2*3)*20"]
}
},
"tooth8": {
"rotation": {
"vector": ["math.cos(q.anim_time*90*2*3)*20", "math.cos(q.anim_time*90*2*3-50)*10", "math.cos(q.anim_time*90*2*3)*20"]
}
},
"body": {
"rotation": {
"vector": ["90-math.cos(q.anim_time*90*2+90)*2", "-math.cos(q.anim_time*90*4)*5", 0]
},
"position": {
"vector": ["math.cos(q.anim_time*90*4-70)", "-14+math.cos(q.anim_time*90*2)-1", 0]
}
},
"tooth1": {
"rotation": {
"vector": ["-math.cos(q.anim_time*90*2*3)*20", 0, 0]
}
},
"tooth2": {
"rotation": {
"vector": [0, 0, "-math.cos(q.anim_time*90*2*3)*20"]
}
},
"tooth3": {
"rotation": {
"vector": [0, 0, "math.cos(q.anim_time*90*2*3)*20"]
}
},
"tooth4": {
"rotation": {
"vector": ["math.cos(q.anim_time*90*2*3)*20", 0, 0]
}
},
"tail": {
"rotation": {
"vector": ["-math.cos(q.anim_time*90*2+30)*5", 0, "-math.cos(q.anim_time*90*4+70)*6"]
}
}
}
}
}
}
@@ -0,0 +1,69 @@
{
"format_version": "1.12.0",
"minecraft:geometry": [
{
"description": {
"identifier": "geometry.mediumworm",
"texture_width": 64,
"texture_height": 64,
"visible_bounds_width": 2,
"visible_bounds_height": 3.5,
"visible_bounds_offset": [0, 1.25, 0]
},
"bones": [
{
"name": "root",
"pivot": [0, 0, 0]
},
{
"name": "body",
"parent": "root",
"pivot": [0, 16, 0],
"cubes": [
{"origin": [-2.5, 16, -2.5], "size": [5, 16, 5], "uv": [0, 0]}
]
},
{
"name": "tooth1",
"parent": "body",
"pivot": [0, 32, 2.5],
"cubes": [
{"origin": [-0.5, 32, 1.5], "size": [1, 3, 1], "uv": [20, 20]}
]
},
{
"name": "tooth2",
"parent": "body",
"pivot": [-2.5, 32, 0],
"cubes": [
{"origin": [-2.5, 32, -0.5], "size": [1, 3, 1], "uv": [4, 21]}
]
},
{
"name": "tooth3",
"parent": "body",
"pivot": [2.5, 32, 0],
"cubes": [
{"origin": [1.5, 32, -0.5], "size": [1, 3, 1], "uv": [8, 21]}
]
},
{
"name": "tooth4",
"parent": "body",
"pivot": [0, 32, -2.5],
"cubes": [
{"origin": [-0.5, 32, -2.5], "size": [1, 3, 1], "uv": [0, 21]}
]
},
{
"name": "tail",
"parent": "body",
"pivot": [0, 16, 0],
"cubes": [
{"origin": [-2, 0, -2], "size": [4, 16, 4], "uv": [20, 0]}
]
}
]
}
]
}
@@ -0,0 +1,29 @@
{
"format_version": "1.12.0",
"minecraft:geometry": [
{
"description": {
"identifier": "geometry.smallworm",
"texture_width": 16,
"texture_height": 16,
"visible_bounds_width": 2,
"visible_bounds_height": 1.5,
"visible_bounds_offset": [0, 0.25, 0]
},
"bones": [
{
"name": "root",
"pivot": [0, 0, 0]
},
{
"name": "body",
"parent": "root",
"pivot": [0, 4, 0],
"cubes": [
{"origin": [-1, 0, -1], "size": [2, 8, 2], "uv": [0, 0]}
]
}
]
}
]
}
@@ -0,0 +1,6 @@
{
"animation": {
"frametime": 4,
"interpolate": false
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

@@ -0,0 +1,6 @@
{
"animation": {
"frametime": 4,
"interpolate": false
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

@@ -0,0 +1,39 @@
{
"parent": "minecraft:adventure/root",
"criteria": {
"become_contracted": {
"conditions": {
"effects": {
"antarchy:contracted": {}
}
},
"trigger": "minecraft:effects_changed"
}
},
"display": {
"announce_to_chat": true,
"description": {
"translate": "advancements.antarchy.enter_the_speed_force.description"
},
"frame": "goal",
"icon": {
"count": 1,
"id": "minecraft:potion",
"components": {
"minecraft:potion_contents": {
"potion": "antarchy:time_contraction"
}
}
},
"show_toast": true,
"title": {
"translate": "advancements.antarchy.enter_the_speed_force.title"
}
},
"requirements": [
[
"become_contracted"
]
],
"sends_telemetry_event": true
}
@@ -0,0 +1,39 @@
{
"parent": "minecraft:adventure/root",
"criteria": {
"become_dilated": {
"conditions": {
"effects": {
"antarchy:dilated": {}
}
},
"trigger": "minecraft:effects_changed"
}
},
"display": {
"announce_to_chat": true,
"description": {
"translate": "advancements.antarchy.probably_wondering_how_i_got_here.description"
},
"frame": "goal",
"icon": {
"count": 1,
"id": "minecraft:potion",
"components": {
"minecraft:potion_contents": {
"potion": "antarchy:time_dilation"
}
}
},
"show_toast": true,
"title": {
"translate": "advancements.antarchy.probably_wondering_how_i_got_here.title"
}
},
"requirements": [
[
"become_dilated"
]
],
"sends_telemetry_event": true
}
@@ -0,0 +1,35 @@
{
"parent": "antarchy:enter_the_speed_force",
"criteria": {
"become_contradictory": {
"conditions": {
"effects": {
"antarchy:contracted": {},
"antarchy:dilated": {}
}
},
"trigger": "minecraft:effects_changed"
}
},
"display": {
"announce_to_chat": true,
"description": {
"translate": "advancements.antarchy.temporal_contradiction.description"
},
"frame": "challenge",
"icon": {
"count": 1,
"id": "minecraft:clock"
},
"show_toast": true,
"title": {
"translate": "advancements.antarchy.temporal_contradiction.title"
}
},
"requirements": [
[
"become_contradictory"
]
],
"sends_telemetry_event": true
}
Loaded 100 of 3734 files, more files were not shown because too many files have changed in this diff. Show more