Skip to content

Commit 3ed0e0e

Browse files
committed
Fix incorrect mapping of ResourceLocationArgument#getId in 1.20.5 & 1.20.6
1 parent c6405f0 commit 3ed0e0e

File tree

6 files changed

+22
-9
lines changed

6 files changed

+22
-9
lines changed

commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.18.2/src/main/java/dev/jorel/commandapi/nms/NMS_1_18_R2.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -572,10 +572,6 @@ public org.bukkit.loot.LootTable getLootTable(CommandContext<CommandSourceStack>
572572
ResourceLocation resourceLocation = ResourceLocationArgument.getId(cmdCtx, key);
573573
return new CraftLootTable(fromResourceLocation(resourceLocation), this.<MinecraftServer>getMinecraftServer().getLootTables().get(resourceLocation));
574574
}
575-
576-
public NamespacedKey getMinecraftKey(CommandContext<CommandSourceStack> cmdCtx, String key) {
577-
return fromResourceLocation(ResourceLocationArgument.getId(cmdCtx, key));
578-
}
579575

580576
@Override
581577
public ParticleData<?> getParticle(CommandContext<CommandSourceStack> cmdCtx, String key) {

commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.18/src/main/java/dev/jorel/commandapi/nms/NMS_1_18_R1.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,8 @@ public org.bukkit.loot.LootTable getLootTable(CommandContext<CommandSourceStack>
520520
ResourceLocation resourceLocation = ResourceLocationArgument.getId(cmdCtx, key);
521521
return new CraftLootTable(fromResourceLocation(resourceLocation), this.<MinecraftServer>getMinecraftServer().getLootTables().get(resourceLocation));
522522
}
523-
523+
524+
@Override
524525
public NamespacedKey getMinecraftKey(CommandContext<CommandSourceStack> cmdCtx, String key) {
525526
return fromResourceLocation(ResourceLocationArgument.getId(cmdCtx, key));
526527
}

commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.20.5/src/main/java/dev/jorel/commandapi/nms/NMS_1_20_R4.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,11 @@ public final org.bukkit.loot.LootTable getLootTable(CommandContext<CommandSource
666666
return CraftLootTable.minecraftToBukkit(ResourceLocationArgument.getId(cmdCtx, key));
667667
}
668668

669+
@Override
670+
public NamespacedKey getMinecraftKey(CommandContext<CommandSourceStack> cmdCtx, String key) {
671+
return fromResourceLocation(ResourceLocationArgument.getId(cmdCtx, key));
672+
}
673+
669674
@Differs(from = "1.20.4", by = "New particle option ColorParticleOption")
670675
@Override
671676
public final ParticleData<?> getParticle(CommandContext<CommandSourceStack> cmdCtx, String key) {

commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-nms-common/src/main/java/dev/jorel/commandapi/nms/NMS_Common.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,7 @@ public final MathOperation getMathOperation(CommandContext<CommandSourceStack> c
476476

477477
@Override
478478
@Overridden(in = "1.17 common; 1.18", because = "1.17 uses ArgumentMinecraftKeyRegistered.f instead of ArgumentMinecraftKeyRegistered.e")
479+
@Overridden(in = "1.20.5, 1.20.6", because = "ArgumentMinecraftKeyRegistered.e -> ArgumentMinecraftKeyRegistered.c")
479480
public NamespacedKey getMinecraftKey(CommandContext<CommandSourceStack> cmdCtx, String key) {
480481
return fromResourceLocation(ResourceLocationArgument.getId(cmdCtx, key));
481482
}

commandapi-preprocessor/src/main/java/dev/jorel/commandapi/preprocessor/Overridden.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@
2020
*******************************************************************************/
2121
package dev.jorel.commandapi.preprocessor;
2222

23-
import java.lang.annotation.ElementType;
24-
import java.lang.annotation.Retention;
25-
import java.lang.annotation.RetentionPolicy;
26-
import java.lang.annotation.Target;
23+
import java.lang.annotation.*;
2724

2825
/**
2926
* Literally just a fancy comment that I can put next to stuff to know why
@@ -32,6 +29,7 @@
3229
*/
3330
@Target(ElementType.METHOD)
3431
@Retention(RetentionPolicy.SOURCE)
32+
@Repeatable(OverriddenRepeatable.class)
3533
public @interface Overridden {
3634

3735
/**
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package dev.jorel.commandapi.preprocessor;
2+
3+
import java.lang.annotation.*;
4+
5+
/**
6+
* The repeatable version of {@link Overridden}
7+
*/
8+
@Target(ElementType.METHOD)
9+
@Retention(RetentionPolicy.SOURCE)
10+
public @interface OverriddenRepeatable {
11+
Overridden[] value();
12+
}

0 commit comments

Comments
 (0)