Skip to content

Upcoming release v1.1.0 - #3

Open
SebiTimeWaster wants to merge 22 commits into
mainfrom
upcoming
Open

SebiTimeWaster wants to merge 22 commits into
mainfrom
upcoming

Conversation

@SebiTimeWaster

Copy link
Copy Markdown
Owner

Release Notes:

  • Added Feature: Portals that teleport a player to any dimension or redirects to another Minecraft server when walked into
  • The command '/spawn' now uses the Minecraft world spawn as a fallback if the spawn target was not set with /setspawn
  • Code cleanup, added Github actions

@SebiTimeWaster SebiTimeWaster self-assigned this Sep 15, 2026
@SebiTimeWaster SebiTimeWaster added the enhancement New feature or request label Sep 15, 2026
@github-actions

github-actions Bot commented Sep 15, 2026

Copy link
Copy Markdown

✅ Duplicate Code Report

Two engines run in parallel for cross-validation. Each has its own thresholds tuned to its baseline - the real safety net is the per-engine "max increase vs base" check.

✅ PMD CPD

PR Base Change
Clones 6 9 🙂 -3
Duplicated lines 86 162 ❤️ -76
Duplication 2.97% 5.60% ❤️ -2.63%
Rule Limit Status
Max duplication 5% ✅ Pass (2.97%)
Max increase vs base +0.1% ✅ Pass (-2.63%)
⚠️ 6 new clones introduced
  • 15 lines (48 tokens): src/main/java/timewaster/publicteleport/Teleports.java:142 <-> src/main/java/timewaster/publicteleport/Teleports.java:189
  • 9 lines (47 tokens): src/main/java/timewaster/publicteleport/Requests.java:206 <-> src/main/java/timewaster/publicteleport/Requests.java:244
  • 5 lines (42 tokens): src/main/java/timewaster/publicteleport/Storage.java:408 <-> src/main/java/timewaster/publicteleport/Storage.java:439
  • 4 lines (41 tokens): src/main/java/timewaster/publicteleport/commands/Warps.java:32 <-> src/main/java/timewaster/publicteleport/commands/Warps.java:78
  • 4 lines (37 tokens): src/main/java/timewaster/publicteleport/Registrar.java:197 <-> src/main/java/timewaster/publicteleport/Registrar.java:223
  • 6 lines (37 tokens): src/main/java/timewaster/publicteleport/Storage.java:327 <-> src/main/java/timewaster/publicteleport/Storage.java:377

✅ jscpd (language-agnostic)

PR Base Change
Clones 19 16 🫤 +3
Duplicated lines 123 140 👍 -17
Duplication 4.25% 6.70% ❤️ -2.45%
Rule Limit Status
Max duplication 5% ✅ Pass (4.25%)
Max increase vs base +0.1% ✅ Pass (-2.45%)
⚠️ 19 new clones introduced
  • 4 lines: src/main/java/timewaster/publicteleport/commands/Warps.java:78 <-> src/main/java/timewaster/publicteleport/commands/Warps.java:32
  • 8 lines: src/main/java/timewaster/publicteleport/commands/Tpa.java:6 <-> src/main/java/timewaster/publicteleport/commands/Warps.java:9
  • 8 lines: src/main/java/timewaster/publicteleport/commands/Spawn.java:3 <-> src/main/java/timewaster/publicteleport/commands/Warps.java:9
  • 4 lines: src/main/java/timewaster/publicteleport/commands/Portals.java:5 <-> src/main/java/timewaster/publicteleport/commands/Warps.java:3
  • 6 lines: src/main/java/timewaster/publicteleport/commands/Homes.java:1 <-> src/main/java/timewaster/publicteleport/commands/Warps.java:1
  • 19 lines: src/main/java/timewaster/publicteleport/commands/Homes.java:7 <-> src/main/java/timewaster/publicteleport/commands/Warps.java:7
  • 3 lines: src/main/java/timewaster/publicteleport/commands/Homes.java:101 <-> src/main/java/timewaster/publicteleport/commands/Warps.java:91
  • 8 lines: src/main/java/timewaster/publicteleport/commands/Help.java:9 <-> src/main/java/timewaster/publicteleport/commands/Warps.java:9
  • 9 lines: src/main/java/timewaster/publicteleport/commands/Back.java:1 <-> src/main/java/timewaster/publicteleport/commands/Warps.java:9
  • 7 lines: src/main/java/timewaster/publicteleport/Teleports.java:3 <-> src/main/java/timewaster/publicteleport/commands/Portals.java:3
  • 15 lines: src/main/java/timewaster/publicteleport/Teleports.java:189 <-> src/main/java/timewaster/publicteleport/Teleports.java:142
  • 4 lines: src/main/java/timewaster/publicteleport/TeleportSafety.java:13 <-> src/main/java/timewaster/publicteleport/commands/Portals.java:30
  • 9 lines: src/main/java/timewaster/publicteleport/Storage.java:375 <-> src/main/java/timewaster/publicteleport/Storage.java:325
  • 5 lines: src/main/java/timewaster/publicteleport/Storage.java:439 <-> src/main/java/timewaster/publicteleport/Storage.java:408
  • 8 lines: src/main/java/timewaster/publicteleport/Requests.java:1 <-> src/main/java/timewaster/publicteleport/commands/Portals.java:3
  • 9 lines: src/main/java/timewaster/publicteleport/Requests.java:244 <-> src/main/java/timewaster/publicteleport/Requests.java:206
  • 6 lines: src/main/java/timewaster/publicteleport/Registrar.java:75 <-> src/main/java/timewaster/publicteleport/commands/Portals.java:267
  • 5 lines: src/main/java/timewaster/publicteleport/Registrar.java:223 <-> src/main/java/timewaster/publicteleport/Registrar.java:197
  • 5 lines: src/main/java/timewaster/publicteleport/Portals.java:9 <-> src/main/java/timewaster/publicteleport/Utils.java:11

