mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 18:37:42 +01:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@c7714bbf Update PlayerPostRespawnEvent to include full location data (#13237) PaperMC/Paper@9d427a5e [ci/skip] Enable unpick (#13241) PaperMC/Paper@13e9c107 [ci/skip] Update mache for new unpick definitions PaperMC/Paper@9934c173 Set chunk loading radius to 0 in PlayerSpawnFinder
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
||||
+++ b/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
||||
@@ -744,5 +_,22 @@
|
||||
@@ -746,5 +_,22 @@
|
||||
DispenserBlock.registerBehavior(Items.TNT_MINECART, new MinecartDispenseItemBehavior(EntityType.TNT_MINECART));
|
||||
DispenserBlock.registerBehavior(Items.HOPPER_MINECART, new MinecartDispenseItemBehavior(EntityType.HOPPER_MINECART));
|
||||
DispenserBlock.registerBehavior(Items.COMMAND_BLOCK_MINECART, new MinecartDispenseItemBehavior(EntityType.COMMAND_BLOCK_MINECART));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -442,6 +_,9 @@
|
||||
@@ -443,6 +_,9 @@
|
||||
public boolean isRealPlayer; // Paper
|
||||
public @Nullable com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent
|
||||
public @Nullable org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - Add API for quit reason; there are a lot of changes to do if we change all methods leading to the event
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
// Paper start - rewrite chunk system
|
||||
private ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader;
|
||||
@@ -515,6 +_,9 @@
|
||||
@@ -516,6 +_,9 @@
|
||||
this.respawnConfig = input.read("respawn", ServerPlayer.RespawnConfig.CODEC).orElse(null);
|
||||
this.spawnExtraParticlesOnFall = input.getBooleanOr("spawn_extra_particles_on_fall", false);
|
||||
this.raidOmenPosition = input.read("raid_omen_position", BlockPos.CODEC).orElse(null);
|
||||
@@ -20,7 +20,7 @@
|
||||
// Paper start - Expand PlayerGameModeChangeEvent
|
||||
this.loadGameTypes(input);
|
||||
}
|
||||
@@ -556,6 +_,9 @@
|
||||
@@ -557,6 +_,9 @@
|
||||
output.store("ShoulderEntityRight", CompoundTag.CODEC, this.getShoulderEntityRight());
|
||||
}
|
||||
this.getBukkitEntity().setExtraData(output); // CraftBukkit
|
||||
@@ -30,7 +30,7 @@
|
||||
}
|
||||
|
||||
private void saveParentVehicle(ValueOutput output) {
|
||||
@@ -1185,6 +_,7 @@
|
||||
@@ -1186,6 +_,7 @@
|
||||
// Paper - moved up to sendClientboundPlayerCombatKillPacket()
|
||||
sendClientboundPlayerCombatKillPacket(event.getShowDeathMessages(), deathScreenMessage); // Paper - Expand PlayerDeathEvent
|
||||
Team team = this.getTeam();
|
||||
@@ -38,7 +38,7 @@
|
||||
if (team == null || team.getDeathMessageVisibility() == Team.Visibility.ALWAYS) {
|
||||
this.server.getPlayerList().broadcastSystemMessage(deathMessage, false);
|
||||
} else if (team.getDeathMessageVisibility() == Team.Visibility.HIDE_FOR_OTHER_TEAMS) {
|
||||
@@ -1292,6 +_,13 @@
|
||||
@@ -1293,6 +_,13 @@
|
||||
if (this.isInvulnerableTo(level, damageSource)) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -52,7 +52,7 @@
|
||||
Entity entity = damageSource.getEntity();
|
||||
if (!( // Paper - split the if statement. If below statement is false, hurtServer would not have been evaluated. Return false.
|
||||
!(entity instanceof Player player && !this.canHarmPlayer(player))
|
||||
@@ -1545,6 +_,7 @@
|
||||
@@ -1546,6 +_,7 @@
|
||||
|
||||
profilerFiller.pop();
|
||||
profilerFiller.push("placing");
|
||||
@@ -60,7 +60,7 @@
|
||||
this.setServerLevel(level);
|
||||
this.connection.internalTeleport(PositionMoveRotation.of(teleportTransition), teleportTransition.relatives()); // CraftBukkit - use internal teleport without event
|
||||
this.connection.resetPosition();
|
||||
@@ -1646,7 +_,7 @@
|
||||
@@ -1647,7 +_,7 @@
|
||||
new AABB(vec3.x() - 8.0, vec3.y() - 5.0, vec3.z() - 8.0, vec3.x() + 8.0, vec3.y() + 5.0, vec3.z() + 8.0),
|
||||
monster -> monster.isPreventingPlayerRest(this.level(), this)
|
||||
);
|
||||
@@ -69,7 +69,7 @@
|
||||
return Either.left(Player.BedSleepingProblem.NOT_SAFE);
|
||||
}
|
||||
}
|
||||
@@ -1683,7 +_,19 @@
|
||||
@@ -1684,7 +_,19 @@
|
||||
CriteriaTriggers.SLEPT_IN_BED.trigger(this);
|
||||
});
|
||||
if (!this.level().canSleepThroughNights()) {
|
||||
@@ -90,7 +90,7 @@
|
||||
}
|
||||
|
||||
this.level().updateSleepingPlayerList();
|
||||
@@ -1775,6 +_,7 @@
|
||||
@@ -1776,6 +_,7 @@
|
||||
|
||||
@Override
|
||||
public void openTextEdit(SignBlockEntity signEntity, boolean isFrontText) {
|
||||
@@ -98,7 +98,7 @@
|
||||
this.connection.send(new ClientboundBlockUpdatePacket(this.level(), signEntity.getBlockPos()));
|
||||
this.connection.send(new ClientboundOpenSignEditorPacket(signEntity.getBlockPos(), isFrontText));
|
||||
}
|
||||
@@ -2084,6 +_,26 @@
|
||||
@@ -2085,6 +_,26 @@
|
||||
this.lastSentExp = -1; // CraftBukkit - Added to reset
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
@Override
|
||||
public void displayClientMessage(Component message, boolean overlay) {
|
||||
this.sendSystemMessage(message, overlay);
|
||||
@@ -2318,6 +_,20 @@
|
||||
@@ -2319,6 +_,20 @@
|
||||
);
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@
|
||||
public void sendSystemMessage(Component message) {
|
||||
this.sendSystemMessage(message, false);
|
||||
}
|
||||
@@ -2456,7 +_,67 @@
|
||||
@@ -2457,7 +_,67 @@
|
||||
|
||||
public void resetLastActionTime() {
|
||||
this.lastActionTime = Util.getMillis();
|
||||
@@ -215,7 +215,7 @@
|
||||
|
||||
public ServerStatsCounter getStats() {
|
||||
return this.stats;
|
||||
@@ -3097,4 +_,65 @@
|
||||
@@ -3098,4 +_,65 @@
|
||||
return (org.bukkit.craftbukkit.entity.CraftPlayer) super.getBukkitEntity();
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -340,6 +_,20 @@
|
||||
@@ -341,6 +_,20 @@
|
||||
}
|
||||
// Paper end - configuration phase API
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
@Override
|
||||
public void tick() {
|
||||
if (this.ackBlockChangesUpTo > -1) {
|
||||
@@ -357,6 +_,12 @@
|
||||
@@ -358,6 +_,12 @@
|
||||
&& this.server.playerIdleTimeout() > 0
|
||||
&& Util.getMillis() - this.player.getLastActionTime() > TimeUnit.MINUTES.toMillis(this.server.playerIdleTimeout())
|
||||
&& !this.player.wonGame) {
|
||||
@@ -34,7 +34,7 @@
|
||||
this.disconnect(Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause
|
||||
}
|
||||
}
|
||||
@@ -671,6 +_,8 @@
|
||||
@@ -672,6 +_,8 @@
|
||||
this.lastYaw = to.getYaw();
|
||||
this.lastPitch = to.getPitch();
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
Location oldTo = to.clone();
|
||||
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
|
||||
this.cserver.getPluginManager().callEvent(event);
|
||||
@@ -750,6 +_,7 @@
|
||||
@@ -751,6 +_,7 @@
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
|
||||
if (packet.getId() == this.awaitingTeleport) {
|
||||
if (this.awaitingPositionFromClient == null) {
|
||||
@@ -51,7 +51,7 @@
|
||||
this.disconnect(Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause
|
||||
return;
|
||||
}
|
||||
@@ -1283,6 +_,10 @@
|
||||
@@ -1284,6 +_,10 @@
|
||||
final int maxBookPageSize = pageMax.intValue();
|
||||
final double multiplier = Math.clamp(io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.totalMultiplier, 0.3D, 1D);
|
||||
long byteAllowed = maxBookPageSize;
|
||||
@@ -62,7 +62,7 @@
|
||||
for (final String page : pageList) {
|
||||
final int byteLength = page.getBytes(java.nio.charset.StandardCharsets.UTF_8).length;
|
||||
byteTotal += byteLength;
|
||||
@@ -1307,7 +_,8 @@
|
||||
@@ -1308,7 +_,8 @@
|
||||
}
|
||||
|
||||
if (byteTotal > byteAllowed) {
|
||||
@@ -72,7 +72,7 @@
|
||||
this.disconnectAsync(Component.literal("Book too large!"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause // Paper - add proper async disconnect
|
||||
return;
|
||||
}
|
||||
@@ -1326,31 +_,45 @@
|
||||
@@ -1327,31 +_,45 @@
|
||||
Optional<String> optional = packet.title();
|
||||
optional.ifPresent(list::add);
|
||||
list.addAll(packet.pages());
|
||||
@@ -122,7 +122,7 @@
|
||||
itemStack.set(
|
||||
DataComponents.WRITTEN_BOOK_CONTENT, new WrittenBookContent(this.filterableFromOutgoing(title), this.player.getPlainTextName(), 0, list, true)
|
||||
);
|
||||
@@ -1363,6 +_,16 @@
|
||||
@@ -1364,6 +_,16 @@
|
||||
return this.player.isTextFilteringEnabled() ? Filterable.passThrough(filteredText.filteredOrEmpty()) : Filterable.from(filteredText);
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
@Override
|
||||
public void handleEntityTagQuery(ServerboundEntityTagQueryPacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
|
||||
@@ -1402,7 +_,15 @@
|
||||
@@ -1403,7 +_,15 @@
|
||||
@Override
|
||||
public void handleMovePlayer(ServerboundMovePlayerPacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
|
||||
@@ -156,7 +156,7 @@
|
||||
this.disconnect(Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause
|
||||
} else {
|
||||
ServerLevel serverLevel = this.player.level();
|
||||
@@ -1584,7 +_,7 @@
|
||||
@@ -1585,7 +_,7 @@
|
||||
movedWrongly = true;
|
||||
if (event.getLogWarning())
|
||||
// Paper end
|
||||
@@ -165,7 +165,7 @@
|
||||
} // Paper
|
||||
}
|
||||
|
||||
@@ -1649,6 +_,8 @@
|
||||
@@ -1650,6 +_,8 @@
|
||||
this.lastYaw = to.getYaw();
|
||||
this.lastPitch = to.getPitch();
|
||||
|
||||
@@ -174,7 +174,7 @@
|
||||
Location oldTo = to.clone();
|
||||
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
|
||||
this.cserver.getPluginManager().callEvent(event);
|
||||
@@ -1704,6 +_,13 @@
|
||||
@@ -1705,6 +_,13 @@
|
||||
this.player.tryResetCurrentImpulseContext();
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@
|
||||
this.player.checkMovementStatistics(this.player.getX() - x, this.player.getY() - y, this.player.getZ() - z);
|
||||
this.lastGoodX = this.player.getX();
|
||||
this.lastGoodY = this.player.getY();
|
||||
@@ -1721,6 +_,17 @@
|
||||
@@ -1722,6 +_,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@
|
||||
private boolean shouldCheckPlayerMovement(boolean isElytraMovement) {
|
||||
if (this.isSingleplayerOwner()) {
|
||||
return false;
|
||||
@@ -2120,6 +_,7 @@
|
||||
@@ -2121,6 +_,7 @@
|
||||
|
||||
boolean cancelled;
|
||||
if (hitResult == null || hitResult.getType() != HitResult.Type.BLOCK) {
|
||||
@@ -214,7 +214,7 @@
|
||||
org.bukkit.event.player.PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.RIGHT_CLICK_AIR, itemInHand, hand);
|
||||
cancelled = event.useItemInHand() == Event.Result.DENY;
|
||||
} else {
|
||||
@@ -2767,6 +_,7 @@
|
||||
@@ -2768,6 +_,7 @@
|
||||
|
||||
AABB boundingBox = target.getBoundingBox();
|
||||
if (this.player.canInteractWithEntity(boundingBox, io.papermc.paper.configuration.GlobalConfiguration.get().misc.clientInteractionLeniencyDistance.or(3.0))) { // Paper - configurable lenience value for interact range
|
||||
@@ -222,7 +222,7 @@
|
||||
packet.dispatch(
|
||||
new ServerboundInteractPacket.Handler() {
|
||||
private void performInteraction(InteractionHand hand, ServerGamePacketListenerImpl.EntityInteraction entityInteraction, PlayerInteractEntityEvent event) { // CraftBukkit
|
||||
@@ -3508,7 +_,7 @@
|
||||
@@ -3509,7 +_,7 @@
|
||||
@Override
|
||||
public void handleChangeGameMode(ServerboundChangeGameModePacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -304,6 +_,7 @@
|
||||
@@ -305,6 +_,7 @@
|
||||
scoreboard.addPlayerToTeam(player.getScoreboardName(), collideRuleTeam);
|
||||
}
|
||||
// Paper end - Configurable player collision
|
||||
@@ -8,7 +8,7 @@
|
||||
// CraftBukkit start - moved down
|
||||
LOGGER.info(
|
||||
"{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", // CraftBukkit - add world name
|
||||
@@ -424,6 +_,7 @@
|
||||
@@ -425,6 +_,7 @@
|
||||
}
|
||||
public @Nullable net.kyori.adventure.text.Component remove(ServerPlayer player, net.kyori.adventure.text.Component leaveMessage) {
|
||||
// Paper end - Fix kick event leave message not being sent
|
||||
@@ -16,7 +16,7 @@
|
||||
ServerLevel serverLevel = player.level();
|
||||
player.awardStat(Stats.LEAVE_GAME);
|
||||
// CraftBukkit start - Quitting must be before we do final save of data, in case plugins need to modify it
|
||||
@@ -763,6 +_,20 @@
|
||||
@@ -764,6 +_,20 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,15 +37,23 @@
|
||||
public void broadcastAll(Packet<?> packet, ResourceKey<Level> dimension) {
|
||||
for (ServerPlayer serverPlayer : this.players) {
|
||||
if (serverPlayer.level().dimension() == dimension) {
|
||||
@@ -857,6 +_,7 @@
|
||||
@@ -852,12 +_,13 @@
|
||||
if (player.connection != null) {
|
||||
byte b;
|
||||
if (permLevel <= 0) {
|
||||
- b = 24;
|
||||
+ b = EntityEvent.PERMISSION_LEVEL_ALL; // Purpur - Constants
|
||||
} else if (permLevel >= 4) {
|
||||
- b = 28;
|
||||
+ b = EntityEvent.PERMISSION_LEVEL_OWNERS; // Purpur - Constants
|
||||
} else {
|
||||
b = (byte)(24 + permLevel);
|
||||
b = (byte)(EntityEvent.PERMISSION_LEVEL_ALL + permLevel);
|
||||
}
|
||||
+ if (b < 28 && player.getBukkitEntity().hasPermission("purpur.debug.f3n")) b = 28; // Purpur - Add permission for F3+N debug
|
||||
+ if (b < EntityEvent.PERMISSION_LEVEL_OWNERS && player.getBukkitEntity().hasPermission("purpur.debug.f3n")) b = EntityEvent.PERMISSION_LEVEL_OWNERS; // Purpur - Add permission for F3+N debug
|
||||
|
||||
player.connection.send(new ClientboundEntityEventPacket(player, b));
|
||||
}
|
||||
@@ -869,7 +_,7 @@
|
||||
@@ -870,7 +_,7 @@
|
||||
|
||||
// Paper start - whitelist verify event / login event
|
||||
public LoginResult canBypassFullServerLogin(final NameAndId nameAndId, final LoginResult currentResult) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -446,6 +_,12 @@
|
||||
@@ -447,6 +_,12 @@
|
||||
if (d < 0.0) {
|
||||
double damagePerBlock = serverLevel1.getWorldBorder().getDamagePerBlock();
|
||||
if (damagePerBlock > 0.0) {
|
||||
@@ -13,16 +13,16 @@
|
||||
this.hurtServer(serverLevel1, this.damageSources().outOfBorder(), Math.max(1, Mth.floor(-d * damagePerBlock)));
|
||||
}
|
||||
}
|
||||
@@ -461,7 +_,7 @@
|
||||
@@ -462,7 +_,7 @@
|
||||
if (this.shouldTakeDrowningDamage()) {
|
||||
this.setAirSupply(0);
|
||||
serverLevel1.broadcastEntityEvent(this, (byte)67);
|
||||
serverLevel1.broadcastEntityEvent(this, EntityEvent.DROWN_PARTICLES);
|
||||
- this.hurtServer(serverLevel1, this.damageSources().drown(), 2.0F);
|
||||
+ this.hurtServer(serverLevel1, this.damageSources().drown(), (float) this.level().purpurConfig.damageFromDrowning); // Purpur - Drowning Settings
|
||||
}
|
||||
} else if (this.getAirSupply() < this.getMaxAirSupply()) {
|
||||
this.setAirSupply(this.increaseAirSupply(this.getAirSupply()));
|
||||
@@ -521,7 +_,7 @@
|
||||
@@ -522,7 +_,7 @@
|
||||
}
|
||||
|
||||
protected boolean shouldTakeDrowningDamage() {
|
||||
@@ -31,7 +31,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1045,14 +_,32 @@
|
||||
@@ -1046,14 +_,32 @@
|
||||
if (lookingEntity != null) {
|
||||
ItemStack itemBySlot = this.getItemBySlot(EquipmentSlot.HEAD);
|
||||
EntityType<?> type = lookingEntity.getType();
|
||||
@@ -72,7 +72,7 @@
|
||||
|
||||
return d;
|
||||
}
|
||||
@@ -1099,6 +_,7 @@
|
||||
@@ -1100,6 +_,7 @@
|
||||
Iterator<MobEffectInstance> iterator = this.activeEffects.values().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
MobEffectInstance effect = iterator.next();
|
||||
@@ -80,7 +80,7 @@
|
||||
EntityPotionEffectEvent event = CraftEventFactory.callEntityPotionEffectChangeEvent(this, effect, null, cause, EntityPotionEffectEvent.Action.CLEARED);
|
||||
if (event.isCancelled()) {
|
||||
continue;
|
||||
@@ -1423,6 +_,24 @@
|
||||
@@ -1424,6 +_,24 @@
|
||||
this.stopSleeping();
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
this.noActionTime = 0;
|
||||
if (amount < 0.0F) {
|
||||
amount = 0.0F;
|
||||
@@ -1685,10 +_,10 @@
|
||||
@@ -1686,10 +_,10 @@
|
||||
protected Player resolvePlayerResponsibleForDamage(DamageSource damageSource) {
|
||||
Entity entity = damageSource.getEntity();
|
||||
if (entity instanceof Player player) {
|
||||
@@ -118,7 +118,7 @@
|
||||
} else {
|
||||
this.lastHurtByPlayer = null;
|
||||
this.lastHurtByPlayerMemoryTime = 0;
|
||||
@@ -1739,6 +_,18 @@
|
||||
@@ -1740,6 +_,18 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
final org.bukkit.inventory.EquipmentSlot handSlot = (hand != null) ? org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand) : null;
|
||||
final EntityResurrectEvent event = new EntityResurrectEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), handSlot);
|
||||
event.setCancelled(itemStack == null);
|
||||
@@ -1920,6 +_,7 @@
|
||||
@@ -1921,6 +_,7 @@
|
||||
boolean flag = this.lastHurtByPlayerMemoryTime > 0;
|
||||
this.dropEquipment(level); // CraftBukkit - from below
|
||||
if (this.shouldDropLoot(level)) {
|
||||
@@ -145,7 +145,7 @@
|
||||
this.dropFromLootTable(level, damageSource, flag);
|
||||
// Paper start
|
||||
final boolean prev = this.clearEquipmentSlots;
|
||||
@@ -1928,6 +_,7 @@
|
||||
@@ -1929,6 +_,7 @@
|
||||
// Paper end
|
||||
this.dropCustomDeathLoot(level, damageSource, flag);
|
||||
this.clearEquipmentSlots = prev; // Paper
|
||||
@@ -153,7 +153,7 @@
|
||||
}
|
||||
|
||||
// CraftBukkit start - Call death event // Paper start - call advancement triggers with correct entity equipment
|
||||
@@ -3146,6 +_,7 @@
|
||||
@@ -3149,6 +_,7 @@
|
||||
float f = (float)(d * 10.0 - 3.0);
|
||||
if (f > 0.0F) {
|
||||
this.playSound(this.getFallDamageSound((int)f), 1.0F, 1.0F);
|
||||
@@ -161,7 +161,7 @@
|
||||
this.hurt(this.damageSources().flyIntoWall(), f);
|
||||
}
|
||||
}
|
||||
@@ -4545,6 +_,12 @@
|
||||
@@ -4548,6 +_,12 @@
|
||||
? slot == EquipmentSlot.MAINHAND && this.canUseSlot(EquipmentSlot.MAINHAND)
|
||||
: slot == equippable.slot() && this.canUseSlot(equippable.slot()) && equippable.canBeEquippedBy(this.getType());
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.java
|
||||
@@ -58,7 +_,7 @@
|
||||
@@ -59,7 +_,7 @@
|
||||
if (firstPassenger instanceof Player player) {
|
||||
int temper = this.horse.getTemper();
|
||||
int maxTemper = this.horse.getMaxTemper();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/ambient/Bat.java
|
||||
+++ b/net/minecraft/world/entity/ambient/Bat.java
|
||||
@@ -233,7 +_,7 @@
|
||||
@@ -234,7 +_,7 @@
|
||||
} else {
|
||||
int maxLocalRawBrightness = level.getMaxLocalRawBrightness(pos);
|
||||
int i = 4;
|
||||
@@ -9,7 +9,7 @@
|
||||
i = 7;
|
||||
} else if (randomSource.nextBoolean()) {
|
||||
return false;
|
||||
@@ -245,6 +_,7 @@
|
||||
@@ -246,6 +_,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/animal/Animal.java
|
||||
+++ b/net/minecraft/world/entity/animal/Animal.java
|
||||
@@ -141,7 +_,7 @@
|
||||
@@ -142,7 +_,7 @@
|
||||
ItemStack itemInHand = player.getItemInHand(hand);
|
||||
if (this.isFood(itemInHand)) {
|
||||
int age = this.getAge();
|
||||
@@ -9,7 +9,7 @@
|
||||
final ItemStack breedCopy = itemInHand.copy(); // Paper - Fix EntityBreedEvent copying
|
||||
this.usePlayerItem(player, hand, itemInHand);
|
||||
this.setInLove(serverPlayer, breedCopy); // Paper - Fix EntityBreedEvent copying
|
||||
@@ -223,10 +_,20 @@
|
||||
@@ -224,10 +_,20 @@
|
||||
public void spawnChildFromBreeding(ServerLevel level, Animal partner) {
|
||||
AgeableMob breedOffspring = this.getBreedOffspring(level, partner);
|
||||
if (breedOffspring != null) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/animal/Bee.java
|
||||
+++ b/net/minecraft/world/entity/animal/Bee.java
|
||||
@@ -170,7 +_,7 @@
|
||||
@@ -171,7 +_,7 @@
|
||||
// Paper end - Fix MC-167279
|
||||
this.lookControl = new Bee.BeeLookControl(this);
|
||||
this.setPathfindingMalus(PathType.DANGER_FIRE, -1.0F);
|
||||
@@ -9,7 +9,7 @@
|
||||
this.setPathfindingMalus(PathType.WATER_BORDER, 16.0F);
|
||||
this.setPathfindingMalus(PathType.COCOA, -1.0F);
|
||||
this.setPathfindingMalus(PathType.FENCE, -1.0F);
|
||||
@@ -366,7 +_,7 @@
|
||||
@@ -367,7 +_,7 @@
|
||||
}
|
||||
|
||||
public static boolean isNightOrRaining(Level level) {
|
||||
@@ -18,7 +18,7 @@
|
||||
}
|
||||
|
||||
public void setStayOutOfHiveCountdown(int stayOutOfHiveCountdown) {
|
||||
@@ -389,7 +_,7 @@
|
||||
@@ -390,7 +_,7 @@
|
||||
@Override
|
||||
protected void customServerAiStep(ServerLevel level) {
|
||||
boolean hasStung = this.hasStung();
|
||||
@@ -27,7 +27,7 @@
|
||||
this.underWaterTicks++;
|
||||
} else {
|
||||
this.underWaterTicks = 0;
|
||||
@@ -399,6 +_,7 @@
|
||||
@@ -400,6 +_,7 @@
|
||||
this.hurtServer(level, this.damageSources().drown(), 1.0F);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
if (hasStung) {
|
||||
this.timeSinceSting++;
|
||||
if (this.timeSinceSting % 5 == 0 && this.random.nextInt(Mth.clamp(1200 - this.timeSinceSting, 1, 1200)) == 0) {
|
||||
@@ -1138,6 +_,7 @@
|
||||
@@ -1139,6 +_,7 @@
|
||||
Bee.this.savedFlowerPos = optional.get();
|
||||
Bee.this.navigation
|
||||
.moveTo(Bee.this.savedFlowerPos.getX() + 0.5, Bee.this.savedFlowerPos.getY() + 0.5, Bee.this.savedFlowerPos.getZ() + 0.5, 1.2F);
|
||||
@@ -43,7 +43,7 @@
|
||||
return true;
|
||||
} else {
|
||||
Bee.this.remainingCooldownBeforeLocatingNewFlower = Mth.nextInt(Bee.this.random, 20, 60);
|
||||
@@ -1184,6 +_,7 @@
|
||||
@@ -1185,6 +_,7 @@
|
||||
this.pollinating = false;
|
||||
Bee.this.navigation.stop();
|
||||
Bee.this.remainingCooldownBeforeLocatingNewFlower = 200;
|
||||
@@ -51,7 +51,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1230,6 +_,7 @@
|
||||
@@ -1231,6 +_,7 @@
|
||||
this.setWantedPos();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/animal/Cat.java
|
||||
+++ b/net/minecraft/world/entity/animal/Cat.java
|
||||
@@ -354,6 +_,14 @@
|
||||
@@ -355,6 +_,14 @@
|
||||
return this.isTame() && otherAnimal instanceof Cat cat && cat.isTame() && super.canMate(otherAnimal);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
@Nullable
|
||||
@Override
|
||||
public SpawnGroupData finalizeSpawn(
|
||||
@@ -452,7 +_,7 @@
|
||||
@@ -453,7 +_,7 @@
|
||||
}
|
||||
|
||||
private void tryToTame(Player player) {
|
||||
@@ -23,4 +23,4 @@
|
||||
+ if (((this.level().purpurConfig.alwaysTameInCreative && player.hasInfiniteMaterials()) || this.random.nextInt(3) == 0) && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, player).isCancelled()) { // CraftBukkit // Purpur - Config to always tame in Creative
|
||||
this.tame(player);
|
||||
this.setOrderedToSit(true);
|
||||
this.level().broadcastEntityEvent(this, (byte)7);
|
||||
this.level().broadcastEntityEvent(this, EntityEvent.TAMING_SUCCEEDED);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/animal/Dolphin.java
|
||||
+++ b/net/minecraft/world/entity/animal/Dolphin.java
|
||||
@@ -74,6 +_,7 @@
|
||||
@@ -75,6 +_,7 @@
|
||||
private static final boolean DEFAULT_GOT_FISH = false;
|
||||
@Nullable
|
||||
public BlockPos treasurePos;
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
public Dolphin(EntityType<? extends Dolphin> type, Level level) {
|
||||
super(type, level);
|
||||
@@ -90,6 +_,7 @@
|
||||
@@ -91,6 +_,7 @@
|
||||
this.setAirSupply(this.getMaxAirSupply());
|
||||
this.setXRot(0.0F);
|
||||
SpawnGroupData spawnGroupData1 = Objects.requireNonNullElseGet(spawnGroupData, () -> new AgeableMob.AgeableMobGroupData(0.1F));
|
||||
@@ -16,7 +16,7 @@
|
||||
return super.finalizeSpawn(level, difficulty, spawnReason, spawnGroupData1);
|
||||
}
|
||||
|
||||
@@ -156,17 +_,19 @@
|
||||
@@ -157,17 +_,19 @@
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(0, new BreathAirGoal(this));
|
||||
this.goalSelector.addGoal(0, new TryFindWaterGoal(this));
|
||||
@@ -37,7 +37,7 @@
|
||||
}
|
||||
|
||||
public static AttributeSupplier.Builder createAttributes() {
|
||||
@@ -399,6 +_,7 @@
|
||||
@@ -400,6 +_,7 @@
|
||||
|
||||
@Override
|
||||
public boolean canUse() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/animal/Fox.java
|
||||
+++ b/net/minecraft/world/entity/animal/Fox.java
|
||||
@@ -346,6 +_,11 @@
|
||||
@@ -348,6 +_,11 @@
|
||||
}
|
||||
|
||||
private void setTargetGoals() {
|
||||
@@ -12,7 +12,7 @@
|
||||
if (this.getVariant() == Fox.Variant.RED) {
|
||||
this.targetSelector.addGoal(4, this.landTargetGoal);
|
||||
this.targetSelector.addGoal(4, this.turtleEggTargetGoal);
|
||||
@@ -373,6 +_,7 @@
|
||||
@@ -375,6 +_,7 @@
|
||||
|
||||
public void setVariant(Fox.Variant variant) {
|
||||
this.entityData.set(DATA_TYPE_ID, variant.getId());
|
||||
@@ -20,7 +20,7 @@
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -702,6 +_,29 @@
|
||||
@@ -704,6 +_,29 @@
|
||||
return slot == EquipmentSlot.MAINHAND;
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/animal/IronGolem.java
|
||||
+++ b/net/minecraft/world/entity/animal/IronGolem.java
|
||||
@@ -58,13 +_,26 @@
|
||||
@@ -59,13 +_,26 @@
|
||||
private int remainingPersistentAngerTime;
|
||||
@Nullable
|
||||
private UUID persistentAngerTarget;
|
||||
@@ -27,7 +27,7 @@
|
||||
this.goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.0, true));
|
||||
this.goalSelector.addGoal(2, new MoveTowardsTargetGoal(this, 0.9, 32.0F));
|
||||
this.goalSelector.addGoal(2, new MoveBackToVillageGoal(this, 0.6, false));
|
||||
@@ -142,6 +_,7 @@
|
||||
@@ -143,6 +_,7 @@
|
||||
protected void addAdditionalSaveData(ValueOutput output) {
|
||||
super.addAdditionalSaveData(output);
|
||||
output.putBoolean("PlayerCreated", this.isPlayerCreated());
|
||||
@@ -35,7 +35,7 @@
|
||||
this.addPersistentAngerSaveData(output);
|
||||
}
|
||||
|
||||
@@ -149,6 +_,7 @@
|
||||
@@ -150,6 +_,7 @@
|
||||
protected void readAdditionalSaveData(ValueInput input) {
|
||||
super.readAdditionalSaveData(input);
|
||||
this.setPlayerCreated(input.getBooleanOr("PlayerCreated", false));
|
||||
@@ -43,7 +43,7 @@
|
||||
this.readPersistentAngerSaveData(this.level(), input);
|
||||
}
|
||||
|
||||
@@ -268,6 +_,7 @@
|
||||
@@ -269,6 +_,7 @@
|
||||
float f = 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F;
|
||||
this.playSound(SoundEvents.IRON_GOLEM_REPAIR, 1.0F, f);
|
||||
itemInHand.consume(1, player);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/animal/Ocelot.java
|
||||
+++ b/net/minecraft/world/entity/animal/Ocelot.java
|
||||
@@ -234,7 +_,7 @@
|
||||
@@ -235,7 +_,7 @@
|
||||
public boolean checkSpawnObstruction(LevelReader level) {
|
||||
if (level.isUnobstructed(this) && !level.containsAnyLiquid(this.getBoundingBox())) {
|
||||
BlockPos blockPos = this.blockPosition();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/animal/Parrot.java
|
||||
+++ b/net/minecraft/world/entity/animal/Parrot.java
|
||||
@@ -159,6 +_,7 @@
|
||||
@@ -160,6 +_,7 @@
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(0, new TamableAnimal.TamableAnimalPanicGoal(1.25));
|
||||
this.goalSelector.addGoal(0, new FloatGoal(this));
|
||||
@@ -8,16 +8,16 @@
|
||||
this.goalSelector.addGoal(1, new LookAtPlayerGoal(this, Player.class, 8.0F));
|
||||
this.goalSelector.addGoal(2, new SitWhenOrderedToGoal(this));
|
||||
this.goalSelector.addGoal(2, new FollowOwnerGoal(this, 1.0, 5.0F, 1.0F));
|
||||
@@ -264,7 +_,7 @@
|
||||
@@ -265,7 +_,7 @@
|
||||
}
|
||||
|
||||
if (!this.level().isClientSide()) {
|
||||
- if (this.random.nextInt(10) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, player).isCancelled()) { // CraftBukkit
|
||||
+ if (((this.level().purpurConfig.alwaysTameInCreative && player.hasInfiniteMaterials()) || this.random.nextInt(10) == 0) && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, player).isCancelled()) { // CraftBukkit // Purpur - Config to always tame in Creative
|
||||
this.tame(player);
|
||||
this.level().broadcastEntityEvent(this, (byte)7);
|
||||
this.level().broadcastEntityEvent(this, EntityEvent.TAMING_SUCCEEDED);
|
||||
} else {
|
||||
@@ -272,6 +_,7 @@
|
||||
@@ -273,6 +_,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
return InteractionResult.SUCCESS;
|
||||
} else if (!itemInHand.is(ItemTags.PARROT_POISONOUS_FOOD)) {
|
||||
if (!this.isFlying() && this.isTame() && this.isOwnedBy(player)) {
|
||||
@@ -296,7 +_,7 @@
|
||||
@@ -297,7 +_,7 @@
|
||||
|
||||
@Override
|
||||
public boolean isFood(ItemStack stack) {
|
||||
@@ -34,7 +34,7 @@
|
||||
}
|
||||
|
||||
public static boolean checkParrotSpawnRules(
|
||||
@@ -311,13 +_,13 @@
|
||||
@@ -312,13 +_,13 @@
|
||||
|
||||
@Override
|
||||
public boolean canMate(Animal otherAnimal) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/animal/Rabbit.java
|
||||
+++ b/net/minecraft/world/entity/animal/Rabbit.java
|
||||
@@ -404,10 +_,23 @@
|
||||
@@ -406,10 +_,23 @@
|
||||
}
|
||||
|
||||
this.setVariant(randomRabbitVariant);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/animal/Squid.java
|
||||
+++ b/net/minecraft/world/entity/animal/Squid.java
|
||||
@@ -46,10 +_,29 @@
|
||||
@@ -47,10 +_,29 @@
|
||||
|
||||
public Squid(EntityType<? extends Squid> type, Level level) {
|
||||
super(type, level);
|
||||
@@ -31,7 +31,7 @@
|
||||
@Override
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(0, new Squid.SquidRandomMovementGoal(this));
|
||||
@@ -127,6 +_,7 @@
|
||||
@@ -128,6 +_,7 @@
|
||||
}
|
||||
|
||||
if (this.isInWater()) {
|
||||
@@ -39,7 +39,7 @@
|
||||
if (this.tentacleMovement < (float) Math.PI) {
|
||||
float f = this.tentacleMovement / (float) Math.PI;
|
||||
this.tentacleAngle = Mth.sin(f * f * (float) Math.PI) * (float) Math.PI * 0.25F;
|
||||
@@ -308,7 +_,7 @@
|
||||
@@ -309,7 +_,7 @@
|
||||
int noActionTime = this.squid.getNoActionTime();
|
||||
if (noActionTime > 100) {
|
||||
this.squid.movementVector = Vec3.ZERO;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/animal/coppergolem/CopperGolem.java
|
||||
+++ b/net/minecraft/world/entity/animal/coppergolem/CopperGolem.java
|
||||
@@ -84,6 +_,7 @@
|
||||
@@ -86,6 +_,7 @@
|
||||
private final AnimationState interactionDropItemAnimationState = new AnimationState();
|
||||
private final AnimationState interactionDropNoItemAnimationState = new AnimationState();
|
||||
public static final EquipmentSlot EQUIPMENT_SLOT_ANTENNA = EquipmentSlot.SADDLE;
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
public CopperGolem(EntityType<? extends AbstractGolem> type, Level level) {
|
||||
super(type, level);
|
||||
@@ -97,6 +_,17 @@
|
||||
@@ -99,6 +_,17 @@
|
||||
this.getBrain().setMemory(MemoryModuleType.TRANSPORT_ITEMS_COOLDOWN_TICKS, this.getRandom().nextInt(60, 100));
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
public static AttributeSupplier.Builder createAttributes() {
|
||||
return Mob.createMobAttributes().add(Attributes.MOVEMENT_SPEED, 0.2F).add(Attributes.STEP_HEIGHT, 1.0).add(Attributes.MAX_HEALTH, 12.0);
|
||||
}
|
||||
@@ -172,6 +_,7 @@
|
||||
@@ -174,6 +_,7 @@
|
||||
super.addAdditionalSaveData(output);
|
||||
output.putLong("next_weather_age", this.nextWeatheringTick);
|
||||
output.store("weather_state", WeatheringCopper.WeatherState.CODEC, this.getWeatherState());
|
||||
@@ -34,7 +34,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -179,6 +_,7 @@
|
||||
@@ -181,6 +_,7 @@
|
||||
super.readAdditionalSaveData(input);
|
||||
this.nextWeatheringTick = input.getLongOr("next_weather_age", -1L);
|
||||
this.setWeatherState(input.read("weather_state", WeatheringCopper.WeatherState.CODEC).orElse(WeatheringCopper.WeatherState.UNAFFECTED));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/animal/goat/Goat.java
|
||||
+++ b/net/minecraft/world/entity/animal/goat/Goat.java
|
||||
@@ -389,6 +_,7 @@
|
||||
@@ -390,6 +_,7 @@
|
||||
|
||||
// Paper start - Goat ram API
|
||||
public void ram(net.minecraft.world.entity.LivingEntity entity) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/animal/wolf/Wolf.java
|
||||
+++ b/net/minecraft/world/entity/animal/wolf/Wolf.java
|
||||
@@ -99,6 +_,37 @@
|
||||
@@ -100,6 +_,37 @@
|
||||
EntityType<?> type = entity.getType();
|
||||
return type == EntityType.SHEEP || type == EntityType.RABBIT || type == EntityType.FOX;
|
||||
};
|
||||
@@ -38,7 +38,7 @@
|
||||
private static final float START_HEALTH = 8.0F;
|
||||
private static final float TAME_HEALTH = 40.0F;
|
||||
private static final float ARMOR_REPAIR_UNIT = 0.125F;
|
||||
@@ -121,12 +_,47 @@
|
||||
@@ -122,12 +_,47 @@
|
||||
this.setPathfindingMalus(PathType.DANGER_POWDER_SNOW, -1.0F);
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
this.goalSelector.addGoal(4, new LeapAtTargetGoal(this, 0.4F));
|
||||
this.goalSelector.addGoal(5, new MeleeAttackGoal(this, 1.0, true));
|
||||
this.goalSelector.addGoal(6, new FollowOwnerGoal(this, 1.0, 10.0F, 2.0F));
|
||||
@@ -139,7 +_,7 @@
|
||||
@@ -140,7 +_,7 @@
|
||||
this.targetSelector.addGoal(2, new OwnerHurtTargetGoal(this));
|
||||
this.targetSelector.addGoal(3, new HurtByTargetGoal(this).setAlertOthers());
|
||||
this.targetSelector.addGoal(4, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, this::isAngryAt));
|
||||
@@ -95,7 +95,7 @@
|
||||
this.targetSelector.addGoal(6, new NonTameRandomTargetGoal<>(this, Turtle.class, false, Turtle.BABY_ON_LAND_SELECTOR));
|
||||
this.targetSelector.addGoal(7, new NearestAttackableTargetGoal<>(this, AbstractSkeleton.class, false));
|
||||
this.targetSelector.addGoal(8, new ResetUniversalAngerTargetGoal<>(this, true));
|
||||
@@ -230,6 +_,7 @@
|
||||
@@ -231,6 +_,7 @@
|
||||
protected void addAdditionalSaveData(ValueOutput output) {
|
||||
super.addAdditionalSaveData(output);
|
||||
output.store("CollarColor", DyeColor.LEGACY_ID_CODEC, this.getCollarColor());
|
||||
@@ -103,7 +103,7 @@
|
||||
VariantUtils.writeVariant(output, this.getVariant());
|
||||
this.addPersistentAngerSaveData(output);
|
||||
this.getSoundVariant()
|
||||
@@ -244,6 +_,10 @@
|
||||
@@ -245,6 +_,10 @@
|
||||
super.readAdditionalSaveData(input);
|
||||
VariantUtils.readVariant(input, Registries.WOLF_VARIANT).ifPresent(this::setVariant);
|
||||
this.setCollarColor(input.read("CollarColor", DyeColor.LEGACY_ID_CODEC).orElse(DEFAULT_COLLAR_COLOR));
|
||||
@@ -114,7 +114,7 @@
|
||||
this.readPersistentAngerSaveData(this.level(), input);
|
||||
input.read("sound_variant", ResourceKey.codec(Registries.WOLF_SOUND_VARIANT))
|
||||
.flatMap(resourceKey -> this.registryAccess().lookupOrThrow(Registries.WOLF_SOUND_VARIANT).get((ResourceKey<WolfSoundVariant>)resourceKey))
|
||||
@@ -268,6 +_,10 @@
|
||||
@@ -269,6 +_,10 @@
|
||||
}
|
||||
|
||||
this.setSoundVariant(WolfSoundVariants.pickRandomSoundVariant(this.registryAccess(), level.getRandom()));
|
||||
@@ -125,7 +125,7 @@
|
||||
return super.finalizeSpawn(level, difficulty, spawnReason, spawnGroupData);
|
||||
}
|
||||
|
||||
@@ -318,6 +_,11 @@
|
||||
@@ -319,6 +_,11 @@
|
||||
public void tick() {
|
||||
super.tick();
|
||||
if (this.isAlive()) {
|
||||
@@ -137,7 +137,7 @@
|
||||
this.interestedAngleO = this.interestedAngle;
|
||||
if (this.isInterested()) {
|
||||
this.interestedAngle = this.interestedAngle + (1.0F - this.interestedAngle) * 0.4F;
|
||||
@@ -519,13 +_,27 @@
|
||||
@@ -520,13 +_,27 @@
|
||||
itemInHand.consume(1, player);
|
||||
this.tryToTame(player);
|
||||
return InteractionResult.SUCCESS_SERVER;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
||||
+++ b/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
||||
@@ -961,6 +_,7 @@
|
||||
@@ -962,6 +_,7 @@
|
||||
|
||||
@Override
|
||||
protected boolean canRide(Entity entity) {
|
||||
@@ -8,7 +8,7 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -996,7 +_,7 @@
|
||||
@@ -997,7 +_,7 @@
|
||||
boolean flag = level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT);
|
||||
int i = 500;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||
+++ b/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||
@@ -79,6 +_,7 @@
|
||||
@@ -80,6 +_,7 @@
|
||||
private static final TargetingConditions.Selector LIVING_ENTITY_SELECTOR = (entity, level) -> !entity.getType().is(EntityTypeTags.WITHER_FRIENDS)
|
||||
&& entity.attackable();
|
||||
private static final TargetingConditions TARGETING_CONDITIONS = TargetingConditions.forCombat().range(20.0).selector(LIVING_ENTITY_SELECTOR);
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
public WitherBoss(EntityType<? extends WitherBoss> type, Level level) {
|
||||
super(type, level);
|
||||
@@ -87,6 +_,17 @@
|
||||
@@ -88,6 +_,17 @@
|
||||
this.xpReward = 50;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
@Override
|
||||
protected PathNavigation createNavigation(Level level) {
|
||||
FlyingPathNavigation flyingPathNavigation = new FlyingPathNavigation(this, level);
|
||||
@@ -119,6 +_,7 @@
|
||||
@@ -120,6 +_,7 @@
|
||||
protected void addAdditionalSaveData(ValueOutput output) {
|
||||
super.addAdditionalSaveData(output);
|
||||
output.putInt("Invul", this.getInvulnerableTicks());
|
||||
@@ -34,7 +34,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -128,6 +_,7 @@
|
||||
@@ -129,6 +_,7 @@
|
||||
if (this.hasCustomName()) {
|
||||
this.bossEvent.setName(this.getDisplayName());
|
||||
}
|
||||
@@ -42,7 +42,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -271,7 +_,7 @@
|
||||
@@ -272,7 +_,7 @@
|
||||
level.explode(this, this.getX(), this.getEyeY(), this.getZ(), event.getRadius(), event.getFire(), Level.ExplosionInteraction.MOB);
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -51,7 +51,7 @@
|
||||
// CraftBukkit start - Use relative location for far away sounds
|
||||
// level.globalLevelEvent(1023, this.blockPosition(), 0);
|
||||
int viewDistance = level.getCraftServer().getViewDistance() * 16;
|
||||
@@ -378,8 +_,10 @@
|
||||
@@ -379,8 +_,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
}
|
||||
|
||||
this.bossEvent.setProgress(this.getHealth() / this.getMaxHealth());
|
||||
@@ -576,6 +_,7 @@
|
||||
@@ -577,6 +_,7 @@
|
||||
|
||||
@Override
|
||||
protected boolean canRide(Entity entity) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
+++ b/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
@@ -91,10 +_,13 @@
|
||||
@@ -92,10 +_,13 @@
|
||||
public boolean canTickSetByAPI = false;
|
||||
private boolean noTickEquipmentDirty = false;
|
||||
// Paper end - Allow ArmorStands not to tick
|
||||
@@ -14,7 +14,7 @@
|
||||
}
|
||||
|
||||
public ArmorStand(Level level, double x, double y, double z) {
|
||||
@@ -521,6 +_,7 @@
|
||||
@@ -522,6 +_,7 @@
|
||||
// Paper start - Allow ArmorStands not to tick
|
||||
@Override
|
||||
public void tick() {
|
||||
@@ -22,7 +22,7 @@
|
||||
if (!this.canTick) {
|
||||
if (this.noTickEquipmentDirty) {
|
||||
this.noTickEquipmentDirty = false;
|
||||
@@ -811,4 +_,18 @@
|
||||
@@ -812,4 +_,18 @@
|
||||
}
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/monster/Ghast.java
|
||||
+++ b/net/minecraft/world/entity/monster/Ghast.java
|
||||
@@ -155,6 +_,11 @@
|
||||
@@ -156,6 +_,11 @@
|
||||
public static boolean checkGhastSpawnRules(
|
||||
EntityType<Ghast> entityType, LevelAccessor level, EntitySpawnReason spawnReason, BlockPos pos, RandomSource random
|
||||
) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/monster/Guardian.java
|
||||
+++ b/net/minecraft/world/entity/monster/Guardian.java
|
||||
@@ -314,6 +_,11 @@
|
||||
@@ -315,6 +_,11 @@
|
||||
public static boolean checkGuardianSpawnRules(
|
||||
EntityType<? extends Guardian> entityType, LevelAccessor level, EntitySpawnReason spawnReason, BlockPos pos, RandomSource random
|
||||
) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/monster/Phantom.java
|
||||
+++ b/net/minecraft/world/entity/monster/Phantom.java
|
||||
@@ -169,7 +_,11 @@
|
||||
@@ -170,7 +_,11 @@
|
||||
ServerLevelAccessor level, DifficultyInstance difficulty, EntitySpawnReason spawnReason, @Nullable SpawnGroupData spawnGroupData
|
||||
) {
|
||||
this.anchorPoint = this.blockPosition().above(5);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/monster/Ravager.java
|
||||
+++ b/net/minecraft/world/entity/monster/Ravager.java
|
||||
@@ -74,6 +_,7 @@
|
||||
@@ -75,6 +_,7 @@
|
||||
protected void registerGoals() {
|
||||
super.registerGoals();
|
||||
this.goalSelector.addGoal(0, new FloatGoal(this));
|
||||
@@ -8,7 +8,7 @@
|
||||
this.goalSelector.addGoal(4, new MeleeAttackGoal(this, 1.0, true));
|
||||
this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 0.4));
|
||||
this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6.0F));
|
||||
@@ -154,7 +_,7 @@
|
||||
@@ -155,7 +_,7 @@
|
||||
)) {
|
||||
BlockState blockState = serverLevel.getBlockState(blockPos);
|
||||
Block block = blockState.getBlock();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/monster/Skeleton.java
|
||||
+++ b/net/minecraft/world/entity/monster/Skeleton.java
|
||||
@@ -129,4 +_,64 @@
|
||||
@@ -130,4 +_,64 @@
|
||||
SoundEvent getStepSound() {
|
||||
return SoundEvents.SKELETON_STEP;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/monster/Zombie.java
|
||||
+++ b/net/minecraft/world/entity/monster/Zombie.java
|
||||
@@ -116,7 +_,19 @@
|
||||
@@ -117,7 +_,19 @@
|
||||
this.goalSelector.addGoal(7, new WaterAvoidingRandomStrollGoal(this, 1.0));
|
||||
this.targetSelector.addGoal(1, new HurtByTargetGoal(this).setAlertOthers(ZombifiedPiglin.class));
|
||||
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true));
|
||||
@@ -21,7 +21,7 @@
|
||||
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, IronGolem.class, true));
|
||||
this.targetSelector.addGoal(5, new NearestAttackableTargetGoal<>(this, Turtle.class, 10, true, false, Turtle.BABY_ON_LAND_SELECTOR));
|
||||
}
|
||||
@@ -550,10 +_,7 @@
|
||||
@@ -551,10 +_,7 @@
|
||||
}
|
||||
|
||||
if (this.getItemBySlot(EquipmentSlot.HEAD).isEmpty()) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/monster/ZombieVillager.java
|
||||
+++ b/net/minecraft/world/entity/monster/ZombieVillager.java
|
||||
@@ -138,10 +_,10 @@
|
||||
@@ -140,10 +_,10 @@
|
||||
public InteractionResult mobInteract(Player player, InteractionHand hand) {
|
||||
ItemStack itemInHand = player.getItemInHand(hand);
|
||||
if (itemInHand.is(Items.GOLDEN_APPLE)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/monster/hoglin/Hoglin.java
|
||||
+++ b/net/minecraft/world/entity/monster/hoglin/Hoglin.java
|
||||
@@ -200,6 +_,11 @@
|
||||
@@ -201,6 +_,11 @@
|
||||
public static boolean checkHoglinSpawnRules(
|
||||
EntityType<Hoglin> entityType, LevelAccessor level, EntitySpawnReason spawnReason, BlockPos pos, RandomSource random
|
||||
) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/npc/Villager.java
|
||||
+++ b/net/minecraft/world/entity/npc/Villager.java
|
||||
@@ -178,6 +_,8 @@
|
||||
@@ -179,6 +_,8 @@
|
||||
MemoryModuleType.MEETING_POINT,
|
||||
(villager, poiType) -> poiType.is(PoiTypes.MEETING)
|
||||
);
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
public Villager(EntityType<? extends Villager> type, Level level) {
|
||||
this(type, level, VillagerType.PLAINS);
|
||||
@@ -196,6 +_,57 @@
|
||||
@@ -197,6 +_,57 @@
|
||||
this.setVillagerData(this.getVillagerData().withType(villagerType).withProfession(level.registryAccess(), VillagerProfession.NONE));
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
@Override
|
||||
public Brain<Villager> getBrain() {
|
||||
return (Brain<Villager>)super.getBrain();
|
||||
@@ -292,11 +_,22 @@
|
||||
@@ -293,11 +_,22 @@
|
||||
// Paper start - EAR 2
|
||||
this.customServerAiStep(level, false);
|
||||
}
|
||||
@@ -92,7 +92,7 @@
|
||||
profilerFiller.pop();
|
||||
if (this.assignProfessionWhenSpawned) {
|
||||
this.assignProfessionWhenSpawned = false;
|
||||
@@ -368,6 +_,7 @@
|
||||
@@ -369,6 +_,7 @@
|
||||
return InteractionResult.CONSUME;
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
this.startTrading(player);
|
||||
}
|
||||
|
||||
@@ -504,7 +_,7 @@
|
||||
@@ -505,7 +_,7 @@
|
||||
|
||||
public void updateDemand() {
|
||||
for (MerchantOffer merchantOffer : this.getOffers()) {
|
||||
@@ -109,7 +109,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -697,7 +_,7 @@
|
||||
@@ -698,7 +_,7 @@
|
||||
|
||||
@Override
|
||||
public boolean canBreed() {
|
||||
@@ -118,7 +118,7 @@
|
||||
}
|
||||
|
||||
private boolean hungry() {
|
||||
@@ -922,6 +_,7 @@
|
||||
@@ -923,6 +_,7 @@
|
||||
}
|
||||
|
||||
public void spawnGolemIfNeeded(ServerLevel level, long gameTime, int minVillagerAmount) {
|
||||
@@ -126,7 +126,7 @@
|
||||
if (this.wantsToSpawnGolem(gameTime)) {
|
||||
AABB aabb = this.getBoundingBox().inflate(10.0, 10.0, 10.0);
|
||||
List<Villager> entitiesOfClass = level.getEntitiesOfClass(Villager.class, aabb);
|
||||
@@ -989,6 +_,12 @@
|
||||
@@ -990,6 +_,12 @@
|
||||
|
||||
@Override
|
||||
public void startSleeping(BlockPos pos) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/net/minecraft/world/entity/player/Player.java
|
||||
@@ -180,11 +_,20 @@
|
||||
@@ -181,11 +_,20 @@
|
||||
private int currentImpulseContextResetGraceTime = 0;
|
||||
public boolean affectsSpawning = true; // Paper - Affects Spawning API
|
||||
public net.kyori.adventure.util.TriState flyingFallDamage = net.kyori.adventure.util.TriState.NOT_SET; // Paper - flying fall damage
|
||||
@@ -21,7 +21,7 @@
|
||||
@Override
|
||||
public org.bukkit.craftbukkit.entity.CraftHumanEntity getBukkitEntity() {
|
||||
return (org.bukkit.craftbukkit.entity.CraftHumanEntity) super.getBukkitEntity();
|
||||
@@ -246,6 +_,12 @@
|
||||
@@ -247,6 +_,12 @@
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
@@ -34,7 +34,7 @@
|
||||
this.noPhysics = this.isSpectator();
|
||||
if (this.isSpectator() || this.isPassenger()) {
|
||||
this.setOnGround(false);
|
||||
@@ -301,6 +_,17 @@
|
||||
@@ -302,6 +_,17 @@
|
||||
this.turtleHelmetTick();
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
this.cooldowns.tick();
|
||||
this.updatePlayerPose();
|
||||
if (this.currentImpulseContextResetGraceTime > 0) {
|
||||
@@ -512,7 +_,7 @@
|
||||
@@ -513,7 +_,7 @@
|
||||
List<Entity> list = Lists.newArrayList();
|
||||
|
||||
for (Entity entity : entities) {
|
||||
@@ -61,7 +61,7 @@
|
||||
list.add(entity);
|
||||
} else if (!entity.isRemoved()) {
|
||||
this.touch(entity);
|
||||
@@ -1074,7 +_,7 @@
|
||||
@@ -1075,7 +_,7 @@
|
||||
flag2 = flag2 && !this.level().paperConfig().entities.behavior.disablePlayerCrits; // Paper - Toggleable player crits
|
||||
if (flag2) {
|
||||
damageSource = damageSource.critical(); // Paper - critical damage API
|
||||
@@ -70,7 +70,7 @@
|
||||
}
|
||||
|
||||
float f2 = f + f1;
|
||||
@@ -1674,7 +_,23 @@
|
||||
@@ -1675,7 +_,23 @@
|
||||
|
||||
@Override
|
||||
protected int getBaseExperienceReward(ServerLevel level) {
|
||||
@@ -95,7 +95,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1717,6 +_,13 @@
|
||||
@@ -1718,6 +_,13 @@
|
||||
public boolean addItem(ItemStack stack) {
|
||||
return this.inventory.add(stack);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/Snowball.java
|
||||
+++ b/net/minecraft/world/entity/projectile/Snowball.java
|
||||
@@ -52,9 +_,39 @@
|
||||
@@ -53,9 +_,39 @@
|
||||
protected void onHitEntity(EntityHitResult result) {
|
||||
super.onHitEntity(result);
|
||||
Entity entity = result.getEntity();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/inventory/AnvilMenu.java
|
||||
+++ b/net/minecraft/world/inventory/AnvilMenu.java
|
||||
@@ -21,6 +_,12 @@
|
||||
@@ -23,6 +_,12 @@
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
public class AnvilMenu extends ItemCombinerMenu {
|
||||
public static final int INPUT_SLOT = 0;
|
||||
public static final int ADDITIONAL_SLOT = 1;
|
||||
@@ -50,6 +_,10 @@
|
||||
@@ -52,6 +_,10 @@
|
||||
private org.bukkit.craftbukkit.inventory.view.CraftAnvilView bukkitEntity;
|
||||
// CraftBukkit end
|
||||
public boolean bypassEnchantmentLevelRestriction = false; // Paper - bypass anvil level restrictions
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
public AnvilMenu(int containerId, Inventory playerInventory) {
|
||||
this(containerId, playerInventory, ContainerLevelAccess.NULL);
|
||||
@@ -75,12 +_,17 @@
|
||||
@@ -77,12 +_,17 @@
|
||||
|
||||
@Override
|
||||
protected boolean mayPickup(Player player, boolean hasStack) {
|
||||
@@ -43,7 +43,7 @@
|
||||
player.giveExperienceLevels(-this.cost.get());
|
||||
}
|
||||
|
||||
@@ -133,13 +_,19 @@
|
||||
@@ -135,13 +_,19 @@
|
||||
|
||||
@Override
|
||||
public void createResult() {
|
||||
@@ -64,7 +64,7 @@
|
||||
ItemStack itemStack = item.copy();
|
||||
ItemStack item1 = this.inputSlots.getItem(1);
|
||||
ItemEnchantments.Mutable mutable = new ItemEnchantments.Mutable(EnchantmentHelper.getEnchantmentsForCrafting(itemStack));
|
||||
@@ -197,23 +_,34 @@
|
||||
@@ -199,23 +_,34 @@
|
||||
int intValue = entry.getIntValue();
|
||||
intValue = level == intValue ? intValue + 1 : Math.max(intValue, level);
|
||||
Enchantment enchantment = holder.value();
|
||||
@@ -103,7 +103,7 @@
|
||||
intValue = enchantment.getMaxLevel();
|
||||
}
|
||||
|
||||
@@ -242,6 +_,54 @@
|
||||
@@ -244,6 +_,54 @@
|
||||
if (!this.itemName.equals(item.getHoverName().getString())) {
|
||||
i1 = 1;
|
||||
i += i1;
|
||||
@@ -158,7 +158,7 @@
|
||||
itemStack.set(DataComponents.CUSTOM_NAME, Component.literal(this.itemName));
|
||||
}
|
||||
} else if (item.has(DataComponents.CUSTOM_NAME)) {
|
||||
@@ -266,6 +_,12 @@
|
||||
@@ -268,6 +_,12 @@
|
||||
this.onlyRenaming = true;
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@
|
||||
if (this.cost.get() >= this.maximumRepairCost && !this.player.hasInfiniteMaterials()) { // CraftBukkit
|
||||
itemStack = ItemStack.EMPTY;
|
||||
}
|
||||
@@ -286,6 +_,13 @@
|
||||
@@ -288,6 +_,13 @@
|
||||
|
||||
org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(this.getBukkitView(), itemStack); // CraftBukkit
|
||||
this.broadcastChanges();
|
||||
@@ -185,7 +185,7 @@
|
||||
} else {
|
||||
org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(this.getBukkitView(), ItemStack.EMPTY); // CraftBukkit
|
||||
this.cost.set(AnvilMenu.DEFAULT_DENIED_COST); // CraftBukkit - use a variable for set a cost for denied item
|
||||
@@ -294,7 +_,7 @@
|
||||
@@ -296,7 +_,7 @@
|
||||
}
|
||||
|
||||
public static int calculateIncreasedRepairCost(int oldRepairCost) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/inventory/GrindstoneMenu.java
|
||||
+++ b/net/minecraft/world/inventory/GrindstoneMenu.java
|
||||
@@ -91,11 +_,13 @@
|
||||
@@ -92,11 +_,13 @@
|
||||
@Override
|
||||
public void onTake(Player player, ItemStack stack) {
|
||||
access.execute((level, blockPos) -> {
|
||||
@@ -15,7 +15,7 @@
|
||||
// Paper end - Fire BlockExpEvent on grindstone use
|
||||
}
|
||||
|
||||
@@ -124,7 +_,7 @@
|
||||
@@ -125,7 +_,7 @@
|
||||
for (Entry<Holder<Enchantment>> entry : enchantmentsForCrafting.entrySet()) {
|
||||
Holder<Enchantment> holder = entry.getKey();
|
||||
int intValue = entry.getIntValue();
|
||||
@@ -24,7 +24,7 @@
|
||||
i += holder.value().getMinCost(intValue);
|
||||
}
|
||||
}
|
||||
@@ -202,15 +_,75 @@
|
||||
@@ -203,15 +_,75 @@
|
||||
|
||||
for (Entry<Holder<Enchantment>> entry : enchantmentsForCrafting.entrySet()) {
|
||||
Holder<Enchantment> holder = entry.getKey();
|
||||
@@ -102,7 +102,7 @@
|
||||
if (item.is(Items.ENCHANTED_BOOK) && itemEnchantments.isEmpty()) {
|
||||
item = item.transmuteCopy(Items.BOOK);
|
||||
}
|
||||
@@ -222,6 +_,23 @@
|
||||
@@ -223,6 +_,23 @@
|
||||
}
|
||||
|
||||
item.set(DataComponents.REPAIR_COST, i);
|
||||
@@ -126,7 +126,7 @@
|
||||
return item;
|
||||
}
|
||||
|
||||
@@ -278,7 +_,9 @@
|
||||
@@ -279,7 +_,9 @@
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/item/AxeItem.java
|
||||
+++ b/net/minecraft/world/item/AxeItem.java
|
||||
@@ -64,13 +_,15 @@
|
||||
@@ -65,13 +_,15 @@
|
||||
if (playerHasBlockingItemUseIntent(context)) {
|
||||
return InteractionResult.PASS;
|
||||
} else {
|
||||
@@ -18,14 +18,14 @@
|
||||
return InteractionResult.PASS;
|
||||
}
|
||||
// Paper end
|
||||
@@ -78,8 +_,15 @@
|
||||
@@ -79,8 +_,15 @@
|
||||
CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger((ServerPlayer)player, clickedPos, itemInHand);
|
||||
}
|
||||
|
||||
- level.setBlock(clickedPos, optional.get(), 11);
|
||||
- level.setBlock(clickedPos, optional.get(), Block.UPDATE_ALL_IMMEDIATE);
|
||||
- level.gameEvent(GameEvent.BLOCK_CHANGE, clickedPos, GameEvent.Context.of(player, optional.get()));
|
||||
+ // Purpur start - Tool actionable options
|
||||
+ level.setBlock(clickedPos, state, 11);
|
||||
+ level.setBlock(clickedPos, state, Block.UPDATE_ALL_IMMEDIATE);
|
||||
+ actionable.drops().forEach((drop, chance) -> {
|
||||
+ if (level.random.nextDouble() < chance) {
|
||||
+ Block.popResourceFromFace(level, clickedPos, context.getClickedFace(), new ItemStack(drop));
|
||||
@@ -36,7 +36,7 @@
|
||||
if (player != null) {
|
||||
itemInHand.hurtAndBreak(1, player, context.getHand().asEquipmentSlot());
|
||||
}
|
||||
@@ -96,21 +_,23 @@
|
||||
@@ -97,21 +_,23 @@
|
||||
&& !player.isSecondaryUseActive();
|
||||
}
|
||||
|
||||
@@ -52,8 +52,8 @@
|
||||
- Optional<BlockState> previous = WeatheringCopper.getPrevious(state);
|
||||
+ Optional<org.purpurmc.purpur.tool.Actionable> previous = Optional.ofNullable(level.purpurConfig.axeWeatherables.get(state.getBlock())); // Purpur - Tool actionable options
|
||||
if (previous.isPresent()) {
|
||||
- spawnSoundAndParticle(level, pos, player, state, SoundEvents.AXE_SCRAPE, 3005);
|
||||
+ spawnSoundAndParticle(level, pos, WeatheringCopper.getPrevious(state).isPresent() ? player : null, state, SoundEvents.AXE_SCRAPE, 3005); // Purpur - Tool actionable options - force sound
|
||||
- spawnSoundAndParticle(level, pos, player, state, SoundEvents.AXE_SCRAPE, LevelEvent.PARTICLES_SCRAPE);
|
||||
+ spawnSoundAndParticle(level, pos, WeatheringCopper.getPrevious(state).isPresent() ? player : null, state, SoundEvents.AXE_SCRAPE, LevelEvent.PARTICLES_SCRAPE); // Purpur - Tool actionable options - force sound
|
||||
return previous;
|
||||
} else {
|
||||
- Optional<BlockState> optional = Optional.ofNullable(HoneycombItem.WAX_OFF_BY_BLOCK.get().get(state.getBlock()))
|
||||
@@ -63,8 +63,8 @@
|
||||
+ // .map(block -> block.withPropertiesOf(state));
|
||||
+ // Purpur end - Tool actionable options
|
||||
if (optional.isPresent()) {
|
||||
- spawnSoundAndParticle(level, pos, player, state, SoundEvents.AXE_WAX_OFF, 3004);
|
||||
+ spawnSoundAndParticle(level, pos, HoneycombItem.WAX_OFF_BY_BLOCK.get().containsKey(state.getBlock()) ? player : null, state, SoundEvents.AXE_WAX_OFF, 3004); // Purpur - Tool actionable options - force sound
|
||||
- spawnSoundAndParticle(level, pos, player, state, SoundEvents.AXE_WAX_OFF, LevelEvent.PARTICLES_WAX_OFF);
|
||||
+ spawnSoundAndParticle(level, pos, HoneycombItem.WAX_OFF_BY_BLOCK.get().containsKey(state.getBlock()) ? player : null, state, SoundEvents.AXE_WAX_OFF, LevelEvent.PARTICLES_WAX_OFF); // Purpur - Tool actionable options - force sound
|
||||
return optional;
|
||||
} else {
|
||||
return Optional.empty();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/item/ShovelItem.java
|
||||
+++ b/net/minecraft/world/item/ShovelItem.java
|
||||
@@ -45,9 +_,12 @@
|
||||
@@ -46,9 +_,12 @@
|
||||
BlockState blockState1 = FLATTENABLES.get(blockState.getBlock());
|
||||
BlockState blockState2 = null;
|
||||
Runnable afterAction = null; // Paper
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/item/SpawnEggItem.java
|
||||
+++ b/net/minecraft/world/item/SpawnEggItem.java
|
||||
@@ -68,6 +_,23 @@
|
||||
@@ -69,6 +_,23 @@
|
||||
return InteractionResult.FAIL;
|
||||
} else {
|
||||
if (level.paperConfig().entities.spawning.disableMobSpawnerSpawnEggTransformation) return InteractionResult.FAIL; // Paper - Allow disabling mob spawner spawn egg transformation
|
||||
@@ -22,5 +22,5 @@
|
||||
+ }
|
||||
+ // Purpur end - PlayerSetSpawnerTypeWithEggEvent
|
||||
spawner.setEntityId(type, level.getRandom());
|
||||
level.sendBlockUpdated(clickedPos, blockState, blockState, 3);
|
||||
level.sendBlockUpdated(clickedPos, blockState, blockState, Block.UPDATE_ALL);
|
||||
level.gameEvent(context.getPlayer(), GameEvent.BLOCK_CHANGE, clickedPos);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/BaseSpawner.java
|
||||
+++ b/net/minecraft/world/level/BaseSpawner.java
|
||||
@@ -61,6 +_,7 @@
|
||||
@@ -62,6 +_,7 @@
|
||||
}
|
||||
|
||||
public boolean isNearPlayer(Level level, BlockPos pos) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/Level.java
|
||||
+++ b/net/minecraft/world/level/Level.java
|
||||
@@ -165,11 +_,55 @@
|
||||
@@ -166,11 +_,55 @@
|
||||
}
|
||||
// Paper end - add paper world config
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
public CraftWorld getWorld() {
|
||||
return this.world;
|
||||
}
|
||||
@@ -845,6 +_,8 @@
|
||||
@@ -846,6 +_,8 @@
|
||||
// Paper end - getblock optimisations - cache world height/sections
|
||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) levelData).getLevelName()); // Spigot
|
||||
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
|
||||
@@ -65,7 +65,7 @@
|
||||
this.generator = generator;
|
||||
this.world = new CraftWorld((ServerLevel) this, generator, biomeProvider, environment);
|
||||
|
||||
@@ -2112,4 +_,14 @@
|
||||
@@ -2113,4 +_,14 @@
|
||||
return this.id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+++ b/net/minecraft/world/level/block/CaveVinesBlock.java
|
||||
@@ -92,4 +_,11 @@
|
||||
public void performBonemeal(ServerLevel level, RandomSource random, BlockPos pos, BlockState state) {
|
||||
level.setBlock(pos, state.setValue(BERRIES, true), 2);
|
||||
level.setBlock(pos, state.setValue(BERRIES, true), Block.UPDATE_CLIENTS);
|
||||
}
|
||||
+
|
||||
+ // Purpur start - cave vines configurable max growth age
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
- return InteractionResult.PASS;
|
||||
- }
|
||||
- // Paper end
|
||||
- level.levelEvent(1500, pos, state != blockState ? 1 : 0);
|
||||
- level.levelEvent(LevelEvent.COMPOSTER_FILL, pos, state != blockState ? 1 : 0);
|
||||
- player.awardStat(Stats.ITEM_USED.get(stack.getItem()));
|
||||
- stack.consume(1, player);
|
||||
- }
|
||||
@@ -46,17 +46,17 @@
|
||||
+ // Purpur start - sneak to bulk process composter
|
||||
+ private static @Nullable BlockState process(int levelValue, Player player, BlockState state, Level level, BlockPos pos, ItemStack stack) {
|
||||
+ if (levelValue < 7 && !level.isClientSide()) {
|
||||
+ BlockState iblockdata1 = ComposterBlock.addItem(player, state, level, pos, stack);
|
||||
+ BlockState blockState = ComposterBlock.addItem(player, state, level, pos, stack);
|
||||
+ // Paper start - handle cancelled events
|
||||
+ if (iblockdata1 == null) {
|
||||
+ if (blockState == null) {
|
||||
+ return null;
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
+ level.levelEvent(1500, pos, state != iblockdata1 ? 1 : 0);
|
||||
+ level.levelEvent(LevelEvent.COMPOSTER_FILL, pos, state != blockState ? 1 : 0);
|
||||
+ player.awardStat(Stats.ITEM_USED.get(stack.getItem()));
|
||||
+ stack.consume(1, player);
|
||||
+ return iblockdata1;
|
||||
+ return blockState;
|
||||
+ }
|
||||
+ return state;
|
||||
+ }
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
+ } else if (requiresRedstone(level, state, pos)) { return InteractionResult.CONSUME; // Purpur - Option to make doors require redstone
|
||||
} else {
|
||||
state = state.cycle(OPEN);
|
||||
level.setBlock(pos, state, 10);
|
||||
level.setBlock(pos, state, Block.UPDATE_CLIENTS | Block.UPDATE_IMMEDIATE);
|
||||
@@ -287,4 +_,18 @@
|
||||
public static boolean isWoodenDoor(BlockState state) {
|
||||
return state.getBlock() instanceof DoorBlock doorBlock && doorBlock.type().canOpenByHand();
|
||||
@@ -19,8 +19,8 @@
|
||||
+ // force update client
|
||||
+ BlockPos otherPos = pos.relative(state.getValue(DoorBlock.HALF) == DoubleBlockHalf.LOWER ? Direction.UP : Direction.DOWN);
|
||||
+ BlockState otherState = level.getBlockState(otherPos);
|
||||
+ level.sendBlockUpdated(pos, state, state, 3);
|
||||
+ level.sendBlockUpdated(otherPos, otherState, otherState, 3);
|
||||
+ level.sendBlockUpdated(pos, state, state, Block.UPDATE_ALL);
|
||||
+ level.sendBlockUpdated(otherPos, otherState, otherState, Block.UPDATE_ALL);
|
||||
+ return true;
|
||||
+ }
|
||||
+ return false;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||
+++ b/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||
@@ -186,6 +_,21 @@
|
||||
@@ -187,6 +_,21 @@
|
||||
}
|
||||
|
||||
ItemStack itemStack = furnace.items.get(1);
|
||||
@@ -22,7 +22,7 @@
|
||||
ItemStack itemStack1 = furnace.items.get(0);
|
||||
boolean flag1 = !itemStack1.isEmpty();
|
||||
boolean flag2 = !itemStack.isEmpty();
|
||||
@@ -269,6 +_,8 @@
|
||||
@@ -270,6 +_,8 @@
|
||||
if (flag) {
|
||||
setChanged(level, pos, state);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
||||
+++ b/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
||||
@@ -148,16 +_,32 @@
|
||||
@@ -149,16 +_,32 @@
|
||||
return this.setText(updater.apply(text), isFrontText);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -306,6 +_,27 @@
|
||||
@@ -307,6 +_,27 @@
|
||||
// CraftBukkit - this
|
||||
return new CommandSourceStack(commandSource, Vec3.atCenterOf(pos), Vec2.ZERO, level, 2, string, component, level.getServer(), player); // Paper - Fix commands from signs not firing command events
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/material/LavaFluid.java
|
||||
+++ b/net/minecraft/world/level/material/LavaFluid.java
|
||||
@@ -190,7 +_,7 @@
|
||||
@@ -192,7 +_,7 @@
|
||||
|
||||
@Override
|
||||
public int getTickDelay(LevelReader level) {
|
||||
@@ -9,9 +9,9 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -211,6 +_,13 @@
|
||||
@@ -213,6 +_,13 @@
|
||||
private void fizz(LevelAccessor level, BlockPos pos) {
|
||||
level.levelEvent(1501, pos, 0);
|
||||
level.levelEvent(LevelEvent.LAVA_FIZZ, pos, 0);
|
||||
}
|
||||
+
|
||||
+ // Purpur start - Implement infinite liquids
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/portal/PortalShape.java
|
||||
+++ b/net/minecraft/world/level/portal/PortalShape.java
|
||||
@@ -28,7 +_,7 @@
|
||||
@@ -29,7 +_,7 @@
|
||||
public static final int MAX_WIDTH = 21;
|
||||
private static final int MIN_HEIGHT = 3;
|
||||
public static final int MAX_HEIGHT = 21;
|
||||
|
||||
Reference in New Issue
Block a user