Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/1.20.6' into 1.20.6
Browse files Browse the repository at this point in the history
  • Loading branch information
sakurawald committed Jul 7, 2024
2 parents 38fd048 + f074d53 commit 0e9b78b
Show file tree
Hide file tree
Showing 104 changed files with 8,140 additions and 1,112 deletions.
6,883 changes: 6,883 additions & 0 deletions .github/files/en_us.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ replay_*.log
output/
logs/
.vim/

# yarn
remappedSrc
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "fuji-fabric.wiki"]
path = fuji-fabric.wiki
url = https://github.com/sakurawald/fuji-fabric.wiki.git
323 changes: 7 additions & 316 deletions README.md

Large diffs are not rendered by default.

25 changes: 12 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ base {
}

repositories {
mavenCentral()
maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url "https://jitpack.io" }
Expand Down Expand Up @@ -52,19 +53,18 @@ dependencies {

implementation group: 'com.google.code.gson', name: 'gson', version: "${project.gson_version}"

include(implementation(annotationProcessor("com.github.llamalad7.mixinextras:mixinextras-fabric:${project.mixin_extras_version}")))

modImplementation("carpet:fabric-carpet:${project.carpet_core_version}")

modImplementation include("me.lucko:fabric-permissions-api:${project.fabric_permissions_version}")

modImplementation include("net.kyori:adventure-platform-fabric:${project.adventure_platform_fabric_version}")
include(implementation "net.kyori:adventure-text-minimessage:${project.adventure_api_version}")
include(implementation "net.kyori:adventure-text-serializer-plain:${project.adventure_api_version}")

modImplementation include("eu.pb4:sgui:${project.sgui_version}")

implementation "me.lucko:spark-api:${project.spark_version}"

include(implementation(annotationProcessor("com.github.llamalad7.mixinextras:mixinextras-fabric:${project.mixin_extras_version}")))
include(implementation "org.apache.commons:commons-compress:${project.apache_commons_compression_version}")
include(implementation "commons-io:commons-io:${project.apache_commons_io_version}")
include(implementation "org.quartz-scheduler:quartz:${project.quartz_version}")
Expand Down Expand Up @@ -118,14 +118,14 @@ publishing {
}
}

// build.gradle
// modrinth
modrinth {
token = "$System.env.modrinth_token"
projectId = "1TowMm2v"
versionNumber = "$mod_version"
versionType = "release"
uploadFile = remapJar
gameVersions = ['1.20.6']
gameVersions = ['1.21']
loaders = ["fabric"]
dependencies {
required.project "fabric-api"
Expand All @@ -134,15 +134,14 @@ modrinth {
}
syncBodyFrom = rootProject.file("README.md").text
}

// replace readme
tasks.modrinth.dependsOn(tasks.modrinthSyncBody)
tasks.register('replaceReadme') {
// todo
}
tasks.modrinthSyncBody.dependsOn(tasks.replaceReadme)


// test framework
test {
useJUnitPlatform()
}

filter {
includeTestsMatching 'ModuleDocumentationGeneratorTest.buildModuleDocumentation'
}
}
tasks.modrinthSyncBody.dependsOn(tasks.test)
1 change: 1 addition & 0 deletions fuji-fabric.wiki
Submodule fuji-fabric.wiki added at 2a71d1
11 changes: 6 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
org.gradle.jvmargs=-Xmx4G
# gradle
org.gradle.jvmargs=-Xmx8G
org.gradle.parallel=true

# mod properties
mod_version=1.2.0
mod_version=1.2.4
maven_group=io.github.sakurawald
archives_base_name=fuji

Expand All @@ -14,9 +15,9 @@ yarn_mappings=1.20.6+build.1
# mod deps
fabric_api_version=0.98.0+1.20.6
carpet_core_version=1.20.6-1.4.141+v240429
sgui_version=1.5.1+1.20.5
adventure_api_version=4.15.0
adventure_platform_fabric_version=5.13.0
sgui_version=1.6.0+1.21
adventure_api_version=4.17.0
adventure_platform_fabric_version=5.14.0-SNAPSHOT

# common deps
fabric_permissions_version=0.2-SNAPSHOT
Expand Down
28 changes: 20 additions & 8 deletions src/main/java/io/github/sakurawald/Fuji.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,37 @@
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.server.MinecraftServer;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.Logger;

import java.nio.file.Path;

// TODO: placeholder module (placeholder api)

// TODO: specific command module
// TODO: add native shell support specific command
// TODO: kit module -> spec-command

// TODO: /spawn module
// TODO: custom tab list
// TODO: player nickname / prefix / suffix
// TODO: backup module
// TODO: warmup module
// TODO: placeholder module

// TODO: command warmup module
// TODO: /spawn module
// TODO: /tppos module
// TODO: playtime(every/for) rewards and rank like module
// TODO: kit module -> spec-command
// TODO: luckperms context calculate module
// TODO: playtime(every/for) rewards module
// TODO: rank module