Powered by astubbs/duplicate-code-cross-check

return false;
}

Teleport target = Teleport.create(player, argValue);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Duplicate code detected - 15 lines duplicated with src/main/java/timewaster/publicteleport/commands/Homes.java:58

@@ -296,7 +306,7 @@ public Boolean setTeleport(ServerPlayer player, Teleport newTeleport, boolean is
int numTeleports = 0;

if (teleports == null) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Duplicate code detected - 7 lines duplicated with src/main/java/timewaster/publicteleport/Storage.java:356

return false;
}
public static boolean teleportPlayer(ServerPlayer player, Teleport teleportTarget) {
ServerLevel level = TeleportSafety.getLevelFromDimension(player, teleportTarget.dimension());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Duplicate code detected - 15 lines duplicated with src/main/java/timewaster/publicteleport/Teleports.java:186

* @param newPortal the {@link Portal} to add or update
* @return {@code true} if successful, {@code false} on file error
*/
public boolean setPortal(ServerPlayer player, Portal newPortal) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Duplicate code detected - 5 lines duplicated with src/main/java/timewaster/publicteleport/Storage.java:418

dispatcher.register(Commands.literal("setwarp").requires(PERMISSIONS_OWNER)
.then(Registrar.buildArgumentString("name", typeNone, (ServerPlayer player, String argValue) -> {
dispatcher.register(Commands.literal("setwarp").requires(Commands.hasPermission(Commands.LEVEL_OWNERS))
.then(Registrar.buildArgumentString("name", NONE, (ServerPlayer player, String argValue) -> {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Duplicate code detected - 4 lines duplicated with src/main/java/timewaster/publicteleport/commands/Warps.java:81

if (argValue.equals("back")) {
Messages.sendMessage(player, "home_reserved_name", Messages.MessageType.WARNING);
Messages.sendMessage(player, "home_reserved_name", WARNING);
return false;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Duplicate code detected - 7 lines duplicated with src/main/java/timewaster/publicteleport/commands/Warps.java:37

@@ -157,7 +197,7 @@ public static RequiredArgumentBuilder<CommandSourceStack, String> buildArgumentS
SuggestionType suggestionType, BiFunction<ServerPlayer, String, Boolean> callback) {
return Commands.argument(argName, Objects.requireNonNull(StringArgumentType.word()))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Duplicate code detected - 4 lines duplicated with src/main/java/timewaster/publicteleport/Registrar.java:224


if (!TeleportSafety.isBlockTeleportable(player, target)) {
Messages.sendMessage(player, "teleport_unsafe_set", Messages.MessageType.ERROR, "Spawn");
Messages.sendMessage(player, "teleport_unsafe_set", ERROR, "Spawn");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Duplicate code detected - 11 lines duplicated with src/main/java/timewaster/publicteleport/commands/Warps.java:43

}

if (type == SuggestionType.PORTALS) {
List<Portal> portals = PublicTeleport.storage.getPortals();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Duplicate code detected - 6 lines duplicated with src/main/java/timewaster/publicteleport/commands/Portals.java:263

@@ -296,7 +323,7 @@ public Boolean setTeleport(ServerPlayer player, Teleport newTeleport, boolean is
int numTeleports = 0;

if (teleports == null) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Duplicate code detected - 7 lines duplicated with src/main/java/timewaster/publicteleport/Storage.java:373

return false;
}
public static boolean teleportPlayer(ServerPlayer player, Teleport teleportTarget) {
ServerLevel level = TeleportSafety.getLevelFromDimension(player, teleportTarget.dimension());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Duplicate code detected - 15 lines duplicated with src/main/java/timewaster/publicteleport/Teleports.java:189

* @param newPortal the {@link Portal} to add or update
* @return {@code true} if successful, {@code false} on file error
*/
public boolean setPortal(ServerPlayer player, Portal newPortal) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Duplicate code detected - 5 lines duplicated with src/main/java/timewaster/publicteleport/Storage.java:435

.then(Registrar.buildArgumentString("name", typeNone, (ServerPlayer player, String argValue) -> {
if (argValue.equals("spawn")) {
dispatcher.register(Commands.literal("setwarp").requires(Commands.hasPermission(Commands.LEVEL_OWNERS))
.then(Registrar.buildArgumentString("name", NONE, (ServerPlayer player, String argValue) -> {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Duplicate code detected - 4 lines duplicated with src/main/java/timewaster/publicteleport/commands/Warps.java:84

@@ -157,7 +200,7 @@ public static RequiredArgumentBuilder<CommandSourceStack, String> buildArgumentS
SuggestionType suggestionType, BiFunction<ServerPlayer, String, Boolean> callback) {
return Commands.argument(argName, Objects.requireNonNull(StringArgumentType.word()))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Duplicate code detected - 4 lines duplicated with src/main/java/timewaster/publicteleport/Registrar.java:227


if (!TeleportSafety.isBlockTeleportable(player, target)) {
Messages.sendMessage(player, "teleport_unsafe_set", Messages.MessageType.ERROR, "Spawn");
Messages.sendMessage(player, "teleport_unsafe_set", ERROR, "Spawn");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Duplicate code detected - 11 lines duplicated with src/main/java/timewaster/publicteleport/commands/Warps.java:46

}

if (type == SuggestionType.PORTALS) {
List<Portal> portals = PublicTeleport.storage.getPortals();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Duplicate code detected - 6 lines duplicated with src/main/java/timewaster/publicteleport/commands/Portals.java:266

return Teleports.teleportPlayer(player, "home", false);
})));

dispatcher.register(Commands.literal("homes")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Duplicate code detected - 3 lines duplicated with src/main/java/timewaster/publicteleport/commands/Warps.java:97

@@ -110,14 +126,18 @@ private Map<String, String> loadTranslations() {
try {
modContainer = fabricLoader.getModContainer(PublicTeleport.MOD_ID).get();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Duplicate code detected - 4 lines duplicated with src/main/java/timewaster/publicteleport/Storage.java:136

@@ -192,26 +202,22 @@ public static boolean cancelRequest(ServerPlayer sender) {
* @return {@code true} if a matching request was found and executed
*/
public static boolean acceptRequest(@Nullable ServerPlayer sender, ServerPlayer receiver) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Duplicate code detected - 9 lines duplicated with src/main/java/timewaster/publicteleport/Requests.java:242

.then(Registrar.buildArgumentString("name", typeNone, (ServerPlayer player, String argValue) -> {
if (argValue.equals("spawn")) {
dispatcher.register(Commands.literal("setwarp").requires(Commands.hasPermission(Commands.LEVEL_OWNERS))
.then(Registrar.buildArgumentString("name", NONE, (ServerPlayer player, String argValue) -> {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Duplicate code detected - 4 lines duplicated with src/main/java/timewaster/publicteleport/commands/Warps.java:78

@@ -192,26 +204,22 @@ public static boolean cancelRequest(ServerPlayer sender) {
* @return {@code true} if a matching request was found and executed
*/
public static boolean acceptRequest(@Nullable ServerPlayer sender, ServerPlayer receiver) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Duplicate code detected - 9 lines duplicated with src/main/java/timewaster/publicteleport/Requests.java:244

* @param newPortal the {@link Portal} to add or update
* @return {@code true} if successful, {@code false} on file error
*/
public boolean setPortal(ServerPlayer player, Portal newPortal) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Duplicate code detected - 5 lines duplicated with src/main/java/timewaster/publicteleport/Storage.java:439

@@ -157,8 +196,8 @@ public static RequiredArgumentBuilder<CommandSourceStack, String> buildArgumentS
SuggestionType suggestionType, BiFunction<ServerPlayer, String, Boolean> callback) {
return Commands.argument(argName, Objects.requireNonNull(StringArgumentType.word()))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Duplicate code detected - 4 lines duplicated with src/main/java/timewaster/publicteleport/Registrar.java:223

@@ -296,32 +325,34 @@ public Boolean setTeleport(ServerPlayer player, Teleport newTeleport, boolean is
int numTeleports = 0;

if (teleports == null) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Duplicate code detected - 6 lines duplicated with src/main/java/timewaster/publicteleport/Storage.java:377

@SebiTimeWaster
SebiTimeWaster force-pushed the upcoming branch 2 times, most recently from 8732491 to c71e8d2 Compare September 19, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant