Skip to content

Commit

Permalink
refactor: simplify the tab module
Browse files Browse the repository at this point in the history
  • Loading branch information
sakurawald committed Oct 30, 2024
1 parent 1af1716 commit 51b49c6
Show file tree
Hide file tree
Showing 21 changed files with 17 additions and 531 deletions.
13 changes: 2 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
> The version number of fuji follows `semver` now: https://semver.org/
> This version includes the following **breaking changes** if you are using them:
> - feature: add `others` literal arguments to most commands that only targeted at command source player in the past,
now allows to use `others` argument to apply the command to a collection of players. This influence the following
commands (**If you are using `command_permission module` with `apply-sponge-implicit-wildcard=false`
in `luckperms.conf`, then everything is fine. If the option is true, then be careful that the `wildcard permission`
may allow players to use the following commands with `others` option.**):
> - all functional commands.
> - most of the commands in `command_toolbox`
> - /afk, /back, /chat style, /pvp, /rtp
> - The command option `/tppos --targetPlayer ...` is replaced by `/tppos others ...`. (command_toolbox.tppos module)
> - make the default required level permission to 4: /heal, /ping, /extinguish, /near (command_toolbox.* module)
> - make the default required level permission to 4: all functional commands. (functional module)
> - refactor: remove `tab_list.sort` and `tab_list.faker` module. (it's highly recommend to use https://github.com/NEZNAMY/TAB for complex purpose, it works just perfect.)
> - refactor: rename `tab_list` module to `tab` module.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ org.gradle.parallel=true
# project
maven_group=io.github.sakurawald
mod_id=fuji
mod_version=5.0.0
mod_version=6.0.0

# loader
minecraft_version=1.21.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static class Modules {
public Predicate predicate = new Predicate();
public MOTD motd = new MOTD();
public Nametag nametag = new Nametag();
public TabList tab_list = new TabList();
public Tab tab = new Tab();
public Tpa tpa = new Tpa();
public Back back = new Back();
public Home home = new Home();
Expand Down Expand Up @@ -661,24 +661,8 @@ public static class Compass {
}
}

public static class TabList {
public static class Tab {
public boolean enable = false;
public Sort sort = new Sort();
public Faker faker = new Faker();

public static class Sort {
public boolean enable = false;

public SyncGameProfile sync_game_profile = new SyncGameProfile();

public static class SyncGameProfile {
public boolean enable = true;
}
}

public static class Faker {
public boolean enable = false;
}
}

public static class Kit {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.sakurawald.module.initializer.tab_list;
package io.github.sakurawald.module.initializer.tab;

import io.github.sakurawald.core.auxiliary.RandomUtil;
import io.github.sakurawald.core.auxiliary.minecraft.ServerHelper;
Expand All @@ -7,8 +7,8 @@
import io.github.sakurawald.core.config.handler.impl.ObjectConfigurationHandler;
import io.github.sakurawald.core.event.impl.ServerLifecycleEvents;
import io.github.sakurawald.module.initializer.ModuleInitializer;
import io.github.sakurawald.module.initializer.tab_list.config.model.TabListConfigModel;
import io.github.sakurawald.module.initializer.tab_list.job.RenderHeaderAndFooterJob;
import io.github.sakurawald.module.initializer.tab.config.model.TabListConfigModel;
import io.github.sakurawald.module.initializer.tab.job.RenderHeaderAndFooterJob;
import net.minecraft.network.packet.s2c.play.PlayerListHeaderS2CPacket;
import net.minecraft.network.packet.s2c.play.PlayerListS2CPacket;
import net.minecraft.server.MinecraftServer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.sakurawald.module.initializer.tab_list.config.model;
package io.github.sakurawald.module.initializer.tab.config.model;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.sakurawald.module.initializer.tab_list.job;
package io.github.sakurawald.module.initializer.tab.job;

import io.github.sakurawald.core.job.abst.CronJob;
import io.github.sakurawald.module.initializer.tab_list.TabListInitializer;
import io.github.sakurawald.module.initializer.tab.TabListInitializer;
import org.quartz.JobExecutionContext;

public class RenderHeaderAndFooterJob extends CronJob {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package io.github.sakurawald.module.mixin.tab_list;
package io.github.sakurawald.module.mixin.tab;

import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import io.github.sakurawald.core.auxiliary.RandomUtil;
import io.github.sakurawald.core.auxiliary.minecraft.TextHelper;
import io.github.sakurawald.module.initializer.tab_list.TabListInitializer;
import io.github.sakurawald.module.initializer.tab.TabListInitializer;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.text.Text;
import org.jetbrains.annotations.NotNull;
Expand All @@ -13,7 +13,7 @@
import org.spongepowered.asm.mixin.injection.At;

@Mixin(value = ServerPlayerEntity.class)
public abstract class ShowTabListBodyStyleMixin {
public abstract class ServerPlayerEntityMixin {

@Unique
private final ServerPlayerEntity player = (ServerPlayerEntity) (Object) this;
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 51b49c6

Please sign in to comment.