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-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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user