mirror of
https://github.com/xoo0524tw/OpenArcadeGames.git
synced 2026-12-06 02:46:01 +02:00
Consolidate engine and games into common module and unify platform APIs
This commit is contained in:
1 parent
76ac0e3acd
commit
fbed884ad9
1353 files changed
+44571
-59600
No files matched your search
@@ -0,0 +1,40 @@
|
||||
# 編譯用 API
|
||||
|
||||
此目錄的 JAR 供 Maven 編譯器解析外部型別與成員簽章。它們使用 `system` scope,不得由 shade、assembly 或其他封裝步驟加入 ArcadeGames 成品。
|
||||
|
||||
`provided-api-stubs.jar` 提供共用的 Bukkit、外掛及第三方 API metadata,不含 `net.minecraft`、CraftBukkit 或 ArcadeGames 類別。平台模組另外選用對應的 `stubs-*.jar`,同次編譯只能使用一份平台 stub。伺服器執行時仍由實際 API/伺服器提供這些類別。
|
||||
|
||||
| 平台群組 | 編譯用 JAR |
|
||||
| --- | --- |
|
||||
| LATEST,CraftBukkit `v1_18_R2` | `stubs-latest-v1_18_R2.jar` |
|
||||
| LATEST,CraftBukkit `v1_19_R3` | `stubs-latest-v1_19_R3.jar` |
|
||||
| LATEST,CraftBukkit `v1_20_R4` | `stubs-latest-v1_20_R4.jar` |
|
||||
| LATEST,CraftBukkit `v1_21_R7` | `stubs-latest-v1_21_R7.jar` |
|
||||
| LATEST,未帶版本的 CraftBukkit 第一組 | `stubs-latest-modern-a.jar` |
|
||||
| LATEST,未帶版本的 CraftBukkit 第二組 | `stubs-latest-modern-b.jar` |
|
||||
| LEGACY,CraftBukkit `v1_8_R3` | `stubs-legacy-v1_8_R3.jar` |
|
||||
| LEGACY,CraftBukkit `v1_12_R1` | `stubs-legacy-v1_12_R1.jar` |
|
||||
|
||||
`modern-a` 與 `modern-b` 只是區分兩套不同 NMS API 的建置群組名稱。這兩組都直接參照未帶版本的 CraftBukkit 套件;名稱不推定 Minecraft 版本。
|
||||
|
||||
## 來源與驗證
|
||||
|
||||
API metadata 以本機快取中的 Spigot API 1.8.8/1.20.1、Paper API 1.20.1、BungeeCord Chat、Guava、Netty、Gson、Authlib、Brigadier、Commons Lang 等真實依賴為底稿,另參考既有 MBedwars、HBedwars 重建專案的編譯用繼承定義。缺少的第三方類別及 NMS 成員,從兩版原始 ArcadeGames JAR 的 descriptor、`invokeinterface`、`new`、父類別與介面等 bytecode 證據補入。這些補入定義只滿足編譯,沒有實作外部服務行為。
|
||||
|
||||
產生器位於 `tools/dependencies/ArcadeStubGenerator.java`。`GenProvidedStubs.java` 改編自既有 MBedwars 工具,使用 ASM 9.9.1 以讀取 Java 21 classfile。ASM 的 `asm-util` 與 `asm-analysis` 取自 Maven Central;其餘 ASM 套件取自同版 Maven 快取。
|
||||
|
||||
已觀察到原始 LATEST 含有 11 組同 owner、方法名稱與參數,卻具有不同回傳型別的跨版本 NMS 方法。隔離平台 stub 可讓每組保留自己的精確 JVM descriptor,避免單份 union API 改變呼叫目標。
|
||||
|
||||
產出時已以 ASM 檢查全部類別結構;`CheckStubCoverage.java` 另確認兩版全部非 NMS 呼叫,以及八組平台中的外部方法/欄位,都能在所選 stub 及其父型別鏈找到精確 descriptor。這項檢查不代表外部 API 的執行行為已驗證,也不取代重建 JAR 的 ABI、語意及差異行為驗證。
|
||||
|
||||
原始名稱分組與依賴閉包見 `tools/dependencies/adapter-groups-with-suppliers.json`;類別與成員參照清單見同目錄的 `inventory.json`、`nms-usage.json`,產物雜湊見 `artifact-inventory.json`。
|
||||
|
||||
## 最終來源編譯檢查
|
||||
|
||||
`tools/dependencies/verify_platform_sources.py` 以 `javac --release 17 -encoding UTF-8 -proc:none -implicit:none -Xpkginfo:always` 分別編譯八組正式平台來源。每組 classpath 使用已從來源編出的 `common`、對應 `platform-api-*`,以及本目錄的共用 stub 與單一平台 stub。結果保存在 `tools/dependencies/final-source-compile.json` 和 `final-check/<group>/javac.log`。
|
||||
|
||||
2026-12-03 已觀察八組皆為 `exit=0`、`errors=0`。LATEST 各組 19 個來源檔,LEGACY 兩組各 23 個來源檔。這項檢查不使用原始外掛 JAR 作為編譯 classpath。
|
||||
|
||||
最後修復了三種編譯 metadata 問題。Guava `Predicate.test(T)` 依真實 Guava 21 API 保持 default 方法,避免合併 stub 產生第二個抽象 SAM;舊版 `PacketPlay*.a(PacketDataSerializer)` 保留 `IOException` 宣告,使原來源的 catch 可編譯;NMS 建構子與 Java 關鍵字編譯別名依各組原 bytecode 的精確 descriptor 剪裁,避免不同映射版本的多載歧義。
|
||||
|
||||
平台 stub 仍保留 seed 簽章解析需要的其他 namespaced 型別定義,供 javac 完成泛型與繼承 metadata 解析。這不代表重建外掛引用了那些伺服器版本;實際引用由成品 bytecode 驗證。同一編譯 classpath 仍只能選一份平台 stub。
|
||||
+2
-2
@@ -5,8 +5,8 @@ import java.util.concurrent.Executors;
|
||||
import ro.fr33styler.arcade.api.engine.feature.JDK;
|
||||
|
||||
public class Jdk21Features implements JDK {
|
||||
public Thread newThread(Runnable var1) {
|
||||
return Thread.ofVirtual().unstarted(var1);
|
||||
public Thread newThread(Runnable runnable) {
|
||||
return Thread.ofVirtual().unstarted(runnable);
|
||||
}
|
||||
|
||||
public ExecutorService startSingleThreadExecutor() {
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion><parent><groupId>ro.fr33styler.arcade</groupId><artifactId>arcadegames-parent</artifactId><version>2.19f-reconstructed</version><relativePath>../../../pom.xml</relativePath></parent>
|
||||
<artifactId>platform-api-latest</artifactId><properties><maven.compiler.release>17</maven.compiler.release></properties>
|
||||
<dependencies><dependency><groupId>ro.fr33styler.arcade</groupId><artifactId>common</artifactId><version>${project.version}</version></dependency></dependencies>
|
||||
</project>
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
package ro.fr33styler.arcade.game.prophunt.platform;
|
||||
|
||||
import ro.fr33styler.arcade.game.prophunt.prop.PropHuntPropType;
|
||||
|
||||
import java.util.UUID;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public interface PropHuntProp {
|
||||
UUID a();
|
||||
|
||||
PropHuntPropType b();
|
||||
|
||||
ItemStack c();
|
||||
|
||||
Player d();
|
||||
|
||||
void a(Player var1);
|
||||
|
||||
Location e();
|
||||
|
||||
void a(Location var1);
|
||||
|
||||
void f();
|
||||
|
||||
void h();
|
||||
}
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
package ro.fr33styler.arcade.game.prophunt.platform;
|
||||
|
||||
import ro.fr33styler.arcade.game.prophunt.prop.PropHuntPropType;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public interface PropHuntPropFactory {
|
||||
Particle a();
|
||||
|
||||
PropHuntProp a(PropHuntPropType var1, ItemStack var2, Location var3);
|
||||
}
|
||||
-55
@@ -1,55 +0,0 @@
|
||||
package ro.fr33styler.arcade.platform.api;
|
||||
|
||||
import ro.fr33styler.arcade.platform.api.hologram.HologramEntity;
|
||||
import ro.fr33styler.arcade.platform.api.network.PacketInterceptor;
|
||||
import ro.fr33styler.arcade.platform.api.npc.NpcFactory;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scoreboard.Score;
|
||||
import org.bukkit.scoreboard.Team;
|
||||
import org.bukkit.scoreboard.Team.OptionStatus;
|
||||
import ro.fr33styler.arcade.api.engine.command.Command;
|
||||
|
||||
public interface ServerPlatform {
|
||||
NpcFactory a();
|
||||
|
||||
PacketInterceptor b();
|
||||
|
||||
void a(Player var1);
|
||||
|
||||
void a(Player var1, Item var2);
|
||||
|
||||
void a(Command var1);
|
||||
|
||||
void b(Command var1);
|
||||
|
||||
default double b(Player var1) {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
default void a(Player var1, double var2) {
|
||||
}
|
||||
|
||||
void a(Block var1, Material var2);
|
||||
|
||||
default HologramEntity a(Location var1) {
|
||||
return this.a(var1.getWorld(), var1.getX(), var1.getY(), var1.getZ());
|
||||
}
|
||||
|
||||
HologramEntity a(World var1, double var2, double var4, double var6);
|
||||
|
||||
default boolean b(Location var1) {
|
||||
return this.a(var1.getBlock(), var1.getX(), var1.getY(), var1.getZ());
|
||||
}
|
||||
|
||||
boolean a(Block var1, double var2, double var4, double var6);
|
||||
|
||||
void a(Player var1, boolean var2, Score var3, int var4);
|
||||
|
||||
void a(Player var1, Team var2, String var3, String var4, OptionStatus var5);
|
||||
}
|
||||
-70
@@ -1,70 +0,0 @@
|
||||
package ro.fr33styler.arcade.platform.api.npc;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import ro.fr33styler.arcade.api.engine.config.annotation.Setting;
|
||||
import ro.fr33styler.arcade.api.engine.config.serialize.Configuration;
|
||||
|
||||
public final class NpcEquipment implements Configuration {
|
||||
@Setting("main-hand")
|
||||
private Material a = Material.AIR;
|
||||
@Setting("main-hand-model-data")
|
||||
private int b = 0;
|
||||
@Setting("off-hand")
|
||||
private Material c = Material.AIR;
|
||||
@Setting("off-hand-model-data")
|
||||
private int d = 0;
|
||||
@Setting("helmet")
|
||||
private Material e = Material.AIR;
|
||||
@Setting("helmet-model-data")
|
||||
private int f = 0;
|
||||
@Setting("chestplate")
|
||||
private Material g = Material.AIR;
|
||||
@Setting("chestplate-model-data")
|
||||
private int h = 0;
|
||||
@Setting("leggings")
|
||||
private Material i = Material.AIR;
|
||||
@Setting("leggings-model-data")
|
||||
private int j = 0;
|
||||
@Setting("boots")
|
||||
private Material k = Material.AIR;
|
||||
@Setting("boots-model-data")
|
||||
private int l = 0;
|
||||
|
||||
public ItemStack a() {
|
||||
return this.a(this.a, this.b);
|
||||
}
|
||||
|
||||
public ItemStack b() {
|
||||
return this.a(this.c, this.d);
|
||||
}
|
||||
|
||||
public ItemStack c() {
|
||||
return this.a(this.e, this.f);
|
||||
}
|
||||
|
||||
public ItemStack d() {
|
||||
return this.a(this.g, this.h);
|
||||
}
|
||||
|
||||
public ItemStack e() {
|
||||
return this.a(this.i, this.j);
|
||||
}
|
||||
|
||||
public ItemStack f() {
|
||||
return this.a(this.k, this.l);
|
||||
}
|
||||
|
||||
private ItemStack a(Material var1, int var2) {
|
||||
ItemMeta var3 = Bukkit.getItemFactory().getItemMeta(var1);
|
||||
if (var3 != null) {
|
||||
var3.setCustomModelData(var2 == 0 ? null : var2);
|
||||
}
|
||||
|
||||
ItemStack var4 = new ItemStack(var1);
|
||||
var4.setItemMeta(var3);
|
||||
return var4;
|
||||
}
|
||||
}
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
package ro.fr33styler.arcade.platform.api.npc;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public interface NpcFactory {
|
||||
Npc a(Location var1, Player var2);
|
||||
|
||||
Npc a(Location var1, String var2, SkinTexture var3, NpcEquipment var4);
|
||||
}
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
package ro.fr33styler.arcade.platform.api.npc;
|
||||
|
||||
import ro.fr33styler.arcade.api.engine.config.annotation.Setting;
|
||||
import ro.fr33styler.arcade.api.engine.config.serialize.Configuration;
|
||||
|
||||
public final class SkinTexture implements Configuration {
|
||||
@Setting("value")
|
||||
private String a;
|
||||
@Setting("signature")
|
||||
private String b;
|
||||
|
||||
public SkinTexture() {
|
||||
this("", "");
|
||||
}
|
||||
|
||||
public SkinTexture(String var1, String var2) {
|
||||
this.a = var1;
|
||||
this.b = var2;
|
||||
}
|
||||
|
||||
public String a() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public String b() {
|
||||
return this.b;
|
||||
}
|
||||
}
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
package ro.fr33styler.arcade.platform.bukkit.command;
|
||||
|
||||
import java.util.List;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class BukkitCommandBridge extends Command {
|
||||
private final ro.fr33styler.arcade.api.engine.command.Command a;
|
||||
|
||||
BukkitCommandBridge(ro.fr33styler.arcade.api.engine.command.Command var1) {
|
||||
super(var1.getCommand(), "", "/", var1.getAliases());
|
||||
this.a = var1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(CommandSender var1, String var2, String[] var3) {
|
||||
this.a.onExecute(var1, var2, var3);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> tabComplete(CommandSender var1, String var2, String[] var3) {
|
||||
return this.a.onSuggestion(var1, var3);
|
||||
}
|
||||
}
|
||||
-62
@@ -1,62 +0,0 @@
|
||||
package ro.fr33styler.arcade.platform.bukkit.command;
|
||||
|
||||
import ro.fr33styler.arcade.support.reflect.Reflection;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandMap;
|
||||
import org.bukkit.command.SimpleCommandMap;
|
||||
|
||||
public class BukkitCommands {
|
||||
private static CommandMap a;
|
||||
private static Map<String, Command> b;
|
||||
|
||||
public static void a(Command var0) {
|
||||
if (b != null) {
|
||||
var0.register(a);
|
||||
b.put(var0.getName(), var0);
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(ro.fr33styler.arcade.api.engine.command.Command var0) {
|
||||
if (b != null) {
|
||||
BukkitCommandBridge var1 = new BukkitCommandBridge(var0);
|
||||
var1.register(a);
|
||||
b.put(var0.getCommand(), var1);
|
||||
var0.getAliases().forEach(var1x -> b.put(var1x, var1));
|
||||
}
|
||||
}
|
||||
|
||||
public static void b(ro.fr33styler.arcade.api.engine.command.Command var0) {
|
||||
if (b != null) {
|
||||
b.remove(var0.getCommand());
|
||||
var0.getAliases().forEach(b::remove);
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(String var0, List<String> var1) {
|
||||
if (b != null) {
|
||||
b.remove("minecraft:" + var0);
|
||||
var1.forEach(var0x -> b.remove("minecraft:" + var0x));
|
||||
}
|
||||
}
|
||||
|
||||
public static void c(ro.fr33styler.arcade.api.engine.command.Command var0) {
|
||||
a(var0.getCommand(), var0.getAliases());
|
||||
}
|
||||
|
||||
static {
|
||||
try {
|
||||
Server var0 = Bukkit.getServer();
|
||||
a = (CommandMap)var0.getClass().getMethod("getCommandMap").invoke(var0);
|
||||
Field var1 = Reflection.a(SimpleCommandMap.class, "knownCommands");
|
||||
b = (Map<String, Command>)Reflection.a(var1, a);
|
||||
} catch (ReflectiveOperationException var2) {
|
||||
var2.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
package ro.fr33styler.arcade.platform.version;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
public class ServerVersion {
|
||||
public static final String a = Bukkit.getServer().getBukkitVersion().substring(0, Bukkit.getServer().getBukkitVersion().length() - 14);
|
||||
public static final int b = a(a);
|
||||
public static final int c = b(a);
|
||||
public static final boolean d = a();
|
||||
|
||||
public static int a(String var0) {
|
||||
String[] var1 = var0.split("\\.");
|
||||
return Integer.parseInt(var1[0].equals("1") ? var1[1] : var1[0]);
|
||||
}
|
||||
|
||||
public static int b(String var0) {
|
||||
String[] var1 = var0.split("\\.");
|
||||
return var1[0].equals("1") ? 0 : Integer.parseInt(var1[1]);
|
||||
}
|
||||
|
||||
private static boolean a() {
|
||||
try {
|
||||
Class.forName("com.destroystokyo.paper.ParticleBuilder");
|
||||
return true;
|
||||
} catch (ClassNotFoundException var1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
-37
@@ -1,37 +0,0 @@
|
||||
package ro.fr33styler.arcade.support.reflect;
|
||||
|
||||
import ro.fr33styler.arcade.engine.config.validation.GenericTypeValidation;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
public class Reflection {
|
||||
public static Field a(Class<?> var0, Class<?> var1) {
|
||||
for (Field var5 : var0.getDeclaredFields()) {
|
||||
if (var5.getType() == var1) {
|
||||
var5.setAccessible(true);
|
||||
return var5;
|
||||
}
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException("No such field type!");
|
||||
}
|
||||
|
||||
public static Field a(Class<?> var0, String var1) {
|
||||
for (Field var5 : var0.getDeclaredFields()) {
|
||||
if (var5.getName().equals(var1)) {
|
||||
var5.setAccessible(true);
|
||||
return var5;
|
||||
}
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException("No such field type!");
|
||||
}
|
||||
|
||||
public static <T> T a(Field var0, Object var1) {
|
||||
try {
|
||||
return (T)var0.get(var1);
|
||||
} catch (IllegalAccessException failure) {
|
||||
throw GenericTypeValidation.re$propagate(failure);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion><parent><groupId>ro.fr33styler.arcade</groupId><artifactId>arcadegames-parent</artifactId><version>2.19f-reconstructed</version><relativePath>../../../pom.xml</relativePath></parent>
|
||||
<artifactId>platform-api-legacy</artifactId><properties><reconstruction.variant>legacy</reconstruction.variant><maven.compiler.release>17</maven.compiler.release></properties>
|
||||
<dependencies><dependency><groupId>ro.fr33styler.arcade</groupId><artifactId>common</artifactId><version>${project.version}</version></dependency></dependencies>
|
||||
</project>
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
package ro.fr33styler.arcade.game.partygames.platform;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.FallingBlock;
|
||||
|
||||
public interface PartyGamesFallingBlockFactory {
|
||||
FallingBlock a(Location var1, Material var2, byte var3);
|
||||
}
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
package ro.fr33styler.arcade.game.prophunt.platform;
|
||||
|
||||
import ro.fr33styler.arcade.game.prophunt.prop.PropHuntPropType;
|
||||
|
||||
import java.util.UUID;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public interface PropHuntProp {
|
||||
UUID a();
|
||||
|
||||
PropHuntPropType b();
|
||||
|
||||
ItemStack c();
|
||||
|
||||
Player d();
|
||||
|
||||
void a(Player var1);
|
||||
|
||||
Location e();
|
||||
|
||||
void a(Location var1);
|
||||
|
||||
void f();
|
||||
|
||||
void g();
|
||||
}
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
package ro.fr33styler.arcade.game.prophunt.platform;
|
||||
|
||||
import ro.fr33styler.arcade.game.prophunt.prop.PropHuntPropType;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public interface PropHuntPropFactory {
|
||||
PropHuntProp a(PropHuntPropType var1, ItemStack var2, Location var3);
|
||||
}
|
||||
-94
@@ -1,94 +0,0 @@
|
||||
package ro.fr33styler.arcade.platform.api;
|
||||
|
||||
import ro.fr33styler.arcade.platform.api.bossbar.LegacyBossBar;
|
||||
import ro.fr33styler.arcade.platform.api.hologram.HologramEntity;
|
||||
import ro.fr33styler.arcade.platform.api.network.PacketInterceptor;
|
||||
import ro.fr33styler.arcade.platform.api.npc.NpcFactory;
|
||||
import ro.fr33styler.arcade.platform.api.npc.SkinTexture;
|
||||
import ro.fr33styler.arcade.platform.legacy.input.SwapHandListener;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Firework;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
import org.bukkit.scoreboard.NameTagVisibility;
|
||||
import org.bukkit.scoreboard.Score;
|
||||
import org.bukkit.scoreboard.Team;
|
||||
|
||||
public interface ServerPlatform {
|
||||
NpcFactory a();
|
||||
|
||||
PacketInterceptor b();
|
||||
|
||||
LegacyBossBar c();
|
||||
|
||||
void a(Firework var1);
|
||||
|
||||
void a(Entity var1, boolean var2);
|
||||
|
||||
void a(LivingEntity var1, double var2);
|
||||
|
||||
void a(Player var1);
|
||||
|
||||
void a(Player var1, Item var2);
|
||||
|
||||
default double b(Player var1) {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
default void a(Player var1, double var2) {
|
||||
}
|
||||
|
||||
void a(Block var1, Material var2, int var3);
|
||||
|
||||
default HologramEntity a(Location var1) {
|
||||
return this.a(var1.getWorld(), var1.getX(), var1.getY(), var1.getZ());
|
||||
}
|
||||
|
||||
HologramEntity a(World var1, double var2, double var4, double var6);
|
||||
|
||||
default boolean b(Location var1) {
|
||||
return this.a(var1.getBlock(), var1.getX(), var1.getY(), var1.getZ());
|
||||
}
|
||||
|
||||
void a(SkullMeta var1, SkinTexture var2);
|
||||
|
||||
boolean a(Block var1, double var2, double var4, double var6);
|
||||
|
||||
boolean a(PlayerInteractEvent var1);
|
||||
|
||||
boolean a(EntityDamageEvent var1);
|
||||
|
||||
SwapHandListener d();
|
||||
|
||||
SkinTexture c(Player var1);
|
||||
|
||||
ItemStack d(Player var1);
|
||||
|
||||
void a(Player var1, ItemStack var2);
|
||||
|
||||
ItemStack e(Player var1);
|
||||
|
||||
void b(Player var1, ItemStack var2);
|
||||
|
||||
void a(Player var1, boolean var2);
|
||||
|
||||
void a(Player var1, String var2);
|
||||
|
||||
void a(Player var1, String var2, String var3, int var4, int var5, int var6);
|
||||
|
||||
void a(Player var1, String var2, String var3);
|
||||
|
||||
void a(Player var1, boolean var2, Score var3, int var4);
|
||||
|
||||
void a(Player var1, Team var2, String var3, String var4, NameTagVisibility var5);
|
||||
}
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
package ro.fr33styler.arcade.platform.api.bossbar;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public interface LegacyBossBar {
|
||||
void a(Player var1);
|
||||
|
||||
void a(String var1);
|
||||
|
||||
void a(boolean var1);
|
||||
|
||||
void b(Player var1);
|
||||
|
||||
void a();
|
||||
}
|
||||
-66
@@ -1,66 +0,0 @@
|
||||
package ro.fr33styler.arcade.platform.api.npc;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import ro.fr33styler.arcade.api.engine.config.annotation.Setting;
|
||||
import ro.fr33styler.arcade.api.engine.config.serialize.Configuration;
|
||||
|
||||
public final class NpcEquipment implements Configuration {
|
||||
@Setting("main-hand")
|
||||
private Material a = Material.AIR;
|
||||
@Setting("main-hand-model-data")
|
||||
private int b = 0;
|
||||
@Setting("off-hand")
|
||||
private Material c = Material.AIR;
|
||||
@Setting("off-hand-model-data")
|
||||
private int d = 0;
|
||||
@Setting("helmet")
|
||||
private Material e = Material.AIR;
|
||||
@Setting("helmet-model-data")
|
||||
private int f = 0;
|
||||
@Setting("chestplate")
|
||||
private Material g = Material.AIR;
|
||||
@Setting("chestplate-model-data")
|
||||
private int h = 0;
|
||||
@Setting("leggings")
|
||||
private Material i = Material.AIR;
|
||||
@Setting("leggings-model-data")
|
||||
private int j = 0;
|
||||
@Setting("boots")
|
||||
private Material k = Material.AIR;
|
||||
@Setting("boots-model-data")
|
||||
private int l = 0;
|
||||
|
||||
public ItemStack a() {
|
||||
return this.a(this.a, this.b);
|
||||
}
|
||||
|
||||
public ItemStack b() {
|
||||
return this.a(this.c, this.d);
|
||||
}
|
||||
|
||||
public ItemStack c() {
|
||||
return this.a(this.e, this.f);
|
||||
}
|
||||
|
||||
public ItemStack d() {
|
||||
return this.a(this.g, this.h);
|
||||
}
|
||||
|
||||
public ItemStack e() {
|
||||
return this.a(this.i, this.j);
|
||||
}
|
||||
|
||||
public ItemStack f() {
|
||||
return this.a(this.k, this.l);
|
||||
}
|
||||
|
||||
private ItemStack a(Material var1, int var2) {
|
||||
ItemMeta var3 = Bukkit.getItemFactory().getItemMeta(var1);
|
||||
ItemStack var4 = new ItemStack(var1);
|
||||
var4.setItemMeta(var3);
|
||||
return var4;
|
||||
}
|
||||
}
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
package ro.fr33styler.arcade.platform.api.npc;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public interface NpcFactory {
|
||||
Npc a(Location var1, Player var2);
|
||||
|
||||
Npc a(Location var1, String var2, SkinTexture var3, NpcEquipment var4);
|
||||
}
|
||||
-32
@@ -1,32 +0,0 @@
|
||||
package ro.fr33styler.arcade.platform.api.npc;
|
||||
|
||||
import ro.fr33styler.arcade.api.engine.config.annotation.Setting;
|
||||
import ro.fr33styler.arcade.api.engine.config.serialize.Configuration;
|
||||
|
||||
public final class SkinTexture implements Configuration {
|
||||
@Setting("value")
|
||||
private String a;
|
||||
@Setting("signature")
|
||||
private String b;
|
||||
|
||||
public SkinTexture() {
|
||||
this("", "");
|
||||
}
|
||||
|
||||
public SkinTexture(String var1) {
|
||||
this(var1, "");
|
||||
}
|
||||
|
||||
public SkinTexture(String var1, String var2) {
|
||||
this.a = var1;
|
||||
this.b = var2;
|
||||
}
|
||||
|
||||
public String a() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public String b() {
|
||||
return this.b;
|
||||
}
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
package ro.fr33styler.arcade.platform.legacy.input;
|
||||
|
||||
import java.util.function.Function;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
public interface SwapHandListener extends Listener {
|
||||
void a(Function<Player, Boolean> var1);
|
||||
}
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
package ro.fr33styler.arcade.platform.legacy.input;
|
||||
|
||||
import java.util.function.Function;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerSwapHandItemsEvent;
|
||||
|
||||
public class V1_12_2SwapHandListener implements SwapHandListener {
|
||||
private Function<Player, Boolean> a;
|
||||
|
||||
@EventHandler
|
||||
public void a(PlayerSwapHandItemsEvent var1) {
|
||||
Boolean var2 = this.a.apply(var1.getPlayer());
|
||||
if (var2 != null) {
|
||||
var1.setCancelled(var2);
|
||||
}
|
||||
}
|
||||
|
||||
public void a(Function<Player, Boolean> var1) {
|
||||
this.a = var1;
|
||||
}
|
||||
}
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
package ro.fr33styler.arcade.support.reflect;
|
||||
|
||||
import ro.fr33styler.arcade.engine.config.validation.GenericTypeValidation;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
public class Reflection {
|
||||
public static Field a(Class<?> var0, String var1) {
|
||||
for (Field var5 : var0.getDeclaredFields()) {
|
||||
if (var5.getName().equals(var1)) {
|
||||
var5.setAccessible(true);
|
||||
return var5;
|
||||
}
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException("No such field type!");
|
||||
}
|
||||
|
||||
public static <T> T a(Field var0, Object var1) {
|
||||
try {
|
||||
return (T)var0.get(var1);
|
||||
} catch (IllegalAccessException failure) {
|
||||
throw GenericTypeValidation.re$propagate(failure);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,5 +2,5 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion><parent><groupId>ro.fr33styler.arcade</groupId><artifactId>arcadegames-parent</artifactId><version>2.19f-reconstructed</version><relativePath>../../../../pom.xml</relativePath></parent>
|
||||
<artifactId>platforms-latest-modern-a</artifactId><properties><maven.compiler.release>17</maven.compiler.release></properties>
|
||||
<dependencies><dependency><groupId>ro.fr33styler.arcade</groupId><artifactId>common</artifactId><version>${project.version}</version></dependency><dependency><groupId>ro.fr33styler.arcade</groupId><artifactId>platform-api-latest</artifactId><version>${project.version}</version></dependency><dependency><groupId>local.compile-only</groupId><artifactId>latest-modern-a</artifactId><version>2.19f</version><scope>system</scope><systemPath>${maven.multiModuleProjectDirectory}/build-support/deps/stubs-latest-modern-a.jar</systemPath></dependency></dependencies>
|
||||
<dependencies><dependency><groupId>ro.fr33styler.arcade</groupId><artifactId>common</artifactId><version>${project.version}</version></dependency><dependency><groupId>local.compile-only</groupId><artifactId>latest-modern-a</artifactId><version>2.19f</version><scope>system</scope><systemPath>${maven.multiModuleProjectDirectory}/build-support/deps/stubs-latest-modern-a.jar</systemPath></dependency></dependencies>
|
||||
</project>
|
||||
+19
-19
@@ -58,48 +58,48 @@ import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scoreboard.Score;
|
||||
import org.bukkit.scoreboard.Team;
|
||||
import org.bukkit.scoreboard.Team.OptionStatus;
|
||||
import ro.fr33styler.arcade.platform.api.scoreboard.TeamVisibility;
|
||||
import ro.fr33styler.arcade.api.engine.command.Command;
|
||||
|
||||
public class V26_1Platform implements ServerPlatform {
|
||||
private final V26_1NpcFactory a;
|
||||
private final V26_1PacketInterceptor b = new V26_1PacketInterceptor();
|
||||
private static final Field c = Reflection.a(Mob.class, "goalSelector");
|
||||
private static final Field d = Reflection.a(Mob.class, "targetSelector");
|
||||
private static final Field c = Reflection.findFieldByName(Mob.class, "goalSelector");
|
||||
private static final Field d = Reflection.findFieldByName(Mob.class, "targetSelector");
|
||||
|
||||
V26_1Platform(Server var1) {
|
||||
this.a = new V26_1NpcFactory(var1);
|
||||
}
|
||||
|
||||
public V26_1NpcFactory a() {
|
||||
public V26_1NpcFactory getNpcFactory() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public V26_1PacketInterceptor b() {
|
||||
public V26_1PacketInterceptor getPacketInterceptor() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public void a(Player var1) {
|
||||
public void sendHealthUpdate(Player var1) {
|
||||
var1.sendHealthUpdate();
|
||||
}
|
||||
|
||||
public void a(Player var1, Item var2) {
|
||||
public void sendCollectItemAnimation(Player var1, Item var2) {
|
||||
((CraftPlayer)var1)
|
||||
.getHandle()
|
||||
.connection
|
||||
.send(new ClientboundTakeItemEntityPacket(var2.getEntityId(), var1.getEntityId(), var2.getItemStack().getAmount()));
|
||||
}
|
||||
|
||||
public void a(Command var1) {
|
||||
public void registerCommand(Command var1) {
|
||||
this.a(var1, var1.getCommand());
|
||||
var1.getAliases().forEach(var2 -> this.a(var1, var2));
|
||||
}
|
||||
|
||||
public void b(Command var1) {
|
||||
public void unregisterCommand(Command var1) {
|
||||
RootCommandNode var2 = this.e().getDispatcher().getRoot();
|
||||
var2.removeCommand(var1.getCommand());
|
||||
var1.getAliases().forEach(var2::removeCommand);
|
||||
BukkitCommands.b(var1);
|
||||
BukkitCommands.unregisterCommand(var1);
|
||||
}
|
||||
|
||||
private Commands e() {
|
||||
@@ -137,26 +137,26 @@ public class V26_1Platform implements ServerPlatform {
|
||||
return 1;
|
||||
});
|
||||
LiteralCommandNode var4 = var3.build();
|
||||
if (!ServerVersion.d) {
|
||||
BukkitCommands.a(new VanillaCommandWrapper(this.e(), var4));
|
||||
if (!ServerVersion.IS_PAPER) {
|
||||
BukkitCommands.registerBukkitCommand(new VanillaCommandWrapper(this.e(), var4));
|
||||
}
|
||||
|
||||
this.e().getDispatcher().getRoot().addChild(var4);
|
||||
}
|
||||
|
||||
public double b(Player var1) {
|
||||
public double getWaypointReceiveRange(Player var1) {
|
||||
AttributeInstance var2 = var1.getAttribute(Attribute.WAYPOINT_RECEIVE_RANGE);
|
||||
return var2 == null ? 0.0 : var2.getBaseValue();
|
||||
}
|
||||
|
||||
public void a(Player var1, double var2) {
|
||||
public void setWaypointReceiveRange(Player var1, double var2) {
|
||||
AttributeInstance var4 = var1.getAttribute(Attribute.WAYPOINT_RECEIVE_RANGE);
|
||||
if (var4 != null) {
|
||||
var4.setBaseValue(var2);
|
||||
}
|
||||
}
|
||||
|
||||
public void a(Block var1, Material var2) {
|
||||
public void setBlock(Block var1, Material var2) {
|
||||
CraftBlock var3 = (CraftBlock)var1;
|
||||
ServerLevel var4 = var3.getCraftWorld().getHandle();
|
||||
BlockState var5 = CraftMagicNumbers.getBlock(var2).defaultBlockState();
|
||||
@@ -164,11 +164,11 @@ public class V26_1Platform implements ServerPlatform {
|
||||
var4.sendBlockUpdated(var3.getPosition(), var4.getBlockState(var3.getPosition()), var5, 0);
|
||||
}
|
||||
|
||||
public HologramEntity a(World var1, double var2, double var4, double var6) {
|
||||
public HologramEntity createHologram(World var1, double var2, double var4, double var6) {
|
||||
return new V26_1HologramEntity(((CraftWorld)var1).getHandle(), var2, var4, var6);
|
||||
}
|
||||
|
||||
public boolean a(Block var1, double var2, double var4, double var6) {
|
||||
public boolean isInsideBlockHitbox(Block var1, double var2, double var4, double var6) {
|
||||
CraftBlock var8 = (CraftBlock)var1;
|
||||
ServerLevel var9 = var8.getCraftWorld().getHandle();
|
||||
VoxelShape var10 = var9.getBlockState(var8.getPosition()).getShape(var9, var8.getPosition());
|
||||
@@ -188,7 +188,7 @@ public class V26_1Platform implements ServerPlatform {
|
||||
return var17.booleanValue();
|
||||
}
|
||||
|
||||
public void a(Player var1, boolean var2, Score var3, int var4) {
|
||||
public void sendScorePacket(Player var1, boolean var2, Score var3, int var4) {
|
||||
if (var2) {
|
||||
((CraftPlayer)var1).getHandle().connection.send(new ClientboundResetScorePacket(var3.getEntry(), var3.getObjective().getName()));
|
||||
} else {
|
||||
@@ -199,7 +199,7 @@ public class V26_1Platform implements ServerPlatform {
|
||||
}
|
||||
}
|
||||
|
||||
public void a(Player var1, Team var2, String var3, String var4, OptionStatus var5) {
|
||||
public void sendTeamPacket(Player var1, Team var2, String var3, String var4, TeamVisibility var5) {
|
||||
if (var1.getScoreboard() == var2.getScoreboard()) {
|
||||
CraftPlayer var6 = (CraftPlayer)var1;
|
||||
PlayerTeam var7 = var6.getScoreboard().getHandle().getPlayerTeam(var2.getName());
|
||||
|
||||
+3
-3
@@ -6,15 +6,15 @@ import ro.fr33styler.arcade.platform.version.VersionFactory;
|
||||
import org.bukkit.Server;
|
||||
|
||||
public class V26_1PlatformFactory implements VersionFactory<ServerPlatform> {
|
||||
public String a() {
|
||||
public String getVersionLabel() {
|
||||
return "26.1";
|
||||
}
|
||||
|
||||
public boolean a(String var1) {
|
||||
public boolean supports(String var1) {
|
||||
return var1.startsWith("26.1");
|
||||
}
|
||||
|
||||
public ServerPlatform a(Server var1) {
|
||||
public ServerPlatform create(Server var1) {
|
||||
return new V26_1Platform(var1);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -12,7 +12,7 @@ import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class BombLobbersV26_1TntFactory implements BombLobbersTntFactory {
|
||||
public TNTPrimed a(Player var1, Color var2, Vector var3) {
|
||||
public TNTPrimed spawnTnt(Player var1, Color var2, Vector var3) {
|
||||
ServerPlayer var4 = ((CraftPlayer)var1).getHandle();
|
||||
BombLobbersV26_1TntEntity var5 = new BombLobbersV26_1TntEntity(var4, new DustParticleOptions(var2.asRGB(), 1.0F), var3);
|
||||
var4.level().addFreshEntity(var5, SpawnReason.CUSTOM);
|
||||
|
||||
+3
-3
@@ -6,15 +6,15 @@ import ro.fr33styler.arcade.platform.version.VersionFactory;
|
||||
import org.bukkit.Server;
|
||||
|
||||
public class BombLobbersV26_1TntFactorySelector implements VersionFactory<BombLobbersTntFactory> {
|
||||
public String a() {
|
||||
public String getVersionLabel() {
|
||||
return "26.1";
|
||||
}
|
||||
|
||||
public boolean a(String var1) {
|
||||
public boolean supports(String var1) {
|
||||
return var1.startsWith("26.1");
|
||||
}
|
||||
|
||||
public BombLobbersTntFactory a(Server var1) {
|
||||
public BombLobbersTntFactory create(Server var1) {
|
||||
return new BombLobbersV26_1TntFactory();
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -16,15 +16,15 @@ import org.bukkit.entity.WitherSkull;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class MiniWallsV26_1EntityFactory implements MiniWallsEntityFactory {
|
||||
public Wither a(Location var1, Predicate<LivingEntity> var2, Runnable var3) {
|
||||
public Wither spawnWither(Location var1, Predicate<LivingEntity> var2, Runnable var3) {
|
||||
return (Wither)new MiniWallsV26_1Wither(var1, var2, var3).getBukkitEntity();
|
||||
}
|
||||
|
||||
public Arrow a(Player var1, Color var2, Vector var3, Predicate<Entity> var4) {
|
||||
public Arrow spawnArrow(Player var1, Color var2, Vector var3, Predicate<Entity> var4) {
|
||||
return (Arrow)new MiniWallsV26_1Arrow(((CraftPlayer)var1).getHandle(), var2, var3, var4).getBukkitEntity();
|
||||
}
|
||||
|
||||
public WitherSkull a(Wither var1, Vector var2, Predicate<Entity> var3) {
|
||||
public WitherSkull spawnWitherSkull(Wither var1, Vector var2, Predicate<Entity> var3) {
|
||||
return (WitherSkull)new MiniWallsV26_1WitherSkull(((CraftWither)var1).getHandle(), var2, var3).getBukkitEntity();
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -6,15 +6,15 @@ import ro.fr33styler.arcade.platform.version.VersionFactory;
|
||||
import org.bukkit.Server;
|
||||
|
||||
public class MiniWallsV26_1EntityFactorySelector implements VersionFactory<MiniWallsEntityFactory> {
|
||||
public String a() {
|
||||
public String getVersionLabel() {
|
||||
return "26.1";
|
||||
}
|
||||
|
||||
public boolean a(String var1) {
|
||||
public boolean supports(String var1) {
|
||||
return var1.startsWith("26.1");
|
||||
}
|
||||
|
||||
public MiniWallsEntityFactory a(Server var1) {
|
||||
public MiniWallsEntityFactory create(Server var1) {
|
||||
return new MiniWallsV26_1EntityFactory();
|
||||
}
|
||||
}
|
||||
+11
-11
@@ -35,34 +35,34 @@ public class PropHuntV26_1PropEntity extends ArmorStand implements PropHuntProp
|
||||
this.setItemSlot(EquipmentSlot.HEAD, CraftItemStack.asNMSCopy(var2));
|
||||
}
|
||||
|
||||
this.a(var3);
|
||||
this.teleport(var3);
|
||||
}
|
||||
|
||||
public UUID a() {
|
||||
public UUID getUniqueId() {
|
||||
return this.uuid;
|
||||
}
|
||||
|
||||
public PropHuntPropType b() {
|
||||
public PropHuntPropType getPropType() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
public ItemStack c() {
|
||||
public ItemStack getItem() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public Player d() {
|
||||
public Player getOwner() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public void a(Player var1) {
|
||||
public void setOwner(Player var1) {
|
||||
this.a = (CraftPlayer)var1;
|
||||
}
|
||||
|
||||
public Location e() {
|
||||
public Location getLocation() {
|
||||
return new Location(this.level().getWorld(), this.getX(), this.getY() + 1.35, this.getZ(), this.getYRot(), this.getXRot());
|
||||
}
|
||||
|
||||
public void a(Location var1) {
|
||||
public void teleport(Location var1) {
|
||||
double var2 = var1.getX();
|
||||
double var4 = var1.getY() - 1.35;
|
||||
double var6 = var1.getZ();
|
||||
@@ -76,13 +76,13 @@ public class PropHuntV26_1PropEntity extends ArmorStand implements PropHuntProp
|
||||
this.snapTo(var2, var4, var6);
|
||||
}
|
||||
|
||||
public void f() {
|
||||
public void attachOwner() {
|
||||
if (this.a != null) {
|
||||
this.getBukkitEntity().addPassenger(this.a);
|
||||
}
|
||||
}
|
||||
|
||||
public void h() {
|
||||
public void destroy() {
|
||||
this.discard();
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ public class PropHuntV26_1PropEntity extends ArmorStand implements PropHuntProp
|
||||
|
||||
public void tick() {
|
||||
if (this.a != null && !this.a.isInsideVehicle()) {
|
||||
this.a(this.a.getLocation());
|
||||
this.teleport(this.a.getLocation());
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -10,11 +10,11 @@ import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class PropHuntV26_1PropFactory implements PropHuntPropFactory {
|
||||
public Particle a() {
|
||||
public Particle getDisguiseParticle() {
|
||||
return Particle.HAPPY_VILLAGER;
|
||||
}
|
||||
|
||||
public PropHuntProp a(PropHuntPropType var1, ItemStack var2, Location var3) {
|
||||
public PropHuntProp createProp(PropHuntPropType var1, ItemStack var2, Location var3) {
|
||||
PropHuntV26_1PropEntity var4 = new PropHuntV26_1PropEntity(var1, var2, var3);
|
||||
var4.level().addFreshEntity(var4, SpawnReason.CUSTOM);
|
||||
return var4;
|
||||
|
||||
+3
-3
@@ -6,15 +6,15 @@ import ro.fr33styler.arcade.platform.version.VersionFactory;
|
||||
import org.bukkit.Server;
|
||||
|
||||
public class PropHuntV26_1PropFactorySelector implements VersionFactory<PropHuntPropFactory> {
|
||||
public String a() {
|
||||
public String getVersionLabel() {
|
||||
return "26.1";
|
||||
}
|
||||
|
||||
public boolean a(String var1) {
|
||||
public boolean supports(String var1) {
|
||||
return var1.startsWith("26.1");
|
||||
}
|
||||
|
||||
public PropHuntPropFactory a(Server var1) {
|
||||
public PropHuntPropFactory create(Server var1) {
|
||||
return new PropHuntV26_1PropFactory();
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -22,22 +22,22 @@ public class V26_1HologramEntity extends ArmorStand implements HologramEntity {
|
||||
super.setInvisible(true);
|
||||
}
|
||||
|
||||
public void a(String var1) {
|
||||
public void setText(String var1) {
|
||||
super.setCustomName(CraftChatMessage.fromStringOrNull(var1));
|
||||
if (super.hasCustomName()) {
|
||||
super.setCustomNameVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
public LivingEntity a() {
|
||||
public LivingEntity getEntity() {
|
||||
return (LivingEntity)this.getBukkitEntity();
|
||||
}
|
||||
|
||||
public void a(Player var1) {
|
||||
public void updateMetadata(Player var1) {
|
||||
this.a(this.b(var1));
|
||||
}
|
||||
|
||||
public void a(Player var1, boolean var2) {
|
||||
public void setVisible(Player var1, boolean var2) {
|
||||
ServerGamePacketListenerImpl var3 = this.b(var1);
|
||||
if (var2) {
|
||||
var3.send(
|
||||
|
||||
+4
-4
@@ -13,10 +13,10 @@ import org.bukkit.craftbukkit.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class V26_1PacketInterceptor implements PacketInterceptor {
|
||||
private static final Field a = Reflection.a(ServerCommonPacketListenerImpl.class, Connection.class);
|
||||
private static final Field a = Reflection.findFieldByType(ServerCommonPacketListenerImpl.class, Connection.class);
|
||||
|
||||
private Channel a(Player var1) throws IllegalAccessException {
|
||||
Connection var2 = (Connection)Reflection.a(a, ((CraftPlayer)var1).getHandle().connection);
|
||||
Connection var2 = (Connection)Reflection.getFieldValue(a, ((CraftPlayer)var1).getHandle().connection);
|
||||
return var2.channel;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public class V26_1PacketInterceptor implements PacketInterceptor {
|
||||
}
|
||||
}
|
||||
|
||||
public void a(String var1, Player var2) {
|
||||
public void inject(String var1, Player var2) {
|
||||
try {
|
||||
ChannelPipeline var3 = this.a(var2).pipeline();
|
||||
this.a(var3, var1);
|
||||
@@ -37,7 +37,7 @@ public class V26_1PacketInterceptor implements PacketInterceptor {
|
||||
}
|
||||
}
|
||||
|
||||
public void b(String var1, Player var2) {
|
||||
public void eject(String var1, Player var2) {
|
||||
try {
|
||||
Channel var3 = this.a(var2);
|
||||
var3.eventLoop().execute(() -> this.a(var3.pipeline(), var1));
|
||||
|
||||
+4
-4
@@ -37,11 +37,11 @@ public class V26_1Npc extends ServerPlayer implements Npc {
|
||||
this.a = var4;
|
||||
}
|
||||
|
||||
public int a() {
|
||||
public int getEntityId() {
|
||||
return this.getId();
|
||||
}
|
||||
|
||||
public Location b() {
|
||||
public Location getLocation() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class V26_1Npc extends ServerPlayer implements Npc {
|
||||
this.b = var1;
|
||||
}
|
||||
|
||||
public void a(Player var1, boolean var2) {
|
||||
public void setVisible(Player var1, boolean var2) {
|
||||
this.connection = this.b(var1);
|
||||
if (var2) {
|
||||
this.connection.send(new ClientboundPlayerInfoUpdatePacket(Action.ADD_PLAYER, this));
|
||||
@@ -85,7 +85,7 @@ public class V26_1Npc extends ServerPlayer implements Npc {
|
||||
return ((CraftPlayer)var1).getHandle().connection;
|
||||
}
|
||||
|
||||
public void a(Player var1) {
|
||||
public void removeFromTabList(Player var1) {
|
||||
this.b(var1).send(new ClientboundPlayerInfoRemovePacket(List.of(this.uuid)));
|
||||
}
|
||||
}
|
||||
+9
-9
@@ -28,7 +28,7 @@ public class V26_1NpcFactory implements NpcFactory {
|
||||
this.a = var1;
|
||||
}
|
||||
|
||||
public V26_1Npc a(Location var1, Player var2) {
|
||||
public V26_1Npc createPlayerNpc(Location var1, Player var2) {
|
||||
ServerPlayer var3 = ((CraftPlayer)var2).getHandle();
|
||||
GameProfile var4 = new GameProfile(UUID.randomUUID(), var2.getName(), var3.getGameProfile().properties());
|
||||
return new V26_1Npc(((CraftServer)this.a).getServer(), var3.level(), var4, var1);
|
||||
@@ -36,20 +36,20 @@ public class V26_1NpcFactory implements NpcFactory {
|
||||
|
||||
public V26_1Npc a(Location var1, String var2, SkinTexture var3) {
|
||||
CraftWorld var4 = (CraftWorld)var1.getWorld();
|
||||
ImmutableMultimap var5 = ImmutableMultimap.of("textures", new Property("textures", var3.a(), var3.b()));
|
||||
ImmutableMultimap var5 = ImmutableMultimap.of("textures", new Property("textures", var3.getValue(), var3.getSignature()));
|
||||
GameProfile var6 = new GameProfile(UUID.randomUUID(), var2, new PropertyMap(var5));
|
||||
return new V26_1Npc(((CraftServer)this.a).getServer(), var4.getHandle(), var6, var1);
|
||||
}
|
||||
|
||||
public V26_1Npc a(Location var1, String var2, SkinTexture var3, NpcEquipment var4) {
|
||||
public V26_1Npc createNpc(Location var1, String var2, SkinTexture var3, NpcEquipment var4) {
|
||||
V26_1Npc var5 = this.a(var1, var2, var3);
|
||||
ArrayList var6 = new ArrayList();
|
||||
var6.add(new Pair(EquipmentSlot.MAINHAND, CraftItemStack.asNMSCopy(var4.a())));
|
||||
var6.add(new Pair(EquipmentSlot.OFFHAND, CraftItemStack.asNMSCopy(var4.b())));
|
||||
var6.add(new Pair(EquipmentSlot.HEAD, CraftItemStack.asNMSCopy(var4.c())));
|
||||
var6.add(new Pair(EquipmentSlot.CHEST, CraftItemStack.asNMSCopy(var4.d())));
|
||||
var6.add(new Pair(EquipmentSlot.LEGS, CraftItemStack.asNMSCopy(var4.e())));
|
||||
var6.add(new Pair(EquipmentSlot.FEET, CraftItemStack.asNMSCopy(var4.f())));
|
||||
var6.add(new Pair(EquipmentSlot.MAINHAND, CraftItemStack.asNMSCopy(var4.getMainHandItem())));
|
||||
var6.add(new Pair(EquipmentSlot.OFFHAND, CraftItemStack.asNMSCopy(var4.getOffHandItem())));
|
||||
var6.add(new Pair(EquipmentSlot.HEAD, CraftItemStack.asNMSCopy(var4.getHelmetItem())));
|
||||
var6.add(new Pair(EquipmentSlot.CHEST, CraftItemStack.asNMSCopy(var4.getChestplateItem())));
|
||||
var6.add(new Pair(EquipmentSlot.LEGS, CraftItemStack.asNMSCopy(var4.getLeggingsItem())));
|
||||
var6.add(new Pair(EquipmentSlot.FEET, CraftItemStack.asNMSCopy(var4.getBootsItem())));
|
||||
var5.a(var6);
|
||||
return var5;
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion><parent><groupId>ro.fr33styler.arcade</groupId><artifactId>arcadegames-parent</artifactId><version>2.19f-reconstructed</version><relativePath>../../../../pom.xml</relativePath></parent>
|
||||
<artifactId>platforms-latest-modern-b</artifactId><properties><maven.compiler.release>17</maven.compiler.release></properties>
|
||||
<dependencies><dependency><groupId>ro.fr33styler.arcade</groupId><artifactId>common</artifactId><version>${project.version}</version></dependency><dependency><groupId>ro.fr33styler.arcade</groupId><artifactId>platform-api-latest</artifactId><version>${project.version}</version></dependency><dependency><groupId>local.compile-only</groupId><artifactId>latest-modern-b</artifactId><version>2.19f</version><scope>system</scope><systemPath>${maven.multiModuleProjectDirectory}/build-support/deps/stubs-latest-modern-b.jar</systemPath></dependency></dependencies>
|
||||
<dependencies><dependency><groupId>ro.fr33styler.arcade</groupId><artifactId>common</artifactId><version>${project.version}</version></dependency><dependency><groupId>local.compile-only</groupId><artifactId>latest-modern-b</artifactId><version>2.19f</version><scope>system</scope><systemPath>${maven.multiModuleProjectDirectory}/build-support/deps/stubs-latest-modern-b.jar</systemPath></dependency></dependencies>
|
||||
</project>
|
||||
+19
-19
@@ -60,48 +60,48 @@ import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scoreboard.Score;
|
||||
import org.bukkit.scoreboard.Team;
|
||||
import org.bukkit.scoreboard.Team.OptionStatus;
|
||||
import ro.fr33styler.arcade.platform.api.scoreboard.TeamVisibility;
|
||||
import ro.fr33styler.arcade.api.engine.command.Command;
|
||||
|
||||
public class V26_2Platform implements ServerPlatform {
|
||||
private final V26_2NpcFactory a;
|
||||
private final V26_2PacketInterceptor b = new V26_2PacketInterceptor();
|
||||
private static final Field c = Reflection.a(Mob.class, "goalSelector");
|
||||
private static final Field d = Reflection.a(Mob.class, "targetSelector");
|
||||
private static final Field c = Reflection.findFieldByName(Mob.class, "goalSelector");
|
||||
private static final Field d = Reflection.findFieldByName(Mob.class, "targetSelector");
|
||||
|
||||
V26_2Platform(Server var1) {
|
||||
this.a = new V26_2NpcFactory(var1);
|
||||
}
|
||||
|
||||
public V26_2NpcFactory a() {
|
||||
public V26_2NpcFactory getNpcFactory() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public V26_2PacketInterceptor b() {
|
||||
public V26_2PacketInterceptor getPacketInterceptor() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public void a(Player var1) {
|
||||
public void sendHealthUpdate(Player var1) {
|
||||
var1.sendHealthUpdate();
|
||||
}
|
||||
|
||||
public void a(Player var1, Item var2) {
|
||||
public void sendCollectItemAnimation(Player var1, Item var2) {
|
||||
((CraftPlayer)var1)
|
||||
.getHandle()
|
||||
.connection
|
||||
.send(new ClientboundTakeItemEntityPacket(var2.getEntityId(), var1.getEntityId(), var2.getItemStack().getAmount()));
|
||||
}
|
||||
|
||||
public void a(Command var1) {
|
||||
public void registerCommand(Command var1) {
|
||||
this.a(var1, var1.getCommand());
|
||||
var1.getAliases().forEach(var2 -> this.a(var1, var2));
|
||||
}
|
||||
|
||||
public void b(Command var1) {
|
||||
public void unregisterCommand(Command var1) {
|
||||
RootCommandNode var2 = this.e().getDispatcher().getRoot();
|
||||
var2.removeCommand(var1.getCommand());
|
||||
var1.getAliases().forEach(var2::removeCommand);
|
||||
BukkitCommands.b(var1);
|
||||
BukkitCommands.unregisterCommand(var1);
|
||||
}
|
||||
|
||||
private Commands e() {
|
||||
@@ -139,26 +139,26 @@ public class V26_2Platform implements ServerPlatform {
|
||||
return 1;
|
||||
});
|
||||
LiteralCommandNode var4 = var3.build();
|
||||
if (!ServerVersion.d) {
|
||||
BukkitCommands.a(new VanillaCommandWrapper(this.e(), var4));
|
||||
if (!ServerVersion.IS_PAPER) {
|
||||
BukkitCommands.registerBukkitCommand(new VanillaCommandWrapper(this.e(), var4));
|
||||
}
|
||||
|
||||
this.e().getDispatcher().getRoot().addChild(var4);
|
||||
}
|
||||
|
||||
public double b(Player var1) {
|
||||
public double getWaypointReceiveRange(Player var1) {
|
||||
AttributeInstance var2 = var1.getAttribute(Attribute.WAYPOINT_RECEIVE_RANGE);
|
||||
return var2 == null ? 0.0 : var2.getBaseValue();
|
||||
}
|
||||
|
||||
public void a(Player var1, double var2) {
|
||||
public void setWaypointReceiveRange(Player var1, double var2) {
|
||||
AttributeInstance var4 = var1.getAttribute(Attribute.WAYPOINT_RECEIVE_RANGE);
|
||||
if (var4 != null) {
|
||||
var4.setBaseValue(var2);
|
||||
}
|
||||
}
|
||||
|
||||
public void a(Block var1, Material var2) {
|
||||
public void setBlock(Block var1, Material var2) {
|
||||
CraftBlock var3 = (CraftBlock)var1;
|
||||
ServerLevel var4 = var3.getCraftWorld().getHandle();
|
||||
BlockState var5 = CraftMagicNumbers.getBlock(var2).defaultBlockState();
|
||||
@@ -166,11 +166,11 @@ public class V26_2Platform implements ServerPlatform {
|
||||
var4.sendBlockUpdated(var3.getPosition(), var4.getBlockState(var3.getPosition()), var5, 0);
|
||||
}
|
||||
|
||||
public HologramEntity a(World var1, double var2, double var4, double var6) {
|
||||
public HologramEntity createHologram(World var1, double var2, double var4, double var6) {
|
||||
return new V26_2HologramEntity(((CraftWorld)var1).getHandle(), var2, var4, var6);
|
||||
}
|
||||
|
||||
public boolean a(Block var1, double var2, double var4, double var6) {
|
||||
public boolean isInsideBlockHitbox(Block var1, double var2, double var4, double var6) {
|
||||
CraftBlock var8 = (CraftBlock)var1;
|
||||
ServerLevel var9 = var8.getCraftWorld().getHandle();
|
||||
VoxelShape var10 = var9.getBlockState(var8.getPosition()).getShape(var9, var8.getPosition());
|
||||
@@ -190,7 +190,7 @@ public class V26_2Platform implements ServerPlatform {
|
||||
return var17.booleanValue();
|
||||
}
|
||||
|
||||
public void a(Player var1, boolean var2, Score var3, int var4) {
|
||||
public void sendScorePacket(Player var1, boolean var2, Score var3, int var4) {
|
||||
if (var2) {
|
||||
((CraftPlayer)var1).getHandle().connection.send(new ClientboundResetScorePacket(var3.getEntry(), var3.getObjective().getName()));
|
||||
} else {
|
||||
@@ -201,7 +201,7 @@ public class V26_2Platform implements ServerPlatform {
|
||||
}
|
||||
}
|
||||
|
||||
public void a(Player var1, Team var2, String var3, String var4, OptionStatus var5) {
|
||||
public void sendTeamPacket(Player var1, Team var2, String var3, String var4, TeamVisibility var5) {
|
||||
if (var1.getScoreboard() == var2.getScoreboard()) {
|
||||
CraftPlayer var6 = (CraftPlayer)var1;
|
||||
PlayerTeam var7 = var6.getScoreboard().getHandle().getPlayerTeam(var2.getName());
|
||||
|
||||
+5
-5
@@ -7,16 +7,16 @@ import ro.fr33styler.arcade.platform.version.VersionFactory;
|
||||
import org.bukkit.Server;
|
||||
|
||||
public class V26_2PlatformFactory implements VersionFactory<ServerPlatform> {
|
||||
public String a() {
|
||||
public String getVersionLabel() {
|
||||
return "26.2+";
|
||||
}
|
||||
|
||||
public boolean a(String var1) {
|
||||
int var2 = ServerVersion.a(var1);
|
||||
return var2 >= 27 || var2 == 26 && ServerVersion.b(var1) >= 2;
|
||||
public boolean supports(String var1) {
|
||||
int var2 = ServerVersion.parseMajorVersion(var1);
|
||||
return var2 >= 27 || var2 == 26 && ServerVersion.parseMinorVersion(var1) >= 2;
|
||||
}
|
||||
|
||||
public ServerPlatform a(Server var1) {
|
||||
public ServerPlatform create(Server var1) {
|
||||
return new V26_2Platform(var1);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -12,7 +12,7 @@ import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class BombLobbersV26_2TntFactory implements BombLobbersTntFactory {
|
||||
public TNTPrimed a(Player var1, Color var2, Vector var3) {
|
||||
public TNTPrimed spawnTnt(Player var1, Color var2, Vector var3) {
|
||||
ServerPlayer var4 = ((CraftPlayer)var1).getHandle();
|
||||
BombLobbersV26_2TntEntity var5 = new BombLobbersV26_2TntEntity(var4, new DustParticleOptions(var2.asRGB(), 1.0F), var3);
|
||||
var4.level().addFreshEntity(var5, SpawnReason.CUSTOM);
|
||||
|
||||
+5
-5
@@ -7,16 +7,16 @@ import ro.fr33styler.arcade.platform.version.VersionFactory;
|
||||
import org.bukkit.Server;
|
||||
|
||||
public class BombLobbersV26_2TntFactorySelector implements VersionFactory<BombLobbersTntFactory> {
|
||||
public String a() {
|
||||
public String getVersionLabel() {
|
||||
return "26.2+";
|
||||
}
|
||||
|
||||
public boolean a(String var1) {
|
||||
int var2 = ServerVersion.a(var1);
|
||||
return var2 >= 27 || var2 == 26 && ServerVersion.b(var1) >= 2;
|
||||
public boolean supports(String var1) {
|
||||
int var2 = ServerVersion.parseMajorVersion(var1);
|
||||
return var2 >= 27 || var2 == 26 && ServerVersion.parseMinorVersion(var1) >= 2;
|
||||
}
|
||||
|
||||
public BombLobbersTntFactory a(Server var1) {
|
||||
public BombLobbersTntFactory create(Server var1) {
|
||||
return new BombLobbersV26_2TntFactory();
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -16,15 +16,15 @@ import org.bukkit.entity.WitherSkull;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class MiniWallsV26_2EntityFactory implements MiniWallsEntityFactory {
|
||||
public Wither a(Location var1, Predicate<LivingEntity> var2, Runnable var3) {
|
||||
public Wither spawnWither(Location var1, Predicate<LivingEntity> var2, Runnable var3) {
|
||||
return (Wither)new MiniWallsV26_2Wither(var1, var2, var3).getBukkitEntity();
|
||||
}
|
||||
|
||||
public Arrow a(Player var1, Color var2, Vector var3, Predicate<Entity> var4) {
|
||||
public Arrow spawnArrow(Player var1, Color var2, Vector var3, Predicate<Entity> var4) {
|
||||
return (Arrow)new MiniWallsV26_2Arrow(((CraftPlayer)var1).getHandle(), var2, var3, var4).getBukkitEntity();
|
||||
}
|
||||
|
||||
public WitherSkull a(Wither var1, Vector var2, Predicate<Entity> var3) {
|
||||
public WitherSkull spawnWitherSkull(Wither var1, Vector var2, Predicate<Entity> var3) {
|
||||
return (WitherSkull)new MiniWallsV26_2WitherSkull(((CraftWither)var1).getHandle(), var2, var3).getBukkitEntity();
|
||||
}
|
||||
}
|
||||
+5
-5
@@ -7,16 +7,16 @@ import ro.fr33styler.arcade.platform.version.VersionFactory;
|
||||
import org.bukkit.Server;
|
||||
|
||||
public class MiniWallsV26_2EntityFactorySelector implements VersionFactory<MiniWallsEntityFactory> {
|
||||
public String a() {
|
||||
public String getVersionLabel() {
|
||||
return "26.2+";
|
||||
}
|
||||
|
||||
public boolean a(String var1) {
|
||||
int var2 = ServerVersion.a(var1);
|
||||
return var2 >= 27 || var2 == 26 && ServerVersion.b(var1) >= 2;
|
||||
public boolean supports(String var1) {
|
||||
int var2 = ServerVersion.parseMajorVersion(var1);
|
||||
return var2 >= 27 || var2 == 26 && ServerVersion.parseMinorVersion(var1) >= 2;
|
||||
}
|
||||
|
||||
public MiniWallsEntityFactory a(Server var1) {
|
||||
public MiniWallsEntityFactory create(Server var1) {
|
||||
return new MiniWallsV26_2EntityFactory();
|
||||
}
|
||||
}
|
||||
+11
-11
@@ -35,34 +35,34 @@ public class PropHuntV26_2PropEntity extends ArmorStand implements PropHuntProp
|
||||
this.setItemSlot(EquipmentSlot.HEAD, CraftItemStack.asNMSCopy(var2));
|
||||
}
|
||||
|
||||
this.a(var3);
|
||||
this.teleport(var3);
|
||||
}
|
||||
|
||||
public UUID a() {
|
||||
public UUID getUniqueId() {
|
||||
return this.uuid;
|
||||
}
|
||||
|
||||
public PropHuntPropType b() {
|
||||
public PropHuntPropType getPropType() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
public ItemStack c() {
|
||||
public ItemStack getItem() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public Player d() {
|
||||
public Player getOwner() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public void a(Player var1) {
|
||||
public void setOwner(Player var1) {
|
||||
this.a = (CraftPlayer)var1;
|
||||
}
|
||||
|
||||
public Location e() {
|
||||
public Location getLocation() {
|
||||
return new Location(this.level().getWorld(), this.getX(), this.getY() + 1.35, this.getZ(), this.getYRot(), this.getXRot());
|
||||
}
|
||||
|
||||
public void a(Location var1) {
|
||||
public void teleport(Location var1) {
|
||||
double var2 = var1.getX();
|
||||
double var4 = var1.getY() - 1.35;
|
||||
double var6 = var1.getZ();
|
||||
@@ -76,13 +76,13 @@ public class PropHuntV26_2PropEntity extends ArmorStand implements PropHuntProp
|
||||
this.snapTo(var2, var4, var6);
|
||||
}
|
||||
|
||||
public void f() {
|
||||
public void attachOwner() {
|
||||
if (this.a != null) {
|
||||
this.getBukkitEntity().addPassenger(this.a);
|
||||
}
|
||||
}
|
||||
|
||||
public void h() {
|
||||
public void destroy() {
|
||||
this.discard();
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ public class PropHuntV26_2PropEntity extends ArmorStand implements PropHuntProp
|
||||
|
||||
public void tick() {
|
||||
if (this.a != null && !this.a.isInsideVehicle()) {
|
||||
this.a(this.a.getLocation());
|
||||
this.teleport(this.a.getLocation());
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -10,11 +10,11 @@ import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class PropHuntV26_2PropFactory implements PropHuntPropFactory {
|
||||
public Particle a() {
|
||||
public Particle getDisguiseParticle() {
|
||||
return Particle.HAPPY_VILLAGER;
|
||||
}
|
||||
|
||||
public PropHuntProp a(PropHuntPropType var1, ItemStack var2, Location var3) {
|
||||
public PropHuntProp createProp(PropHuntPropType var1, ItemStack var2, Location var3) {
|
||||
PropHuntV26_2PropEntity var4 = new PropHuntV26_2PropEntity(var1, var2, var3);
|
||||
var4.level().addFreshEntity(var4, SpawnReason.CUSTOM);
|
||||
return var4;
|
||||
|
||||
+5
-5
@@ -7,16 +7,16 @@ import ro.fr33styler.arcade.platform.version.VersionFactory;
|
||||
import org.bukkit.Server;
|
||||
|
||||
public class PropHuntV26_2PropFactorySelector implements VersionFactory<PropHuntPropFactory> {
|
||||
public String a() {
|
||||
public String getVersionLabel() {
|
||||
return "26.2+";
|
||||
}
|
||||
|
||||
public boolean a(String var1) {
|
||||
int var2 = ServerVersion.a(var1);
|
||||
return var2 >= 27 || var2 == 26 && ServerVersion.b(var1) >= 2;
|
||||
public boolean supports(String var1) {
|
||||
int var2 = ServerVersion.parseMajorVersion(var1);
|
||||
return var2 >= 27 || var2 == 26 && ServerVersion.parseMinorVersion(var1) >= 2;
|
||||
}
|
||||
|
||||
public PropHuntPropFactory a(Server var1) {
|
||||
public PropHuntPropFactory create(Server var1) {
|
||||
return new PropHuntV26_2PropFactory();
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -22,22 +22,22 @@ public class V26_2HologramEntity extends ArmorStand implements HologramEntity {
|
||||
super.setInvisible(true);
|
||||
}
|
||||
|
||||
public void a(String var1) {
|
||||
public void setText(String var1) {
|
||||
super.setCustomName(CraftChatMessage.fromStringOrNull(var1));
|
||||
if (super.hasCustomName()) {
|
||||
super.setCustomNameVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
public LivingEntity a() {
|
||||
public LivingEntity getEntity() {
|
||||
return (LivingEntity)this.getBukkitEntity();
|
||||
}
|
||||
|
||||
public void a(Player var1) {
|
||||
public void updateMetadata(Player var1) {
|
||||
this.a(this.b(var1));
|
||||
}
|
||||
|
||||
public void a(Player var1, boolean var2) {
|
||||
public void setVisible(Player var1, boolean var2) {
|
||||
ServerGamePacketListenerImpl var3 = this.b(var1);
|
||||
if (var2) {
|
||||
var3.send(
|
||||
|
||||
+4
-4
@@ -13,10 +13,10 @@ import org.bukkit.craftbukkit.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class V26_2PacketInterceptor implements PacketInterceptor {
|
||||
private static final Field a = Reflection.a(ServerCommonPacketListenerImpl.class, Connection.class);
|
||||
private static final Field a = Reflection.findFieldByType(ServerCommonPacketListenerImpl.class, Connection.class);
|
||||
|
||||
private Channel a(Player var1) throws IllegalAccessException {
|
||||
Connection var2 = (Connection)Reflection.a(a, ((CraftPlayer)var1).getHandle().connection);
|
||||
Connection var2 = (Connection)Reflection.getFieldValue(a, ((CraftPlayer)var1).getHandle().connection);
|
||||
return var2.channel;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public class V26_2PacketInterceptor implements PacketInterceptor {
|
||||
}
|
||||
}
|
||||
|
||||
public void a(String var1, Player var2) {
|
||||
public void inject(String var1, Player var2) {
|
||||
try {
|
||||
ChannelPipeline var3 = this.a(var2).pipeline();
|
||||
this.a(var3, var1);
|
||||
@@ -37,7 +37,7 @@ public class V26_2PacketInterceptor implements PacketInterceptor {
|
||||
}
|
||||
}
|
||||
|
||||
public void b(String var1, Player var2) {
|
||||
public void eject(String var1, Player var2) {
|
||||
try {
|
||||
Channel var3 = this.a(var2);
|
||||
var3.eventLoop().execute(() -> this.a(var3.pipeline(), var1));
|
||||
|
||||
+5
-5
@@ -41,11 +41,11 @@ public class V26_2Npc extends ServerPlayer implements Npc {
|
||||
this.a = var4;
|
||||
}
|
||||
|
||||
public int a() {
|
||||
public int getEntityId() {
|
||||
return this.getId();
|
||||
}
|
||||
|
||||
public Location b() {
|
||||
public Location getLocation() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class V26_2Npc extends ServerPlayer implements Npc {
|
||||
this.b = var1;
|
||||
}
|
||||
|
||||
public void a(Player var1, boolean var2) {
|
||||
public void setVisible(Player var1, boolean var2) {
|
||||
this.connection = this.b(var1);
|
||||
if (var2) {
|
||||
this.connection.send(new ClientboundPlayerInfoUpdatePacket(Action.ADD_PLAYER, this));
|
||||
@@ -79,7 +79,7 @@ public class V26_2Npc extends ServerPlayer implements Npc {
|
||||
this.connection.send(new ClientboundSetEquipmentPacket(this.getId(), this.b));
|
||||
}
|
||||
|
||||
if (ServerVersion.b < 27 && ServerVersion.c < 3) {
|
||||
if (ServerVersion.MAJOR_VERSION < 27 && ServerVersion.MINOR_VERSION < 3) {
|
||||
this.connection.send(new ClientboundAnimatePacket(this, 0));
|
||||
} else {
|
||||
this.connection.send(new ClientboundSwingAnimationPacket(this, InteractionHand.MAIN_HAND, SwingAnimation.DEFAULT));
|
||||
@@ -93,7 +93,7 @@ public class V26_2Npc extends ServerPlayer implements Npc {
|
||||
return ((CraftPlayer)var1).getHandle().connection;
|
||||
}
|
||||
|
||||
public void a(Player var1) {
|
||||
public void removeFromTabList(Player var1) {
|
||||
this.b(var1).send(new ClientboundPlayerInfoRemovePacket(List.of(this.uuid)));
|
||||
}
|
||||
}
|
||||
+9
-9
@@ -28,7 +28,7 @@ public class V26_2NpcFactory implements NpcFactory {
|
||||
this.a = var1;
|
||||
}
|
||||
|
||||
public V26_2Npc a(Location var1, Player var2) {
|
||||
public V26_2Npc createPlayerNpc(Location var1, Player var2) {
|
||||
ServerPlayer var3 = ((CraftPlayer)var2).getHandle();
|
||||
GameProfile var4 = new GameProfile(UUID.randomUUID(), var2.getName(), var3.getGameProfile().properties());
|
||||
return new V26_2Npc(((CraftServer)this.a).getServer(), var3.level(), var4, var1);
|
||||
@@ -36,20 +36,20 @@ public class V26_2NpcFactory implements NpcFactory {
|
||||
|
||||
public V26_2Npc a(Location var1, String var2, SkinTexture var3) {
|
||||
CraftWorld var4 = (CraftWorld)var1.getWorld();
|
||||
ImmutableMultimap var5 = ImmutableMultimap.of("textures", new Property("textures", var3.a(), var3.b()));
|
||||
ImmutableMultimap var5 = ImmutableMultimap.of("textures", new Property("textures", var3.getValue(), var3.getSignature()));
|
||||
GameProfile var6 = new GameProfile(UUID.randomUUID(), var2, new PropertyMap(var5));
|
||||
return new V26_2Npc(((CraftServer)this.a).getServer(), var4.getHandle(), var6, var1);
|
||||
}
|
||||
|
||||
public V26_2Npc a(Location var1, String var2, SkinTexture var3, NpcEquipment var4) {
|
||||
public V26_2Npc createNpc(Location var1, String var2, SkinTexture var3, NpcEquipment var4) {
|
||||
V26_2Npc var5 = this.a(var1, var2, var3);
|
||||
ArrayList var6 = new ArrayList();
|
||||
var6.add(new Pair(EquipmentSlot.MAINHAND, CraftItemStack.asNMSCopy(var4.a())));
|
||||
var6.add(new Pair(EquipmentSlot.OFFHAND, CraftItemStack.asNMSCopy(var4.b())));
|
||||
var6.add(new Pair(EquipmentSlot.HEAD, CraftItemStack.asNMSCopy(var4.c())));
|
||||
var6.add(new Pair(EquipmentSlot.CHEST, CraftItemStack.asNMSCopy(var4.d())));
|
||||
var6.add(new Pair(EquipmentSlot.LEGS, CraftItemStack.asNMSCopy(var4.e())));
|
||||
var6.add(new Pair(EquipmentSlot.FEET, CraftItemStack.asNMSCopy(var4.f())));
|
||||
var6.add(new Pair(EquipmentSlot.MAINHAND, CraftItemStack.asNMSCopy(var4.getMainHandItem())));
|
||||
var6.add(new Pair(EquipmentSlot.OFFHAND, CraftItemStack.asNMSCopy(var4.getOffHandItem())));
|
||||
var6.add(new Pair(EquipmentSlot.HEAD, CraftItemStack.asNMSCopy(var4.getHelmetItem())));
|
||||
var6.add(new Pair(EquipmentSlot.CHEST, CraftItemStack.asNMSCopy(var4.getChestplateItem())));
|
||||
var6.add(new Pair(EquipmentSlot.LEGS, CraftItemStack.asNMSCopy(var4.getLeggingsItem())));
|
||||
var6.add(new Pair(EquipmentSlot.FEET, CraftItemStack.asNMSCopy(var4.getBootsItem())));
|
||||
var5.a(var6);
|
||||
return var5;
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion><parent><groupId>ro.fr33styler.arcade</groupId><artifactId>arcadegames-parent</artifactId><version>2.19f-reconstructed</version><relativePath>../../../../pom.xml</relativePath></parent>
|
||||
<artifactId>platforms-latest-v1_18_R2</artifactId><properties><maven.compiler.release>17</maven.compiler.release></properties>
|
||||
<dependencies><dependency><groupId>ro.fr33styler.arcade</groupId><artifactId>common</artifactId><version>${project.version}</version></dependency><dependency><groupId>ro.fr33styler.arcade</groupId><artifactId>platform-api-latest</artifactId><version>${project.version}</version></dependency><dependency><groupId>local.compile-only</groupId><artifactId>latest-v1_18_R2</artifactId><version>2.19f</version><scope>system</scope><systemPath>${maven.multiModuleProjectDirectory}/build-support/deps/stubs-latest-v1_18_R2.jar</systemPath></dependency></dependencies>
|
||||
<dependencies><dependency><groupId>ro.fr33styler.arcade</groupId><artifactId>common</artifactId><version>${project.version}</version></dependency><dependency><groupId>local.compile-only</groupId><artifactId>latest-v1_18_R2</artifactId><version>2.19f</version><scope>system</scope><systemPath>${maven.multiModuleProjectDirectory}/build-support/deps/stubs-latest-v1_18_R2.jar</systemPath></dependency></dependencies>
|
||||
</project>
|
||||
+14
-14
@@ -46,7 +46,7 @@ import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scoreboard.Score;
|
||||
import org.bukkit.scoreboard.Team;
|
||||
import org.bukkit.scoreboard.Team.OptionStatus;
|
||||
import ro.fr33styler.arcade.platform.api.scoreboard.TeamVisibility;
|
||||
import ro.fr33styler.arcade.api.engine.command.Command;
|
||||
|
||||
public class V1_18_2Platform implements ServerPlatform {
|
||||
@@ -57,32 +57,32 @@ public class V1_18_2Platform implements ServerPlatform {
|
||||
this.a = new V1_18_2NpcFactory(var1);
|
||||
}
|
||||
|
||||
public V1_18_2NpcFactory a() {
|
||||
public V1_18_2NpcFactory getNpcFactory() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public V1_18_2PacketInterceptor b() {
|
||||
public V1_18_2PacketInterceptor getPacketInterceptor() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public void a(Player var1) {
|
||||
public void sendHealthUpdate(Player var1) {
|
||||
((CraftPlayer)var1).sendHealthUpdate();
|
||||
}
|
||||
|
||||
public void a(Player var1, Item var2) {
|
||||
public void sendCollectItemAnimation(Player var1, Item var2) {
|
||||
((CraftPlayer)var1).getHandle().b.a(new PacketPlayOutCollect(var2.getEntityId(), var1.getEntityId(), var2.getItemStack().getAmount()));
|
||||
}
|
||||
|
||||
public void a(Command var1) {
|
||||
public void registerCommand(Command var1) {
|
||||
this.a(var1, var1.getCommand());
|
||||
var1.getAliases().forEach(var2 -> this.a(var1, var2));
|
||||
}
|
||||
|
||||
public void b(Command var1) {
|
||||
public void unregisterCommand(Command var1) {
|
||||
RootCommandNode var2 = this.e().a().getRoot();
|
||||
var2.removeCommand(var1.getCommand());
|
||||
var1.getAliases().forEach(var2::removeCommand);
|
||||
BukkitCommands.b(var1);
|
||||
BukkitCommands.unregisterCommand(var1);
|
||||
}
|
||||
|
||||
private CommandDispatcher e() {
|
||||
@@ -120,11 +120,11 @@ public class V1_18_2Platform implements ServerPlatform {
|
||||
return 1;
|
||||
});
|
||||
LiteralCommandNode var4 = var3.build();
|
||||
BukkitCommands.a(new VanillaCommandWrapper(this.e(), var4));
|
||||
BukkitCommands.registerBukkitCommand(new VanillaCommandWrapper(this.e(), var4));
|
||||
this.e().a().getRoot().addChild(var4);
|
||||
}
|
||||
|
||||
public void a(Block var1, Material var2) {
|
||||
public void setBlock(Block var1, Material var2) {
|
||||
CraftBlock var3 = (CraftBlock)var1;
|
||||
Chunk var4 = ((CraftChunk)var1.getChunk()).getHandle();
|
||||
IBlockData var5 = CraftMagicNumbers.getBlock(var2).n();
|
||||
@@ -132,11 +132,11 @@ public class V1_18_2Platform implements ServerPlatform {
|
||||
var4.D().a(var3.getPosition(), var3.getNMS(), var5, 0);
|
||||
}
|
||||
|
||||
public HologramEntity a(World var1, double var2, double var4, double var6) {
|
||||
public HologramEntity createHologram(World var1, double var2, double var4, double var6) {
|
||||
return new V1_18_2HologramEntity(((CraftWorld)var1).getHandle(), var2, var4, var6);
|
||||
}
|
||||
|
||||
public boolean a(Block var1, double var2, double var4, double var6) {
|
||||
public boolean isInsideBlockHitbox(Block var1, double var2, double var4, double var6) {
|
||||
CraftBlock var8 = (CraftBlock)var1;
|
||||
VoxelShape var9 = var8.getNMS().j(var8.getCraftWorld().getHandle(), var8.getPosition());
|
||||
if (var9.b()) {
|
||||
@@ -155,12 +155,12 @@ public class V1_18_2Platform implements ServerPlatform {
|
||||
return var16.booleanValue();
|
||||
}
|
||||
|
||||
public void a(Player var1, boolean var2, Score var3, int var4) {
|
||||
public void sendScorePacket(Player var1, boolean var2, Score var3, int var4) {
|
||||
Action var5 = var2 ? Action.b : Action.a;
|
||||
((CraftPlayer)var1).getHandle().b.a(new PacketPlayOutScoreboardScore(var5, var3.getObjective().getName(), var3.getEntry(), var4));
|
||||
}
|
||||
|
||||
public void a(Player var1, Team var2, String var3, String var4, OptionStatus var5) {
|
||||
public void sendTeamPacket(Player var1, Team var2, String var3, String var4, TeamVisibility var5) {
|
||||
if (var1.getScoreboard() == var2.getScoreboard()) {
|
||||
EntityPlayer var6 = ((CraftPlayer)var1).getHandle();
|
||||
ScoreboardTeam var7 = var6.fF().f(var2.getName());
|
||||
|
||||
+3
-3
@@ -6,15 +6,15 @@ import ro.fr33styler.arcade.platform.version.VersionFactory;
|
||||
import org.bukkit.Server;
|
||||
|
||||
public class V1_18_2PlatformFactory implements VersionFactory<ServerPlatform> {
|
||||
public String a() {
|
||||
public String getVersionLabel() {
|
||||
return "1.18.2";
|
||||
}
|
||||
|
||||
public boolean a(String var1) {
|
||||
public boolean supports(String var1) {
|
||||
return var1.equals("1.18.2");
|
||||
}
|
||||
|
||||
public ServerPlatform a(Server var1) {
|
||||
public ServerPlatform create(Server var1) {
|
||||
return new V1_18_2Platform(var1);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -13,7 +13,7 @@ import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class BombLobbersV1_18_2TntFactory implements BombLobbersTntFactory {
|
||||
public TNTPrimed a(Player var1, Color var2, Vector var3) {
|
||||
public TNTPrimed spawnTnt(Player var1, Color var2, Vector var3) {
|
||||
EntityPlayer var4 = ((CraftPlayer)var1).getHandle();
|
||||
Vector3fa var5 = new Vector3fa(var2.getRed() / 255.0F, var2.getGreen() / 255.0F, var2.getBlue() / 255.0F);
|
||||
BombLobbersV1_18_2TntEntity var6 = new BombLobbersV1_18_2TntEntity(var4, new ParticleParamRedstone(var5, 1.0F), var3);
|
||||
|
||||
+3
-3
@@ -6,15 +6,15 @@ import ro.fr33styler.arcade.platform.version.VersionFactory;
|
||||
import org.bukkit.Server;
|
||||
|
||||
public class BombLobbersV1_18_2TntFactorySelector implements VersionFactory<BombLobbersTntFactory> {
|
||||
public String a() {
|
||||
public String getVersionLabel() {
|
||||
return "1.18.2";
|
||||
}
|
||||
|
||||
public boolean a(String var1) {
|
||||
public boolean supports(String var1) {
|
||||
return var1.equals("1.18.2");
|
||||
}
|
||||
|
||||
public BombLobbersTntFactory a(Server var1) {
|
||||
public BombLobbersTntFactory create(Server var1) {
|
||||
return new BombLobbersV1_18_2TntFactory();
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -16,15 +16,15 @@ import org.bukkit.entity.WitherSkull;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class MiniWallsV1_18_2EntityFactory implements MiniWallsEntityFactory {
|
||||
public Wither a(Location var1, Predicate<LivingEntity> var2, Runnable var3) {
|
||||
public Wither spawnWither(Location var1, Predicate<LivingEntity> var2, Runnable var3) {
|
||||
return (Wither)new MiniWallsV1_18_2Wither(var1, var2, var3).getBukkitEntity();
|
||||
}
|
||||
|
||||
public Arrow a(Player var1, Color var2, Vector var3, Predicate<Entity> var4) {
|
||||
public Arrow spawnArrow(Player var1, Color var2, Vector var3, Predicate<Entity> var4) {
|
||||
return (Arrow)new MiniWallsV1_18_2Arrow(((CraftPlayer)var1).getHandle(), var2, var3, var4).getBukkitEntity();
|
||||
}
|
||||
|
||||
public WitherSkull a(Wither var1, Vector var2, Predicate<Entity> var3) {
|
||||
public WitherSkull spawnWitherSkull(Wither var1, Vector var2, Predicate<Entity> var3) {
|
||||
return (WitherSkull)new MiniWallsV1_18_2WitherSkull(((CraftWither)var1).getHandle(), var2, var3).getBukkitEntity();
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -6,15 +6,15 @@ import ro.fr33styler.arcade.platform.version.VersionFactory;
|
||||
import org.bukkit.Server;
|
||||
|
||||
public class MiniWallsV1_18_2EntityFactorySelector implements VersionFactory<MiniWallsEntityFactory> {
|
||||
public String a() {
|
||||
public String getVersionLabel() {
|
||||
return "1.18.2";
|
||||
}
|
||||
|
||||
public boolean a(String var1) {
|
||||
public boolean supports(String var1) {
|
||||
return var1.equals("1.18.2");
|
||||
}
|
||||
|
||||
public MiniWallsEntityFactory a(Server var1) {
|
||||
public MiniWallsEntityFactory create(Server var1) {
|
||||
return new MiniWallsV1_18_2EntityFactory();
|
||||
}
|
||||
}
|
||||
+11
-11
@@ -35,34 +35,34 @@ public class PropHuntV1_18_2PropEntity extends EntityArmorStand implements PropH
|
||||
this.a(EnumItemSlot.f, CraftItemStack.asNMSCopy(var2));
|
||||
}
|
||||
|
||||
this.a(var3);
|
||||
this.teleport(var3);
|
||||
}
|
||||
|
||||
public UUID a() {
|
||||
public UUID getUniqueId() {
|
||||
return this.aj;
|
||||
}
|
||||
|
||||
public PropHuntPropType b() {
|
||||
public PropHuntPropType getPropType() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
public ItemStack c() {
|
||||
public ItemStack getItem() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public Player d() {
|
||||
public Player getOwner() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public void a(Player var1) {
|
||||
public void setOwner(Player var1) {
|
||||
this.a = (CraftPlayer)var1;
|
||||
}
|
||||
|
||||
public Location e() {
|
||||
public Location getLocation() {
|
||||
return new Location(this.s.getWorld(), this.dc(), this.de() + 1.35, this.di(), this.dn(), this.do_());
|
||||
}
|
||||
|
||||
public void a(Location var1) {
|
||||
public void teleport(Location var1) {
|
||||
double var2 = var1.getX();
|
||||
double var4 = var1.getY() - 1.35;
|
||||
double var6 = var1.getZ();
|
||||
@@ -76,13 +76,13 @@ public class PropHuntV1_18_2PropEntity extends EntityArmorStand implements PropH
|
||||
this.c(var2, var4, var6);
|
||||
}
|
||||
|
||||
public void f() {
|
||||
public void attachOwner() {
|
||||
if (this.a != null) {
|
||||
this.getBukkitEntity().addPassenger(this.a);
|
||||
}
|
||||
}
|
||||
|
||||
public void h() {
|
||||
public void destroy() {
|
||||
this.ah();
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ public class PropHuntV1_18_2PropEntity extends EntityArmorStand implements PropH
|
||||
|
||||
public void k() {
|
||||
if (this.a != null && !this.a.isInsideVehicle()) {
|
||||
this.a(this.a.getLocation());
|
||||
this.teleport(this.a.getLocation());
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -10,11 +10,11 @@ import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class PropHuntV1_18_2PropFactory implements PropHuntPropFactory {
|
||||
public Particle a() {
|
||||
public Particle getDisguiseParticle() {
|
||||
return Particle.VILLAGER_HAPPY;
|
||||
}
|
||||
|
||||
public PropHuntProp a(PropHuntPropType var1, ItemStack var2, Location var3) {
|
||||
public PropHuntProp createProp(PropHuntPropType var1, ItemStack var2, Location var3) {
|
||||
PropHuntV1_18_2PropEntity var4 = new PropHuntV1_18_2PropEntity(var1, var2, var3);
|
||||
var4.s.addFreshEntity(var4, SpawnReason.CUSTOM);
|
||||
return var4;
|
||||
|
||||
+3
-3
@@ -6,15 +6,15 @@ import ro.fr33styler.arcade.platform.version.VersionFactory;
|
||||
import org.bukkit.Server;
|
||||
|
||||
public class PropHuntV1_18_2PropFactorySelector implements VersionFactory<PropHuntPropFactory> {
|
||||
public String a() {
|
||||
public String getVersionLabel() {
|
||||
return "1.18.2";
|
||||
}
|
||||
|
||||
public boolean a(String var1) {
|
||||
public boolean supports(String var1) {
|
||||
return var1.equals("1.18.2");
|
||||
}
|
||||
|
||||
public PropHuntPropFactory a(Server var1) {
|
||||
public PropHuntPropFactory create(Server var1) {
|
||||
return new PropHuntV1_18_2PropFactory();
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -22,22 +22,22 @@ public class V1_18_2HologramEntity extends EntityArmorStand implements HologramE
|
||||
super.j(true);
|
||||
}
|
||||
|
||||
public void a(String var1) {
|
||||
public void setText(String var1) {
|
||||
super.a(CraftChatMessage.fromStringOrNull(var1));
|
||||
if (super.Y()) {
|
||||
super.n(true);
|
||||
}
|
||||
}
|
||||
|
||||
public LivingEntity a() {
|
||||
public LivingEntity getEntity() {
|
||||
return (LivingEntity)this.getBukkitEntity();
|
||||
}
|
||||
|
||||
public void a(Player var1) {
|
||||
public void updateMetadata(Player var1) {
|
||||
this.a(this.b(var1));
|
||||
}
|
||||
|
||||
public void a(Player var1, boolean var2) {
|
||||
public void setVisible(Player var1, boolean var2) {
|
||||
PlayerConnection var3 = this.b(var1);
|
||||
if (var2) {
|
||||
var3.a(new PacketPlayOutSpawnEntity(this));
|
||||
|
||||
+2
-2
@@ -19,7 +19,7 @@ public class V1_18_2PacketInterceptor implements PacketInterceptor {
|
||||
}
|
||||
}
|
||||
|
||||
public void a(String var1, Player var2) {
|
||||
public void inject(String var1, Player var2) {
|
||||
try {
|
||||
ChannelPipeline var3 = this.a(var2).pipeline();
|
||||
this.a(var3, var1);
|
||||
@@ -28,7 +28,7 @@ public class V1_18_2PacketInterceptor implements PacketInterceptor {
|
||||
}
|
||||
}
|
||||
|
||||
public void b(String var1, Player var2) {
|
||||
public void eject(String var1, Player var2) {
|
||||
Channel var3 = this.a(var2);
|
||||
var3.eventLoop().execute(() -> this.a(var3.pipeline(), var1));
|
||||
}
|
||||
|
||||
+4
-4
@@ -34,11 +34,11 @@ public class V1_18_2Npc extends EntityPlayer implements Npc {
|
||||
this.a = var4;
|
||||
}
|
||||
|
||||
public int a() {
|
||||
public int getEntityId() {
|
||||
return this.ae();
|
||||
}
|
||||
|
||||
public Location b() {
|
||||
public Location getLocation() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class V1_18_2Npc extends EntityPlayer implements Npc {
|
||||
this.b = var1;
|
||||
}
|
||||
|
||||
public void a(Player var1, boolean var2) {
|
||||
public void setVisible(Player var1, boolean var2) {
|
||||
ServerPlayerConnection var3 = this.b(var1);
|
||||
if (var2) {
|
||||
var3.a(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.a, new EntityPlayer[]{this}));
|
||||
@@ -67,7 +67,7 @@ public class V1_18_2Npc extends EntityPlayer implements Npc {
|
||||
return ((CraftPlayer)var1).getHandle().b;
|
||||
}
|
||||
|
||||
public void a(Player var1) {
|
||||
public void removeFromTabList(Player var1) {
|
||||
this.b(var1).a(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.e, new EntityPlayer[]{this}));
|
||||
}
|
||||
}
|
||||
+9
-9
@@ -27,7 +27,7 @@ public class V1_18_2NpcFactory implements NpcFactory {
|
||||
this.a = var1;
|
||||
}
|
||||
|
||||
public V1_18_2Npc a(Location var1, Player var2) {
|
||||
public V1_18_2Npc createPlayerNpc(Location var1, Player var2) {
|
||||
EntityPlayer var3 = ((CraftPlayer)var2).getHandle();
|
||||
GameProfile var4 = new GameProfile(UUID.randomUUID(), var2.getName());
|
||||
var4.getProperties().putAll(var3.fq().getProperties());
|
||||
@@ -37,19 +37,19 @@ public class V1_18_2NpcFactory implements NpcFactory {
|
||||
public V1_18_2Npc a(Location var1, String var2, SkinTexture var3) {
|
||||
CraftWorld var4 = (CraftWorld)var1.getWorld();
|
||||
GameProfile var5 = new GameProfile(UUID.randomUUID(), var2);
|
||||
var5.getProperties().put("textures", new Property("textures", var3.a(), var3.b()));
|
||||
var5.getProperties().put("textures", new Property("textures", var3.getValue(), var3.getSignature()));
|
||||
return new V1_18_2Npc(((CraftServer)this.a).getServer(), var4.getHandle(), var5, var1);
|
||||
}
|
||||
|
||||
public V1_18_2Npc a(Location var1, String var2, SkinTexture var3, NpcEquipment var4) {
|
||||
public V1_18_2Npc createNpc(Location var1, String var2, SkinTexture var3, NpcEquipment var4) {
|
||||
V1_18_2Npc var5 = this.a(var1, var2, var3);
|
||||
ArrayList var6 = new ArrayList();
|
||||
var6.add(new Pair(EnumItemSlot.a, CraftItemStack.asNMSCopy(var4.a())));
|
||||
var6.add(new Pair(EnumItemSlot.b, CraftItemStack.asNMSCopy(var4.b())));
|
||||
var6.add(new Pair(EnumItemSlot.f, CraftItemStack.asNMSCopy(var4.c())));
|
||||
var6.add(new Pair(EnumItemSlot.e, CraftItemStack.asNMSCopy(var4.d())));
|
||||
var6.add(new Pair(EnumItemSlot.d, CraftItemStack.asNMSCopy(var4.e())));
|
||||
var6.add(new Pair(EnumItemSlot.c, CraftItemStack.asNMSCopy(var4.f())));
|
||||
var6.add(new Pair(EnumItemSlot.a, CraftItemStack.asNMSCopy(var4.getMainHandItem())));
|
||||
var6.add(new Pair(EnumItemSlot.b, CraftItemStack.asNMSCopy(var4.getOffHandItem())));
|
||||
var6.add(new Pair(EnumItemSlot.f, CraftItemStack.asNMSCopy(var4.getHelmetItem())));
|
||||
var6.add(new Pair(EnumItemSlot.e, CraftItemStack.asNMSCopy(var4.getChestplateItem())));
|
||||
var6.add(new Pair(EnumItemSlot.d, CraftItemStack.asNMSCopy(var4.getLeggingsItem())));
|
||||
var6.add(new Pair(EnumItemSlot.c, CraftItemStack.asNMSCopy(var4.getBootsItem())));
|
||||
var5.a(var6);
|
||||
return var5;
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion><parent><groupId>ro.fr33styler.arcade</groupId><artifactId>arcadegames-parent</artifactId><version>2.19f-reconstructed</version><relativePath>../../../../pom.xml</relativePath></parent>
|
||||
<artifactId>platforms-latest-v1_19_R3</artifactId><properties><maven.compiler.release>17</maven.compiler.release></properties>
|
||||
<dependencies><dependency><groupId>ro.fr33styler.arcade</groupId><artifactId>common</artifactId><version>${project.version}</version></dependency><dependency><groupId>ro.fr33styler.arcade</groupId><artifactId>platform-api-latest</artifactId><version>${project.version}</version></dependency><dependency><groupId>local.compile-only</groupId><artifactId>latest-v1_19_R3</artifactId><version>2.19f</version><scope>system</scope><systemPath>${maven.multiModuleProjectDirectory}/build-support/deps/stubs-latest-v1_19_R3.jar</systemPath></dependency></dependencies>
|
||||
<dependencies><dependency><groupId>ro.fr33styler.arcade</groupId><artifactId>common</artifactId><version>${project.version}</version></dependency><dependency><groupId>local.compile-only</groupId><artifactId>latest-v1_19_R3</artifactId><version>2.19f</version><scope>system</scope><systemPath>${maven.multiModuleProjectDirectory}/build-support/deps/stubs-latest-v1_19_R3.jar</systemPath></dependency></dependencies>
|
||||
</project>
|
||||
+14
-14
@@ -46,7 +46,7 @@ import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scoreboard.Score;
|
||||
import org.bukkit.scoreboard.Team;
|
||||
import org.bukkit.scoreboard.Team.OptionStatus;
|
||||
import ro.fr33styler.arcade.platform.api.scoreboard.TeamVisibility;
|
||||
import ro.fr33styler.arcade.api.engine.command.Command;
|
||||
|
||||
public class V1_19_4Platform implements ServerPlatform {
|
||||
@@ -57,32 +57,32 @@ public class V1_19_4Platform implements ServerPlatform {
|
||||
this.a = new V1_19_4NpcFactory(var1);
|
||||
}
|
||||
|
||||
public V1_19_4NpcFactory a() {
|
||||
public V1_19_4NpcFactory getNpcFactory() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public V1_19_4PacketInterceptor b() {
|
||||
public V1_19_4PacketInterceptor getPacketInterceptor() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public void a(Player var1) {
|
||||
public void sendHealthUpdate(Player var1) {
|
||||
((CraftPlayer)var1).sendHealthUpdate();
|
||||
}
|
||||
|
||||
public void a(Player var1, Item var2) {
|
||||
public void sendCollectItemAnimation(Player var1, Item var2) {
|
||||
((CraftPlayer)var1).getHandle().b.a(new PacketPlayOutCollect(var2.getEntityId(), var1.getEntityId(), var2.getItemStack().getAmount()));
|
||||
}
|
||||
|
||||
public void a(Command var1) {
|
||||
public void registerCommand(Command var1) {
|
||||
this.a(var1, var1.getCommand());
|
||||
var1.getAliases().forEach(var2 -> this.a(var1, var2));
|
||||
}
|
||||
|
||||
public void b(Command var1) {
|
||||
public void unregisterCommand(Command var1) {
|
||||
RootCommandNode var2 = this.e().a().getRoot();
|
||||
var2.removeCommand(var1.getCommand());
|
||||
var1.getAliases().forEach(var2::removeCommand);
|
||||
BukkitCommands.b(var1);
|
||||
BukkitCommands.unregisterCommand(var1);
|
||||
}
|
||||
|
||||
private CommandDispatcher e() {
|
||||
@@ -120,22 +120,22 @@ public class V1_19_4Platform implements ServerPlatform {
|
||||
return 1;
|
||||
});
|
||||
LiteralCommandNode var4 = var3.build();
|
||||
BukkitCommands.a(new VanillaCommandWrapper(this.e(), var4));
|
||||
BukkitCommands.registerBukkitCommand(new VanillaCommandWrapper(this.e(), var4));
|
||||
this.e().a().getRoot().addChild(var4);
|
||||
}
|
||||
|
||||
public void a(Block var1, Material var2) {
|
||||
public void setBlock(Block var1, Material var2) {
|
||||
CraftBlock var3 = (CraftBlock)var1;
|
||||
IBlockData var4 = CraftMagicNumbers.getBlock(var2).o();
|
||||
((CraftChunk)var1.getChunk()).getHandle(ChunkStatus.o).a(var3.getPosition(), var4, false);
|
||||
var3.getCraftWorld().getHandle().a(var3.getPosition(), var3.getNMS(), var4, 0);
|
||||
}
|
||||
|
||||
public HologramEntity a(World var1, double var2, double var4, double var6) {
|
||||
public HologramEntity createHologram(World var1, double var2, double var4, double var6) {
|
||||
return new V1_19_4HologramEntity(((CraftWorld)var1).getHandle(), var2, var4, var6);
|
||||
}
|
||||
|
||||
public boolean a(Block var1, double var2, double var4, double var6) {
|
||||
public boolean isInsideBlockHitbox(Block var1, double var2, double var4, double var6) {
|
||||
CraftBlock var8 = (CraftBlock)var1;
|
||||
VoxelShape var9 = var8.getNMS().j(var8.getCraftWorld().getHandle(), var8.getPosition());
|
||||
if (var9.b()) {
|
||||
@@ -154,12 +154,12 @@ public class V1_19_4Platform implements ServerPlatform {
|
||||
return var16.booleanValue();
|
||||
}
|
||||
|
||||
public void a(Player var1, boolean var2, Score var3, int var4) {
|
||||
public void sendScorePacket(Player var1, boolean var2, Score var3, int var4) {
|
||||
Action var5 = var2 ? Action.b : Action.a;
|
||||
((CraftPlayer)var1).getHandle().b.a(new PacketPlayOutScoreboardScore(var5, var3.getObjective().getName(), var3.getEntry(), var4));
|
||||
}
|
||||
|
||||
public void a(Player var1, Team var2, String var3, String var4, OptionStatus var5) {
|
||||
public void sendTeamPacket(Player var1, Team var2, String var3, String var4, TeamVisibility var5) {
|
||||
if (var1.getScoreboard() == var2.getScoreboard()) {
|
||||
EntityPlayer var6 = ((CraftPlayer)var1).getHandle();
|
||||
ScoreboardTeam var7 = var6.fY().f(var2.getName());
|
||||
|
||||
+3
-3
@@ -6,15 +6,15 @@ import ro.fr33styler.arcade.platform.version.VersionFactory;
|
||||
import org.bukkit.Server;
|
||||
|
||||
public class V1_19_4PlatformFactory implements VersionFactory<ServerPlatform> {
|
||||
public String a() {
|
||||
public String getVersionLabel() {
|
||||
return "1.19.4";
|
||||
}
|
||||
|
||||
public boolean a(String var1) {
|
||||
public boolean supports(String var1) {
|
||||
return var1.equals("1.19.4");
|
||||
}
|
||||
|
||||
public ServerPlatform a(Server var1) {
|
||||
public ServerPlatform create(Server var1) {
|
||||
return new V1_19_4Platform(var1);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -13,7 +13,7 @@ import org.bukkit.util.Vector;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
public class BombLobbersV1_19_4TntFactory implements BombLobbersTntFactory {
|
||||
public TNTPrimed a(Player var1, Color var2, Vector var3) {
|
||||
public TNTPrimed spawnTnt(Player var1, Color var2, Vector var3) {
|
||||
EntityPlayer var4 = ((CraftPlayer)var1).getHandle();
|
||||
Vector3f var5 = new Vector3f(var2.getRed() / 255.0F, var2.getGreen() / 255.0F, var2.getBlue() / 255.0F);
|
||||
BombLobbersV1_19_4TntEntity var6 = new BombLobbersV1_19_4TntEntity(var4, new ParticleParamRedstone(var5, 1.0F), var3);
|
||||
|
||||
+3
-3
@@ -6,15 +6,15 @@ import ro.fr33styler.arcade.platform.version.VersionFactory;
|
||||
import org.bukkit.Server;
|
||||
|
||||
public class BombLobbersV1_19_4TntFactorySelector implements VersionFactory<BombLobbersTntFactory> {
|
||||
public String a() {
|
||||
public String getVersionLabel() {
|
||||
return "1.19.4";
|
||||
}
|
||||
|
||||
public boolean a(String var1) {
|
||||
public boolean supports(String var1) {
|
||||
return var1.equals("1.19.4");
|
||||
}
|
||||
|
||||
public BombLobbersTntFactory a(Server var1) {
|
||||
public BombLobbersTntFactory create(Server var1) {
|
||||
return new BombLobbersV1_19_4TntFactory();
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -16,15 +16,15 @@ import org.bukkit.entity.WitherSkull;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class MiniWallsV1_19_4EntityFactory implements MiniWallsEntityFactory {
|
||||
public Wither a(Location var1, Predicate<LivingEntity> var2, Runnable var3) {
|
||||
public Wither spawnWither(Location var1, Predicate<LivingEntity> var2, Runnable var3) {
|
||||
return (Wither)new MiniWallsV1_19_4Wither(var1, var2, var3).getBukkitEntity();
|
||||
}
|
||||
|
||||
public Arrow a(Player var1, Color var2, Vector var3, Predicate<Entity> var4) {
|
||||
public Arrow spawnArrow(Player var1, Color var2, Vector var3, Predicate<Entity> var4) {
|
||||
return (Arrow)new MiniWallsV1_19_4Arrow(((CraftPlayer)var1).getHandle(), var2, var3, var4).getBukkitEntity();
|
||||
}
|
||||
|
||||
public WitherSkull a(Wither var1, Vector var2, Predicate<Entity> var3) {
|
||||
public WitherSkull spawnWitherSkull(Wither var1, Vector var2, Predicate<Entity> var3) {
|
||||
return (WitherSkull)new MiniWallsV1_19_4WitherSkull(((CraftWither)var1).getHandle(), var2, var3).getBukkitEntity();
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -6,15 +6,15 @@ import ro.fr33styler.arcade.platform.version.VersionFactory;
|
||||
import org.bukkit.Server;
|
||||
|
||||
public class MiniWallsV1_19_4EntityFactorySelector implements VersionFactory<MiniWallsEntityFactory> {
|
||||
public String a() {
|
||||
public String getVersionLabel() {
|
||||
return "1.19.4";
|
||||
}
|
||||
|
||||
public boolean a(String var1) {
|
||||
public boolean supports(String var1) {
|
||||
return var1.equals("1.19.4");
|
||||
}
|
||||
|
||||
public MiniWallsEntityFactory a(Server var1) {
|
||||
public MiniWallsEntityFactory create(Server var1) {
|
||||
return new MiniWallsV1_19_4EntityFactory();
|
||||
}
|
||||
}
|
||||
+11
-11
@@ -35,34 +35,34 @@ public class PropHuntV1_19_4PropEntity extends EntityArmorStand implements PropH
|
||||
this.a(EnumItemSlot.f, CraftItemStack.asNMSCopy(var2));
|
||||
}
|
||||
|
||||
this.a(var3);
|
||||
this.teleport(var3);
|
||||
}
|
||||
|
||||
public UUID a() {
|
||||
public UUID getUniqueId() {
|
||||
return this.ax;
|
||||
}
|
||||
|
||||
public PropHuntPropType b() {
|
||||
public PropHuntPropType getPropType() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
public ItemStack c() {
|
||||
public ItemStack getItem() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public Player d() {
|
||||
public Player getOwner() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public void a(Player var1) {
|
||||
public void setOwner(Player var1) {
|
||||
this.a = (CraftPlayer)var1;
|
||||
}
|
||||
|
||||
public Location e() {
|
||||
public Location getLocation() {
|
||||
return new Location(this.H.getWorld(), this.dl(), this.dn() + 1.35, this.dr(), this.dw(), this.dy());
|
||||
}
|
||||
|
||||
public void a(Location var1) {
|
||||
public void teleport(Location var1) {
|
||||
double var2 = var1.getX();
|
||||
double var4 = var1.getY() - 1.35;
|
||||
double var6 = var1.getZ();
|
||||
@@ -76,13 +76,13 @@ public class PropHuntV1_19_4PropEntity extends EntityArmorStand implements PropH
|
||||
this.d(var2, var4, var6);
|
||||
}
|
||||
|
||||
public void f() {
|
||||
public void attachOwner() {
|
||||
if (this.a != null) {
|
||||
this.getBukkitEntity().addPassenger(this.a);
|
||||
}
|
||||
}
|
||||
|
||||
public void h() {
|
||||
public void destroy() {
|
||||
this.ai();
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ public class PropHuntV1_19_4PropEntity extends EntityArmorStand implements PropH
|
||||
|
||||
public void l() {
|
||||
if (this.a != null && !this.a.isInsideVehicle()) {
|
||||
this.a(this.a.getLocation());
|
||||
this.teleport(this.a.getLocation());
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -10,11 +10,11 @@ import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class PropHuntV1_19_4PropFactory implements PropHuntPropFactory {
|
||||
public Particle a() {
|
||||
public Particle getDisguiseParticle() {
|
||||
return Particle.VILLAGER_HAPPY;
|
||||
}
|
||||
|
||||
public PropHuntProp a(PropHuntPropType var1, ItemStack var2, Location var3) {
|
||||
public PropHuntProp createProp(PropHuntPropType var1, ItemStack var2, Location var3) {
|
||||
PropHuntV1_19_4PropEntity var4 = new PropHuntV1_19_4PropEntity(var1, var2, var3);
|
||||
var4.H.addFreshEntity(var4, SpawnReason.CUSTOM);
|
||||
return var4;
|
||||
|
||||
+3
-3
@@ -6,15 +6,15 @@ import ro.fr33styler.arcade.platform.version.VersionFactory;
|
||||
import org.bukkit.Server;
|
||||
|
||||
public class PropHuntV1_19_4PropFactorySelector implements VersionFactory<PropHuntPropFactory> {
|
||||
public String a() {
|
||||
public String getVersionLabel() {
|
||||
return "1.19.4";
|
||||
}
|
||||
|
||||
public boolean a(String var1) {
|
||||
public boolean supports(String var1) {
|
||||
return var1.equals("1.19.4");
|
||||
}
|
||||
|
||||
public PropHuntPropFactory a(Server var1) {
|
||||
public PropHuntPropFactory create(Server var1) {
|
||||
return new PropHuntV1_19_4PropFactory();
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -22,22 +22,22 @@ public class V1_19_4HologramEntity extends EntityArmorStand implements HologramE
|
||||
super.j(true);
|
||||
}
|
||||
|
||||
public void a(String var1) {
|
||||
public void setText(String var1) {
|
||||
super.b(CraftChatMessage.fromStringOrNull(var1));
|
||||
if (super.aa()) {
|
||||
super.n(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void a(Player var1) {
|
||||
public void updateMetadata(Player var1) {
|
||||
this.a(this.b(var1));
|
||||
}
|
||||
|
||||
public LivingEntity a() {
|
||||
public LivingEntity getEntity() {
|
||||
return (LivingEntity)this.getBukkitEntity();
|
||||
}
|
||||
|
||||
public void a(Player var1, boolean var2) {
|
||||
public void setVisible(Player var1, boolean var2) {
|
||||
PlayerConnection var3 = this.b(var1);
|
||||
if (var2) {
|
||||
var3.a(new PacketPlayOutSpawnEntity(this));
|
||||
|
||||
+4
-4
@@ -13,10 +13,10 @@ import org.bukkit.craftbukkit.v1_19_R3.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class V1_19_4PacketInterceptor implements PacketInterceptor {
|
||||
private static final Field a = Reflection.a(PlayerConnection.class, NetworkManager.class);
|
||||
private static final Field a = Reflection.findFieldByType(PlayerConnection.class, NetworkManager.class);
|
||||
|
||||
private Channel a(Player var1) throws IllegalAccessException {
|
||||
NetworkManager var2 = (NetworkManager)Reflection.a(a, ((CraftPlayer)var1).getHandle().b);
|
||||
NetworkManager var2 = (NetworkManager)Reflection.getFieldValue(a, ((CraftPlayer)var1).getHandle().b);
|
||||
return var2.m;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public class V1_19_4PacketInterceptor implements PacketInterceptor {
|
||||
}
|
||||
}
|
||||
|
||||
public void a(String var1, Player var2) {
|
||||
public void inject(String var1, Player var2) {
|
||||
try {
|
||||
ChannelPipeline var3 = this.a(var2).pipeline();
|
||||
this.a(var3, var1);
|
||||
@@ -37,7 +37,7 @@ public class V1_19_4PacketInterceptor implements PacketInterceptor {
|
||||
}
|
||||
}
|
||||
|
||||
public void b(String var1, Player var2) {
|
||||
public void eject(String var1, Player var2) {
|
||||
try {
|
||||
Channel var3 = this.a(var2);
|
||||
var3.eventLoop().execute(() -> this.a(var3.pipeline(), var1));
|
||||
|
||||
+4
-4
@@ -35,11 +35,11 @@ public class V1_19_4Npc extends EntityPlayer implements Npc {
|
||||
this.a = var4;
|
||||
}
|
||||
|
||||
public int a() {
|
||||
public int getEntityId() {
|
||||
return this.af();
|
||||
}
|
||||
|
||||
public Location b() {
|
||||
public Location getLocation() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class V1_19_4Npc extends EntityPlayer implements Npc {
|
||||
this.b = var1;
|
||||
}
|
||||
|
||||
public void a(Player var1, boolean var2) {
|
||||
public void setVisible(Player var1, boolean var2) {
|
||||
ServerPlayerConnection var3 = this.b(var1);
|
||||
if (var2) {
|
||||
var3.a(new ClientboundPlayerInfoUpdatePacket(net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket.a.a, this));
|
||||
@@ -68,7 +68,7 @@ public class V1_19_4Npc extends EntityPlayer implements Npc {
|
||||
return ((CraftPlayer)var1).getHandle().b;
|
||||
}
|
||||
|
||||
public void a(Player var1) {
|
||||
public void removeFromTabList(Player var1) {
|
||||
this.b(var1).a(new ClientboundPlayerInfoRemovePacket(List.of(this.ax)));
|
||||
}
|
||||
}
|
||||
+9
-9
@@ -27,7 +27,7 @@ public class V1_19_4NpcFactory implements NpcFactory {
|
||||
this.a = var1;
|
||||
}
|
||||
|
||||
public V1_19_4Npc a(Location var1, Player var2) {
|
||||
public V1_19_4Npc createPlayerNpc(Location var1, Player var2) {
|
||||
EntityPlayer var3 = ((CraftPlayer)var2).getHandle();
|
||||
GameProfile var4 = new GameProfile(UUID.randomUUID(), var2.getName());
|
||||
var4.getProperties().putAll(var3.fI().getProperties());
|
||||
@@ -37,19 +37,19 @@ public class V1_19_4NpcFactory implements NpcFactory {
|
||||
public V1_19_4Npc a(Location var1, String var2, SkinTexture var3) {
|
||||
CraftWorld var4 = (CraftWorld)var1.getWorld();
|
||||
GameProfile var5 = new GameProfile(UUID.randomUUID(), var2);
|
||||
var5.getProperties().put("textures", new Property("textures", var3.a(), var3.b()));
|
||||
var5.getProperties().put("textures", new Property("textures", var3.getValue(), var3.getSignature()));
|
||||
return new V1_19_4Npc(((CraftServer)this.a).getServer(), var4.getHandle(), var5, var1);
|
||||
}
|
||||
|
||||
public V1_19_4Npc a(Location var1, String var2, SkinTexture var3, NpcEquipment var4) {
|
||||
public V1_19_4Npc createNpc(Location var1, String var2, SkinTexture var3, NpcEquipment var4) {
|
||||
V1_19_4Npc var5 = this.a(var1, var2, var3);
|
||||
ArrayList var6 = new ArrayList();
|
||||
var6.add(new Pair(EnumItemSlot.a, CraftItemStack.asNMSCopy(var4.a())));
|
||||
var6.add(new Pair(EnumItemSlot.b, CraftItemStack.asNMSCopy(var4.b())));
|
||||
var6.add(new Pair(EnumItemSlot.f, CraftItemStack.asNMSCopy(var4.c())));
|
||||
var6.add(new Pair(EnumItemSlot.e, CraftItemStack.asNMSCopy(var4.d())));
|
||||
var6.add(new Pair(EnumItemSlot.d, CraftItemStack.asNMSCopy(var4.e())));
|
||||
var6.add(new Pair(EnumItemSlot.c, CraftItemStack.asNMSCopy(var4.f())));
|
||||
var6.add(new Pair(EnumItemSlot.a, CraftItemStack.asNMSCopy(var4.getMainHandItem())));
|
||||
var6.add(new Pair(EnumItemSlot.b, CraftItemStack.asNMSCopy(var4.getOffHandItem())));
|
||||
var6.add(new Pair(EnumItemSlot.f, CraftItemStack.asNMSCopy(var4.getHelmetItem())));
|
||||
var6.add(new Pair(EnumItemSlot.e, CraftItemStack.asNMSCopy(var4.getChestplateItem())));
|
||||
var6.add(new Pair(EnumItemSlot.d, CraftItemStack.asNMSCopy(var4.getLeggingsItem())));
|
||||
var6.add(new Pair(EnumItemSlot.c, CraftItemStack.asNMSCopy(var4.getBootsItem())));
|
||||
var5.a(var6);
|
||||
return var5;
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion><parent><groupId>ro.fr33styler.arcade</groupId><artifactId>arcadegames-parent</artifactId><version>2.19f-reconstructed</version><relativePath>../../../../pom.xml</relativePath></parent>
|
||||
<artifactId>platforms-latest-v1_20_R4</artifactId><properties><maven.compiler.release>17</maven.compiler.release></properties>
|
||||
<dependencies><dependency><groupId>ro.fr33styler.arcade</groupId><artifactId>common</artifactId><version>${project.version}</version></dependency><dependency><groupId>ro.fr33styler.arcade</groupId><artifactId>platform-api-latest</artifactId><version>${project.version}</version></dependency><dependency><groupId>local.compile-only</groupId><artifactId>latest-v1_20_R4</artifactId><version>2.19f</version><scope>system</scope><systemPath>${maven.multiModuleProjectDirectory}/build-support/deps/stubs-latest-v1_20_R4.jar</systemPath></dependency></dependencies>
|
||||
<dependencies><dependency><groupId>ro.fr33styler.arcade</groupId><artifactId>common</artifactId><version>${project.version}</version></dependency><dependency><groupId>local.compile-only</groupId><artifactId>latest-v1_20_R4</artifactId><version>2.19f</version><scope>system</scope><systemPath>${maven.multiModuleProjectDirectory}/build-support/deps/stubs-latest-v1_20_R4.jar</systemPath></dependency></dependencies>
|
||||
</project>
|
||||
+15
-15
@@ -52,7 +52,7 @@ import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scoreboard.Score;
|
||||
import org.bukkit.scoreboard.Team;
|
||||
import org.bukkit.scoreboard.Team.OptionStatus;
|
||||
import ro.fr33styler.arcade.platform.api.scoreboard.TeamVisibility;
|
||||
import ro.fr33styler.arcade.api.engine.command.Command;
|
||||
|
||||
public class V1_20_6Platform implements ServerPlatform {
|
||||
@@ -63,32 +63,32 @@ public class V1_20_6Platform implements ServerPlatform {
|
||||
this.a = new V1_20_6NpcFactory(var1);
|
||||
}
|
||||
|
||||
public V1_20_6NpcFactory a() {
|
||||
public V1_20_6NpcFactory getNpcFactory() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public V1_20_6PacketInterceptor b() {
|
||||
public V1_20_6PacketInterceptor getPacketInterceptor() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public void a(Player var1) {
|
||||
public void sendHealthUpdate(Player var1) {
|
||||
var1.sendHealthUpdate();
|
||||
}
|
||||
|
||||
public void a(Player var1, Item var2) {
|
||||
public void sendCollectItemAnimation(Player var1, Item var2) {
|
||||
((CraftPlayer)var1).getHandle().c.b(new PacketPlayOutCollect(var2.getEntityId(), var1.getEntityId(), var2.getItemStack().getAmount()));
|
||||
}
|
||||
|
||||
public void a(Command var1) {
|
||||
public void registerCommand(Command var1) {
|
||||
this.a(var1, var1.getCommand());
|
||||
var1.getAliases().forEach(var2 -> this.a(var1, var2));
|
||||
}
|
||||
|
||||
public void b(Command var1) {
|
||||
public void unregisterCommand(Command var1) {
|
||||
RootCommandNode var2 = this.e().a().getRoot();
|
||||
var2.removeCommand(var1.getCommand());
|
||||
var1.getAliases().forEach(var2::removeCommand);
|
||||
BukkitCommands.b(var1);
|
||||
BukkitCommands.unregisterCommand(var1);
|
||||
}
|
||||
|
||||
private CommandDispatcher e() {
|
||||
@@ -126,25 +126,25 @@ public class V1_20_6Platform implements ServerPlatform {
|
||||
return 1;
|
||||
});
|
||||
LiteralCommandNode var4 = var3.build();
|
||||
if (!ServerVersion.d) {
|
||||
BukkitCommands.a(new VanillaCommandWrapper(this.e(), var4));
|
||||
if (!ServerVersion.IS_PAPER) {
|
||||
BukkitCommands.registerBukkitCommand(new VanillaCommandWrapper(this.e(), var4));
|
||||
}
|
||||
|
||||
this.e().a().getRoot().addChild(var4);
|
||||
}
|
||||
|
||||
public void a(Block var1, Material var2) {
|
||||
public void setBlock(Block var1, Material var2) {
|
||||
CraftBlock var3 = (CraftBlock)var1;
|
||||
IBlockData var4 = CraftMagicNumbers.getBlock(var2).o();
|
||||
((CraftChunk)var1.getChunk()).getHandle(ChunkStatus.n).a(var3.getPosition(), var4, false);
|
||||
var3.getCraftWorld().getHandle().a(var3.getPosition(), var3.getNMS(), var4, 0);
|
||||
}
|
||||
|
||||
public HologramEntity a(World var1, double var2, double var4, double var6) {
|
||||
public HologramEntity createHologram(World var1, double var2, double var4, double var6) {
|
||||
return new V1_20_6HologramEntity(((CraftWorld)var1).getHandle(), var2, var4, var6);
|
||||
}
|
||||
|
||||
public boolean a(Block var1, double var2, double var4, double var6) {
|
||||
public boolean isInsideBlockHitbox(Block var1, double var2, double var4, double var6) {
|
||||
CraftBlock var8 = (CraftBlock)var1;
|
||||
VoxelShape var9 = var8.getNMS().j(var8.getCraftWorld().getHandle(), var8.getPosition());
|
||||
if (var9.c()) {
|
||||
@@ -163,7 +163,7 @@ public class V1_20_6Platform implements ServerPlatform {
|
||||
return var16.booleanValue();
|
||||
}
|
||||
|
||||
public void a(Player var1, boolean var2, Score var3, int var4) {
|
||||
public void sendScorePacket(Player var1, boolean var2, Score var3, int var4) {
|
||||
if (var2) {
|
||||
((CraftPlayer)var1).getHandle().c.b(new ClientboundResetScorePacket(var3.getEntry(), var3.getObjective().getName()));
|
||||
} else {
|
||||
@@ -174,7 +174,7 @@ public class V1_20_6Platform implements ServerPlatform {
|
||||
}
|
||||
}
|
||||
|
||||
public void a(Player var1, Team var2, String var3, String var4, OptionStatus var5) {
|
||||
public void sendTeamPacket(Player var1, Team var2, String var3, String var4, TeamVisibility var5) {
|
||||
if (var1.getScoreboard() == var2.getScoreboard()) {
|
||||
EntityPlayer var6 = ((CraftPlayer)var1).getHandle();
|
||||
ScoreboardTeam var7 = var6.gr().b(var2.getName());
|
||||
|
||||
+3
-3
@@ -6,15 +6,15 @@ import ro.fr33styler.arcade.platform.version.VersionFactory;
|
||||
import org.bukkit.Server;
|
||||
|
||||
public class V1_20_6PlatformFactory implements VersionFactory<ServerPlatform> {
|
||||
public String a() {
|
||||
public String getVersionLabel() {
|
||||
return "1.20.6";
|
||||
}
|
||||
|
||||
public boolean a(String var1) {
|
||||
public boolean supports(String var1) {
|
||||
return var1.equals("1.20.5") || var1.equals("1.20.6");
|
||||
}
|
||||
|
||||
public ServerPlatform a(Server var1) {
|
||||
public ServerPlatform create(Server var1) {
|
||||
return new V1_20_6Platform(var1);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -13,7 +13,7 @@ import org.bukkit.util.Vector;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
public class BombLobbersV1_20_6TntFactory implements BombLobbersTntFactory {
|
||||
public TNTPrimed a(Player var1, Color var2, Vector var3) {
|
||||
public TNTPrimed spawnTnt(Player var1, Color var2, Vector var3) {
|
||||
EntityPlayer var4 = ((CraftPlayer)var1).getHandle();
|
||||
Vector3f var5 = new Vector3f(var2.getRed() / 255.0F, var2.getGreen() / 255.0F, var2.getBlue() / 255.0F);
|
||||
BombLobbersV1_20_6TntEntity var6 = new BombLobbersV1_20_6TntEntity(var4, new ParticleParamRedstone(var5, 1.0F), var3);
|
||||
|
||||
+3
-3
@@ -6,15 +6,15 @@ import ro.fr33styler.arcade.platform.version.VersionFactory;
|
||||
import org.bukkit.Server;
|
||||
|
||||
public class BombLobbersV1_20_6TntFactorySelector implements VersionFactory<BombLobbersTntFactory> {
|
||||
public String a() {
|
||||
public String getVersionLabel() {
|
||||
return "1.20.6";
|
||||
}
|
||||
|
||||
public boolean a(String var1) {
|
||||
public boolean supports(String var1) {
|
||||
return var1.equals("1.20.5") || var1.equals("1.20.6");
|
||||
}
|
||||
|
||||
public BombLobbersTntFactory a(Server var1) {
|
||||
public BombLobbersTntFactory create(Server var1) {
|
||||
return new BombLobbersV1_20_6TntFactory();
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -16,15 +16,15 @@ import org.bukkit.entity.WitherSkull;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class MiniWallsV1_20_6EntityFactory implements MiniWallsEntityFactory {
|
||||
public Wither a(Location var1, Predicate<LivingEntity> var2, Runnable var3) {
|
||||
public Wither spawnWither(Location var1, Predicate<LivingEntity> var2, Runnable var3) {
|
||||
return (Wither)new MiniWallsV1_20_6Wither(var1, var2, var3).getBukkitEntity();
|
||||
}
|
||||
|
||||
public Arrow a(Player var1, Color var2, Vector var3, Predicate<Entity> var4) {
|
||||
public Arrow spawnArrow(Player var1, Color var2, Vector var3, Predicate<Entity> var4) {
|
||||
return (Arrow)new MiniWallsV1_20_6Arrow(((CraftPlayer)var1).getHandle(), var2, var3, var4).getBukkitEntity();
|
||||
}
|
||||
|
||||
public WitherSkull a(Wither var1, Vector var2, Predicate<Entity> var3) {
|
||||
public WitherSkull spawnWitherSkull(Wither var1, Vector var2, Predicate<Entity> var3) {
|
||||
return (WitherSkull)new MiniWallsV1_20_6WitherSkull(((CraftWither)var1).getHandle(), var2, var3).getBukkitEntity();
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -6,15 +6,15 @@ import ro.fr33styler.arcade.platform.version.VersionFactory;
|
||||
import org.bukkit.Server;
|
||||
|
||||
public class MiniWallsV1_20_6EntityFactorySelector implements VersionFactory<MiniWallsEntityFactory> {
|
||||
public String a() {
|
||||
public String getVersionLabel() {
|
||||
return "1.20.6";
|
||||
}
|
||||
|
||||
public boolean a(String var1) {
|
||||
public boolean supports(String var1) {
|
||||
return var1.equals("1.20.5") || var1.equals("1.20.6");
|
||||
}
|
||||
|
||||
public MiniWallsEntityFactory a(Server var1) {
|
||||
public MiniWallsEntityFactory create(Server var1) {
|
||||
return new MiniWallsV1_20_6EntityFactory();
|
||||
}
|
||||
}
|
||||
+11
-11
@@ -35,34 +35,34 @@ public class PropHuntV1_20_6PropEntity extends EntityArmorStand implements PropH
|
||||
this.a(EnumItemSlot.f, CraftItemStack.asNMSCopy(var2));
|
||||
}
|
||||
|
||||
this.a(var3);
|
||||
this.teleport(var3);
|
||||
}
|
||||
|
||||
public UUID a() {
|
||||
public UUID getUniqueId() {
|
||||
return this.az;
|
||||
}
|
||||
|
||||
public PropHuntPropType b() {
|
||||
public PropHuntPropType getPropType() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
public ItemStack c() {
|
||||
public ItemStack getItem() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public Player d() {
|
||||
public Player getOwner() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public void a(Player var1) {
|
||||
public void setOwner(Player var1) {
|
||||
this.a = (CraftPlayer)var1;
|
||||
}
|
||||
|
||||
public Location e() {
|
||||
public Location getLocation() {
|
||||
return new Location(this.dP().getWorld(), this.du(), this.dw() + 1.35, this.dA(), this.dF(), this.dH());
|
||||
}
|
||||
|
||||
public void a(Location var1) {
|
||||
public void teleport(Location var1) {
|
||||
double var2 = var1.getX();
|
||||
double var4 = var1.getY() - 1.35;
|
||||
double var6 = var1.getZ();
|
||||
@@ -76,13 +76,13 @@ public class PropHuntV1_20_6PropEntity extends EntityArmorStand implements PropH
|
||||
this.e(var2, var4, var6);
|
||||
}
|
||||
|
||||
public void f() {
|
||||
public void attachOwner() {
|
||||
if (this.a != null) {
|
||||
this.getBukkitEntity().addPassenger(this.a);
|
||||
}
|
||||
}
|
||||
|
||||
public void h() {
|
||||
public void destroy() {
|
||||
this.ao();
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ public class PropHuntV1_20_6PropEntity extends EntityArmorStand implements PropH
|
||||
|
||||
public void l() {
|
||||
if (this.a != null && !this.a.isInsideVehicle()) {
|
||||
this.a(this.a.getLocation());
|
||||
this.teleport(this.a.getLocation());
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -10,11 +10,11 @@ import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class PropHuntV1_20_6PropFactory implements PropHuntPropFactory {
|
||||
public Particle a() {
|
||||
public Particle getDisguiseParticle() {
|
||||
return Particle.HAPPY_VILLAGER;
|
||||
}
|
||||
|
||||
public PropHuntProp a(PropHuntPropType var1, ItemStack var2, Location var3) {
|
||||
public PropHuntProp createProp(PropHuntPropType var1, ItemStack var2, Location var3) {
|
||||
PropHuntV1_20_6PropEntity var4 = new PropHuntV1_20_6PropEntity(var1, var2, var3);
|
||||
var4.dP().addFreshEntity(var4, SpawnReason.CUSTOM);
|
||||
return var4;
|
||||
|
||||
+3
-3
@@ -6,15 +6,15 @@ import ro.fr33styler.arcade.platform.version.VersionFactory;
|
||||
import org.bukkit.Server;
|
||||
|
||||
public class PropHuntV1_20_6PropFactorySelector implements VersionFactory<PropHuntPropFactory> {
|
||||
public String a() {
|
||||
public String getVersionLabel() {
|
||||
return "1.20.6";
|
||||
}
|
||||
|
||||
public boolean a(String var1) {
|
||||
public boolean supports(String var1) {
|
||||
return var1.equals("1.20.5") || var1.equals("1.20.6");
|
||||
}
|
||||
|
||||
public PropHuntPropFactory a(Server var1) {
|
||||
public PropHuntPropFactory create(Server var1) {
|
||||
return new PropHuntV1_20_6PropFactory();
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -22,22 +22,22 @@ public class V1_20_6HologramEntity extends EntityArmorStand implements HologramE
|
||||
super.k(true);
|
||||
}
|
||||
|
||||
public void a(String var1) {
|
||||
public void setText(String var1) {
|
||||
super.b(CraftChatMessage.fromStringOrNull(var1));
|
||||
if (super.ag()) {
|
||||
super.o(true);
|
||||
}
|
||||
}
|
||||
|
||||
public LivingEntity a() {
|
||||
public LivingEntity getEntity() {
|
||||
return (LivingEntity)this.getBukkitEntity();
|
||||
}
|
||||
|
||||
public void a(Player var1) {
|
||||
public void updateMetadata(Player var1) {
|
||||
this.a(this.b(var1));
|
||||
}
|
||||
|
||||
public void a(Player var1, boolean var2) {
|
||||
public void setVisible(Player var1, boolean var2) {
|
||||
PlayerConnection var3 = this.b(var1);
|
||||
if (var2) {
|
||||
var3.b(new PacketPlayOutSpawnEntity(this));
|
||||
|
||||
+4
-4
@@ -13,10 +13,10 @@ import org.bukkit.craftbukkit.v1_20_R4.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class V1_20_6PacketInterceptor implements PacketInterceptor {
|
||||
private static final Field a = Reflection.a(ServerCommonPacketListenerImpl.class, NetworkManager.class);
|
||||
private static final Field a = Reflection.findFieldByType(ServerCommonPacketListenerImpl.class, NetworkManager.class);
|
||||
|
||||
private Channel a(Player var1) throws IllegalAccessException {
|
||||
NetworkManager var2 = (NetworkManager)Reflection.a(a, ((CraftPlayer)var1).getHandle().c);
|
||||
NetworkManager var2 = (NetworkManager)Reflection.getFieldValue(a, ((CraftPlayer)var1).getHandle().c);
|
||||
return var2.n;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public class V1_20_6PacketInterceptor implements PacketInterceptor {
|
||||
}
|
||||
}
|
||||
|
||||
public void a(String var1, Player var2) {
|
||||
public void inject(String var1, Player var2) {
|
||||
try {
|
||||
ChannelPipeline var3 = this.a(var2).pipeline();
|
||||
this.a(var3, var1);
|
||||
@@ -37,7 +37,7 @@ public class V1_20_6PacketInterceptor implements PacketInterceptor {
|
||||
}
|
||||
}
|
||||
|
||||
public void b(String var1, Player var2) {
|
||||
public void eject(String var1, Player var2) {
|
||||
try {
|
||||
Channel var3 = this.a(var2);
|
||||
var3.eventLoop().execute(() -> this.a(var3.pipeline(), var1));
|
||||
|
||||
+4
-4
@@ -36,11 +36,11 @@ public class V1_20_6Npc extends EntityPlayer implements Npc {
|
||||
this.a = var4;
|
||||
}
|
||||
|
||||
public int a() {
|
||||
public int getEntityId() {
|
||||
return this.al();
|
||||
}
|
||||
|
||||
public Location b() {
|
||||
public Location getLocation() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class V1_20_6Npc extends EntityPlayer implements Npc {
|
||||
this.b = var1;
|
||||
}
|
||||
|
||||
public void a(Player var1, boolean var2) {
|
||||
public void setVisible(Player var1, boolean var2) {
|
||||
this.c = this.b(var1);
|
||||
if (var2) {
|
||||
this.c.b(new ClientboundPlayerInfoUpdatePacket(net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket.a.a, this));
|
||||
@@ -69,7 +69,7 @@ public class V1_20_6Npc extends EntityPlayer implements Npc {
|
||||
return ((CraftPlayer)var1).getHandle().c;
|
||||
}
|
||||
|
||||
public void a(Player var1) {
|
||||
public void removeFromTabList(Player var1) {
|
||||
this.b(var1).b(new ClientboundPlayerInfoRemovePacket(List.of(this.az)));
|
||||
}
|
||||
}
|
||||
+9
-9
@@ -26,7 +26,7 @@ public class V1_20_6NpcFactory implements NpcFactory {
|
||||
this.a = var1;
|
||||
}
|
||||
|
||||
public V1_20_6Npc a(Location var1, Player var2) {
|
||||
public V1_20_6Npc createPlayerNpc(Location var1, Player var2) {
|
||||
EntityPlayer var3 = ((CraftPlayer)var2).getHandle();
|
||||
GameProfile var4 = new GameProfile(UUID.randomUUID(), var2.getName());
|
||||
var4.getProperties().putAll(var3.gb().getProperties());
|
||||
@@ -36,19 +36,19 @@ public class V1_20_6NpcFactory implements NpcFactory {
|
||||
public V1_20_6Npc a(Location var1, String var2, SkinTexture var3) {
|
||||
CraftWorld var4 = (CraftWorld)var1.getWorld();
|
||||
GameProfile var5 = new GameProfile(UUID.randomUUID(), var2);
|
||||
var5.getProperties().put("textures", new Property("textures", var3.a(), var3.b()));
|
||||
var5.getProperties().put("textures", new Property("textures", var3.getValue(), var3.getSignature()));
|
||||
return new V1_20_6Npc(((CraftServer)this.a).getServer(), var4.getHandle(), var5, var1);
|
||||
}
|
||||
|
||||
public V1_20_6Npc a(Location var1, String var2, SkinTexture var3, NpcEquipment var4) {
|
||||
public V1_20_6Npc createNpc(Location var1, String var2, SkinTexture var3, NpcEquipment var4) {
|
||||
V1_20_6Npc var5 = this.a(var1, var2, var3);
|
||||
ArrayList var6 = new ArrayList();
|
||||
var6.add(new Pair(EnumItemSlot.a, CraftItemStack.asNMSCopy(var4.a())));
|
||||
var6.add(new Pair(EnumItemSlot.b, CraftItemStack.asNMSCopy(var4.b())));
|
||||
var6.add(new Pair(EnumItemSlot.f, CraftItemStack.asNMSCopy(var4.c())));
|
||||
var6.add(new Pair(EnumItemSlot.e, CraftItemStack.asNMSCopy(var4.d())));
|
||||
var6.add(new Pair(EnumItemSlot.d, CraftItemStack.asNMSCopy(var4.e())));
|
||||
var6.add(new Pair(EnumItemSlot.c, CraftItemStack.asNMSCopy(var4.f())));
|
||||
var6.add(new Pair(EnumItemSlot.a, CraftItemStack.asNMSCopy(var4.getMainHandItem())));
|
||||
var6.add(new Pair(EnumItemSlot.b, CraftItemStack.asNMSCopy(var4.getOffHandItem())));
|
||||
var6.add(new Pair(EnumItemSlot.f, CraftItemStack.asNMSCopy(var4.getHelmetItem())));
|
||||
var6.add(new Pair(EnumItemSlot.e, CraftItemStack.asNMSCopy(var4.getChestplateItem())));
|
||||
var6.add(new Pair(EnumItemSlot.d, CraftItemStack.asNMSCopy(var4.getLeggingsItem())));
|
||||
var6.add(new Pair(EnumItemSlot.c, CraftItemStack.asNMSCopy(var4.getBootsItem())));
|
||||
var5.a(var6);
|
||||
return var5;
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion><parent><groupId>ro.fr33styler.arcade</groupId><artifactId>arcadegames-parent</artifactId><version>2.19f-reconstructed</version><relativePath>../../../../pom.xml</relativePath></parent>
|
||||
<artifactId>platforms-latest-v1_21_R7</artifactId><properties><maven.compiler.release>17</maven.compiler.release></properties>
|
||||
<dependencies><dependency><groupId>ro.fr33styler.arcade</groupId><artifactId>common</artifactId><version>${project.version}</version></dependency><dependency><groupId>ro.fr33styler.arcade</groupId><artifactId>platform-api-latest</artifactId><version>${project.version}</version></dependency><dependency><groupId>local.compile-only</groupId><artifactId>latest-v1_21_R7</artifactId><version>2.19f</version><scope>system</scope><systemPath>${maven.multiModuleProjectDirectory}/build-support/deps/stubs-latest-v1_21_R7.jar</systemPath></dependency></dependencies>
|
||||
<dependencies><dependency><groupId>ro.fr33styler.arcade</groupId><artifactId>common</artifactId><version>${project.version}</version></dependency><dependency><groupId>local.compile-only</groupId><artifactId>latest-v1_21_R7</artifactId><version>2.19f</version><scope>system</scope><systemPath>${maven.multiModuleProjectDirectory}/build-support/deps/stubs-latest-v1_21_R7.jar</systemPath></dependency></dependencies>
|
||||
</project>
|
||||
+17
-17
@@ -54,7 +54,7 @@ import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scoreboard.Score;
|
||||
import org.bukkit.scoreboard.Team;
|
||||
import org.bukkit.scoreboard.Team.OptionStatus;
|
||||
import ro.fr33styler.arcade.platform.api.scoreboard.TeamVisibility;
|
||||
import ro.fr33styler.arcade.api.engine.command.Command;
|
||||
|
||||
public class V1_21_11Platform implements ServerPlatform {
|
||||
@@ -65,32 +65,32 @@ public class V1_21_11Platform implements ServerPlatform {
|
||||
this.a = new V1_21_11NpcFactory(var1);
|
||||
}
|
||||
|
||||
public V1_21_11NpcFactory a() {
|
||||
public V1_21_11NpcFactory getNpcFactory() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public V1_21_11PacketInterceptor b() {
|
||||
public V1_21_11PacketInterceptor getPacketInterceptor() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public void a(Player var1) {
|
||||
public void sendHealthUpdate(Player var1) {
|
||||
var1.sendHealthUpdate();
|
||||
}
|
||||
|
||||
public void a(Player var1, Item var2) {
|
||||
public void sendCollectItemAnimation(Player var1, Item var2) {
|
||||
((CraftPlayer)var1).getHandle().g.b(new PacketPlayOutCollect(var2.getEntityId(), var1.getEntityId(), var2.getItemStack().getAmount()));
|
||||
}
|
||||
|
||||
public void a(Command var1) {
|
||||
public void registerCommand(Command var1) {
|
||||
this.a(var1, var1.getCommand());
|
||||
var1.getAliases().forEach(var2 -> this.a(var1, var2));
|
||||
}
|
||||
|
||||
public void b(Command var1) {
|
||||
public void unregisterCommand(Command var1) {
|
||||
RootCommandNode var2 = this.e().a().getRoot();
|
||||
var2.removeCommand(var1.getCommand());
|
||||
var1.getAliases().forEach(var2::removeCommand);
|
||||
BukkitCommands.b(var1);
|
||||
BukkitCommands.unregisterCommand(var1);
|
||||
}
|
||||
|
||||
private CommandDispatcher e() {
|
||||
@@ -128,37 +128,37 @@ public class V1_21_11Platform implements ServerPlatform {
|
||||
return 1;
|
||||
});
|
||||
LiteralCommandNode var4 = var3.build();
|
||||
if (!ServerVersion.d) {
|
||||
BukkitCommands.a(new VanillaCommandWrapper(this.e(), var4));
|
||||
if (!ServerVersion.IS_PAPER) {
|
||||
BukkitCommands.registerBukkitCommand(new VanillaCommandWrapper(this.e(), var4));
|
||||
}
|
||||
|
||||
this.e().a().getRoot().addChild(var4);
|
||||
}
|
||||
|
||||
public double b(Player var1) {
|
||||
public double getWaypointReceiveRange(Player var1) {
|
||||
AttributeInstance var2 = var1.getAttribute(Attribute.WAYPOINT_RECEIVE_RANGE);
|
||||
return var2 == null ? 0.0 : var2.getBaseValue();
|
||||
}
|
||||
|
||||
public void a(Player var1, double var2) {
|
||||
public void setWaypointReceiveRange(Player var1, double var2) {
|
||||
AttributeInstance var4 = var1.getAttribute(Attribute.WAYPOINT_RECEIVE_RANGE);
|
||||
if (var4 != null) {
|
||||
var4.setBaseValue(var2);
|
||||
}
|
||||
}
|
||||
|
||||
public void a(Block var1, Material var2) {
|
||||
public void setBlock(Block var1, Material var2) {
|
||||
CraftBlock var3 = (CraftBlock)var1;
|
||||
IBlockData var4 = CraftMagicNumbers.getBlock(var2).m();
|
||||
((CraftChunk)var1.getChunk()).getHandle(ChunkStatus.n).a(var3.getPosition(), var4, 530);
|
||||
var3.getCraftWorld().getHandle().a(var3.getPosition(), var3.getNMS(), var4, 0);
|
||||
}
|
||||
|
||||
public HologramEntity a(World var1, double var2, double var4, double var6) {
|
||||
public HologramEntity createHologram(World var1, double var2, double var4, double var6) {
|
||||
return new V1_21_11HologramEntity(((CraftWorld)var1).getHandle(), var2, var4, var6);
|
||||
}
|
||||
|
||||
public boolean a(Block var1, double var2, double var4, double var6) {
|
||||
public boolean isInsideBlockHitbox(Block var1, double var2, double var4, double var6) {
|
||||
CraftBlock var8 = (CraftBlock)var1;
|
||||
VoxelShape var9 = var8.getNMS().f(var8.getCraftWorld().getHandle(), var8.getPosition());
|
||||
if (var9.c()) {
|
||||
@@ -177,7 +177,7 @@ public class V1_21_11Platform implements ServerPlatform {
|
||||
return var16.booleanValue();
|
||||
}
|
||||
|
||||
public void a(Player var1, boolean var2, Score var3, int var4) {
|
||||
public void sendScorePacket(Player var1, boolean var2, Score var3, int var4) {
|
||||
if (var2) {
|
||||
((CraftPlayer)var1).getHandle().g.b(new ClientboundResetScorePacket(var3.getEntry(), var3.getObjective().getName()));
|
||||
} else {
|
||||
@@ -188,7 +188,7 @@ public class V1_21_11Platform implements ServerPlatform {
|
||||
}
|
||||
}
|
||||
|
||||
public void a(Player var1, Team var2, String var3, String var4, OptionStatus var5) {
|
||||
public void sendTeamPacket(Player var1, Team var2, String var3, String var4, TeamVisibility var5) {
|
||||
if (var1.getScoreboard() == var2.getScoreboard()) {
|
||||
CraftPlayer var6 = (CraftPlayer)var1;
|
||||
ScoreboardTeam var7 = var6.getScoreboard().getHandle().b(var2.getName());
|
||||
|
||||
+3
-3
@@ -6,15 +6,15 @@ import ro.fr33styler.arcade.platform.version.VersionFactory;
|
||||
import org.bukkit.Server;
|
||||
|
||||
public class V1_21_11PlatformFactory implements VersionFactory<ServerPlatform> {
|
||||
public String a() {
|
||||
public String getVersionLabel() {
|
||||
return "1.21.11";
|
||||
}
|
||||
|
||||
public boolean a(String var1) {
|
||||
public boolean supports(String var1) {
|
||||
return var1.equals("1.21.11");
|
||||
}
|
||||
|
||||
public ServerPlatform a(Server var1) {
|
||||
public ServerPlatform create(Server var1) {
|
||||
return new V1_21_11Platform(var1);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -12,7 +12,7 @@ import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class BombLobbersV1_21_11TntFactory implements BombLobbersTntFactory {
|
||||
public TNTPrimed a(Player var1, Color var2, Vector var3) {
|
||||
public TNTPrimed spawnTnt(Player var1, Color var2, Vector var3) {
|
||||
EntityPlayer var4 = ((CraftPlayer)var1).getHandle();
|
||||
BombLobbersV1_21_11TntEntity var5 = new BombLobbersV1_21_11TntEntity(var4, new ParticleParamRedstone(var2.asRGB(), 1.0F), var3);
|
||||
var4.A().addFreshEntity(var5, SpawnReason.CUSTOM);
|
||||
|
||||
+3
-3
@@ -6,15 +6,15 @@ import ro.fr33styler.arcade.platform.version.VersionFactory;
|
||||
import org.bukkit.Server;
|
||||
|
||||
public class BombLobbersV1_21_11TntFactorySelector implements VersionFactory<BombLobbersTntFactory> {
|
||||
public String a() {
|
||||
public String getVersionLabel() {
|
||||
return "1.21.11";
|
||||
}
|
||||
|
||||
public boolean a(String var1) {
|
||||
public boolean supports(String var1) {
|
||||
return var1.equals("1.21.11");
|
||||
}
|
||||
|
||||
public BombLobbersTntFactory a(Server var1) {
|
||||
public BombLobbersTntFactory create(Server var1) {
|
||||
return new BombLobbersV1_21_11TntFactory();
|
||||
}
|
||||
}
|
||||
Loaded 100 of 1353 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user