File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
src/main/java/com/laytonsmith/abstraction/enums/bukkit Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 11package com .laytonsmith .abstraction .enums .bukkit ;
22
33import com .laytonsmith .abstraction .Implementation ;
4+ import com .laytonsmith .abstraction .bukkit .BukkitMCServer ;
45import com .laytonsmith .abstraction .enums .EnumConvertor ;
56import com .laytonsmith .abstraction .enums .MCTeleportCause ;
7+ import com .laytonsmith .abstraction .enums .MCVersion ;
68import com .laytonsmith .annotations .abstractionenum ;
9+ import com .laytonsmith .core .Static ;
710import org .bukkit .event .player .PlayerTeleportEvent .TeleportCause ;
811
912@ abstractionenum (
@@ -21,4 +24,23 @@ public static com.laytonsmith.abstraction.enums.bukkit.BukkitMCTeleportCause get
2124 }
2225 return instance ;
2326 }
27+
28+ @ Override
29+ protected MCTeleportCause getAbstractedEnumCustom (TeleportCause concrete ) {
30+ if (Static .getServer ().getMinecraftVersion ().gte (MCVersion .MC1_21_5 )
31+ && concrete .name ().equals ("CONSUMABLE_EFFECT" )) {
32+ return MCTeleportCause .CHORUS_FRUIT ;
33+ }
34+ return super .getAbstractedEnumCustom (concrete );
35+ }
36+
37+ @ Override
38+ protected TeleportCause getConcreteEnumCustom (MCTeleportCause abstracted ) {
39+ BukkitMCServer server = (BukkitMCServer ) Static .getServer ();
40+ if (server .isPaper () && server .getMinecraftVersion ().gte (MCVersion .MC1_21_5 )
41+ && abstracted == MCTeleportCause .CHORUS_FRUIT ) {
42+ return TeleportCause .valueOf ("CONSUMABLE_EFFECT" );
43+ }
44+ return super .getConcreteEnumCustom (abstracted );
45+ }
2446}
You can’t perform that action at this time.
0 commit comments