From 194b8851d25d8ca875a4ebea02f2d6aa5276af7f Mon Sep 17 00:00:00 2001 From: XiaoMoMi <972454774@qq.com> Date: Mon, 25 Sep 2023 22:25:30 +0800 Subject: [PATCH] 1.20.2 --- plugin/build.gradle.kts | 2 +- plugin/libs/BiomeAPI.jar | Bin 10488 -> 11703 bytes .../compatibility/quest/BattlePassHook.java | 1 - .../mechanic/action/ActionManagerImpl.java | 71 +++++++++++------- .../mechanic/item/ItemManagerImpl.java | 2 + 5 files changed, 48 insertions(+), 28 deletions(-) diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index edfe90b9..795ffed3 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -65,7 +65,7 @@ dependencies { implementation("net.kyori:adventure-text-serializer-legacy:4.14.0") // nbt - implementation("de.tr7zw:item-nbt-api:2.11.3") + implementation("de.tr7zw:item-nbt-api:2.12.0") // bStats implementation("org.bstats:bstats-bukkit:3.0.1") diff --git a/plugin/libs/BiomeAPI.jar b/plugin/libs/BiomeAPI.jar index 00c06717792bd9929cb8177b8d3784f4a8d57471..470bb2cc76cb0f68dc8fceda4e337fde2f874cef 100644 GIT binary patch delta 2411 zcmV-x36%EuQMX$TP)h>@3IG5I2ms2fIaiSm#RST$IaiU_G!e?HIakTUM3FiK007Vk z001VFp$8k2c_j{im6hF78&w#_pOXN)giV2^&`+=}YLgfVNwv@hQwkM}1WEy+Kr3v* z8W!@^Byi5;RTp<-oY;A5jrO?yCs6So{d$v??vZ<&H)HKk6!vcnS&O*V; z=k0<(;6KBE$Pz~O_%fU>9MN#pz%d*bXy5bj5oH9L8Re{9*p@SQ`uuz2t8_=@5}!2C zjUKKBy+_klu_(~t+Z(p(r0Xf1)^Nr^FJ2UA-8U}ap?=y*Zdxh3^0=BuwVQLijI$bi z2K)#x<^vuA8fTfZ31O;3-`#k7FNJGDWfiNQf%8iPnKw~kVmWy!KcW@T} z^1(hi<7)<9$9XQrx>Z~s&8^ugv&MA{vTr-Q66s%=i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`pc~I|H|RZ< zv5G~3lfJ`Yt3kS6z(ox`1}@`Bo zVgJzD+!Y-oHHzpMtx>;@>s1<5bK^DQ+*?%|AZd78ApERpauD;Re3ho^QmUXmh)d;c z-O7l62QyNcs9VWs=cID6KINc#=7Ll%*RA9;m!$GmeaZo)T$Rc-0pGJKJ-7px?2-mj zvYyCyPdUgU;}U4BBwuUX$=TDp*`!^Vw~`r-n6j{B7OjFKxjNWb+H{zMdZt=*n2t}a zMFQSLi7(oewNq8LTQgnAPB-9pM9cjUN#_es?Y$*jgjM%BQg+`u2p7Vny6k)>^f zkky&JO$yTr+NQt*i2F*g!QQO~HKf@a6$fl8d9(ccRdIyga!&sOTA&Q?=STG3LwX$! zwrGVc#}&Q!9WI6gu@U$R?LUa+Z_ruBxiX$F<3+Q#jF;V!sfJjvj4Pi(UZ2RA_8%>O z$-nc_{-d9Yv>(uxXy4oae&iS0EbXtfYqY=7-q`pgB;+(8pMD#qMDtXuhr} z-bk7Vnr|qIHIasb<~2oqZc=a198=Vzk-CHCn~FMgQftthP~>iN$GSgNF@A{3{XupSlBq>gsRy0qVA>B|kPMRalD;gv%kZvjpkd{a* ziq4Z(Nw*c9Al)IoOOl(*&9vm{xYX%{mt{LbQXVE2mI3=#)w78Bl zVve7w+x*nXQ|yxIBsQv9An)XP3TzY3q5W^HYX}Lix>|ZG*83;q+mSiQwo57(CxMoS z&>7wOm(cF3oT%lDhkaJ%QSKkJe+4rFv+N6j90ZS=%T|+dDC7i>n#)#`St&vdkDAL? zU2Lf)7z6+SSd*wJWddCVlR*?7lPxML0+|JqK@=*JgDMh}_$nR(h6j^D6fBeQ2LzKY z3D=GrP3zI< { @@ -435,7 +435,7 @@ public class ActionManagerImpl implements ActionManager { }; } else { LogUtils.warn("Illegal value format found at action: command-nearby"); - return null; + return EmptyAction.instance; } }); } @@ -491,7 +491,7 @@ public class ActionManagerImpl implements ActionManager { }; } else { LogUtils.warn("Illegal value format found at action: command-nearby"); - return null; + return EmptyAction.instance; } }); } @@ -573,7 +573,7 @@ public class ActionManagerImpl implements ActionManager { }; } else { LogUtils.warn("Illegal value format found at action: hologram"); - return null; + return EmptyAction.instance; } }); } @@ -591,7 +591,7 @@ public class ActionManagerImpl implements ActionManager { }; } else { LogUtils.warn("Illegal value format found at action: item-amount"); - return null; + return EmptyAction.instance; } }); } @@ -612,8 +612,8 @@ public class ActionManagerImpl implements ActionManager { } }; } else { - LogUtils.warn("Illegal value format found at action: item-durability"); - return null; + LogUtils.warn("Illegal value format found at action: durability"); + return EmptyAction.instance; } }); } @@ -630,7 +630,7 @@ public class ActionManagerImpl implements ActionManager { }; } else { LogUtils.warn("Illegal value format found at action: give-item"); - return null; + return EmptyAction.instance; } }); } @@ -656,8 +656,8 @@ public class ActionManagerImpl implements ActionManager { ); }; } else { - LogUtils.warn("Illegal value format found at action: hologram"); - return null; + LogUtils.warn("Illegal value format found at action: fake-item"); + return EmptyAction.instance; } }); } @@ -747,7 +747,7 @@ public class ActionManagerImpl implements ActionManager { }; } else { LogUtils.warn("Illegal value format found at action: title"); - return null; + return EmptyAction.instance; } }); registerAction("title-nearby", (args, chance) -> { @@ -781,7 +781,7 @@ public class ActionManagerImpl implements ActionManager { }; } else { LogUtils.warn("Illegal value format found at action: title-nearby"); - return null; + return EmptyAction.instance; } }); registerAction("random-title", (args, chance) -> { @@ -804,7 +804,7 @@ public class ActionManagerImpl implements ActionManager { }; } else { LogUtils.warn("Illegal value format found at action: random-title"); - return null; + return EmptyAction.instance; } }); } @@ -821,9 +821,10 @@ public class ActionManagerImpl implements ActionManager { if (Math.random() > chance) return; condition.getPlayer().addPotionEffect(potionEffect); }; + } else { + LogUtils.warn("Illegal value format found at action: potion-effect"); + return EmptyAction.instance; } - LogUtils.warn("Illegal value format found at action: potion-effect"); - return null; }); } @@ -852,9 +853,10 @@ public class ActionManagerImpl implements ActionManager { if (Math.random() > chance) return; AdventureManagerImpl.getInstance().sendSound(condition.getPlayer(), sound); }; + } else { + LogUtils.warn("Illegal value format found at action: sound"); + return EmptyAction.instance; } - LogUtils.warn("Illegal value format found at action: sound"); - return null; }); } @@ -871,14 +873,14 @@ public class ActionManagerImpl implements ActionManager { return; } } - if (actions != null) - for (Action action : actions) { - action.trigger(condition); - } + for (Action action : actions) { + action.trigger(condition); + } }; + } else { + LogUtils.warn("Illegal value format found at action: conditional"); + return EmptyAction.instance; } - LogUtils.warn("Illegal value format found at action: conditional"); - return null; }); } @@ -910,9 +912,10 @@ public class ActionManagerImpl implements ActionManager { return; } }; + } else { + LogUtils.warn("Illegal value format found at action: priority"); + return EmptyAction.instance; } - LogUtils.warn("Illegal value format found at action: conditional"); - return null; }); } @@ -928,8 +931,10 @@ public class ActionManagerImpl implements ActionManager { it.addXp(condition.getPlayer(), target, exp); }, () -> LogUtils.warn("Plugin (" + pluginName + "'s) level is not compatible. Please double check if it's a problem caused by pronunciation.")); }; + } else { + LogUtils.warn("Illegal value format found at action: plugin-exp"); + return EmptyAction.instance; } - return null; }); } @@ -950,4 +955,18 @@ public class ActionManagerImpl implements ActionManager { }; }); } + + private void registerTempEffectAction() { + registerAction("temp-effects", (args, chance) -> { + if (args instanceof ConfigurationSection section) { + return condition -> { + if (Math.random() > chance) return; + + }; + } else { + LogUtils.warn("Illegal value format found at action: temp-effects"); + return EmptyAction.instance; + } + }); + } } diff --git a/plugin/src/main/java/net/momirealms/customfishing/mechanic/item/ItemManagerImpl.java b/plugin/src/main/java/net/momirealms/customfishing/mechanic/item/ItemManagerImpl.java index a5c08489..2eaeb9a9 100644 --- a/plugin/src/main/java/net/momirealms/customfishing/mechanic/item/ItemManagerImpl.java +++ b/plugin/src/main/java/net/momirealms/customfishing/mechanic/item/ItemManagerImpl.java @@ -233,6 +233,8 @@ public class ItemManagerImpl implements ItemManager, Listener { @NotNull @Override public String getAnyPluginItemID(ItemStack itemStack) { + if (itemStack == null || itemStack.getType() == Material.AIR) + return "AIR"; for (String plugin : CFConfig.itemDetectOrder) { ItemLibrary itemLibrary = itemLibraryMap.get(plugin); if (itemLibrary != null) {