mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-22 02:25:28 +01:00
More more more more more more more more more work
This commit is contained in:
parent
11709feb21
commit
98330439e8
@ -958,7 +958,7 @@ index 0000000000000000000000000000000000000000..683688edff2c86d92f6b3e15271c3289
|
||||
+ .ensureSize("WATER_BASED", 11);
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/Tag.java b/src/main/java/org/bukkit/Tag.java
|
||||
index c86ac9f44c81ed86a157f0666b52e8a4d8e9304c..cbe233c67f97452f662bb49ec5778f7187bf3441 100644
|
||||
index 5a25301a81b0e88a4891cbc4710289544d44105c..34d23f53acf00620223731c4fdacffde9cff41a8 100644
|
||||
--- a/src/main/java/org/bukkit/Tag.java
|
||||
+++ b/src/main/java/org/bukkit/Tag.java
|
||||
@@ -11,6 +11,10 @@ import org.jetbrains.annotations.NotNull;
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add sun related API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index fff4d4083a0065655192cff4ed61f4e80a2e7f75..e4d3618afa8a022ae556febd23be76b5fe6dfe0e 100644
|
||||
index a0a4d0f143303bd449494ec1479db1e449836595..614c04c31c95e9a404b5caac3e07285ce2c58367 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -1789,6 +1789,16 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
@ -5,10 +5,10 @@ Subject: [PATCH] Allow chests to be placed with NBT data
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index 533f2fd1a7c63180385ef544cba2b1d29c00b481..c5683f76f6f11246dc5bbaa13dfc253e5e286590 100644
|
||||
index 6c82bb01db0431080425bfa65ab67ce703194214..9126aa0c988824ce89ffa724ae9895105184d0f1 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -338,6 +338,7 @@ public final class ItemStack {
|
||||
@@ -339,6 +339,7 @@ public final class ItemStack {
|
||||
enuminteractionresult = InteractionResult.FAIL; // cancel placement
|
||||
// PAIL: Remove this when MC-99075 fixed
|
||||
placeEvent.getPlayer().updateInventory();
|
||||
@ -17,10 +17,10 @@ index 533f2fd1a7c63180385ef544cba2b1d29c00b481..c5683f76f6f11246dc5bbaa13dfc253e
|
||||
world.preventPoiUpdated = true; // CraftBukkit - SPIGOT-5710
|
||||
for (BlockState blockstate : blocks) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java
|
||||
index f2c9755c2b55bee2a0b981313e1fcd1f8ab5e3d8..52de9852f87d346714a950b60a0004d386ac10f0 100644
|
||||
index ff8e05038c1c2fa630f2d4efe460a313d209da8d..e56f7d76b501dab7d549efd2fafd514a9625c24e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java
|
||||
@@ -239,7 +239,7 @@ public class ChestBlockEntity extends RandomizableContainerBlockEntity implement
|
||||
@@ -238,7 +238,7 @@ public class ChestBlockEntity extends RandomizableContainerBlockEntity implement
|
||||
// CraftBukkit start
|
||||
@Override
|
||||
public boolean onlyOpCanSetNbt() {
|
@ -151,10 +151,10 @@ index 0000000000000000000000000000000000000000..8c9f0c6c38627beded373ca29f1989ae
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/Path.java b/src/main/java/net/minecraft/world/level/pathfinder/Path.java
|
||||
index 31d4431a60e742e2ca3b1a2abcce33954f599488..f4b6c2bf74884c0b53956788dcfcca784cfafca2 100644
|
||||
index 5f59b2bd26571d16e04f2b6a5ded8f8fb7c4e31e..bdc221f5b1eccff017c5eace11f4ea2540329f1d 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/pathfinder/Path.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/pathfinder/Path.java
|
||||
@@ -20,6 +20,7 @@ public class Path {
|
||||
@@ -21,6 +21,7 @@ public class Path {
|
||||
private final BlockPos target;
|
||||
private final float distToTarget;
|
||||
private final boolean reached;
|
||||
@ -163,7 +163,7 @@ index 31d4431a60e742e2ca3b1a2abcce33954f599488..f4b6c2bf74884c0b53956788dcfcca78
|
||||
public Path(List<Node> nodes, BlockPos target, boolean reachesTarget) {
|
||||
this.nodes = nodes;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||
index ee84ae1baf959a496a4228edab89b9c0079bc615..140672d03dd2563d2b1fb905d79164ff53cf0b76 100644
|
||||
index 219bdf53a860628335efe92d4f294a5fa52087b2..b0d348061487110993b6c4c8a7dc7208f27361b3 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||
@@ -12,8 +12,11 @@ import org.bukkit.loot.LootTable;
|
@ -5,7 +5,7 @@ Subject: [PATCH] Implement an API for CanPlaceOn and CanDestroy NBT values
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
index 71320d9484842be3a694117de25159f3581bd2a3..0aa7854119ab876f0e46bb7667282d79d2a57e3d 100644
|
||||
index ec26116dcaa2b1ba71498323d3b7624aad49dbbf..9d4685698ed707239b071a366eebbc4b8450683c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
@@ -83,6 +83,12 @@ import org.bukkit.persistence.PersistentDataContainer;
|
||||
@ -125,7 +125,7 @@ index 71320d9484842be3a694117de25159f3581bd2a3..0aa7854119ab876f0e46bb7667282d79
|
||||
+
|
||||
String internal = SerializableMeta.getString(map, "internal", true);
|
||||
if (internal != null) {
|
||||
ByteArrayInputStream buf = new ByteArrayInputStream(Base64.decodeBase64(internal));
|
||||
ByteArrayInputStream buf = new ByteArrayInputStream(Base64.getDecoder().decode(internal));
|
||||
@@ -647,6 +723,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
if (this.hasDamage()) {
|
||||
itemTag.putInt(DAMAGE.NBT, damage);
|
@ -5,10 +5,10 @@ Subject: [PATCH] Prevent chunk loading from Fluid Flowing
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
||||
index 21e2ffc105b7b573b19c826a5877ed726156e692..6e3e873efa1f50f53cb6503bde8a981f9cefd006 100644
|
||||
index 4be8fbe06ee97d5fe8f99d5d8137ac7302ffec91..18e24f400289fdfca0bf33ea0f93badeef3e46eb 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
||||
@@ -176,7 +176,8 @@ public abstract class FlowingFluid extends Fluid {
|
||||
@@ -175,7 +175,8 @@ public abstract class FlowingFluid extends Fluid {
|
||||
Direction enumdirection = (Direction) entry.getKey();
|
||||
FluidState fluid1 = (FluidState) entry.getValue();
|
||||
BlockPos blockposition1 = pos.relative(enumdirection);
|
||||
@ -18,21 +18,22 @@ index 21e2ffc105b7b573b19c826a5877ed726156e692..6e3e873efa1f50f53cb6503bde8a981f
|
||||
|
||||
if (this.canSpreadTo(world, pos, blockState, enumdirection, blockposition1, iblockdata1, world.getFluidState(blockposition1), fluid1.getType())) {
|
||||
// CraftBukkit start
|
||||
@@ -203,7 +204,8 @@ public abstract class FlowingFluid extends Fluid {
|
||||
@@ -202,7 +203,9 @@ public abstract class FlowingFluid extends Fluid {
|
||||
while (iterator.hasNext()) {
|
||||
Direction enumdirection = (Direction) iterator.next();
|
||||
BlockPos blockposition1 = pos.relative(enumdirection);
|
||||
- BlockState iblockdata1 = world.getBlockState(blockposition1);
|
||||
+
|
||||
+ BlockState iblockdata1 = world.getTypeIfLoaded(blockposition1); // Paper
|
||||
+ if (iblockdata1 == null) continue; // Paper
|
||||
FluidState fluid = iblockdata1.getFluidState();
|
||||
|
||||
if (fluid.getType().isSame((Fluid) this) && this.canPassThroughWall(enumdirection, (BlockGetter) world, pos, state, blockposition1, iblockdata1)) {
|
||||
@@ -320,11 +322,18 @@ public abstract class FlowingFluid extends Fluid {
|
||||
if (fluid.getType().isSame(this) && this.canPassThroughWall(enumdirection, world, pos, state, blockposition1, iblockdata1)) {
|
||||
@@ -319,11 +322,18 @@ public abstract class FlowingFluid extends Fluid {
|
||||
if (enumdirection1 != enumdirection) {
|
||||
BlockPos blockposition2 = blockposition.relative(enumdirection1);
|
||||
short short0 = FlowingFluid.getCacheKey(blockposition1, blockposition2);
|
||||
- Pair<BlockState, FluidState> pair = (Pair) short2objectmap.computeIfAbsent(short0, (k) -> {
|
||||
- Pair<BlockState, FluidState> pair = (Pair) short2objectmap.computeIfAbsent(short0, (short1) -> {
|
||||
- BlockState iblockdata1 = world.getBlockState(blockposition2);
|
||||
+ // Paper start - avoid loading chunks
|
||||
+ Pair<BlockState, FluidState> pair = short2objectmap.get(short0);
|
||||
@ -51,11 +52,11 @@ index 21e2ffc105b7b573b19c826a5877ed726156e692..6e3e873efa1f50f53cb6503bde8a981f
|
||||
BlockState iblockdata1 = (BlockState) pair.getFirst();
|
||||
FluidState fluid = (FluidState) pair.getSecond();
|
||||
|
||||
@@ -396,11 +405,16 @@ public abstract class FlowingFluid extends Fluid {
|
||||
@@ -395,11 +405,16 @@ public abstract class FlowingFluid extends Fluid {
|
||||
Direction enumdirection = (Direction) iterator.next();
|
||||
BlockPos blockposition1 = pos.relative(enumdirection);
|
||||
short short0 = FlowingFluid.getCacheKey(pos, blockposition1);
|
||||
- Pair<BlockState, FluidState> pair = (Pair) short2objectmap.computeIfAbsent(short0, (j) -> {
|
||||
- Pair<BlockState, FluidState> pair = (Pair) short2objectmap.computeIfAbsent(short0, (short1) -> {
|
||||
- BlockState iblockdata1 = world.getBlockState(blockposition1);
|
||||
-
|
||||
- return Pair.of(iblockdata1, iblockdata1.getFluidState());
|
@ -5,7 +5,7 @@ Subject: [PATCH] Prevent Mob AI Rules from Loading Chunks
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java
|
||||
index b255eed15cfc7282167a9bed01653b34bb8d13f1..ac5779319081a6894373877067edf958da8a9cf5 100644
|
||||
index 4a67daa7ee7f8c0fcb37c2a0fdba158485343a1f..a618b50ac8448528ac6ac64b400fa3d0882dbaf9 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java
|
||||
@@ -133,7 +133,9 @@ public class RemoveBlockGoal extends MoveToBlockGoal {
|
@ -6,10 +6,10 @@ Subject: [PATCH] Prevent mob spawning from loading/generating chunks
|
||||
also prevents if out of world border bounds
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
index ca0fcf46e67deb07a3fdb071b771a7603e0fc3d0..c8b9877135aebf1f500ab9b00d94dde0e846d247 100644
|
||||
index 831799937d4e1f31dbf7caaf0c6b38762ccec127..86cdb9ea888b85424285fc26534dc7a7ad3610ac 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
@@ -193,9 +193,9 @@ public final class NaturalSpawner {
|
||||
@@ -196,9 +196,9 @@ public final class NaturalSpawner {
|
||||
StructureFeatureManager structuremanager = world.structureFeatureManager();
|
||||
ChunkGenerator chunkgenerator = world.getChunkSource().getGenerator();
|
||||
int i = pos.getY();
|
||||
@ -21,12 +21,12 @@ index ca0fcf46e67deb07a3fdb071b771a7603e0fc3d0..c8b9877135aebf1f500ab9b00d94dde0
|
||||
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos();
|
||||
int j = 0;
|
||||
int k = 0;
|
||||
@@ -224,7 +224,7 @@ public final class NaturalSpawner {
|
||||
@@ -227,7 +227,7 @@ public final class NaturalSpawner {
|
||||
if (entityhuman != null) {
|
||||
double d2 = entityhuman.distanceToSqr(d0, (double) i, d1);
|
||||
|
||||
- if (NaturalSpawner.isRightDistanceToPlayerAndSpawnPoint(world, chunk, blockposition_mutableblockposition, d2)) {
|
||||
+ if (world.isLoadedAndInBounds(blockposition_mutableblockposition) && NaturalSpawner.isRightDistanceToPlayerAndSpawnPoint(world, chunk, blockposition_mutableblockposition, d2)) { // Paper - don't load chunks for mob spawn
|
||||
if (biomesettingsmobs_c == null) {
|
||||
Optional<MobSpawnSettings.SpawnerData> optional = NaturalSpawner.getRandomSpawnMobAt(world, structuremanager, chunkgenerator, group, world.random, (BlockPos) blockposition_mutableblockposition);
|
||||
Optional<MobSpawnSettings.SpawnerData> optional = NaturalSpawner.getRandomSpawnMobAt(world, structuremanager, chunkgenerator, group, world.random, blockposition_mutableblockposition);
|
||||
|
@ -11,7 +11,7 @@ to the nearest Integer when updating its current cook time.
|
||||
Modified by: Eric Su <ericsu@alumni.usc.edu>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||
index 265fa3cb96b7d39194a7e83b8b77b811bc3e8b40..02ded982bc36ce6530c92e18a079dc0bec729273 100644
|
||||
index 6c33b524d81ccd8ed060c3a9067cb1b669c7660d..fd1fb954ef1eb2624939a5c5d0d2c258d3398ff2 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||
@@ -73,6 +73,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||
@ -42,7 +42,7 @@ index 265fa3cb96b7d39194a7e83b8b77b811bc3e8b40..02ded982bc36ce6530c92e18a079dc0b
|
||||
ContainerHelper.saveAllItems(nbt, this.items);
|
||||
CompoundTag nbttagcompound1 = new CompoundTag();
|
||||
|
||||
@@ -346,7 +353,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||
@@ -345,7 +352,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||
CraftItemStack source = CraftItemStack.asCraftMirror(blockEntity.items.get(0));
|
||||
CookingRecipe<?> recipe = (CookingRecipe<?>) irecipe.toBukkitRecipe();
|
||||
|
||||
@ -51,7 +51,7 @@ index 265fa3cb96b7d39194a7e83b8b77b811bc3e8b40..02ded982bc36ce6530c92e18a079dc0b
|
||||
world.getCraftServer().getPluginManager().callEvent(event);
|
||||
|
||||
blockEntity.cookingTotalTime = event.getTotalCookTime();
|
||||
@@ -354,9 +361,9 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||
@@ -353,9 +360,9 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||
// CraftBukkit end
|
||||
|
||||
++blockEntity.cookingProgress;
|
||||
@ -63,7 +63,7 @@ index 265fa3cb96b7d39194a7e83b8b77b811bc3e8b40..02ded982bc36ce6530c92e18a079dc0b
|
||||
if (AbstractFurnaceBlockEntity.burn(blockEntity.level, blockEntity.worldPosition, irecipe, blockEntity.items, i)) { // CraftBukkit
|
||||
blockEntity.setRecipeUsed(irecipe);
|
||||
}
|
||||
@@ -456,9 +463,13 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||
@@ -455,9 +462,13 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,7 +79,7 @@ index 265fa3cb96b7d39194a7e83b8b77b811bc3e8b40..02ded982bc36ce6530c92e18a079dc0b
|
||||
|
||||
public static boolean isFuel(ItemStack stack) {
|
||||
return AbstractFurnaceBlockEntity.getFuel().containsKey(stack.getItem());
|
||||
@@ -527,7 +538,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||
@@ -526,7 +537,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||
}
|
||||
|
||||
if (slot == 0 && !flag) {
|
@ -13,7 +13,7 @@ Shulkers) may need to be changed in order for it to re-save properly
|
||||
No more crashing though.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
|
||||
index 1c09656bfed70ead0f0d182be4f84f1a97b3cf1e..f1135616657692a2611dde02e2dc5ac4d8127269 100644
|
||||
index 170b3cbc89793bb92e249383d86a5f0c756d5004..3b10ef3801ffd47707836b3ed3482e99ddd0050b 100644
|
||||
--- a/src/main/java/net/minecraft/server/MCUtil.java
|
||||
+++ b/src/main/java/net/minecraft/server/MCUtil.java
|
||||
@@ -7,6 +7,8 @@ import it.unimi.dsi.fastutil.objects.ObjectRBTreeSet;
|
||||
@ -69,7 +69,7 @@ index 04a3627667498b841fbff547d1874d99cc708af4..2e6172930526efc536a214e420e690a5
|
||||
|
||||
if (nbt.contains("TrackOutput", 1)) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java
|
||||
index e07c9e7e37a2c6aa3fc4b7fdc2d547d9c8a2177e..83f27ede626fc7e263acf2c9417a2c2699e4c79a 100644
|
||||
index 8854901b439cdeddc528e02fa5f8539869556a3c..c72ec5b38fe8a234eb31065dfa88698dfbb6c054 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java
|
||||
@@ -10,6 +10,7 @@ import net.minecraft.nbt.ListTag;
|
||||
@ -78,9 +78,9 @@ index e07c9e7e37a2c6aa3fc4b7fdc2d547d9c8a2177e..83f27ede626fc7e263acf2c9417a2c26
|
||||
import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket;
|
||||
+import net.minecraft.server.MCUtil;
|
||||
import net.minecraft.world.Nameable;
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraft.world.item.DyeColor;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
@@ -95,7 +96,7 @@ public class BannerBlockEntity extends BlockEntity implements Nameable {
|
||||
@@ -97,7 +98,7 @@ public class BannerBlockEntity extends BlockEntity implements Nameable {
|
||||
public void load(CompoundTag nbt) {
|
||||
super.load(nbt);
|
||||
if (nbt.contains("CustomName", 8)) {
|
||||
@ -90,7 +90,7 @@ index e07c9e7e37a2c6aa3fc4b7fdc2d547d9c8a2177e..83f27ede626fc7e263acf2c9417a2c26
|
||||
|
||||
this.itemPatterns = nbt.getList("Patterns", 10);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
|
||||
index 16fd9b356fee79b56893fe0a7c71721ae81664ab..67e39ebc7984d47bdf9081c24cb26845d70b83bb 100644
|
||||
index cfd1e2fbc029d928daa2d9f12df393c8cf30e850..d9ed3c53187febbc6c835286d6db17b508dbf71a 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
|
||||
@@ -5,6 +5,7 @@ import net.minecraft.core.BlockPos;
|
@ -8,7 +8,7 @@ our own relocation. Also lets us rewrite NMS calls for when we're
|
||||
debugging in an IDE pre-relocate.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
index a79c62e1c3ee49ada505c07b1171b439beeb4bdf..cbf630243410f97c21b14f654e81dc96b0323b70 100644
|
||||
index a679133a3de51e26eb19932ece9ade292879aefd..d5330d1dff2d02e585eba3ec7c48bf261cdce8ef 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
@@ -6,7 +6,9 @@ import java.io.FileOutputStream;
|
||||
@ -167,7 +167,7 @@ index a79c62e1c3ee49ada505c07b1171b439beeb4bdf..cbf630243410f97c21b14f654e81dc96
|
||||
if ( owner.equals( "org/bukkit/block/Biome" ) )
|
||||
{
|
||||
switch ( name )
|
||||
@@ -273,6 +387,14 @@ public class Commodore
|
||||
@@ -306,6 +420,14 @@ public class Commodore
|
||||
return;
|
||||
}
|
||||
|
@ -9,10 +9,10 @@ SpawnerSpawnEvent gets called instead of the CreatureSpawnEvent for
|
||||
spawners.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
index 572328fafb2347886900352983fd5b6490b0dd68..8c266bd81b9350b056067d83415bf2b581e19c94 100644
|
||||
index ef0b18dba50916c4c717c2e6bd55a5e4d60f225f..36d1bdef298cecd84fdaa400f414f2798a9a49bb 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
@@ -139,11 +139,11 @@ public abstract class BaseSpawner {
|
||||
@@ -128,11 +128,11 @@ public abstract class BaseSpawner {
|
||||
|
||||
org.bukkit.entity.EntityType type = org.bukkit.entity.EntityType.fromName(key);
|
||||
if (type != null) {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add LivingEntity#getTargetEntity
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 1c35ba0d74aa02b0a94400308c20485ccaad7a13..a7aa62e52105b7adb7725f7abeae376df8f7bb3e 100644
|
||||
index d61375bdd0cff7dfd74dd5dc1e6803e6320aa82a..5d47b536e89f192b10aa1434cd9cdccc49cd3eec 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -116,6 +116,7 @@ import net.minecraft.world.level.storage.loot.LootTable;
|
||||
@@ -113,6 +113,7 @@ import net.minecraft.world.level.storage.loot.LootTable;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
@ -16,7 +16,7 @@ index 1c35ba0d74aa02b0a94400308c20485ccaad7a13..a7aa62e52105b7adb7725f7abeae376d
|
||||
import net.minecraft.world.phys.HitResult;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraft.world.scores.PlayerTeam;
|
||||
@@ -3736,6 +3737,38 @@ public abstract class LivingEntity extends Entity {
|
||||
@@ -3735,6 +3736,38 @@ public abstract class LivingEntity extends Entity {
|
||||
return level.clip(raytrace);
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ index 1c35ba0d74aa02b0a94400308c20485ccaad7a13..a7aa62e52105b7adb7725f7abeae376d
|
||||
|
||||
public int getShieldBlockingDelay() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 873b70c36d145a14632102c9e92d501745064fa4..c396ad36084e46c4b812d970e07a9188aed16daf 100644
|
||||
index 9c024b46522e2984ed662538302fbac68a77fd86..fb0e0c629d16bc97efc3e91f7ba6fe9e87fc950b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -1,5 +1,6 @@
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add sun related API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 034c2886b4e29be40fa2e5e213a7457d803c0f55..a6884bde5e6e717c5f37b0b96070b44f1253ce35 100644
|
||||
index 7f4024dbc1a0c50af9344689561de54eb35e1c98..8615d4abbf18ab105ca7edffa10e8122ef76add3 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -664,6 +664,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@ -23,7 +23,7 @@ index 034c2886b4e29be40fa2e5e213a7457d803c0f55..a6884bde5e6e717c5f37b0b96070b44f
|
||||
public long getGameTime() {
|
||||
return world.levelData.getGameTime();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||
index 140672d03dd2563d2b1fb905d79164ff53cf0b76..e0022ea4bf228eef8384f20cfc717076c5ca5c99 100644
|
||||
index b0d348061487110993b6c4c8a7dc7208f27361b3..d7bc601f2cb4e22565eeebb2d8ebe051748de92a 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||
@@ -80,4 +80,11 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Turtle API
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
|
||||
index 70a51ba19fb34f652858b18f24554261787d97e2..27ea9c10b7f66c2133b0829c0b1c37143dd80b56 100644
|
||||
index dabdce6332c267c3b82698010e284b34dcc0c083..8d8cce87acc5a93afb4b8925a5a5dbf71d371fcd 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
|
||||
@@ -14,7 +14,7 @@ public abstract class MoveToBlockGoal extends Goal {
|
||||
@ -18,31 +18,23 @@ index 70a51ba19fb34f652858b18f24554261787d97e2..27ea9c10b7f66c2133b0829c0b1c3714
|
||||
private final int searchRange;
|
||||
private final int verticalSearchRange;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Turtle.java b/src/main/java/net/minecraft/world/entity/animal/Turtle.java
|
||||
index 3ba8fafcd5de584209dd30cadb8e76a46dac4bc8..00dbe5046c3b93e402218a6903ea2f087410388b 100644
|
||||
index 44679e3b44b03dc20b3763af84df655d81680c06..60e1111f3c2c43398f21c541248f38524f41f4fb 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Turtle.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Turtle.java
|
||||
@@ -11,6 +11,7 @@ import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
import net.minecraft.network.syncher.EntityDataSerializers;
|
||||
import net.minecraft.network.syncher.SynchedEntityData;
|
||||
+import net.minecraft.server.MCUtil;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
@@ -487,14 +488,17 @@ public class Turtle extends Animal {
|
||||
@@ -484,14 +484,17 @@ public class Turtle extends Animal {
|
||||
|
||||
if (!this.turtle.isInWater() && this.isReachedTarget()) {
|
||||
if (this.turtle.layEggCounter < 1) {
|
||||
- this.turtle.setLayingEgg(true);
|
||||
+ this.turtle.setLayingEgg(new com.destroystokyo.paper.event.entity.TurtleStartDiggingEvent((org.bukkit.entity.Turtle) this.turtle.getBukkitEntity(), MCUtil.toLocation(this.turtle.level, this.getTargetPosition())).callEvent()); // Paper
|
||||
} else if (this.turtle.layEggCounter > 200) {
|
||||
+ this.turtle.setLayingEgg(new com.destroystokyo.paper.event.entity.TurtleStartDiggingEvent((org.bukkit.entity.Turtle) this.turtle.getBukkitEntity(), net.minecraft.server.MCUtil.toLocation(this.turtle.level, this.getTargetPosition())).callEvent()); // Paper
|
||||
} else if (this.turtle.layEggCounter > this.adjustedTickDelay(200)) {
|
||||
Level world = this.turtle.level;
|
||||
|
||||
// CraftBukkit start
|
||||
- if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.turtle, this.blockPos.above(), (BlockState) Blocks.TURTLE_EGG.defaultBlockState().setValue(TurtleEggBlock.EGGS, this.turtle.random.nextInt(4) + 1)).isCancelled()) {
|
||||
+ // Paper start
|
||||
+ int eggCount = this.turtle.random.nextInt(4) + 1;
|
||||
+ com.destroystokyo.paper.event.entity.TurtleLayEggEvent layEggEvent = new com.destroystokyo.paper.event.entity.TurtleLayEggEvent((org.bukkit.entity.Turtle) this.turtle.getBukkitEntity(), MCUtil.toLocation(this.turtle.level, this.blockPos.above()), eggCount);
|
||||
+ com.destroystokyo.paper.event.entity.TurtleLayEggEvent layEggEvent = new com.destroystokyo.paper.event.entity.TurtleLayEggEvent((org.bukkit.entity.Turtle) this.turtle.getBukkitEntity(), net.minecraft.server.MCUtil.toLocation(this.turtle.level, this.blockPos.above()), eggCount);
|
||||
+ if (layEggEvent.callEvent() && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.turtle, this.blockPos.above(), Blocks.TURTLE_EGG.defaultBlockState().setValue(TurtleEggBlock.EGGS, layEggEvent.getEggCount())).isCancelled()) {
|
||||
world.playSound((Player) null, blockposition, SoundEvents.TURTLE_LAY_EGG, SoundSource.BLOCKS, 0.3F, 0.9F + world.random.nextFloat() * 0.2F);
|
||||
- world.setBlock(this.blockPos.above(), (BlockState) Blocks.TURTLE_EGG.defaultBlockState().setValue(TurtleEggBlock.EGGS, this.turtle.random.nextInt(4) + 1), 3);
|
||||
@ -50,12 +42,12 @@ index 3ba8fafcd5de584209dd30cadb8e76a46dac4bc8..00dbe5046c3b93e402218a6903ea2f08
|
||||
}
|
||||
// CraftBukkit end
|
||||
this.turtle.setHasEgg(false);
|
||||
@@ -562,7 +566,7 @@ public class Turtle extends Animal {
|
||||
@@ -559,7 +562,7 @@ public class Turtle extends Animal {
|
||||
|
||||
@Override
|
||||
public boolean canUse() {
|
||||
- return this.turtle.isBaby() ? false : (this.turtle.hasEgg() ? true : (this.turtle.getRandom().nextInt(700) != 0 ? false : !this.turtle.getHomePos().closerThan((Position) this.turtle.position(), 64.0D)));
|
||||
+ return this.turtle.isBaby() ? false : (this.turtle.hasEgg() ? true : (this.turtle.getRandom().nextInt(700) != 0 ? false : !this.turtle.getHomePos().closerThan((Position) this.turtle.position(), 64.0D))) && new com.destroystokyo.paper.event.entity.TurtleGoHomeEvent((org.bukkit.entity.Turtle) this.turtle.getBukkitEntity()).callEvent(); // Paper
|
||||
- return this.turtle.isBaby() ? false : (this.turtle.hasEgg() ? true : (this.turtle.getRandom().nextInt(reducedTickDelay(700)) != 0 ? false : !this.turtle.getHomePos().closerThan((Position) this.turtle.position(), 64.0D)));
|
||||
+ return this.turtle.isBaby() ? false : (this.turtle.hasEgg() ? true : (this.turtle.getRandom().nextInt(reducedTickDelay(700)) != 0 ? false : !this.turtle.getHomePos().closerThan((Position) this.turtle.position(), 64.0D))) && new com.destroystokyo.paper.event.entity.TurtleGoHomeEvent((org.bukkit.entity.Turtle) this.turtle.getBukkitEntity()).callEvent(); // Paper
|
||||
}
|
||||
|
||||
@Override
|
@ -19,24 +19,24 @@ spectate the target entity.
|
||||
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 4cfbb920abad262d42553270455f0cd09dbdcb1a..c4f433832dc439830fc1584d36a197066fdb3e75 100644
|
||||
index a2e2b6ea166bf64fe5b49672a6c6f86af3776638..4a8afc06f58bb608055a0fabc587bf06a7110232 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1823,14 +1823,58 @@ public class ServerPlayer extends Player {
|
||||
@@ -1850,14 +1850,58 @@ public class ServerPlayer extends Player {
|
||||
}
|
||||
|
||||
public void setCamera(Entity entity) {
|
||||
public void setCamera(@Nullable Entity entity) {
|
||||
+ // Paper start - Add PlayerStartSpectatingEntityEvent and PlayerStopSpectatingEntity Event and improve implementation
|
||||
Entity entity1 = this.getCamera();
|
||||
|
||||
- this.camera = (Entity) (entity == null ? this : entity);
|
||||
- if (entity1 != this.camera) {
|
||||
- this.connection.send(new ClientboundSetCameraPacket(this.camera));
|
||||
- this.connection.b(this.camera.getX(), this.camera.getY(), this.camera.getZ(), this.getYRot(), this.getXRot(), TeleportCause.SPECTATE); // CraftBukkit
|
||||
- this.connection.teleport(this.camera.getX(), this.camera.getY(), this.camera.getZ(), this.getYRot(), this.getXRot(), TeleportCause.SPECTATE); // CraftBukkit
|
||||
+ if (entity == null) {
|
||||
+ entity = this;
|
||||
}
|
||||
|
||||
+ }
|
||||
+
|
||||
+ if (entity1 == entity) return; // new spec target is the current spec target
|
||||
+
|
||||
+ if (entity == this) {
|
||||
@ -63,8 +63,8 @@ index 4cfbb920abad262d42553270455f0cd09dbdcb1a..c4f433832dc439830fc1584d36a19706
|
||||
+ MinecraftServer.LOGGER.debug("Blocking frozen player " + this + " from spectating entity " + entity);
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
}
|
||||
|
||||
+ this.camera = entity; // only set after validating state
|
||||
+
|
||||
+ if (entity != this) {
|
Loading…
Reference in New Issue
Block a user