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_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();
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -16,15 +16,15 @@ import org.bukkit.entity.WitherSkull;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class MiniWallsV1_21_11EntityFactory 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_21_11Wither(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_21_11Arrow(((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_21_11WitherSkull(((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_21_11EntityFactorySelector implements VersionFactory<MiniWallsEntityFactory> {
|
||||
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 MiniWallsEntityFactory a(Server var1) {
|
||||
public MiniWallsEntityFactory create(Server var1) {
|
||||
return new MiniWallsV1_21_11EntityFactory();
|
||||
}
|
||||
}
|
||||
+11
-11
@@ -35,34 +35,34 @@ public class PropHuntV1_21_11PropEntity extends EntityArmorStand implements Prop
|
||||
this.a(EnumItemSlot.f, CraftItemStack.asNMSCopy(var2));
|
||||
}
|
||||
|
||||
this.a(var3);
|
||||
this.teleport(var3);
|
||||
}
|
||||
|
||||
public UUID a() {
|
||||
public UUID getUniqueId() {
|
||||
return this.aH;
|
||||
}
|
||||
|
||||
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.ao().getWorld(), this.dP(), this.dR() + 1.35, this.dV(), this.ec(), this.ee());
|
||||
}
|
||||
|
||||
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_21_11PropEntity extends EntityArmorStand implements Prop
|
||||
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.aC();
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ public class PropHuntV1_21_11PropEntity extends EntityArmorStand implements Prop
|
||||
|
||||
public void g() {
|
||||
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_21_11PropFactory 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_21_11PropEntity var4 = new PropHuntV1_21_11PropEntity(var1, var2, var3);
|
||||
var4.ao().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_21_11PropFactorySelector implements VersionFactory<PropHuntPropFactory> {
|
||||
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 PropHuntPropFactory a(Server var1) {
|
||||
public PropHuntPropFactory create(Server var1) {
|
||||
return new PropHuntV1_21_11PropFactory();
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -22,22 +22,22 @@ public class V1_21_11HologramEntity extends EntityArmorStand implements Hologram
|
||||
super.l(true);
|
||||
}
|
||||
|
||||
public void a(String var1) {
|
||||
public void setText(String var1) {
|
||||
super.b(CraftChatMessage.fromStringOrNull(var1));
|
||||
if (super.i_()) {
|
||||
super.p(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(
|
||||
|
||||
+4
-4
@@ -13,10 +13,10 @@ import org.bukkit.craftbukkit.v1_21_R7.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class V1_21_11PacketInterceptor 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().g);
|
||||
NetworkManager var2 = (NetworkManager)Reflection.getFieldValue(a, ((CraftPlayer)var1).getHandle().g);
|
||||
return var2.k;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public class V1_21_11PacketInterceptor 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_21_11PacketInterceptor 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 V1_21_11Npc extends EntityPlayer implements Npc {
|
||||
this.a = var4;
|
||||
}
|
||||
|
||||
public int a() {
|
||||
public int getEntityId() {
|
||||
return this.aA();
|
||||
}
|
||||
|
||||
public Location b() {
|
||||
public Location getLocation() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class V1_21_11Npc extends EntityPlayer implements Npc {
|
||||
this.b = var1;
|
||||
}
|
||||
|
||||
public void a(Player var1, boolean var2) {
|
||||
public void setVisible(Player var1, boolean var2) {
|
||||
this.g = this.b(var1);
|
||||
if (var2) {
|
||||
this.g.b(new ClientboundPlayerInfoUpdatePacket(net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket.a.a, this));
|
||||
@@ -75,7 +75,7 @@ public class V1_21_11Npc extends EntityPlayer implements Npc {
|
||||
return ((CraftPlayer)var1).getHandle().g;
|
||||
}
|
||||
|
||||
public void a(Player var1) {
|
||||
public void removeFromTabList(Player var1) {
|
||||
this.b(var1).b(new ClientboundPlayerInfoRemovePacket(List.of(this.aH)));
|
||||
}
|
||||
}
|
||||
+9
-9
@@ -28,7 +28,7 @@ public class V1_21_11NpcFactory implements NpcFactory {
|
||||
this.a = var1;
|
||||
}
|
||||
|
||||
public V1_21_11Npc a(Location var1, Player var2) {
|
||||
public V1_21_11Npc createPlayerNpc(Location var1, Player var2) {
|
||||
EntityPlayer var3 = ((CraftPlayer)var2).getHandle();
|
||||
GameProfile var4 = new GameProfile(UUID.randomUUID(), var2.getName(), var3.gI().properties());
|
||||
return new V1_21_11Npc(((CraftServer)this.a).getServer(), var3.A(), var4, var1);
|
||||
@@ -36,20 +36,20 @@ public class V1_21_11NpcFactory implements NpcFactory {
|
||||
|
||||
public V1_21_11Npc 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 V1_21_11Npc(((CraftServer)this.a).getServer(), var4.getHandle(), var6, var1);
|
||||
}
|
||||
|
||||
public V1_21_11Npc a(Location var1, String var2, SkinTexture var3, NpcEquipment var4) {
|
||||
public V1_21_11Npc createNpc(Location var1, String var2, SkinTexture var3, NpcEquipment var4) {
|
||||
V1_21_11Npc 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