mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-22 14:35:11 +01:00
good luck americans
This commit is contained in:
parent
5a6011c08c
commit
5d19e2b332
11 changed files with 42 additions and 66 deletions
|
@ -14,10 +14,10 @@ clearing the owner.
|
|||
Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 34e175b28f7c9120b58fc8e2b65ca978c7f301b5..cd362a91ad31dbae94fdb5a8c71839576f397ea1 100644
|
||||
index 2c959a99376ed479415354c481801643c5f6b1a1..8cdef637f6343119fc77f87e7478ee23e9b8efab 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -390,6 +390,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -393,6 +393,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
public boolean inWorld = false;
|
||||
public boolean generation;
|
||||
public int maxAirTicks = this.getDefaultMaxAirSupply(); // CraftBukkit - SPIGOT-6907: re-implement LivingEntity#setMaximumAir()
|
||||
|
@ -26,10 +26,10 @@ index 34e175b28f7c9120b58fc8e2b65ca978c7f301b5..cd362a91ad31dbae94fdb5a8c7183957
|
|||
public boolean lastDamageCancelled; // SPIGOT-5339, SPIGOT-6252, SPIGOT-6777: Keep track if the event was canceled
|
||||
public boolean persistentInvisibility = false;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
index 63ffa02f820d88f865ae604712edcf2ac13f0bff..f2bdd95a6ae77400742d87bcae35c09fb8b047ba 100644
|
||||
index 4d487090a622d280bdfacc18978929c61f74f147..3982b32cf69250ebd138eff225b65313f75286ea 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
@@ -57,14 +57,31 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
@@ -63,17 +63,35 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
this.ownerUUID = entity.getUUID();
|
||||
this.cachedOwner = entity;
|
||||
}
|
||||
|
@ -59,18 +59,14 @@ index 63ffa02f820d88f865ae604712edcf2ac13f0bff..f2bdd95a6ae77400742d87bcae35c09f
|
|||
@Override
|
||||
public Entity getOwner() {
|
||||
if (this.cachedOwner != null && !this.cachedOwner.isRemoved()) {
|
||||
+ this.refreshProjectileSource(false); // Paper - Refresh ProjectileSource for projectiles
|
||||
return this.cachedOwner;
|
||||
} else if (this.ownerUUID != null) {
|
||||
this.cachedOwner = this.findOwner(this.ownerUUID);
|
||||
+ this.refreshProjectileSource(false); // Paper - Refresh ProjectileSource for projectiles
|
||||
return this.cachedOwner;
|
||||
} else {
|
||||
if (this.ownerUUID != null) {
|
||||
@@ -74,6 +91,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
ServerLevel worldserver = (ServerLevel) world;
|
||||
|
||||
this.cachedOwner = worldserver.getEntity(this.ownerUUID);
|
||||
+ this.refreshProjectileSource(false); // Paper - Refresh ProjectileSource for projectiles
|
||||
return this.cachedOwner;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java b/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java
|
||||
index de4fb2654c7895cfd83ad694455ee56cb708c2f2..591af9d0d2fdc9953415979fc97a4a00afd85885 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java
|
|
@ -9,10 +9,10 @@ Fix several issues when a player interact with a block:
|
|||
* poi can desync when the BlockPhysicsEvent is cancelled
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
index 7d76cdc59984b156628273c8357485eb10046007..7180996027f70aef7afe32fb2adfce6431429401 100644
|
||||
index 44cc12a3338b5f0448c88192c8674cd36531db34..d59120f0304823361cc4112f5583323945df4229 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
@@ -128,7 +128,7 @@ public class BlockItem extends Item {
|
||||
@@ -122,7 +122,7 @@ public class BlockItem extends Item {
|
||||
|
||||
SoundType soundeffecttype = iblockdata1.getSoundType();
|
||||
|
||||
|
@ -20,9 +20,9 @@ index 7d76cdc59984b156628273c8357485eb10046007..7180996027f70aef7afe32fb2adfce64
|
|||
+ if (entityhuman == null) world.playSound(entityhuman, blockposition, this.getPlaceSound(iblockdata1), net.minecraft.sounds.SoundSource.BLOCKS, (soundeffecttype.getVolume() + 1.0F) / 2.0F, soundeffecttype.getPitch() * 0.8F); // Paper - Fix block place logic; reintroduce this for the dispenser (i.e the shulker)
|
||||
world.gameEvent((Holder) GameEvent.BLOCK_PLACE, blockposition, GameEvent.Context.of(entityhuman, iblockdata1));
|
||||
itemstack.consume(1, entityhuman);
|
||||
return InteractionResult.sidedSuccess(world.isClientSide);
|
||||
return InteractionResult.SUCCESS;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index cc92d2e8b77c75da1d8b850c3bc251e8ac221c24..0a3e56302470f239d4840e4e32d2a0ce4611ff65 100644
|
||||
index a6f538372830f3f80740ef503733736e0561d1bd..d048d0e4b16459b5bad44ebfa3c6a8f336f6762b 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -552,17 +552,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
@ -5,19 +5,19 @@ Subject: [PATCH] Fix spigot sound playing for BlockItem ItemStacks
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index e64cc91b416bbbefe6aadf1c6b685346cf258ab4..276858d23be2f9443cc364046a55b9c9a88bf4ea 100644
|
||||
index d8dc3228f3cd8c9efc8359162edac601a87bf762..5867a0e3e2ce9be7514771549ad318947e387470 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -571,7 +571,11 @@ public final class ItemStack implements DataComponentHolder {
|
||||
@@ -577,7 +577,11 @@ public final class ItemStack implements DataComponentHolder {
|
||||
|
||||
// SPIGOT-1288 - play sound stripped from ItemBlock
|
||||
if (this.item instanceof BlockItem) {
|
||||
- SoundType soundeffecttype = ((BlockItem) this.item).getBlock().defaultBlockState().getSoundType(); // TODO: not strictly correct, however currently only affects decorated pots
|
||||
// SPIGOT-1288 - play sound stripped from ItemBlock
|
||||
if (this.item instanceof BlockItem) {
|
||||
- SoundType soundeffecttype = ((BlockItem) this.item).getBlock().defaultBlockState().getSoundType(); // TODO: not strictly correct, however currently only affects decorated pots
|
||||
+ // Paper start - Fix spigot sound playing for BlockItem ItemStacks
|
||||
+ BlockPos position = new net.minecraft.world.item.context.BlockPlaceContext(context).getClickedPos();
|
||||
+ net.minecraft.world.level.block.state.BlockState blockData = world.getBlockState(position);
|
||||
+ SoundType soundeffecttype = blockData.getSoundType();
|
||||
+ // Paper end - Fix spigot sound playing for BlockItem ItemStacks
|
||||
world.playSound(entityhuman, blockposition, soundeffecttype.getPlaceSound(), SoundSource.BLOCKS, (soundeffecttype.getVolume() + 1.0F) / 2.0F, soundeffecttype.getPitch() * 0.8F);
|
||||
}
|
||||
world.playSound(entityhuman, blockposition, soundeffecttype.getPlaceSound(), SoundSource.BLOCKS, (soundeffecttype.getVolume() + 1.0F) / 2.0F, soundeffecttype.getPitch() * 0.8F);
|
||||
}
|
||||
|
|
@ -6,10 +6,10 @@ Subject: [PATCH] Call BlockGrowEvent for missing blocks
|
|||
Call the event for pitcher crops and sniffer egg
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java b/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java
|
||||
index d06e3892cf42723f8e3f621b5497c5348fa1a715..5f1ec3f69295760b7b8097916c82cbf9ddd49700 100644
|
||||
index ea6135edc76c06b7cd55930b620dfb05f939e4f6..640e439524cc1e5960ba99f8bd555c7dee8edbf5 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java
|
||||
@@ -133,7 +133,7 @@ public class PitcherCropBlock extends DoublePlantBlock implements BonemealableBl
|
||||
@@ -142,7 +142,7 @@ public class PitcherCropBlock extends DoublePlantBlock implements BonemealableBl
|
||||
int i = Math.min(state.getValue(AGE) + amount, 4);
|
||||
if (this.canGrow(world, pos, state, i)) {
|
||||
BlockState blockState = state.setValue(AGE, Integer.valueOf(i));
|
||||
|
@ -19,10 +19,10 @@ index d06e3892cf42723f8e3f621b5497c5348fa1a715..5f1ec3f69295760b7b8097916c82cbf9
|
|||
world.setBlock(pos.above(), blockState.setValue(HALF, DoubleBlockHalf.UPPER), 3);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java b/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java
|
||||
index f53808e200bd83ab80954ec5c1e9c14250302be8..b943384eb6a4612993556036f0d3beec6939a559 100644
|
||||
index 2df28caefff893f319924ae5fd376c8aeb0a2158..c6b7cfd78bc0c4cb64eada507876c293541890f4 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java
|
||||
@@ -71,8 +71,13 @@ public class SnifferEggBlock extends Block {
|
||||
@@ -72,8 +72,13 @@ public class SnifferEggBlock extends Block {
|
||||
@Override
|
||||
public void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
|
||||
if (!this.isReadyToHatch(state)) {
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Don't enforce icanhasbukkit default if alias block exists
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index d0deaa80b404043b8cb3dbc390fd5ec3bff2630b..622fe949819ec80737da21305e1a1e0c46480a63 100644
|
||||
index f89cbdb157cb56b1b3e0658d80de48695734138d..f85e8ec660bf588f694aa96e6e2ade478a9696b7 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -355,7 +355,11 @@ public final class CraftServer implements Server {
|
||||
@@ -358,7 +358,11 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
this.commandsConfiguration = YamlConfiguration.loadConfiguration(this.getCommandsConfigFile());
|
||||
this.commandsConfiguration.options().copyDefaults(true);
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add method to remove all active potion effects
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 4ede706367d00965ac75a6ac95877e862d464f74..fb6465bbb2a8bb7597c15d7ac8375f696b897e43 100644
|
||||
index 203e06fdff824ba67dce0e026f7ea5b746d7f258..a62d17b72c675120b447e625cb3dc437681bdf20 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -564,6 +564,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -573,6 +573,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
return effects;
|
||||
}
|
||||
|
|
@ -5,32 +5,32 @@ Subject: [PATCH] Add event for player editing sign
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index 276858d23be2f9443cc364046a55b9c9a88bf4ea..10b3e41d589d480046e15a957902c2751b731cec 100644
|
||||
index 5867a0e3e2ce9be7514771549ad318947e387470..612eb27b471a9ebfdea29a58e5a32931f869bfb6 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -550,7 +550,7 @@ public final class ItemStack implements DataComponentHolder {
|
||||
try {
|
||||
if (world.getBlockEntity(SignItem.openSign) instanceof SignBlockEntity tileentitysign) {
|
||||
if (world.getBlockState(SignItem.openSign).getBlock() instanceof SignBlock blocksign) {
|
||||
- blocksign.openTextEdit(entityhuman, tileentitysign, true, org.bukkit.event.player.PlayerSignOpenEvent.Cause.PLACE); // Craftbukkit
|
||||
+ blocksign.openTextEdit(entityhuman, tileentitysign, true, io.papermc.paper.event.player.PlayerOpenSignEvent.Cause.PLACE); // Paper - Add PlayerOpenSignEvent
|
||||
@@ -556,7 +556,7 @@ public final class ItemStack implements DataComponentHolder {
|
||||
try {
|
||||
if (world.getBlockEntity(SignItem.openSign) instanceof SignBlockEntity tileentitysign) {
|
||||
if (world.getBlockState(SignItem.openSign).getBlock() instanceof SignBlock blocksign) {
|
||||
- blocksign.openTextEdit(entityhuman, tileentitysign, true, org.bukkit.event.player.PlayerSignOpenEvent.Cause.PLACE); // Craftbukkit
|
||||
+ blocksign.openTextEdit(entityhuman, tileentitysign, true, io.papermc.paper.event.player.PlayerOpenSignEvent.Cause.PLACE); // Craftbukkit // Paper - Add PlayerOpenSignEvent
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
} finally {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/SignBlock.java b/src/main/java/net/minecraft/world/level/block/SignBlock.java
|
||||
index e00bfb839a2512f018d874976d6f9607877fc2af..73874cd18a5b335e895ea0b2fefbd521209afe08 100644
|
||||
index 725a207f80651939c1d793f8aa4ba27e8e4da568..b212fe323f048dab40c0ccbb9327c9fc73b9e03a 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/SignBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/SignBlock.java
|
||||
@@ -139,7 +139,7 @@ public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterlo
|
||||
@@ -140,7 +140,7 @@ public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterlo
|
||||
} else if (flag1) {
|
||||
return InteractionResult.SUCCESS;
|
||||
return InteractionResult.SUCCESS_SERVER;
|
||||
} else if (!this.otherPlayerIsEditingSign(player, tileentitysign) && player.mayBuild() && this.hasEditableText(player, tileentitysign, flag)) {
|
||||
- this.openTextEdit(player, tileentitysign, flag, org.bukkit.event.player.PlayerSignOpenEvent.Cause.INTERACT); // CraftBukkit
|
||||
+ this.openTextEdit(player, tileentitysign, flag, io.papermc.paper.event.player.PlayerOpenSignEvent.Cause.INTERACT); // Paper - Add PlayerOpenSignEvent
|
||||
return InteractionResult.SUCCESS;
|
||||
return InteractionResult.SUCCESS_SERVER;
|
||||
} else {
|
||||
return InteractionResult.PASS;
|
||||
@@ -184,16 +184,33 @@ public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterlo
|
||||
@@ -185,16 +185,33 @@ public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterlo
|
||||
return blockpropertywood;
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Redned <redned235@gmail.com>
|
||||
Date: Mon, 12 Jun 2023 11:54:12 -0500
|
||||
Subject: [PATCH] Fix incorrect crafting result amount for fireworks
|
||||
|
||||
Although vanilla does not specifically call this method anywhere, this fixes a bug where the result using the Bukkit API returns the wrong amount.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/crafting/FireworkRocketRecipe.java b/src/main/java/net/minecraft/world/item/crafting/FireworkRocketRecipe.java
|
||||
index e2a3a4fc2fff21b926a74ed11389333165180fe7..93c2268ea1be1727c2939d5730427e24d4e03e2f 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/crafting/FireworkRocketRecipe.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/crafting/FireworkRocketRecipe.java
|
||||
@@ -77,7 +77,7 @@ public class FireworkRocketRecipe extends CustomRecipe {
|
||||
|
||||
@Override
|
||||
public ItemStack getResultItem(HolderLookup.Provider registriesLookup) {
|
||||
- return new ItemStack(Items.FIREWORK_ROCKET);
|
||||
+ return new ItemStack(Items.FIREWORK_ROCKET, 3); // Paper - Fix incorrect crafting result amount
|
||||
}
|
||||
|
||||
@Override
|
Loading…
Reference in a new issue