Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 20:40:07 +01:00
26734e83b0
* Updated Upstream (Bukkit/CraftBukkit/Spigot) Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 8085edde SPIGOT-6918: Add SpawnCategory API and configurations for Axolotls 04c7e13c PR-719: Add Player Profile API 71564210 SPIGOT-6910: Add BlockDamageAbortEvent CraftBukkit Changes: febaa1c6 SPIGOT-6918: Add SpawnCategory API and configurations for Axolotls 9dafd109 Don't send updates over large distances bdac46b0 SPIGOT-6782: EntityPortalEvent should not destroy entity when setTo() uses same world as getFrom() 8f361ece PR-1002: Add Player Profile API 911875d4 Increase outdated build delay e5f8a767 SPIGOT-6917: Use main scoreboard for /trigger a672a531 Clean up callBlockDamageEvent 8e1bdeef SPIGOT-6910: Add BlockDamageAbortEvent Spigot Changes: 6edb62f3 Rebuild patches 7fbc6a1e Rebuild patches * Updated Upstream (CraftBukkit) Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing CraftBukkit Changes: de951355 SPIGOT-6927: Fix default value of spawn-limits in Worlds
94 Zeilen
4.4 KiB
Diff
94 Zeilen
4.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jedediah Smith <jedediah@silencegreys.com>
|
|
Date: Sat, 4 Apr 2015 23:17:52 -0400
|
|
Subject: [PATCH] Complete resource pack API
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
index 979ece36de5c160a188b4c14b2bf991924f6fd98..18854aaa1359dd5c944d7e3a6177152bff9614a2 100644
|
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
@@ -1638,8 +1638,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
|
ServerGamePacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getName());
|
|
this.disconnect(new TranslatableComponent("multiplayer.requiredTexturePrompt.disconnect"));
|
|
}
|
|
- this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), PlayerResourcePackStatusEvent.Status.values()[packet.action.ordinal()])); // CraftBukkit
|
|
-
|
|
+ // Paper start
|
|
+ PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packet.action.ordinal()];
|
|
+ player.getBukkitEntity().setResourcePackStatus(packStatus);
|
|
+ this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), packStatus)); // CraftBukkit
|
|
+ // Paper end
|
|
}
|
|
|
|
@Override
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
index 924260ec220f2f1abfb4383a9787ebad3a25bef1..a29c20dddb1732a46c05e9ca2386b384b782adab 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
@@ -139,6 +139,7 @@ import org.bukkit.plugin.Plugin;
|
|
import org.bukkit.plugin.messaging.StandardMessenger;
|
|
import org.bukkit.profile.PlayerProfile;
|
|
import org.bukkit.scoreboard.Scoreboard;
|
|
+import org.jetbrains.annotations.NotNull;
|
|
|
|
import net.md_5.bungee.api.chat.BaseComponent; // Spigot
|
|
|
|
@@ -155,6 +156,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|
private double health = 20;
|
|
private boolean scaledHealth = false;
|
|
private double healthScale = 20;
|
|
+ // Paper start
|
|
+ private org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus;
|
|
+ private String resourcePackHash;
|
|
+ // Paper end
|
|
|
|
public CraftPlayer(CraftServer server, ServerPlayer entity) {
|
|
super(server, entity);
|
|
@@ -2007,6 +2012,45 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|
public boolean getAffectsSpawning() {
|
|
return this.getHandle().affectsSpawning;
|
|
}
|
|
+
|
|
+ @Override
|
|
+ public void setResourcePack(@NotNull String url, @NotNull String hash) {
|
|
+ this.setResourcePack(url, hash, false, null);
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void setResourcePack(@NotNull String url, @NotNull String hash, boolean required) {
|
|
+ this.setResourcePack(url, hash, required, null);
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void setResourcePack(@NotNull String url, @NotNull String hash, boolean required, net.kyori.adventure.text.Component resourcePackPrompt) {
|
|
+ Validate.notNull(url, "Resource pack URL cannot be null");
|
|
+ Validate.notNull(hash, "Hash cannot be null");
|
|
+ net.minecraft.network.chat.Component promptComponent = resourcePackPrompt != null ?
|
|
+ io.papermc.paper.adventure.PaperAdventure.asVanilla(resourcePackPrompt) :
|
|
+ null;
|
|
+ this.getHandle().sendTexturePack(url, hash, required, promptComponent);
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public org.bukkit.event.player.PlayerResourcePackStatusEvent.Status getResourcePackStatus() {
|
|
+ return this.resourcePackStatus;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public String getResourcePackHash() {
|
|
+ return this.resourcePackHash;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public boolean hasResourcePack() {
|
|
+ return this.resourcePackStatus == org.bukkit.event.player.PlayerResourcePackStatusEvent.Status.SUCCESSFULLY_LOADED;
|
|
+ }
|
|
+
|
|
+ public void setResourcePackStatus(org.bukkit.event.player.PlayerResourcePackStatusEvent.Status status) {
|
|
+ this.resourcePackStatus = status;
|
|
+ }
|
|
// Paper end
|
|
|
|
@Override
|