made it work, at least for a command

This commit is contained in:
Chipperfluff 2025-12-15 16:25:40 +01:00
parent 4ae47943f3
commit 57aff3b28d
11 changed files with 80 additions and 105 deletions

View File

@ -1,9 +1,10 @@
plugins { plugins {
id 'fabric-loom' version '1.6.12' id 'fabric-loom' version '1.6-SNAPSHOT'
id 'maven-publish'
} }
version = "1.0.0" version = "1.0.0"
group = "dev.chipper" group = "net.Chipperfluff"
repositories { repositories {
mavenCentral() mavenCentral()
@ -11,10 +12,16 @@ repositories {
dependencies { dependencies {
minecraft "com.mojang:minecraft:1.20.1" minecraft "com.mojang:minecraft:1.20.1"
mappings "net.fabricmc:yarn:1.20.1+build.10:v2" mappings "net.fabricmc:yarn:1.20.1+build.10:v2"
modImplementation "net.fabricmc:fabric-loader:0.15.11" modImplementation "net.fabricmc:fabric-loader:0.15.11"
// 🔴 THIS LINE IS THE FIX
modImplementation "net.fabricmc.fabric-api:fabric-api:0.92.2+1.20.1"
} }
java { java {
toolchain.languageVersion = JavaLanguageVersion.of(17) toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
} }

View File

@ -1,11 +0,0 @@
package dev.chipper.dimension;
import net.fabricmc.api.ModInitializer;
public class ChipperDimensionMod implements ModInitializer {
@Override
public void onInitialize() {
ChipperDimensions.init();
}
}

View File

@ -1,30 +0,0 @@
package dev.chipper.dimension;
import net.minecraft.block.Blocks;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.world.World;
public class ChipperDimensions {
public static final RegistryKey<World> CHIPPER_WORLD =
RegistryKey.of(RegistryKeys.WORLD, new Identifier("chipperdimension", "chipper"));
public static void init() {
// JSON handles dimension creation
}
public static void ensureSpawnPlatform(ServerWorld world) {
BlockPos center = new BlockPos(0, 64, 0);
for (int x = -5; x < 5; x++) {
for (int z = -5; z < 5; z++) {
world.setBlockState(center.add(x, 0, z),
Blocks.STONE.getDefaultState());
}
}
}
}

View File

@ -1,11 +0,0 @@
{
"type": "chipperdimension:chipper",
"generator": {
"type": "minecraft:noise",
"settings": "minecraft:overworld",
"biome_source": {
"type": "minecraft:fixed",
"biome": "minecraft:the_void"
}
}
}

View File

@ -1,25 +0,0 @@
{
"ultrawarm": false,
"natural": false,
"coordinate_scale": 1.0,
"has_skylight": true,
"has_ceiling": false,
"ambient_light": 0.0,
"fixed_time": 6000,
"monster_spawn_light_level": {
"type": "minecraft:uniform",
"value": {
"min_inclusive": 0,
"max_inclusive": 7
}
},
"monster_spawn_block_light_limit": 0,
"piglin_safe": false,
"bed_works": true,
"respawn_anchor_works": false,
"infiniburn": "#minecraft:infiniburn_overworld",
"effects": "minecraft:overworld",
"min_y": 0,
"height": 256,
"logical_height": 256
}

View File

@ -1,19 +0,0 @@
{
"schemaVersion": 1,
"id": "chipperdimension",
"version": "1.0.0",
"name": "The Chipper Dimension",
"description": "A void dimension for testing.",
"authors": ["you"],
"environment": "*",
"entrypoints": {
"main": [
"dev.chipper.dimension.ChipperDimensionMod"
]
},
"depends": {
"fabricloader": ">=0.15.0",
"minecraft": "1.20.1",
"java": ">=17"
}
}

View File

@ -1,6 +0,0 @@
{
"pack": {
"pack_format": 15,
"description": "The Chipper Dimension"
}
}

View File

@ -0,0 +1,17 @@
package net.Chipperfluff.chipi;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import net.Chipperfluff.chipi.command.ChipperCommand;
public class ChipiMod implements ModInitializer {
@Override
public void onInitialize() {
CommandRegistrationCallback.EVENT.register(
(dispatcher, registryAccess, environment) -> {
ChipperCommand.register(dispatcher);
}
);
}
}

View File

@ -0,0 +1,23 @@
package net.Chipperfluff.chipi.command;
import com.mojang.brigadier.CommandDispatcher;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.text.Text;
import static net.minecraft.server.command.CommandManager.literal;
public class ChipperCommand {
public static void register(CommandDispatcher<ServerCommandSource> dispatcher) {
dispatcher.register(
literal("chipper")
.executes(context -> {
context.getSource().sendFeedback(
() -> Text.literal("This is a test command!"),
false
);
return 1;
})
);
}
}

View File

@ -0,0 +1,22 @@
{
"schemaVersion": 1,
"id": "chipi",
"version": "1.0.0",
"name": "Chipi Mod",
"description": "Test mod with a command",
"authors": ["You"],
"environment": "*",
"entrypoints": {
"main": [
"net.Chipperfluff.chipi.ChipiMod"
]
},
"depends": {
"fabricloader": ">=0.14.0",
"minecraft": ">=1.20",
"fabric-api": "*"
}
}

View File

@ -0,0 +1,8 @@
{
"pack": {
"description": {
"text": "${mod_id} resources"
},
"pack_format": 15
}
}