Skip to content

Commit

Permalink
Merge pull request #1 from Vulpeus-Server/dev
Browse files Browse the repository at this point in the history
2.0.2
  • Loading branch information
topi-banana authored Sep 22, 2024
2 parents 29cda68 + bf60337 commit be23358
Show file tree
Hide file tree
Showing 23 changed files with 816 additions and 18 deletions.
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ plugins {
preprocess {
def mc119 = createNode('1.19.4', 1_19_04, '')
def mc1201 = createNode('1.20.1', 1_20_01, '')
def mc1202 = createNode('1.20.2', 1_20_02, '')
def mc1206 = createNode('1.20.6', 1_20_06, '')
def mc121 = createNode('1.21.1', 1_21_01, '')

mc119.link(mc1201, null)
mc1201.link(mc1206, null)
mc1201.link(mc1202, null)
mc1202.link(mc1206, null)
mc1206.link(mc121, null)
}

Expand Down
8 changes: 5 additions & 3 deletions common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ repositories {
maven {
url 'https://masa.dy.fi/maven'
}
maven {
url 'https://api.modrinth.com/maven'
}
}

// https://github.com/FabricMC/fabric-loader/issues/783
Expand All @@ -33,12 +36,11 @@ dependencies {
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

modImplementation "carpet:fabric-carpet:${project.carpet_version}"

// dependencies
modImplementation "carpet:fabric-carpet:${project.carpet_version}"

// library mods
include(modImplementation(fabricApi.module("fabric-resource-loader-v0", project.fabric_api_version)))
// include(modImplementation(fabricApi.module("fabric-resource-loader-v0", project.fabric_api_version)))
include(modImplementation("me.fallenbreath:conditional-mixin-fabric:${project.conditionalmixin_version}"))
include(annotationProcessor(implementation("io.github.llamalad7:mixinextras-fabric:${project.mixinextras_version}")))

Expand Down
57 changes: 57 additions & 0 deletions docs/en_us.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
## Rules

### commandCustomLoad

Enable `/custom-load` command. Inspired by AMS blockChunkLoader.

- Type: `String`
- Default value: `ops`
- Allowed options: `true`, `false`, `ops`, `0`, `1`, `2`, `3`, `4`
- Categories: `SURVIVAL`, `COMMAND`, `VULPEUS`

### commandHat

Enable `/hat` command. Ported from essential addons.
Expand Down Expand Up @@ -52,6 +61,30 @@ yeet the server crash caused by StackOverflowError.
- Default value: `false`
- Categories: `VULPEUS`

### fixedBeeNotLeavingHive (<=1.21.1)

fixed MC-168329.

- Type: `boolean`
- Default value: `false`
- Categories: `BUGFIX`, `VULPEUS`

### fixedFallingBlockCantUseNetherPortal (<=1.20.6)

fixed MC-9644.

- Type: `boolean`
- Default value: `false`
- Categories: `BUGFIX`, `VULPEUS`

### fixedTickMemoriesEntityAI (<=1.20.1)

fixed MC-254100.

- Type: `boolean`
- Default value: `false`
- Categories: `BUGFIX`, `VULPEUS`

### optmizedDragonRespawn

Optimize dragon respawn method. Ported from carpet AMS addition.
Expand All @@ -64,6 +97,30 @@ Optimize dragon respawn method. Ported from carpet AMS addition.

## Command

### custom-load

`/custom-load` : Show current custom loading chunk list.

`/custom-load add [<dimension>] [<cx>] [<cz>] [<radius>]` : add to list.

`/custom-load remove [<dimension>] [<index>]` : remove from list.

`[<dimension>]` : dimension id

`[<cx>]` : x of the chunk at the center of the loading range.

`[<cz>]` : z of the chunk at the center of the loading range.

`[<radius>]` : radius

`[<index>]` : index of the list. you can check it with `/custom-load`.

### hat

`/hat` : Equip the item you have on your own head. Totem of undying or non-empty shulker box cannot
be equipped.Also you cannot use this command if you already equip the item enchanted curse of
binding.

### hat

`/hat` : Equip the item you have on your own head. Totem of undying or non-empty shulker box cannot
Expand Down
52 changes: 51 additions & 1 deletion docs/ja_jp.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
## ルール

### commandCustomLoad

`/custom-load`コマンドの有効化。AMS の blockChunkLoader から発想を得ました。

- Type: `String`
- Default value: `ops`
- Allowed options: `true`, `false`, `ops`, `0`, `1`, `2`, `3`, `4`
- Categories: `SURVIVAL`, `COMMAND`, `VULPEUS`

### commandHat

`/hat`コマンドの有効化。essential addons からの移植。
Expand Down Expand Up @@ -53,6 +62,30 @@ StackOverflowError によるサーバーのクラッシュの無効化。
- デフォルト: `false`
- カテゴリー: `VULPEUS`

### fixedBeeNotLeavingHive (<=1.21.1)

MC-168329 の修正。

- タイプ: `boolean`
- デフォルト: `false`
- カテゴリー: `BUGFIX`, `VULPEUS`

### fixedFallingBlockCantUseNetherPortal (<=1.20.6)

MC-9644 の修正。

- タイプ: `boolean`
- デフォルト: `false`
- カテゴリー: `BUGFIX`, `VULPEUS`

### fixedTickMemoriesEntityAI (<=1.20.1)

MC-254100 の修正

- タイプ: `boolean`
- デフォルト: `false`
- カテゴリー: `BUGFIX`, `VULPEUS`

### optmizedDragonRespawn

エンダードラゴンのリスポーン処理の最適化。carpet AMS addition からの移植。
Expand All @@ -65,8 +98,25 @@ StackOverflowError によるサーバーのクラッシュの無効化。

## コマンド

### hat
### custom-load

`/custom-load` : 現在の CustomLoadingChunk のリストを表示。

`/custom-load add [<dimension>] [<cx>] [<cz>] [<radius>]` : リストに追加

`/custom-load remove [<dimension>] [<index>]` : リストから削除

`[<dimension>]` : ディメンションID

`[<cx>]` : ロード範囲の中心チャンクの ChunkX

`[<cz>]` : ロード範囲の中心チャンクの ChunkZ

`[<radius>]` : 半径

`[<index>]` : 要素のインデックス。`/custom-load`で確認できます。

### hat

`/hat` : 頭に所持しているアイテムを装備します。不死のトーテムや空でないシュルカーボックスは装備できません。また、束縛の呪いが付いた装備すでにしている場合も同様です。

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

# Fabric Basic Properties
# https://fabricmc.net/versions.html
loader_version=0.16.2
loader_version=0.16.3

# Mod Properties
mod_id=vulpeus_carpet
mod_name=VulpeusCarpet
mod_version=2.0.0
mod_version=2.0.2
maven_group=com.vulpeus
archives_base_name=vulpeus_carpet

Expand Down
1 change: 1 addition & 0 deletions settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"versions": [
"1.19.4",
"1.20.1",
"1.20.2",
"1.20.6",
"1.21.1"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@
import carpet.CarpetServer;
import carpet.utils.Translations;
import com.mojang.brigadier.CommandDispatcher;
import com.vulpeus.vulpeus_carpet.commands.customLoadCommand;
import com.vulpeus.vulpeus_carpet.commands.hatCommand;
import com.vulpeus.vulpeus_carpet.commands.sitCommand;
import com.vulpeus.vulpeus_carpet.commands.viewCommand;
import com.vulpeus.vulpeus_carpet.utils.rule.commandCustomLoad.CustomLoadingChunks;
import com.vulpeus.vulpeus_carpet.utils.ScriptCollection;
import com.vulpeus.vulpeus_carpet.utils.rule.defaultOpLevel.PlayerUtil;
import java.io.IOException;
import java.util.Map;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.loader.api.FabricLoader;
Expand All @@ -36,6 +40,7 @@
import net.minecraft.GameVersion;
import net.minecraft.MinecraftVersion;
import net.minecraft.command.CommandRegistryAccess;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.network.ServerPlayerEntity;

Expand All @@ -45,6 +50,8 @@ public class VulpeusCarpetExtension implements CarpetExtension, ModInitializer {
public static final String MOD_NAME;
public static final Version MOD_VERSION;
public static final GameVersion GAME_VERSION;
public static final String ASSETS_PATH;
public static final ClassLoader CLASS_LOADER;

static {
ModMetadata metadata =
Expand All @@ -55,6 +62,10 @@ public class VulpeusCarpetExtension implements CarpetExtension, ModInitializer {
MOD_NAME = metadata.getName();
MOD_VERSION = metadata.getVersion();
GAME_VERSION = MinecraftVersion.CURRENT;

ASSETS_PATH = String.format("assets/%s", MOD_ID);

CLASS_LOADER = VulpeusCarpetExtension.class.getClassLoader();
}

public static void loadExtension() {
Expand All @@ -74,10 +85,30 @@ public void onInitialize() {
@Override
public void onGameStarted() {
CarpetServer.settingsManager.parseSettingsClass(VulpeusCarpetSettings.class);
ScriptCollection.load();
}

@Override
public void onServerLoadedWorlds(MinecraftServer server) {
try {
System.out.println(server);
CustomLoadingChunks.importConfig(server);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
@Override
public void onServerClosed(MinecraftServer server) {
try {
CustomLoadingChunks.exportConfig(server);
} catch (IOException e) {
throw new RuntimeException(e);
}
}

@Override
public void registerCommands(CommandDispatcher<ServerCommandSource> dispatcher, CommandRegistryAccess commandRegistryAccess) {
customLoadCommand.register(dispatcher);
viewCommand.register(dispatcher);
hatCommand.register(dispatcher);
sitCommand.register(dispatcher);
Expand All @@ -90,9 +121,14 @@ public void onPlayerLoggedIn(ServerPlayerEntity player) {
}
}

@Override
public void onTick(MinecraftServer server){
}

@Override
public Map<String, String> canHasTranslations(String lang) {
return Translations.getTranslationFromResourcePath(
String.format("assets/%s/lang/%s.json", MOD_ID, lang));
String.format("%s/lang/%s.json", ASSETS_PATH, lang)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@

package com.vulpeus.vulpeus_carpet;

import static carpet.api.settings.RuleCategory.COMMAND;
import static carpet.api.settings.RuleCategory.OPTIMIZATION;
import static carpet.api.settings.RuleCategory.SURVIVAL;
import static carpet.api.settings.RuleCategory.*;

import carpet.api.settings.Rule;

public class VulpeusCarpetSettings {

private static final String VULPEUS = "vulpeus";

@Rule(categories = {OPTIMIZATION, COMMAND, VULPEUS})
public static String commandCustomLoad = "ops";

@Rule(categories = {SURVIVAL, COMMAND, VULPEUS})
public static String commandHat = "ops";

Expand All @@ -48,6 +49,22 @@ public class VulpeusCarpetSettings {
@Rule(categories = {VULPEUS})
public static boolean disableSOECrash = false;

//#if MC<=12101
//$$ @Rule(categories = {BUGFIX, VULPEUS})
//#endif
public static boolean fixedBeeNotLeavingHive = false;

//#if MC<=12006
//$$ @Rule(categories = {BUGFIX, VULPEUS})
//#endif
public static boolean fixedFallingBlockCantUseNetherPortal = false;

//#if MC<=12001
//$$ @Rule(categories = {BUGFIX, VULPEUS})
//#endif
public static boolean fixedTickMemoriesEntityAI = false;

@Rule(categories = {OPTIMIZATION, VULPEUS})
public static boolean optimizedDragonRespawn = false;

}
Loading

0 comments on commit be23358

Please sign in to comment.