Матвей Чумаков

собери jar Fabric

Kodari AI
KodariOct 30 at 1:44 pm 1

Чтобы собрать Fabric-мод и скачать JAR:

  1. Нажмите Compile в верхней панели (на телефоне: ⋮ → Compile Project).

  2. В открывшемся окне нажмите Compile.

  3. После успешной сборки нажмите Download у сборки или Download {name}.jar в чате.

[Generation stopped]

Матвей Чумаков

The compilation failed with this error:

code
Compilation failed with 2 error(s):

ERROR in src/main/java/com/example/advborder/mixin/ServerPlayerMixin.java at line 42: cannot find symbol
        ServerWorld world = this.owner.getServerWorld();
                                      ^
  symbol: method getServerWorld()
  location: variable owner of type ServerPlayerEntity

ERROR in   src/main/java/com/example/advborder/mixin/ServerPlayerMixin.java at line 42: cannot find symbol
          ServerWorld world = this.owner.getServerWorld();
                                        ^
  symbol: method getServerWorld()
  location: variable owner of type ServerPlayerEntity


=== COMPILATION ERROR ANALYSIS ===

MISSING METHODS:
  - getServerWorld()
ACTION: Check method names and signatures

FILES TO INVESTIGATE:
  - src/main/java/com/example/advborder/mixin/ServerPlayerMixin.java
  -   src/main/java/com/example/advborder/mixin/ServerPlayerMixin.java

Please fix this error by creating a new artifact with the corrected code.

Kodari AI
KodariOct 30 at 1:50 pm 1
  • Заменю отсутствующий getServerWorld() на Yarn-метод getEntityWorld().

  • Приведу результат к ServerWorld, так как getEntityWorld() возвращает общий тип World.

Fixed the missing method in ServerPlayerMixin.java by using getEntityWorld() and casting the result to ServerWorld.

To create the updated JAR, click Compile in the top bar (or ⋮ → Compile Project on phone), then click Compile in the window. Download the JAR once the build succeeds.

Kodari can make mistakes. Review important code before using.
Files
src
advancement-border-mod-source (1).zip
advancement-border-mod-source.zip
BORDERMODPRIKINE.zip
build.gradle
gradle.properties
README.md
settings.gradle
Code
251 7,224
src/main/java/com/example/advborder/AdvancementBorderMod.java
package com.example.advborder;

import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerWorldEvents;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.border.WorldBorder;
import net.minecraft.world.World;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class AdvancementBorderMod implements ModInitializer {
    public static final String MOD_ID = "advborder";
    public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);

    // Expansion amounts
    public static final double TASK_EXPAND = 1.0;
    public static final double GOAL_EXPAND = 10.0;
    public static final double CHALLENGE_EXPAND = 50.0;
    public static final double HIDDEN_EXPAND = 100.0;

    // Starting diameter (1x1 means diameter 1)
    public static final double START_DIAMETER = 1.0;

    @Override
    public void onInitialize() {
        LOGGER.info("Advancement Border mod loaded!");

        ServerLifecycleEvents.SERVER_STARTED.register(this::onServerStarted);
        ServerWorldEvents.LOAD.register(this::onWorldLoad);
    }

    private void onServerStarted(MinecraftServer server) {
        // Ensure overworld border is set
        ServerWorld overworld = server.getWorld(World.OVERWORLD);
        if (overworld != null) {
            setupBorder(overworld);
        }
    }

    private void onWorldLoad(MinecraftServer server, ServerWorld world) {
        if (world.getRegistryKey() == World.OVERWORLD) {
            setupBorder(world);
        }
    }

    public static void setupBorder(ServerWorld world) {
        WorldBorder border = world.getWorldBorder();
        // Only set if it looks like default (very large)
        if (border.getSize() > 100000) {
            border.setCenter(0.5, 0.5); // center of block 0,0
            border.setSize(START_DIAMETER);
            LOGGER.info("World border initialized to {} blocks diameter", START_DIAMETER);
        }
    }

    public static void expandBorder(ServerWorld world, double amount, String reason) {
        WorldBorder border = world.getWorldBorder();
        double newSize = border.getSize() + amount;
        border.setSize(newSize);

        // Broadcast message
        String message = "§a[Border] §fГраница расширена на §e" + (int)amount + " §fблоков! (" + reason + ") §7Новый размер: §b" + (int)newSize + "x" + (int)newSize;
        world.getServer().getPlayerManager().broadcast(
            net.minecraft.text.Text.literal(message),
            false
        );
        LOGGER.info("Border expanded by {} to {}. Reason: {}", amount, newSize, reason);
    }
}