diff options
author | Nassim Jahnke <[email protected]> | 2022-09-12 13:31:45 +0200 |
---|---|---|
committer | Nassim Jahnke <[email protected]> | 2022-09-12 13:31:45 +0200 |
commit | ef0e5a642d33ac62f070c45a61cb42647b2744cd (patch) | |
tree | 70dff1b36e6d4306f059b3c8e335527af00adf73 /patches/server/0698-Fix-block-drops-position-losing-precision-millions-o.patch | |
parent | 51183af967aafb3d57dc19421da1bcb0aea9d3d2 (diff) | |
download | Paper-ef0e5a642d33ac62f070c45a61cb42647b2744cd.tar.gz Paper-ef0e5a642d33ac62f070c45a61cb42647b2744cd.zip |
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:
9ae3f10f SPIGOT-3842: Add Player#fireworkBoost() and expand Firework API
48c0c547 PR-786: Add methods to get sounds from entities
CraftBukkit Changes:
5cc9c022a SPIGOT-7152: Handle hand item changing during air interact event
4ffa1acf6 SPIGOT-7154: Players get kicked when interacting with a conversation
4daa21123 SPIGOT-3842: Add Player#fireworkBoost() and expand Firework API
e5d6a9bbf PR-1100: Add methods to get sounds from entities
b7e9f1c8b SPIGOT-7146: Reduce use of Material switch in ItemMeta
Spigot Changes:
4c157bb4 Rebuild patches
Diffstat (limited to 'patches/server/0698-Fix-block-drops-position-losing-precision-millions-o.patch')
-rw-r--r-- | patches/server/0698-Fix-block-drops-position-losing-precision-millions-o.patch | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/patches/server/0698-Fix-block-drops-position-losing-precision-millions-o.patch b/patches/server/0698-Fix-block-drops-position-losing-precision-millions-o.patch new file mode 100644 index 0000000000..6b5cd596c4 --- /dev/null +++ b/patches/server/0698-Fix-block-drops-position-losing-precision-millions-o.patch @@ -0,0 +1,41 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jason Penilla <[email protected]> +Date: Thu, 12 Aug 2021 21:15:38 -0700 +Subject: [PATCH] Fix block drops position losing precision millions of blocks + out + + +diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java +index cb11cef117fc896ddcb40993ddb852a2e717c2ad..2db7b9f145b53df5ef79ae235a0de7ccff50db7e 100644 +--- a/src/main/java/net/minecraft/world/level/block/Block.java ++++ b/src/main/java/net/minecraft/world/level/block/Block.java +@@ -346,9 +346,11 @@ public class Block extends BlockBehaviour implements ItemLike { + + public static void popResource(Level world, BlockPos pos, ItemStack stack) { + float f = EntityType.ITEM.getHeight() / 2.0F; +- double d0 = (double) ((float) pos.getX() + 0.5F) + Mth.nextDouble(world.random, -0.25D, 0.25D); +- double d1 = (double) ((float) pos.getY() + 0.5F) + Mth.nextDouble(world.random, -0.25D, 0.25D) - (double) f; +- double d2 = (double) ((float) pos.getZ() + 0.5F) + Mth.nextDouble(world.random, -0.25D, 0.25D); ++ // Paper start - don't convert potentially massive numbers to floats ++ double d0 = pos.getX() + 0.5D + Mth.nextDouble(world.random, -0.25D, 0.25D); ++ double d1 = pos.getY() + 0.5D + Mth.nextDouble(world.random, -0.25D, 0.25D) - (double) f; ++ double d2 = pos.getZ() + 0.5D + Mth.nextDouble(world.random, -0.25D, 0.25D); ++ // Paper end + + Block.popResource(world, () -> { + return new ItemEntity(world, d0, d1, d2, stack); +@@ -361,9 +363,11 @@ public class Block extends BlockBehaviour implements ItemLike { + int k = direction.getStepZ(); + float f = EntityType.ITEM.getWidth() / 2.0F; + float f1 = EntityType.ITEM.getHeight() / 2.0F; +- double d0 = (double) ((float) pos.getX() + 0.5F) + (i == 0 ? Mth.nextDouble(world.random, -0.25D, 0.25D) : (double) ((float) i * (0.5F + f))); +- double d1 = (double) ((float) pos.getY() + 0.5F) + (j == 0 ? Mth.nextDouble(world.random, -0.25D, 0.25D) : (double) ((float) j * (0.5F + f1))) - (double) f1; +- double d2 = (double) ((float) pos.getZ() + 0.5F) + (k == 0 ? Mth.nextDouble(world.random, -0.25D, 0.25D) : (double) ((float) k * (0.5F + f))); ++ // Paper start - don't convert potentially massive numbers to floats ++ double d0 = pos.getX() + 0.5D + (i == 0 ? Mth.nextDouble(world.random, -0.25D, 0.25D) : (double) ((float) i * (0.5F + f))); ++ double d1 = pos.getY() + 0.5D + (j == 0 ? Mth.nextDouble(world.random, -0.25D, 0.25D) : (double) ((float) j * (0.5F + f1))) - (double) f1; ++ double d2 = pos.getZ() + 0.5D + (k == 0 ? Mth.nextDouble(world.random, -0.25D, 0.25D) : (double) ((float) k * (0.5F + f))); ++ // Paper end + double d3 = i == 0 ? Mth.nextDouble(world.random, -0.1D, 0.1D) : (double) i * 0.1D; + double d4 = j == 0 ? Mth.nextDouble(world.random, 0.0D, 0.1D) : (double) j * 0.1D + 0.1D; + double d5 = k == 0 ? Mth.nextDouble(world.random, -0.1D, 0.1D) : (double) k * 0.1D; |