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
@@ -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-legacy-v1_12_R1</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><dependency><groupId>ro.fr33styler.arcade</groupId><artifactId>platform-api-legacy</artifactId><version>${project.version}</version></dependency><dependency><groupId>local.compile-only</groupId><artifactId>legacy-v1_12_R1</artifactId><version>2.19f</version><scope>system</scope><systemPath>${maven.multiModuleProjectDirectory}/build-support/deps/stubs-legacy-v1_12_R1.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>legacy-v1_12_R1</artifactId><version>2.19f</version><scope>system</scope><systemPath>${maven.multiModuleProjectDirectory}/build-support/deps/stubs-legacy-v1_12_R1.jar</systemPath></dependency></dependencies>
|
||||
</project>
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
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> handler;
|
||||
|
||||
@EventHandler
|
||||
public void onSwapHandItems(PlayerSwapHandItemsEvent event) {
|
||||
Boolean cancelled = this.handler.apply(event.getPlayer());
|
||||
if (cancelled != null) {
|
||||
event.setCancelled(cancelled);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHandler(Function<Player, Boolean> handler) {
|
||||
this.handler = handler;
|
||||
}
|
||||
}
|
||||
+31
-31
@@ -62,7 +62,7 @@ import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
import org.bukkit.scoreboard.NameTagVisibility;
|
||||
import ro.fr33styler.arcade.platform.api.scoreboard.TeamVisibility;
|
||||
import org.bukkit.scoreboard.Score;
|
||||
import org.bukkit.scoreboard.Team;
|
||||
|
||||
@@ -110,42 +110,42 @@ public class V1_12_2Platform implements ServerPlatform {
|
||||
b[30] = var2;
|
||||
}
|
||||
|
||||
public V1_12_2NpcFactory a() {
|
||||
public V1_12_2NpcFactory getNpcFactory() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
public V1_12_2PacketInterceptor b() {
|
||||
public V1_12_2PacketInterceptor getPacketInterceptor() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
public LegacyBossBar c() {
|
||||
public LegacyBossBar createLegacyBossBar() {
|
||||
return new V1_12_2BossBar();
|
||||
}
|
||||
|
||||
public void a(Firework var1) {
|
||||
public void detonateFirework(Firework var1) {
|
||||
((CraftFirework)var1).getHandle().expectedLifespan = 2;
|
||||
}
|
||||
|
||||
public void a(org.bukkit.entity.Entity var1, boolean var2) {
|
||||
public void setInvulnerable(org.bukkit.entity.Entity var1, boolean var2) {
|
||||
var1.setInvulnerable(var2);
|
||||
}
|
||||
|
||||
public void a(LivingEntity var1, double var2) {
|
||||
public void setMovementSpeed(LivingEntity var1, double var2) {
|
||||
var1.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).setBaseValue(var2);
|
||||
}
|
||||
|
||||
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()
|
||||
.playerConnection
|
||||
.sendPacket(new PacketPlayOutCollect(var2.getEntityId(), var1.getEntityId(), var2.getItemStack().getAmount()));
|
||||
}
|
||||
|
||||
public void a(Block var1, Material var2, int var3) {
|
||||
public void setBlock(Block var1, Material var2, int var3) {
|
||||
Chunk var4 = ((CraftChunk)var1.getChunk()).getHandle();
|
||||
BlockPosition var5 = new BlockPosition(var1.getX(), var1.getY(), var1.getZ());
|
||||
IBlockData var6 = net.minecraft.server.v1_12_R1.Block.getByCombinedId(var2.getId() + (var3 << 12));
|
||||
@@ -153,17 +153,17 @@ public class V1_12_2Platform implements ServerPlatform {
|
||||
var4.getWorld().notify(var5, var4.getBlockData(var5), var6, 3);
|
||||
}
|
||||
|
||||
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_12_2HologramEntity(((CraftWorld)var1).getHandle(), var2, var4, var6);
|
||||
}
|
||||
|
||||
public void a(SkullMeta var1, SkinTexture var2) {
|
||||
public void applySkullTexture(SkullMeta var1, SkinTexture var2) {
|
||||
GameProfile var3 = new GameProfile(UUID.randomUUID(), "");
|
||||
var3.getProperties().put("textures", new Property("textures", var2.a()));
|
||||
var3.getProperties().put("textures", new Property("textures", var2.getValue()));
|
||||
|
||||
try {
|
||||
if (this.f == null) {
|
||||
this.f = Reflection.a(var1.getClass(), "profile");
|
||||
this.f = Reflection.findFieldByName(var1.getClass(), "profile");
|
||||
}
|
||||
|
||||
this.f.set(var1, var3);
|
||||
@@ -172,7 +172,7 @@ public class V1_12_2Platform implements ServerPlatform {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean a(Block var1, double var2, double var4, double var6) {
|
||||
public boolean isInsideBlockHitbox(Block var1, double var2, double var4, double var6) {
|
||||
return switch (V1_12_2PlatformSwitchTable.a[var1.getType().ordinal()]) {
|
||||
case 1 -> {
|
||||
double var13 = var2 - var1.getX();
|
||||
@@ -192,19 +192,19 @@ public class V1_12_2Platform implements ServerPlatform {
|
||||
};
|
||||
}
|
||||
|
||||
public boolean a(PlayerInteractEvent var1) {
|
||||
public boolean isMainHandInteract(PlayerInteractEvent var1) {
|
||||
return var1.getHand() == EquipmentSlot.HAND;
|
||||
}
|
||||
|
||||
public boolean a(EntityDamageEvent var1) {
|
||||
public boolean isCrammingDamage(EntityDamageEvent var1) {
|
||||
return var1.getCause() == DamageCause.CRAMMING;
|
||||
}
|
||||
|
||||
public SwapHandListener d() {
|
||||
public SwapHandListener createSwapHandListener() {
|
||||
return new V1_12_2SwapHandListener();
|
||||
}
|
||||
|
||||
public SkinTexture c(Player var1) {
|
||||
public SkinTexture getSkinTexture(Player var1) {
|
||||
for (Property var3 : ((CraftPlayer)var1).getHandle().getProfile().getProperties().get("textures")) {
|
||||
if (var3.getName().equals("textures")) {
|
||||
return new SkinTexture(var3.getValue());
|
||||
@@ -214,34 +214,34 @@ public class V1_12_2Platform implements ServerPlatform {
|
||||
return new SkinTexture();
|
||||
}
|
||||
|
||||
public ItemStack d(Player var1) {
|
||||
public ItemStack getMainHandItem(Player var1) {
|
||||
return var1.getInventory().getItemInMainHand();
|
||||
}
|
||||
|
||||
public void a(Player var1, ItemStack var2) {
|
||||
public void setMainHandItem(Player var1, ItemStack var2) {
|
||||
var1.getInventory().setItemInMainHand(var2);
|
||||
}
|
||||
|
||||
public ItemStack e(Player var1) {
|
||||
public ItemStack getOffHandItem(Player var1) {
|
||||
return var1.getInventory().getItemInOffHand();
|
||||
}
|
||||
|
||||
public void b(Player var1, ItemStack var2) {
|
||||
public void setOffHandItem(Player var1, ItemStack var2) {
|
||||
var1.getInventory().setItemInOffHand(var2);
|
||||
}
|
||||
|
||||
public void a(Player var1, boolean var2) {
|
||||
public void setCollidable(Player var1, boolean var2) {
|
||||
var1.setCollidable(var2);
|
||||
}
|
||||
|
||||
public void a(Player var1, String var2) {
|
||||
public void sendActionBar(Player var1, String var2) {
|
||||
((CraftPlayer)var1)
|
||||
.getHandle()
|
||||
.playerConnection
|
||||
.sendPacket(new PacketPlayOutChat(ChatSerializer.a("{\"text\": \"" + var2 + "\"}"), ChatMessageType.GAME_INFO));
|
||||
}
|
||||
|
||||
public void a(Player var1, String var2, String var3, int var4, int var5, int var6) {
|
||||
public void sendTitle(Player var1, String var2, String var3, int var4, int var5, int var6) {
|
||||
PlayerConnection var7 = ((CraftPlayer)var1).getHandle().playerConnection;
|
||||
var7.sendPacket(new PacketPlayOutTitle(EnumTitleAction.TIMES, null, var4, var5, var6));
|
||||
if (var2 != null) {
|
||||
@@ -253,7 +253,7 @@ public class V1_12_2Platform implements ServerPlatform {
|
||||
}
|
||||
}
|
||||
|
||||
public void a(Player var1, String var2, String var3) {
|
||||
public void sendHeaderAndFooter(Player var1, String var2, String var3) {
|
||||
IChatBaseComponent var4 = ChatSerializer.a("{\"text\":\"" + var2 + "\"}");
|
||||
IChatBaseComponent var5 = ChatSerializer.a("{\"text\":\"" + var3 + "\"}");
|
||||
|
||||
@@ -269,7 +269,7 @@ public class V1_12_2Platform implements ServerPlatform {
|
||||
}
|
||||
}
|
||||
|
||||
public void a(Player var1, boolean var2, Score var3, int var4) {
|
||||
public void sendScorePacket(Player var1, boolean var2, Score var3, int var4) {
|
||||
PacketDataSerializer var5 = new PacketDataSerializer(Unpooled.buffer());
|
||||
var5.a(var3.getEntry());
|
||||
var5.d(var2 ? 1 : 0);
|
||||
@@ -286,7 +286,7 @@ public class V1_12_2Platform implements ServerPlatform {
|
||||
}
|
||||
}
|
||||
|
||||
public void a(Player var1, Team var2, String var3, String var4, NameTagVisibility 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.getScoreboard().getTeam(var2.getName());
|
||||
@@ -315,8 +315,8 @@ public class V1_12_2Platform implements ServerPlatform {
|
||||
|
||||
static {
|
||||
try {
|
||||
a = (RegistryID<Class<? extends Entity>>)Reflection.a(RegistryMaterials.class, "a").get(EntityTypes.b);
|
||||
b = (Object[])Reflection.a(RegistryID.class, "d").get(a);
|
||||
a = (RegistryID<Class<? extends Entity>>)Reflection.findFieldByName(RegistryMaterials.class, "a").get(EntityTypes.b);
|
||||
b = (Object[])Reflection.findFieldByName(RegistryID.class, "d").get(a);
|
||||
} catch (IllegalAccessException var1) {
|
||||
throw new RuntimeException(var1);
|
||||
}
|
||||
|
||||
+3
-3
@@ -6,15 +6,15 @@ import ro.fr33styler.arcade.platform.version.VersionFactory;
|
||||
import org.bukkit.Server;
|
||||
|
||||
public class V1_12_2PlatformFactory implements VersionFactory<ServerPlatform> {
|
||||
public String a() {
|
||||
public String getVersionLabel() {
|
||||
return "1.12.2";
|
||||
}
|
||||
|
||||
public boolean a(String var1) {
|
||||
public boolean supports(String var1) {
|
||||
return var1.equals("1.12.2");
|
||||
}
|
||||
|
||||
public ServerPlatform a(Server var1) {
|
||||
public ServerPlatform create(Server var1) {
|
||||
return new V1_12_2Platform(var1);
|
||||
}
|
||||
}
|
||||
+5
-5
@@ -12,23 +12,23 @@ import org.bukkit.entity.Player;
|
||||
public class V1_12_2BossBar implements LegacyBossBar {
|
||||
private final BossBar a = new CraftBossBar("", BarColor.WHITE, BarStyle.SOLID, new BarFlag[0]);
|
||||
|
||||
public void a(Player var1) {
|
||||
public void addPlayer(Player var1) {
|
||||
this.a.addPlayer(var1);
|
||||
}
|
||||
|
||||
public void a(String var1) {
|
||||
public void setTitle(String var1) {
|
||||
this.a.setTitle(var1);
|
||||
}
|
||||
|
||||
public void a(boolean var1) {
|
||||
public void setVisible(boolean var1) {
|
||||
this.a.setVisible(var1);
|
||||
}
|
||||
|
||||
public void b(Player var1) {
|
||||
public void removePlayer(Player var1) {
|
||||
this.a.removePlayer(var1);
|
||||
}
|
||||
|
||||
public void a() {
|
||||
public void removeAll() {
|
||||
this.a.removeAll();
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -14,7 +14,7 @@ import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class BombLobbersV1_12_2TntEntity extends EntityTNTPrimed {
|
||||
private static final Field a = Reflection.a(EntityTNTPrimed.class, "source");
|
||||
private static final Field a = Reflection.findFieldByName(EntityTNTPrimed.class, "source");
|
||||
private float b;
|
||||
private float c;
|
||||
private float d;
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class BombLobbersV1_12_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();
|
||||
BombLobbersV1_12_2TntEntity var5 = new BombLobbersV1_12_2TntEntity(var4, var2, var3);
|
||||
var4.world.addEntity(var5, SpawnReason.CUSTOM);
|
||||
|
||||
+3
-3
@@ -6,15 +6,15 @@ import ro.fr33styler.arcade.platform.version.VersionFactory;
|
||||
import org.bukkit.Server;
|
||||
|
||||
public class BombLobbersV1_12_2TntFactorySelector implements VersionFactory<BombLobbersTntFactory> {
|
||||
public String a() {
|
||||
public String getVersionLabel() {
|
||||
return "1.12.2";
|
||||
}
|
||||
|
||||
public boolean a(String var1) {
|
||||
public boolean supports(String var1) {
|
||||
return var1.equals("1.12.2");
|
||||
}
|
||||
|
||||
public BombLobbersTntFactory a(Server var1) {
|
||||
public BombLobbersTntFactory create(Server var1) {
|
||||
return new BombLobbersV1_12_2TntFactory();
|
||||
}
|
||||
}
|
||||
+5
-5
@@ -29,22 +29,22 @@ public class MiniWallsV1_12_2EntityFactory implements MiniWallsEntityFactory {
|
||||
b[64] = var1;
|
||||
}
|
||||
|
||||
public Wither a(Location var1, Predicate<LivingEntity> var2, Runnable var3) {
|
||||
public Wither spawnWither(Location var1, Predicate<LivingEntity> var2, Runnable var3) {
|
||||
return (Wither)new MiniWallsV1_12_2Wither(var1, var2, var3).getBukkitEntity();
|
||||
}
|
||||
|
||||
public Arrow a(Player var1, Color var2, Vector var3, Predicate<org.bukkit.entity.Entity> var4) {
|
||||
public Arrow spawnArrow(Player var1, Color var2, Vector var3, Predicate<org.bukkit.entity.Entity> var4) {
|
||||
return (Arrow)new MiniWallsV1_12_2Arrow(((CraftPlayer)var1).getHandle(), var2, var3, var4).getBukkitEntity();
|
||||
}
|
||||
|
||||
public WitherSkull a(Wither var1, Vector var2, Predicate<org.bukkit.entity.Entity> var3) {
|
||||
public WitherSkull spawnWitherSkull(Wither var1, Vector var2, Predicate<org.bukkit.entity.Entity> var3) {
|
||||
return (WitherSkull)new MiniWallsV1_12_2WitherSkull(((CraftWither)var1).getHandle(), var2, var3).getBukkitEntity();
|
||||
}
|
||||
|
||||
static {
|
||||
try {
|
||||
a = (RegistryID<Class<? extends Entity>>)Reflection.a(RegistryMaterials.class, "a").get(EntityTypes.b);
|
||||
b = (Object[])Reflection.a(RegistryID.class, "d").get(a);
|
||||
a = (RegistryID<Class<? extends Entity>>)Reflection.findFieldByName(RegistryMaterials.class, "a").get(EntityTypes.b);
|
||||
b = (Object[])Reflection.findFieldByName(RegistryID.class, "d").get(a);
|
||||
} catch (IllegalAccessException var1) {
|
||||
throw new RuntimeException(var1);
|
||||
}
|
||||
|
||||
+3
-3
@@ -6,15 +6,15 @@ import ro.fr33styler.arcade.platform.version.VersionFactory;
|
||||
import org.bukkit.Server;
|
||||
|
||||
public class MiniWallsV1_12_2EntityFactorySelector implements VersionFactory<MiniWallsEntityFactory> {
|
||||
public String a() {
|
||||
public String getVersionLabel() {
|
||||
return "1.12.2";
|
||||
}
|
||||
|
||||
public boolean a(String var1) {
|
||||
public boolean supports(String var1) {
|
||||
return var1.equals("1.12.2");
|
||||
}
|
||||
|
||||
public MiniWallsEntityFactory a(Server var1) {
|
||||
public MiniWallsEntityFactory create(Server var1) {
|
||||
return new MiniWallsV1_12_2EntityFactory();
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -7,7 +7,7 @@ import org.bukkit.Material;
|
||||
import org.bukkit.entity.FallingBlock;
|
||||
|
||||
public class PartyGamesV1_12_2FallingBlockFactory implements PartyGamesFallingBlockFactory {
|
||||
public FallingBlock a(Location var1, Material var2, byte var3) {
|
||||
public FallingBlock spawnFallingBlock(Location var1, Material var2, byte var3) {
|
||||
return (FallingBlock)new PartyGamesV1_12_2FallingBlock(var1, var2, var3).getBukkitEntity();
|
||||
}
|
||||
}
|
||||
+11
-11
@@ -34,34 +34,34 @@ public class PropHuntV1_12_2PropEntity extends EntityArmorStand implements PropH
|
||||
this.setSlot(EnumItemSlot.HEAD, CraftItemStack.asNMSCopy(var2));
|
||||
}
|
||||
|
||||
this.a(var3);
|
||||
this.teleport(var3);
|
||||
}
|
||||
|
||||
public UUID a() {
|
||||
public UUID getUniqueId() {
|
||||
return this.uniqueID;
|
||||
}
|
||||
|
||||
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.world.getWorld(), this.locX, this.locY + 1.35, this.locZ, this.yaw, this.pitch);
|
||||
}
|
||||
|
||||
public void a(Location var1) {
|
||||
public void teleport(Location var1) {
|
||||
double var2 = var1.getX();
|
||||
double var4 = var1.getY() - 1.35;
|
||||
double var6 = var1.getZ();
|
||||
@@ -75,13 +75,13 @@ public class PropHuntV1_12_2PropEntity extends EntityArmorStand implements PropH
|
||||
this.setPosition(var2, var4, var6);
|
||||
}
|
||||
|
||||
public void f() {
|
||||
public void attachOwner() {
|
||||
if (this.a != null) {
|
||||
this.getBukkitEntity().addPassenger(this.a);
|
||||
}
|
||||
}
|
||||
|
||||
public void g() {
|
||||
public void destroy() {
|
||||
this.die();
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ public class PropHuntV1_12_2PropEntity extends EntityArmorStand implements PropH
|
||||
|
||||
public void B_() {
|
||||
if (this.a != null && !this.a.isInsideVehicle()) {
|
||||
this.a(this.a.getLocation());
|
||||
this.teleport(this.a.getLocation());
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -9,7 +9,7 @@ import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class PropHuntV1_12_2PropFactory implements PropHuntPropFactory {
|
||||
public PropHuntProp a(PropHuntPropType var1, ItemStack var2, Location var3) {
|
||||
public PropHuntProp createProp(PropHuntPropType var1, ItemStack var2, Location var3) {
|
||||
PropHuntV1_12_2PropEntity var4 = new PropHuntV1_12_2PropEntity(var1, var2, var3);
|
||||
var4.world.addEntity(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_12_2PropFactorySelector implements VersionFactory<PropHuntPropFactory> {
|
||||
public String a() {
|
||||
public String getVersionLabel() {
|
||||
return "1.12.2";
|
||||
}
|
||||
|
||||
public boolean a(String var1) {
|
||||
public boolean supports(String var1) {
|
||||
return var1.equals("1.12.2");
|
||||
}
|
||||
|
||||
public PropHuntPropFactory a(Server var1) {
|
||||
public PropHuntPropFactory create(Server var1) {
|
||||
return new PropHuntV1_12_2PropFactory();
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -20,22 +20,22 @@ public class V1_12_2HologramEntity extends EntityArmorStand implements HologramE
|
||||
super.setInvisible(true);
|
||||
}
|
||||
|
||||
public void a(String var1) {
|
||||
public void setText(String var1) {
|
||||
super.setCustomName(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) {
|
||||
PlayerConnection var3 = this.b(var1);
|
||||
if (var2) {
|
||||
var3.sendPacket(new PacketPlayOutSpawnEntityLiving(this));
|
||||
|
||||
+2
-2
@@ -19,7 +19,7 @@ public class V1_12_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_12_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
@@ -31,15 +31,15 @@ public class V1_12_2Npc extends EntityPlayer implements Npc {
|
||||
this.a = var4;
|
||||
}
|
||||
|
||||
public int a() {
|
||||
public int getEntityId() {
|
||||
return this.getId();
|
||||
}
|
||||
|
||||
public Location b() {
|
||||
public Location getLocation() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public void a(Player var1, boolean var2) {
|
||||
public void setVisible(Player var1, boolean var2) {
|
||||
PlayerConnection var3 = this.b(var1);
|
||||
if (var2) {
|
||||
var3.sendPacket(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.ADD_PLAYER, new EntityPlayer[]{this}));
|
||||
@@ -61,7 +61,7 @@ public class V1_12_2Npc extends EntityPlayer implements Npc {
|
||||
return ((CraftPlayer)var1).getHandle().playerConnection;
|
||||
}
|
||||
|
||||
public void a(Player var1) {
|
||||
public void removeFromTabList(Player var1) {
|
||||
this.b(var1).sendPacket(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.REMOVE_PLAYER, new EntityPlayer[]{this}));
|
||||
}
|
||||
}
|
||||
+9
-9
@@ -25,7 +25,7 @@ public class V1_12_2NpcFactory implements NpcFactory {
|
||||
this.a = var1;
|
||||
}
|
||||
|
||||
public V1_12_2Npc a(Location var1, Player var2) {
|
||||
public V1_12_2Npc createPlayerNpc(Location var1, Player var2) {
|
||||
EntityPlayer var3 = ((CraftPlayer)var2).getHandle();
|
||||
GameProfile var4 = new GameProfile(UUID.randomUUID(), var2.getName());
|
||||
var4.getProperties().putAll(var3.getProfile().getProperties());
|
||||
@@ -35,18 +35,18 @@ public class V1_12_2NpcFactory implements NpcFactory {
|
||||
public V1_12_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_12_2Npc(((CraftServer)this.a).getServer(), var4.getHandle(), var5, var1);
|
||||
}
|
||||
|
||||
public V1_12_2Npc a(Location var1, String var2, SkinTexture var3, NpcEquipment var4) {
|
||||
public V1_12_2Npc createNpc(Location var1, String var2, SkinTexture var3, NpcEquipment var4) {
|
||||
V1_12_2Npc var5 = this.a(var1, var2, var3);
|
||||
var5.setSlot(EnumItemSlot.MAINHAND, CraftItemStack.asNMSCopy(var4.a()));
|
||||
var5.setSlot(EnumItemSlot.OFFHAND, CraftItemStack.asNMSCopy(var4.b()));
|
||||
var5.setSlot(EnumItemSlot.HEAD, CraftItemStack.asNMSCopy(var4.c()));
|
||||
var5.setSlot(EnumItemSlot.CHEST, CraftItemStack.asNMSCopy(var4.d()));
|
||||
var5.setSlot(EnumItemSlot.LEGS, CraftItemStack.asNMSCopy(var4.e()));
|
||||
var5.setSlot(EnumItemSlot.FEET, CraftItemStack.asNMSCopy(var4.f()));
|
||||
var5.setSlot(EnumItemSlot.MAINHAND, CraftItemStack.asNMSCopy(var4.getMainHandItem()));
|
||||
var5.setSlot(EnumItemSlot.OFFHAND, CraftItemStack.asNMSCopy(var4.getOffHandItem()));
|
||||
var5.setSlot(EnumItemSlot.HEAD, CraftItemStack.asNMSCopy(var4.getHelmetItem()));
|
||||
var5.setSlot(EnumItemSlot.CHEST, CraftItemStack.asNMSCopy(var4.getChestplateItem()));
|
||||
var5.setSlot(EnumItemSlot.LEGS, CraftItemStack.asNMSCopy(var4.getLeggingsItem()));
|
||||
var5.setSlot(EnumItemSlot.FEET, CraftItemStack.asNMSCopy(var4.getBootsItem()));
|
||||
return var5;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user