Skip to content

Commit

Permalink
[Fabric] Remove redundant function split based on server version
Browse files Browse the repository at this point in the history
  • Loading branch information
NEZNAMY committed Feb 11, 2025
1 parent 416e707 commit 70b4080
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,6 @@ public static String getLevelName(@NotNull Level level) {
return loader1_14_4.getLevelName(level);
}

/**
* Adds sibling to a component.
*
* @param parent
* Parent to add sibling to
* @param child
* Sibling to add
*/
public static void addSibling(@NotNull Component parent, @NotNull Component child) {
if (serverVersion.getMinorVersion() >= 16) loaderLatest.addSibling(parent, child);
else loader1_14_4.addSibling(parent, child);
}

/**
* Converts TAB's ChatModifier class to Minecraft Style class.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public Component convertComponent(@NotNull TabComponent component) {

// Extra
for (TabComponent extra : component.getExtra()) {
FabricMultiVersion.addSibling(nmsComponent, convertComponent(extra));
nmsComponent.getSiblings().add(convertComponent(extra));
}

return nmsComponent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,6 @@ default Style convertModifier(@NotNull ChatModifier modifier) {
throw new UnsupportedOperationException("Not implemented.");
}

/**
* Adds sibling to a component.
*
* @param parent
* Parent to add sibling to
* @param child
* Sibling to add
*/
default void addSibling(@NotNull Component parent, @NotNull Component child) {
throw new UnsupportedOperationException("Not implemented.");
}

/**
* Creates team register packet using given team.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,6 @@ public Style convertModifier(@NotNull ChatModifier modifier) {
);
}

@Override
public void addSibling(@NotNull Component parent, @NotNull Component child) {
parent.getSiblings().add(child);
}

@Override
@NotNull
public Packet<?> registerTeam(@NotNull PlayerTeam team) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,6 @@ public Style convertModifier(@NotNull ChatModifier modifier) {
return style;
}

@Override
public void addSibling(@NotNull Component parent, @NotNull Component child) {
parent.append(child);
}

@Override
@NotNull
public Packet<?> registerTeam(@NotNull PlayerTeam team) {
Expand Down

0 comments on commit 70b4080

Please sign in to comment.