// TODO: a light-weight way to implement chat module

// TODO: revert some custom events

// TODO: delete ./github images

// TODO: remove fabric-api dep

public class Fuji implements ModInitializer {
public static final String MOD_ID = "fuji";
public static final Logger LOGGER = LogUtil.createLogger("Fuji");
public static final Logger LOGGER = LogUtil.createLogger(StringUtils.capitalize(MOD_ID));
public static final Path CONFIG_PATH = FabricLoader.getInstance().getConfigDir().resolve(MOD_ID).toAbsolutePath();
public static MinecraftServer SERVER;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package io.github.sakurawald.common.event;

import net.fabricmc.fabric.api.event.Event;
import net.fabricmc.fabric.api.event.EventFactory;
import net.minecraft.network.ClientConnection;
import net.minecraft.network.DisconnectionInfo;
import net.minecraft.server.network.ConnectedClientData;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.util.ActionResult;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

public interface PostPlayerConnectEvent {
Event<PostPlayerConnectEvent> EVENT = EventFactory.createArrayBacked(PostPlayerConnectEvent.class,
(listeners) -> (connection, player, commonListenerCookie) -> {
for (PostPlayerConnectEvent listener : listeners) {
ActionResult result = listener.interact(connection, player, commonListenerCookie);

if (result != ActionResult.PASS) {
return result;
}
}

return ActionResult.PASS;
});

ActionResult interact(ClientConnection connection, ServerPlayerEntity player, ConnectedClientData commonListenerCookie);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package io.github.sakurawald.common.event;

import com.mojang.brigadier.ParseResults;
import com.mojang.brigadier.context.CommandContext;
import net.fabricmc.fabric.api.event.Event;
import net.fabricmc.fabric.api.event.EventFactory;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.util.ActionResult;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

public interface PreCommandExecuteEvent {
Event<PreCommandExecuteEvent> EVENT = EventFactory.createArrayBacked(PreCommandExecuteEvent.class,
(listeners) -> (parseResults, string) -> {
for (PreCommandExecuteEvent listener : listeners) {
ActionResult result = listener.interact(parseResults, string);
if (result != ActionResult.PASS) {
return result;
}
}
return ActionResult.PASS;
});

ActionResult interact(ParseResults<ServerCommandSource> parseResults, String string);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package io.github.sakurawald.common.event;

import net.fabricmc.fabric.api.event.Event;
import net.fabricmc.fabric.api.event.EventFactory;
import net.minecraft.entity.damage.DamageSource;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.util.ActionResult;

public interface PrePlayerDeathEvent {
Event<PrePlayerDeathEvent> EVENT = EventFactory.createArrayBacked(PrePlayerDeathEvent.class,
(listeners) -> (player, damageSource) -> {
for (PrePlayerDeathEvent listener : listeners) {
ActionResult result = listener.interact(player, damageSource);
if (result != ActionResult.PASS) {
return result;
}
}

return ActionResult.PASS;
});

ActionResult interact(ServerPlayerEntity player, DamageSource damageSource);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package io.github.sakurawald.common.event;

import net.fabricmc.fabric.api.event.Event;
import net.fabricmc.fabric.api.event.EventFactory;
import net.minecraft.entity.passive.SheepEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.network.DisconnectionInfo;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.util.ActionResult;

public interface PrePlayerDisconnectEvent {

Event<PrePlayerDisconnectEvent> EVENT = EventFactory.createArrayBacked(PrePlayerDisconnectEvent.class,
(listeners) -> (player, disconnectionInfo) -> {
for (PrePlayerDisconnectEvent listener : listeners) {
ActionResult result = listener.interact(player, disconnectionInfo);

if(result != ActionResult.PASS) {
return result;
}
}

return ActionResult.PASS;
});

ActionResult interact(ServerPlayerEntity player, DisconnectionInfo disconnectionInfo);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.sakurawald.module.initializer.seen;
package io.github.sakurawald.common.structure;

import java.util.Collection;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.sakurawald.module.initializer.teleport_warmup;
package io.github.sakurawald.common.structure;

import io.github.sakurawald.Fuji;
import io.github.sakurawald.util.MessageUtil;
Expand Down Expand Up @@ -50,7 +50,7 @@ public double distanceToSqr(Position position) {
}

public void teleport(ServerPlayerEntity player) {
RegistryKey<World> worldKey = RegistryKey.of(RegistryKeys.WORLD, new Identifier(this.level));
RegistryKey<World> worldKey = RegistryKey.of(RegistryKeys.WORLD, Identifier.of(this.level));
ServerWorld serverLevel = Fuji.SERVER.getWorld(worldKey);
if (serverLevel == null) {
MessageUtil.sendMessage(player, "level.no_exists", this.level);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.lang.annotation.*;

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface Comment {
@Target({ElementType.TYPE, ElementType.FIELD})
public @interface Documentation {
String value();
}
Loading

0 comments on commit 0e9b78b

Please sign in to comment.