Updated Upstream (Paper, Tuinity, & Airplane)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
d4532f7e7 bug #5373 - fix AsyncChatEvent not being posted when processing a legacy APCE continuation
522ae1c51 Replace all block states of a specified block (#5055)
1cda67118 [Auto] Updated Upstream (CraftBukkit)

Tuinity Changes:
44e8e5de5 Do not load extra radius of chunks when loading a single chunk
31f9cae05 Revert custom table implementation for blockstate states
9ac33d168 Be aware of entity teleports when chunk checking entities
18c7f3f59 Always set impluse for projectiles to true, even if hit failed

Airplane Changes:
0f8044393 Update Upstream (Tuinity)
2f6cbdc74 More debug for plugins not shutting down tasks
12e1b6169 Update Upstream (Tuinity)
fc778d30b Update README.md
b23bee302 Remove debug
8157e9838 Config style, flare style, disable tracker by def
98d0b589b Updates to README
This commit is contained in:
BillyGalbreath
2021-03-17 13:45:42 -05:00
parent 45b9a18cd9
commit 297181ed5e
17 changed files with 170 additions and 461 deletions

2
Paper

Submodule Paper updated: 8c74d31264...d4532f7e70

View File

@@ -419,6 +419,19 @@ index 5bb677ce585b856b3d3e589e29786a29619c56a7..613f00fa387dcc5af3191e550dea9d4d
public class CachedSizeConcurrentLinkedQueue<E> extends ConcurrentLinkedQueue<E> {
private final LongAdder cachedSize = new LongAdder();
diff --git a/src/main/java/io/papermc/paper/inventory/ItemRarity.java b/src/main/java/io/papermc/paper/inventory/ItemRarity.java
index 74ef8395cc040ce488c2acaa416db20272cc2734..b974627a415cd6897b245275e953cc907a5929d8 100644
--- a/src/main/java/io/papermc/paper/inventory/ItemRarity.java
+++ b/src/main/java/io/papermc/paper/inventory/ItemRarity.java
@@ -19,7 +19,7 @@ public enum ItemRarity {
/**
* Gets the color formatting associated with the rarity.
- * @return
+ * @return TextColor
*/
@NotNull
public TextColor getColor() {
diff --git a/src/main/java/io/papermc/paper/world/MoonPhase.java b/src/main/java/io/papermc/paper/world/MoonPhase.java
index df05153397b42930cd53d37b30824c7e5f008f7e..ebf70fea04a9d37aa5f2ad8e7d6cef73cd3a4541 100644
--- a/src/main/java/io/papermc/paper/world/MoonPhase.java

View File

@@ -169,7 +169,7 @@ permanent authorization for you to choose that version for the
Library.
diff --git a/pom.xml b/pom.xml
index 9ba379b7e3ee3bc8c6d2c8ec46213c404c73d682..e83e4241a56fe131a75fe21cc1518992c089da2c 100644
index 11b4d56922cae5ba3f76c21a76a8ae40b3719afa..d9b46ca2fb2ec8f76f3c781d9250fdc68ad7e363 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,11 +1,11 @@
@@ -235,7 +235,7 @@ index 9ba379b7e3ee3bc8c6d2c8ec46213c404c73d682..e83e4241a56fe131a75fe21cc1518992
<!-- deprecated API depend -->
<dependency>
<groupId>com.googlecode.json-simple</groupId>
@@ -149,6 +152,13 @@
@@ -149,19 +152,26 @@
<version>4.8.47</version>
<scope>test</scope>
</dependency>
@@ -248,9 +248,6 @@ index 9ba379b7e3ee3bc8c6d2c8ec46213c404c73d682..e83e4241a56fe131a75fe21cc1518992
+ </dependency>
</dependencies>
<repositories>
@@ -173,15 +183,15 @@
<!-- This builds a completely 'ready to start' jar with all dependencies inside -->
<build>
- <finalName>paper-${minecraft.version}</finalName>
@@ -8904,172 +8901,6 @@ index 0000000000000000000000000000000000000000..606417a8aeaca2682595f417bba8e9d4
+ }
+ }
+}
diff --git a/src/main/java/com/tuinity/tuinity/util/table/ZeroCollidingReferenceStateTable.java b/src/main/java/com/tuinity/tuinity/util/table/ZeroCollidingReferenceStateTable.java
new file mode 100644
index 0000000000000000000000000000000000000000..298d09634effcb06cd2237a1f7f903e9e46ec78d
--- /dev/null
+++ b/src/main/java/com/tuinity/tuinity/util/table/ZeroCollidingReferenceStateTable.java
@@ -0,0 +1,160 @@
+package com.tuinity.tuinity.util.table;
+
+import com.google.common.collect.Table;
+import net.minecraft.server.IBlockDataHolder;
+import net.minecraft.server.IBlockState;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+public final class ZeroCollidingReferenceStateTable {
+
+ // upper 32 bits: starting index
+ // lower 32 bits: bitset for contained ids
+ protected final long[] this_index_table;
+ protected final Comparable<?>[] this_table;
+ protected final IBlockDataHolder<?, ?> this_state;
+
+ protected long[] index_table;
+ protected IBlockDataHolder<?, ?>[][] value_table;
+
+ public ZeroCollidingReferenceStateTable(final IBlockDataHolder<?, ?> state, final Map<IBlockState<?>, Comparable<?>> this_map) {
+ this.this_state = state;
+ this.this_index_table = this.create_table(this_map.keySet());
+
+ int max_id = -1;
+ for (final IBlockState<?> property : this_map.keySet()) {
+ final int id = lookup_vindex(property, this.this_index_table);
+ if (id > max_id) {
+ max_id = id;
+ }
+ }
+
+ this.this_table = new Comparable[max_id + 1];
+ for (final Map.Entry<IBlockState<?>, Comparable<?>> entry : this_map.entrySet()) {
+ this.this_table[lookup_vindex(entry.getKey(), this.this_index_table)] = entry.getValue();
+ }
+ }
+
+ public void loadInTable(final Table<IBlockState<?>, Comparable<?>, IBlockDataHolder<?, ?>> table,
+ final Map<IBlockState<?>, Comparable<?>> this_map) {
+ final Set<IBlockState<?>> combined = new HashSet<>(table.rowKeySet());
+ combined.addAll(this_map.keySet());
+
+ this.index_table = this.create_table(combined);
+
+ int max_id = -1;
+ for (final IBlockState<?> property : combined) {
+ final int id = lookup_vindex(property, this.index_table);
+ if (id > max_id) {
+ max_id = id;
+ }
+ }
+
+ this.value_table = new IBlockDataHolder[max_id + 1][];
+
+ final Map<IBlockState<?>, Map<Comparable<?>, IBlockDataHolder<?, ?>>> map = table.rowMap();
+ for (final IBlockState<?> property : map.keySet()) {
+ final Map<Comparable<?>, IBlockDataHolder<?, ?>> propertyMap = map.get(property);
+
+ final int id = lookup_vindex(property, this.index_table);
+ final IBlockDataHolder<?, ?>[] states = this.value_table[id] = new IBlockDataHolder[property.getValues().size()];
+
+ for (final Map.Entry<Comparable<?>, IBlockDataHolder<?, ?>> entry : propertyMap.entrySet()) {
+ if (entry.getValue() == null) {
+ // TODO what
+ continue;
+ }
+
+ states[((IBlockState)property).getIdFor(entry.getKey())] = entry.getValue();
+ }
+ }
+
+
+ for (final Map.Entry<IBlockState<?>, Comparable<?>> entry : this_map.entrySet()) {
+ final IBlockState<?> property = entry.getKey();
+ final int index = lookup_vindex(property, this.index_table);
+
+ if (this.value_table[index] == null) {
+ this.value_table[index] = new IBlockDataHolder[property.getValues().size()];
+ }
+
+ this.value_table[index][((IBlockState)property).getIdFor(entry.getValue())] = this.this_state;
+ }
+ }
+
+
+ protected long[] create_table(final Collection<IBlockState<?>> collection) {
+ int max_id = -1;
+ for (final IBlockState<?> property : collection) {
+ final int id = property.getId();
+ if (id > max_id) {
+ max_id = id;
+ }
+ }
+
+ final long[] ret = new long[((max_id + 1) + 31) >>> 5]; // ceil((max_id + 1) / 32)
+
+ for (final IBlockState<?> property : collection) {
+ final int id = property.getId();
+
+ ret[id >>> 5] |= (1L << (id & 31));
+ }
+
+ int total = 0;
+ for (int i = 1, len = ret.length; i < len; ++i) {
+ ret[i] |= (long)(total += Long.bitCount(ret[i - 1] & 0xFFFFFFFFL)) << 32;
+ }
+
+ return ret;
+ }
+
+ public Comparable<?> get(final IBlockState<?> state) {
+ final Comparable<?>[] table = this.this_table;
+ final int index = lookup_vindex(state, this.this_index_table);
+
+ if (index < 0 || index >= table.length) {
+ return null;
+ }
+ return table[index];
+ }
+
+ public IBlockDataHolder<?, ?> get(final IBlockState<?> property, final Comparable<?> with) {
+ final int withId = ((IBlockState)property).getIdFor(with);
+ if (withId < 0) {
+ return null;
+ }
+
+ final int index = lookup_vindex(property, this.index_table);
+ final IBlockDataHolder<?, ?>[][] table = this.value_table;
+ if (index < 0 || index >= table.length) {
+ return null;
+ }
+
+ final IBlockDataHolder<?, ?>[] values = table[index];
+
+ if (withId >= values.length) {
+ return null;
+ }
+
+ return values[withId];
+ }
+
+ protected static int lookup_vindex(final IBlockState<?> property, final long[] index_table) {
+ final int id = property.getId();
+ final long bitset_mask = (1L << (id & 31));
+ final long lower_mask = bitset_mask - 1;
+ final int index = id >>> 5;
+ if (index >= index_table.length) {
+ return -1;
+ }
+ final long index_value = index_table[index];
+ final long contains_check = ((index_value & bitset_mask) - 1) >> (Long.SIZE - 1); // -1L if doesn't contain
+
+ // index = total bits set in lower table values (upper 32 bits of index_value) plus total bits set in lower indices below id
+ // contains_check is 0 if the bitset had id set, else it's -1: so index is unaffected if contains_check == 0,
+ // otherwise it comes out as -1.
+ return (int)(((index_value >>> 32) + Long.bitCount(index_value & lower_mask)) | contains_check);
+ }
+}
diff --git a/src/main/java/com/tuinity/tuinity/voxel/AABBVoxelShape.java b/src/main/java/com/tuinity/tuinity/voxel/AABBVoxelShape.java
new file mode 100644
index 0000000000000000000000000000000000000000..002abb3cbf0f742e685f2f043d2600de03e37a19
@@ -10525,80 +10356,6 @@ index 2d887af902a33b0e28d8f0a6ac2e59c815a7856e..2291135eaef64c403183724cb6e413cd
@Override
public BlockPosition immutableCopy() {
diff --git a/src/main/java/net/minecraft/server/BlockStateBoolean.java b/src/main/java/net/minecraft/server/BlockStateBoolean.java
index 4ca8db630434915de4eaeac6c4ecd60714d7f5d9..d6c8ae638b3993ce55be91087de09a300405e075 100644
--- a/src/main/java/net/minecraft/server/BlockStateBoolean.java
+++ b/src/main/java/net/minecraft/server/BlockStateBoolean.java
@@ -12,6 +12,13 @@ public class BlockStateBoolean extends IBlockState<Boolean> {
super(s, Boolean.class);
}
+ // Tuinity start - optimise iblockdata state lookup
+ @Override
+ public final int getIdFor(final Boolean value) {
+ return value.booleanValue() ? 1 : 0;
+ }
+ // Tuinity end - optimise iblockdata state lookup
+
@Override
public Collection<Boolean> getValues() {
return this.a;
diff --git a/src/main/java/net/minecraft/server/BlockStateEnum.java b/src/main/java/net/minecraft/server/BlockStateEnum.java
index 8dc620b22bb904aa6a82e2127aa9da861986525c..e6663281481a48fe1b838339160565fbf4c6a65a 100644
--- a/src/main/java/net/minecraft/server/BlockStateEnum.java
+++ b/src/main/java/net/minecraft/server/BlockStateEnum.java
@@ -17,6 +17,15 @@ public class BlockStateEnum<T extends Enum<T> & INamable> extends IBlockState<T>
private final ImmutableSet<T> a;
private final Map<String, T> b = Maps.newHashMap();
+ // Tuinity start - optimise iblockdata state lookup
+ private int[] idLookupTable;
+
+ @Override
+ public final int getIdFor(final T value) {
+ return this.idLookupTable[value.ordinal()];
+ }
+ // Tuinity end - optimise iblockdata state lookup
+
protected BlockStateEnum(String s, Class<T> oclass, Collection<T> collection) {
super(s, oclass);
this.a = ImmutableSet.copyOf(collection);
@@ -32,6 +41,14 @@ public class BlockStateEnum<T extends Enum<T> & INamable> extends IBlockState<T>
this.b.put(s1, t0);
}
+ // Tuinity start - optimise iblockdata state lookup
+ int id = 0;
+ this.idLookupTable = new int[oclass.getEnumConstants().length];
+ java.util.Arrays.fill(this.idLookupTable, -1);
+ for (final T value : this.getValues()) {
+ this.idLookupTable[value.ordinal()] = id++;
+ }
+ // Tuinity end - optimise iblockdata state lookup
}
diff --git a/src/main/java/net/minecraft/server/BlockStateInteger.java b/src/main/java/net/minecraft/server/BlockStateInteger.java
index 36b84446e96faefad3b783f73df74e0f3bce8255..acae5fe0bff44d2bc3921c8e078b2f261de3a035 100644
--- a/src/main/java/net/minecraft/server/BlockStateInteger.java
+++ b/src/main/java/net/minecraft/server/BlockStateInteger.java
@@ -13,6 +13,16 @@ public class BlockStateInteger extends IBlockState<Integer> {
public final int min;
public final int max;
+ // Tuinity start - optimise iblockdata state lookup
+ @Override
+ public final int getIdFor(final Integer value) {
+ final int val = value.intValue();
+ final int ret = val - this.min;
+
+ return ret | ((this.max - ret) >> 31);
+ }
+ // Tuinity end - optimise iblockdata state lookup
+
protected BlockStateInteger(String s, int i, int j) {
super(s, Integer.class);
this.min = i;
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 3bcd63a754538ccfc5965207a8fc79faa31925c0..8e59a794f6190930cb7bb81a2fe1a1d374dacce7 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
@@ -12559,20 +12316,19 @@ index 534238688be75c53058dcfeabcdf86d9c0504089..2ec48858be8eb2c522c9685b43bd36b3
int j = MathHelper.floor(d1);
int k = MathHelper.floor(d2);
diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java
index 1e7f5957d879d1ba8cf2b29cf9397b8e204e4381..77ddda8bd5b8a37ed51324e9769da4978173e744 100644
index 1e7f5957d879d1ba8cf2b29cf9397b8e204e4381..7532e4e6fc561645e7e7a4f703025af77825b0bd 100644
--- a/src/main/java/net/minecraft/server/EntityArrow.java
+++ b/src/main/java/net/minecraft/server/EntityArrow.java
@@ -173,8 +173,10 @@ public abstract class EntityArrow extends IProjectile {
@@ -173,7 +173,9 @@ public abstract class EntityArrow extends IProjectile {
// Paper end
if (object != null && !flag) {
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, (MovingObjectPosition) object)) { // CraftBukkit - Call event // Paper - make cancellable // Tuinity - implement cancellation properly
this.a((MovingObjectPosition) object);
this.impulse = true;
+ } // Tuinity - implement cancellation properly
this.impulse = true;
}
if (movingobjectpositionentity == null || this.getPierceLevel() <= 0) {
@@ -507,7 +509,8 @@ public abstract class EntityArrow extends IProjectile {
}
itemstack = item.getItemStack();
@@ -12627,20 +12383,19 @@ index 0840fdf3585407ec317f0326359619220c64db78..6b9b64539d2272070b523ed6b927de02
// CraftBukkit start - Fire ProjectileHitEvent
if (this.dead) {
diff --git a/src/main/java/net/minecraft/server/EntityFireworks.java b/src/main/java/net/minecraft/server/EntityFireworks.java
index 9bc4d3dbd4c64a6fbf33dcf28afde59ace9171ba..d8faa18724baa240fca78a35c362cf661615ec4d 100644
index 9bc4d3dbd4c64a6fbf33dcf28afde59ace9171ba..7ec62d734542d64809c71776eb865ff8ca51dc7f 100644
--- a/src/main/java/net/minecraft/server/EntityFireworks.java
+++ b/src/main/java/net/minecraft/server/EntityFireworks.java
@@ -125,8 +125,10 @@ public class EntityFireworks extends IProjectile {
@@ -125,7 +125,9 @@ public class EntityFireworks extends IProjectile {
MovingObjectPosition movingobjectposition = ProjectileHelper.a((Entity) this, this::a);
if (!this.noclip) {
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition)) { // CraftBukkit - Call event // Paper - make cancellable // Tuinity - implement cancellation properly
this.a(movingobjectposition);
this.impulse = true;
+ } // Tuinity - implement cancellation properly
this.impulse = true;
}
this.x();
diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java
index 3580f40b2bb30bceca0ce374edb29608168a00c0..9841c7c27cd296a5156ba79ab734d45922bacaf7 100644
--- a/src/main/java/net/minecraft/server/EntityFishingHook.java
@@ -13099,106 +12854,6 @@ index c4a83448ed4513f6e4ab179d1d43e5bb0cb13641..5ccf6b483fe15d4ad12ce2d3d11e9440
Vec3D vec3d = raytrace1.b();
Vec3D vec3d1 = raytrace1.a();
VoxelShape voxelshape = raytrace1.a(iblockdata, this, blockposition);
diff --git a/src/main/java/net/minecraft/server/IBlockDataHolder.java b/src/main/java/net/minecraft/server/IBlockDataHolder.java
index b19c694cf01bc868dd7c4ec6432b613d19f2ca40..06d2dd7584253a406aa77867fac5543aa01020fd 100644
--- a/src/main/java/net/minecraft/server/IBlockDataHolder.java
+++ b/src/main/java/net/minecraft/server/IBlockDataHolder.java
@@ -39,11 +39,13 @@ public abstract class IBlockDataHolder<O, S> {
private final ImmutableMap<IBlockState<?>, Comparable<?>> b;
private Table<IBlockState<?>, Comparable<?>, S> e;
protected final MapCodec<S> d;
+ protected com.tuinity.tuinity.util.table.ZeroCollidingReferenceStateTable optimisedTable; // Tuinity - optimise state lookup
protected IBlockDataHolder(O o0, ImmutableMap<IBlockState<?>, Comparable<?>> immutablemap, MapCodec<S> mapcodec) {
this.c = o0;
this.b = immutablemap;
this.d = mapcodec;
+ this.optimisedTable = new com.tuinity.tuinity.util.table.ZeroCollidingReferenceStateTable(this, immutablemap); // Tuinity - optimise state lookup
}
public <T extends Comparable<T>> S a(IBlockState<T> iblockstate) {
@@ -85,11 +87,11 @@ public abstract class IBlockDataHolder<O, S> {
public <T extends Comparable<T>> boolean contains(IBlockState<T> iblockstate) { return this.b(iblockstate); } // Paper - OBFHELPER
public <T extends Comparable<T>> boolean b(IBlockState<T> iblockstate) {
- return this.b.containsKey(iblockstate);
+ return this.optimisedTable.get(iblockstate) != null; // Tuinity - optimise state lookup
}
public <T extends Comparable<T>> T get(IBlockState<T> iblockstate) {
- Comparable<?> comparable = (Comparable) this.b.get(iblockstate);
+ final Comparable<?> comparable = this.optimisedTable.get(iblockstate); // Tuinity - optimise state lookup
if (comparable == null) {
throw new IllegalArgumentException("Cannot get property " + iblockstate + " as it does not exist in " + this.c);
@@ -99,27 +101,21 @@ public abstract class IBlockDataHolder<O, S> {
}
public <T extends Comparable<T>> Optional<T> d(IBlockState<T> iblockstate) {
- Comparable<?> comparable = (Comparable) this.b.get(iblockstate);
+ final Comparable<?> comparable = this.optimisedTable.get(iblockstate); // Tuinity - optimise state lookup
return comparable == null ? Optional.empty() : Optional.of(iblockstate.getType().cast(comparable));
}
public <T extends Comparable<T>, V extends T> S set(IBlockState<T> iblockstate, V v0) {
- Comparable<?> comparable = (Comparable) this.b.get(iblockstate);
+ // Tuinity start - optimise state lookup
+ final S ret = (S)this.optimisedTable.get(iblockstate, v0);
- if (comparable == null) {
- throw new IllegalArgumentException("Cannot set property " + iblockstate + " as it does not exist in " + this.c);
- } else if (comparable == v0) {
- return (S) this; // Paper - decompile error
- } else {
- S s0 = this.e.get(iblockstate, v0);
-
- if (s0 == null) {
- throw new IllegalArgumentException("Cannot set property " + iblockstate + " to " + v0 + " on " + this.c + ", it is not an allowed value");
- } else {
- return s0;
- }
+ if (ret == null) {
+ throw new IllegalArgumentException("Cannot set property " + iblockstate + " to " + v0 + " on " + this.c + ", it is not an allowed value");
}
+
+ return ret;
+ // Tuinity end - optimise state lookup
}
public void a(Map<Map<IBlockState<?>, Comparable<?>>, S> map) {
@@ -143,7 +139,8 @@ public abstract class IBlockDataHolder<O, S> {
}
}
- this.e = (Table) (table.isEmpty() ? table : ArrayTable.create(table));
+ this.e = (Table) (table.isEmpty() ? table : ArrayTable.create(table)); this.optimisedTable.loadInTable((Table)this.e, this.b); // Tuinity - optimise state lookup
+
}
}
diff --git a/src/main/java/net/minecraft/server/IBlockState.java b/src/main/java/net/minecraft/server/IBlockState.java
index 6550b55067db31dbbc903fe17a13849383651c5a..30344d1e5703690d97ecb889af24fa5e7b35f895 100644
--- a/src/main/java/net/minecraft/server/IBlockState.java
+++ b/src/main/java/net/minecraft/server/IBlockState.java
@@ -15,6 +15,17 @@ public abstract class IBlockState<T extends Comparable<T>> {
private final Codec<T> d;
private final Codec<IBlockState.a<T>> e;
+ // Tuinity start - optimise iblockdata state lookup
+ private static final java.util.concurrent.atomic.AtomicInteger ID_GENERATOR = new java.util.concurrent.atomic.AtomicInteger();
+ private final int id = ID_GENERATOR.getAndIncrement();
+
+ public final int getId() {
+ return this.id;
+ }
+
+ public abstract int getIdFor(final T value);
+ // Tuinity end - optimise state lookup
+
protected IBlockState(String s, Class<T> oclass) {
this.d = Codec.STRING.comapFlatMap((s1) -> this.b(s1).map(DataResult::success).orElseGet(() -> { // Paper - decompile error
return DataResult.error("Unable to read property: " + this + " with value: " + s1);
diff --git a/src/main/java/net/minecraft/server/IChunkAccess.java b/src/main/java/net/minecraft/server/IChunkAccess.java
index 180b6b58dc5663158db84b6f1257591439b48c31..eb0d794b7275af7f860e7c7b85a9e3b2aa4a863f 100644
--- a/src/main/java/net/minecraft/server/IChunkAccess.java
@@ -15471,7 +15126,7 @@ index 904c6a7d0a36b57bb4f693fc4fd0dd5b17adcbac..dcf13e62264f97384fb2f6c30cbc183a
if (chunk != null) {
playerchunkmap.callbackExecutor.execute(() -> {
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 00d0a5fd7c5d2db19756f3c6cfb2381868af51fd..3e0bf6df7c4608a5b19024612db52558fd722f4b 100644
index 00d0a5fd7c5d2db19756f3c6cfb2381868af51fd..945d16f57317406bff3cbe20756677eccfba1525 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -49,6 +49,7 @@ import java.util.stream.Collectors;
@@ -15956,6 +15611,15 @@ index 00d0a5fd7c5d2db19756f3c6cfb2381868af51fd..3e0bf6df7c4608a5b19024612db52558
if (!this.updatingChunksModified) {
return false;
} else {
@@ -1105,7 +1206,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
if (ichunkaccess.getChunkStatus().b(chunkstatus)) {
CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> completablefuture1; // Paper
- if (chunkstatus == ChunkStatus.LIGHT) {
+ if (!com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine && chunkstatus == ChunkStatus.LIGHT) { // Tuinity - we use edge checks, so loading 1 radius neighbours isn't necessary
completablefuture1 = this.b(playerchunk, chunkstatus);
} else {
completablefuture1 = chunkstatus.a(this.world, this.definedStructureManager, this.lightEngine, (ichunkaccess1) -> {
@@ -1135,6 +1236,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
this.getVillagePlace().loadInData(chunkcoordintpair, chunkHolder.poiData);
@@ -19323,7 +18987,7 @@ index 6e82c1d1b272a95144bfc78d34b630c24466fa3e..6b4c007550c3e2e405314d8931630557
return this.j.d();
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index cf7d94aabab600822eb5e27f38690b06456d5fcc..a77fceac7c9e79a6bac05becc21bcb6bf2a1a7c7 100644
index cf7d94aabab600822eb5e27f38690b06456d5fcc..18d21f21c10974d21d17abe2f9319cdc7fd51eea 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -55,12 +55,13 @@ import org.bukkit.event.server.MapInitializeEvent;
@@ -20041,19 +19705,50 @@ index cf7d94aabab600822eb5e27f38690b06456d5fcc..a77fceac7c9e79a6bac05becc21bcb6b
if (entity.inChunk && this.isChunkLoaded(entity.chunkX, entity.chunkZ)) {
this.getChunkAt(entity.chunkX, entity.chunkZ).a(entity, entity.chunkY);
}
@@ -943,6 +1460,11 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -941,8 +1458,41 @@ public class WorldServer extends World implements GeneratorAccessSeed {
entity.inChunk = false;
} else {
this.getChunkAt(i, k).a(entity);
}
- this.getChunkAt(i, k).a(entity);
+ // Tuinity start - gotta be careful here, sync load can teleport entity.
+ Chunk chunk = this.getChunkIfLoaded(i, k);
+ if (chunk == null) {
+ // might teleport the entity, so be prepared.
+ // at this point, we are NOT in a chunk. so CLEARLY mark that for a recursive call to see.
+ entity.inChunk = false;
+ // now load
+ chunk = this.getChunkAt(i, k);
+ // are we in a chunk now?
+ if (entity.inChunk) {
+ // yup we teleported and were added to another chunk. do not add to the current one!
+ return;
+ }
+ // did we teleport but did not add to a chunk?
+ // copied from start
+ int in = MathHelper.floor(entity.locX() / 16.0D);
+ int jn = Math.min(15, Math.max(0, MathHelper.floor(entity.locY() / 16.0D))); // Paper - stay consistent with chunk add/remove behavior
+ int kn = MathHelper.floor(entity.locZ() / 16.0D);
+ if (in != i || jn != j || kn != k) {
+ // teleported but were not added to a chunk. try now, let the new call try to add again
+ this.chunkCheck(entity);
+ return;
+ }
+
+ // only now at this point have we verified the new load did not screw up our position, so
+ // now we can add to the chunk
+ }
+ chunk.a(entity);
+ // Tuinity end - gotta be careful here, sync load can teleport entity.
+ }
+ // Tuinity start
+ if (entity.inChunk && (oldRegionX != newRegionX || oldRegionZ != newRegionZ)) {
+ this.addNavigatorsIfPathingToRegion(entity);
+ }
}
+ // Tuinity end
}
this.getMethodProfiler().exit();
@@ -1279,9 +1801,13 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1279,9 +1829,13 @@ public class WorldServer extends World implements GeneratorAccessSeed {
// Spigot Start
for (TileEntity tileentity : chunk.getTileEntities().values()) {
if (tileentity instanceof IInventory) {
@@ -20068,7 +19763,7 @@ index cf7d94aabab600822eb5e27f38690b06456d5fcc..a77fceac7c9e79a6bac05becc21bcb6b
}
}
// Spigot End
@@ -1298,7 +1824,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1298,7 +1852,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
Entity entity = (Entity) iterator.next();
if (!(entity instanceof EntityPlayer)) {
@@ -20077,7 +19772,7 @@ index cf7d94aabab600822eb5e27f38690b06456d5fcc..a77fceac7c9e79a6bac05becc21bcb6b
throw (IllegalStateException) SystemUtils.c((Throwable) (new IllegalStateException("Removing entity while ticking!")));
}
@@ -1326,6 +1852,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1326,6 +1880,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
public void unregisterEntity(Entity entity) {
org.spigotmc.AsyncCatcher.catchOp("entity unregister"); // Spigot
@@ -20085,7 +19780,7 @@ index cf7d94aabab600822eb5e27f38690b06456d5fcc..a77fceac7c9e79a6bac05becc21bcb6b
// Paper start - fix entity registration issues
if (entity instanceof EntityComplexPart) {
// Usually this is a no-op for complex parts, and ID's should be removed, but go ahead and remove it anyways
@@ -1392,17 +1919,76 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1392,17 +1947,76 @@ public class WorldServer extends World implements GeneratorAccessSeed {
this.getScoreboard().a(entity);
// CraftBukkit start - SPIGOT-5278
if (entity instanceof EntityDrowned) {
@@ -20165,7 +19860,7 @@ index cf7d94aabab600822eb5e27f38690b06456d5fcc..a77fceac7c9e79a6bac05becc21bcb6b
private void registerEntity(Entity entity) {
org.spigotmc.AsyncCatcher.catchOp("entity register"); // Spigot
// Paper start - don't double enqueue entity registration
@@ -1413,7 +1999,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1413,7 +2027,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
return;
}
// Paper end
@@ -20174,7 +19869,7 @@ index cf7d94aabab600822eb5e27f38690b06456d5fcc..a77fceac7c9e79a6bac05becc21bcb6b
if (!entity.isQueuedForRegister) { // Paper
this.entitiesToAdd.add(entity);
entity.isQueuedForRegister = true; // Paper
@@ -1421,6 +2007,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1421,6 +2035,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
} else {
entity.isQueuedForRegister = false; // Paper
this.entitiesById.put(entity.getId(), entity);
@@ -20182,7 +19877,7 @@ index cf7d94aabab600822eb5e27f38690b06456d5fcc..a77fceac7c9e79a6bac05becc21bcb6b
if (entity instanceof EntityEnderDragon) {
EntityComplexPart[] aentitycomplexpart = ((EntityEnderDragon) entity).eJ();
int i = aentitycomplexpart.length;
@@ -1429,6 +2016,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1429,6 +2044,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
EntityComplexPart entitycomplexpart = aentitycomplexpart[j];
this.entitiesById.put(entitycomplexpart.getId(), entitycomplexpart);
@@ -20190,7 +19885,7 @@ index cf7d94aabab600822eb5e27f38690b06456d5fcc..a77fceac7c9e79a6bac05becc21bcb6b
}
}
@@ -1453,12 +2041,16 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1453,12 +2069,16 @@ public class WorldServer extends World implements GeneratorAccessSeed {
// this.getChunkProvider().addEntity(entity); // Paper - moved down below valid=true
// CraftBukkit start - SPIGOT-5278
if (entity instanceof EntityDrowned) {
@@ -20210,7 +19905,7 @@ index cf7d94aabab600822eb5e27f38690b06456d5fcc..a77fceac7c9e79a6bac05becc21bcb6b
}
entity.valid = true; // CraftBukkit
this.getChunkProvider().addEntity(entity); // Paper - from above to be below valid=true
@@ -1474,7 +2066,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1474,7 +2094,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
}
public void removeEntity(Entity entity) {
@@ -20219,7 +19914,7 @@ index cf7d94aabab600822eb5e27f38690b06456d5fcc..a77fceac7c9e79a6bac05becc21bcb6b
throw (IllegalStateException) SystemUtils.c((Throwable) (new IllegalStateException("Removing entity while ticking!")));
} else {
this.removeEntityFromChunk(entity);
@@ -1570,20 +2162,33 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1570,20 +2190,33 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@Override
public void notify(BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1, int i) {
@@ -20255,7 +19950,7 @@ index cf7d94aabab600822eb5e27f38690b06456d5fcc..a77fceac7c9e79a6bac05becc21bcb6b
} catch (java.util.ConcurrentModificationException ex) {
// This can happen because the pathfinder update below may trigger a chunk load, which in turn may cause more navigators to register
// In this case we just run the update again across all the iterators as the chunk will then be loaded
@@ -1597,6 +2202,9 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1597,6 +2230,9 @@ public class WorldServer extends World implements GeneratorAccessSeed {
navigationabstract.b(blockposition);
}
}

View File

@@ -626,7 +626,7 @@ copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
diff --git a/pom.xml b/pom.xml
index e83e4241a56fe131a75fe21cc1518992c089da2c..fa4ff553ae58285201d773a538eeda2b40c89c4a 100644
index d9b46ca2fb2ec8f76f3c781d9250fdc68ad7e363..1c8ff351df082c4afe8c722b3132e4446e9b42e7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -27,8 +27,8 @@
@@ -640,7 +640,7 @@ index e83e4241a56fe131a75fe21cc1518992c089da2c..fa4ff553ae58285201d773a538eeda2b
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
@@ -159,6 +159,13 @@
@@ -159,8 +159,23 @@
<version>1.1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
@@ -653,19 +653,17 @@ index e83e4241a56fe131a75fe21cc1518992c089da2c..fa4ff553ae58285201d773a538eeda2b
+ </dependency>
</dependencies>
<repositories>
@@ -172,6 +179,11 @@
<id>spigotmc-public</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
</repository>
+ <repositories>
+ <!-- Airplane - Flare -->
+ <repository>
+ <id>jitpack.io</id>
+ <url>https://jitpack.io</url>
+ </repository>
</repositories>
<pluginRepositories>
+ </repositories>
+
<!-- This builds a completely 'ready to start' jar with all dependencies inside -->
<build>
<finalName>tuinity-${minecraft.version}</finalName>
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
index 52c0ab1ce46e1f3233ef746d9bc699356fa9fae4..b480bd3044370b8eb733166f0c4b737344475993 100644
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
@@ -800,10 +798,10 @@ index 0000000000000000000000000000000000000000..1fa9b40e2f89272fa8bc9d927a9a852b
+}
diff --git a/src/main/java/gg/airplane/AirplaneConfig.java b/src/main/java/gg/airplane/AirplaneConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..424325ada75b788ce390378d8df0116e5c50cf3d
index 0000000000000000000000000000000000000000..3886c731a69540f638d57a411285da289d3b704b
--- /dev/null
+++ b/src/main/java/gg/airplane/AirplaneConfig.java
@@ -0,0 +1,107 @@
@@ -0,0 +1,108 @@
+package gg.airplane;
+
+import gg.airplane.manual.ManualParser;
@@ -828,8 +826,9 @@ index 0000000000000000000000000000000000000000..424325ada75b788ce390378d8df0116e
+
+ manual.get("info.version", "1.0");
+ manual.setComment("info",
+ " Airplane Configuration",
+ " Please see https://airplane.gg/config for help.");
+ "Airplane Configuration",
+ "Read https://blog.airplane.gg/ to find out more about Airplane",
+ "Join our Discord to receive support & optimization help: https://discord.gg/3gtc45q");
+
+ for (Method method : AirplaneConfig.class.getDeclaredMethods()) {
+ if (Modifier.isStatic(method.getModifiers()) && Modifier.isPrivate(method.getModifiers())) {
@@ -897,7 +896,7 @@ index 0000000000000000000000000000000000000000..424325ada75b788ce390378d8df0116e
+ }
+
+
+ public static boolean multithreadedEntityTracker = true;
+ public static boolean multithreadedEntityTracker = false;
+ public static boolean entityTrackerAsyncPackets = false;
+
+ private static void entityTracker() {
@@ -1037,21 +1036,21 @@ index 0000000000000000000000000000000000000000..f4976428bc721319d2926e97cbe0f64c
+}
diff --git a/src/main/java/gg/airplane/flare/FlareCommand.java b/src/main/java/gg/airplane/flare/FlareCommand.java
new file mode 100644
index 0000000000000000000000000000000000000000..e3ef62ae97b8b92459e1c405525790ba2172df01
index 0000000000000000000000000000000000000000..ddc90f1589e683f452c5a74d9d2408803edea029
--- /dev/null
+++ b/src/main/java/gg/airplane/flare/FlareCommand.java
@@ -0,0 +1,159 @@
@@ -0,0 +1,149 @@
+package gg.airplane.flare;
+
+import com.google.common.collect.ImmutableList;
+import gg.airplane.AirplaneConfig;
+import gg.airplane.flare.exceptions.UserReportableException;
+import gg.airplane.flare.profiling.AsyncProfilerIntegration;
+import net.md_5.bungee.api.ChatColor;
+import net.md_5.bungee.api.chat.BaseComponent;
+import net.md_5.bungee.api.chat.ClickEvent;
+import net.md_5.bungee.api.chat.ComponentBuilder;
+import net.md_5.bungee.api.chat.TextComponent;
+import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.event.ClickEvent;
+import net.kyori.adventure.text.format.NamedTextColor;
+import net.kyori.adventure.text.format.TextColor;
+import net.kyori.adventure.text.format.TextDecoration;
+import org.bukkit.Bukkit;
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandSender;
@@ -1066,21 +1065,14 @@ index 0000000000000000000000000000000000000000..e3ef62ae97b8b92459e1c405525790ba
+public class FlareCommand extends Command {
+
+ private static final String BASE_URL = "https://blog.airplane.gg/flare-tutorial/#setting-the-access-token";
+ private static final ChatColor HEX = ChatColor.of("#6a7eda");
+ private static final BaseComponent[] PREFIX = new ComponentBuilder("Flare ✈ ")
+ .color(HEX)
+ .bold(true)
+ .create();
+
+ private static ComponentBuilder create(ComponentBuilder newBuilder) {
+ newBuilder.color(HEX);
+ newBuilder.bold(false);
+
+ ComponentBuilder builder = new ComponentBuilder();
+ builder.append(PREFIX);
+ builder.append(newBuilder.create());
+ return builder;
+ }
+ private static final TextColor HEX = TextColor.fromHexString("#e3eaea");
+ private static final Component PREFIX = Component.text()
+ .append(Component.text("Flare ✈")
+ .color(TextColor.fromHexString("#6a7eda"))
+ .decoration(TextDecoration.BOLD, true)
+ .append(Component.text(" ", HEX)
+ .decoration(TextDecoration.BOLD, false)))
+ .asComponent();
+
+ public FlareCommand() {
+ super("flare", "Profile your server with Flare", "/flare", Collections.singletonList("profile"));
@@ -1091,36 +1083,28 @@ index 0000000000000000000000000000000000000000..e3ef62ae97b8b92459e1c405525790ba
+ public boolean execute(CommandSender sender, String commandLabel, String[] args) {
+ if (!testPermission(sender)) return true;
+ if (AirplaneConfig.accessToken.length() == 0) {
+ BaseComponent clickable = new TextComponent(BASE_URL);
+ clickable.setUnderlined(true);
+ clickable.setColor(HEX);
+ clickable.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, BASE_URL));
+ Component clickable = Component.text(BASE_URL, HEX, TextDecoration.UNDERLINED).clickEvent(ClickEvent.clickEvent(ClickEvent.Action.OPEN_URL, BASE_URL));
+
+ sender.sendMessage(create(new ComponentBuilder("Flare currently requires an access token to use. To learn more, visit ")
+ .color(HEX)
+ .append(clickable)
+ )
+ .create());
+ sender.sendMessage(PREFIX.append(Component.text("Flare currently requires an access token to use. To learn more, visit ").color(HEX).append(clickable)));
+ return true;
+ }
+
+ if (AsyncProfilerIntegration.doesNotSupportProfiling()) {
+ sender.sendMessage(create(new ComponentBuilder("Profiling is not supported in this environment, reason: " + AsyncProfilerIntegration.getDisabledReason())
+ .color(ChatColor.RED)
+ ).create());
+ sender.sendMessage(PREFIX.append(
+ Component.text("Profiling is not supported in this environment, reason: " + AsyncProfilerIntegration.getDisabledReason(), NamedTextColor.RED)));
+ return true;
+ }
+ if (ProfilingManager.isProfiling()) {
+ if (args.length == 1 && args[0].equalsIgnoreCase("status")) {
+ sender.sendMessage(create(new ComponentBuilder("Status: " + AsyncProfilerIntegration.status())).create());
+ sender.sendMessage(PREFIX.append(Component.text("Status: " + AsyncProfilerIntegration.status(), HEX)));
+ return true;
+ }
+ if (ProfilingManager.stop()) {
+ if (!(sender instanceof ConsoleCommandSender)) {
+ sender.sendMessage(create(new ComponentBuilder("Profiling has been stopped.")).create());
+ sender.sendMessage(PREFIX.append(Component.text("Profiling has been stopped.", HEX)));
+ }
+ } else {
+ sender.sendMessage(create(new ComponentBuilder("Profiling has already been stopped.")).create());
+ sender.sendMessage(PREFIX.append(Component.text("Profiling has already been stopped.", HEX)));
+ }
+ } else {
+ ProfileType profileType = null;
@@ -1128,10 +1112,11 @@ index 0000000000000000000000000000000000000000..e3ef62ae97b8b92459e1c405525790ba
+ try {
+ profileType = ProfileType.valueOf(args[0].toUpperCase());
+ } catch (Exception e) {
+ sender.sendMessage(create(new ComponentBuilder("Invalid profile type ")
+ .append(args[0]).color(ChatColor.BOLD)
+ .append("!").color(HEX)).create());
+ return false;
+ sender.sendMessage(PREFIX.append(Component
+ .text("Invalid profile type ", HEX)
+ .append(Component.text(args[0], HEX, TextDecoration.BOLD)
+ .append(Component.text("!", HEX)))
+ ));
+ }
+ }
+ int interval = 5;
@@ -1139,10 +1124,12 @@ index 0000000000000000000000000000000000000000..e3ef62ae97b8b92459e1c405525790ba
+ try {
+ interval = Integer.parseInt(args[1]);
+ } catch (Exception e) {
+ sender.sendMessage(create(new ComponentBuilder("Invalid time in milliseconds ")
+ .append(args[1]).color(HEX).bold(true)
+ .append("!").color(HEX)).create());
+ return false;
+ sender.sendMessage(PREFIX.append(Component
+ .text("Invalid time in milliseconds ", HEX)
+ .append(Component.text(args[1], HEX, TextDecoration.BOLD)
+ .append(Component.text("!", HEX)))
+ ));
+ return true;
+ }
+ }
+ int finalInterval = interval;
@@ -1151,18 +1138,20 @@ index 0000000000000000000000000000000000000000..e3ef62ae97b8b92459e1c405525790ba
+ try {
+ if (ProfilingManager.start(finalProfileType, finalInterval)) {
+ if (!(sender instanceof ConsoleCommandSender)) {
+ sender.sendMessage(create(new ComponentBuilder("Profiling has been started: " + ProfilingManager.getProfilingUrl().get())
+ .event(new ClickEvent(ClickEvent.Action.OPEN_URL, ProfilingManager.getProfilingUrl().get())))
+ .create());
+ sender.sendMessage(create(new ComponentBuilder(" Run /" + commandLabel + " to stop profiling.")).create());
+ sender.sendMessage(PREFIX.append(Component
+ .text("Flare has been started: " + ProfilingManager.getProfilingUrl().get(), HEX)
+ .clickEvent(ClickEvent.openUrl(ProfilingManager.getProfilingUrl().get()))
+ ));
+ sender.sendMessage(PREFIX.append(Component.text(" Run /" + commandLabel + " to stop the Flare.", HEX)));
+ }
+ } else {
+ sender.sendMessage(create(new ComponentBuilder("Profiling has already been started: " + ProfilingManager.getProfilingUrl().get())
+ .event(new ClickEvent(ClickEvent.Action.OPEN_URL, ProfilingManager.getProfilingUrl().get())))
+ .create());
+ sender.sendMessage(PREFIX.append(Component
+ .text("Flare has already been started: " + ProfilingManager.getProfilingUrl().get(), HEX)
+ .clickEvent(ClickEvent.openUrl(ProfilingManager.getProfilingUrl().get()))
+ ));
+ }
+ } catch (UserReportableException e) {
+ sender.sendMessage(create(new ComponentBuilder("Profiling failed to start: " + e.getUserError())).create());
+ sender.sendMessage(Component.text("Flare failed to start: " + e.getUserError(), NamedTextColor.RED));
+ e.printStackTrace();
+ }
+ });
@@ -2528,7 +2517,7 @@ index 3ebe3d0dc4c2c6aee6ea349006a74cbe5aa8e78f..7b80f6f08f274fd1adff114a81919bf4
if (d2 > d1 * d1) {
return false;
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 3e0bf6df7c4608a5b19024612db52558fd722f4b..e5e8d066661a0dee1c07ba0c855204cb81459da5 100644
index 945d16f57317406bff3cbe20756677eccfba1525..05250a66202cf7f6c8b7dba5e70682ed4d354156 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -651,7 +651,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -3019,7 +3008,7 @@ index bf06ef09cfd4d7618365249d1332d264d8ff1377..996fa5b4652f847f4e64d4cd191fe5a5
// Paper start - Prevent armor stands from doing entity lookups
@Override
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index a77fceac7c9e79a6bac05becc21bcb6bf2a1a7c7..f4eb878f9a66fd3404ddde5a14924bb419a351db 100644
index 18d21f21c10974d21d17abe2f9319cdc7fd51eea..a2b8aa9ebef69535a8560e4eef42471e58e84e7f 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -968,11 +968,12 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -3137,7 +3126,7 @@ index a77fceac7c9e79a6bac05becc21bcb6bf2a1a7c7..f4eb878f9a66fd3404ddde5a14924bb4
if (isActive) { // Paper - EAR 2
TimingHistory.activatedEntityTicks++; // Paper
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index f994e99ebc8fe22e6f6b45f6379ec410a598789f..ec8ad7a51f62c699588b5804331a5d33ab1fa5a7 100644
index f994e99ebc8fe22e6f6b45f6379ec410a598789f..ea91e1a9b99a42c462befa8245dea029ea536e01 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -232,7 +232,7 @@ import javax.annotation.Nullable; // Paper
@@ -3149,6 +3138,18 @@ index f994e99ebc8fe22e6f6b45f6379ec410a598789f..ec8ad7a51f62c699588b5804331a5d33
private final String serverVersion;
private final String bukkitVersion = Versioning.getBukkitVersion();
private final Logger logger = Logger.getLogger("Minecraft");
@@ -978,6 +978,11 @@ public final class CraftServer implements Server {
plugin.getDescription().getName(),
"This plugin is not properly shutting down its async tasks when it is being shut down. This task may throw errors during the final shutdown logs and might not complete before process dies."
));
+ getLogger().log(Level.SEVERE, String.format("%s Stacktrace", worker.getThread().getName()));
+ StackTraceElement[] stackTrace = worker.getThread().getStackTrace();
+ for (StackTraceElement element : stackTrace) {
+ getLogger().log(Level.SEVERE, " " + element.toString());
+ }
}
}
// Paper end
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java
index 4aba511fe8078164bf1467b39645dd9bf6a931e7..56b781e438f0cf1c12dd55eb37356601e47de47f 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Rebrand
diff --git a/pom.xml b/pom.xml
index fa4ff553ae58285201d773a538eeda2b40c89c4a..02bbe784d0a062dd643e37f3ad04b77a78144828 100644
index 1c8ff351df082c4afe8c722b3132e4446e9b42e7..37569029a241a7b3439325392e21a35b719a0067 100644
--- a/pom.xml
+++ b/pom.xml
@@ -27,8 +27,10 @@
@@ -186,7 +186,7 @@ index 0000000000000000000000000000000000000000..cabfcebf9f944f7a2a2a1cffc7401435
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index ec8ad7a51f62c699588b5804331a5d33ab1fa5a7..a3cea65ab086fac48c68578c6be70b0f0c5e70a1 100644
index ea91e1a9b99a42c462befa8245dea029ea536e01..ffafb7d67f66a60a7d65cb353f24c5f9a9e15154 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -232,7 +232,7 @@ import javax.annotation.Nullable; // Paper

View File

@@ -360,7 +360,7 @@ index 0000000000000000000000000000000000000000..4904be939c7a4b1d1583fd7b6232c930
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index a3cea65ab086fac48c68578c6be70b0f0c5e70a1..a4669fe6e21c38c10979f0e25b41e296e6c08738 100644
index ffafb7d67f66a60a7d65cb353f24c5f9a9e15154..e48298f9ca28be83c3441afd8a8f0a6033ae0781 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -865,6 +865,7 @@ public final class CraftServer implements Server {
@@ -387,7 +387,7 @@ index a3cea65ab086fac48c68578c6be70b0f0c5e70a1..a4669fe6e21c38c10979f0e25b41e296
overrideAllCommandBlockCommands = commandsConfiguration.getStringList("command-block-overrides").contains("*");
ignoreVanillaPermissions = commandsConfiguration.getBoolean("ignore-vanilla-permissions");
@@ -2357,6 +2360,18 @@ public final class CraftServer implements Server {
@@ -2362,6 +2365,18 @@ public final class CraftServer implements Server {
}
// Tuinity end - add config to timings report

View File

@@ -193,7 +193,7 @@ index 9146b60cff0aa06e2f6b6003bfe9e2be9d2f0d56..bba8dc8fd10dc34179ca3c8cf471fbb3
if (from.getX() != Double.MAX_VALUE) {
Location oldTo = to.clone();
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index f4eb878f9a66fd3404ddde5a14924bb419a351db..8ac7efc7a99a740f4c3078f926b626b38e15bb74 100644
index a2b8aa9ebef69535a8560e4eef42471e58e84e7f..2d72803f1c52acf8bc069777351a3ef4d75f6e6c 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -887,7 +887,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {

View File

@@ -17,10 +17,10 @@ index 15a4f921b1ae2bbc66b7d58238b60151123a7eb3..fe5937d890762ab37a90f189c4992af3
public final boolean spawnNpcs = this.getBoolean("spawn-npcs", true);
public final boolean pvp = this.getBoolean("pvp", true);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index a4669fe6e21c38c10979f0e25b41e296e6c08738..a33f22fb3ae807dc0c4cde537a2ca6c8250419a8 100644
index e48298f9ca28be83c3441afd8a8f0a6033ae0781..e5fd26a42b3f7ca11005d3311c5f6b25f193c850 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2520,4 +2520,11 @@ public final class CraftServer implements Server {
@@ -2525,4 +2525,11 @@ public final class CraftServer implements Server {
return mobGoals;
}
// Paper end

View File

@@ -41,10 +41,10 @@ index 4627261562a1482aecf4034b8717ecccc2dd9eb0..a34ed978596f1a466b0b48e7db92ac4f
public static boolean enderChestSixRows = false;
public static boolean enderChestPermissionRows = false;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index a33f22fb3ae807dc0c4cde537a2ca6c8250419a8..780b737e5c6b073fdf4b558f31306b6703178b17 100644
index e5fd26a42b3f7ca11005d3311c5f6b25f193c850..d73e68689a5dab8efd3e5d84cffa9ae67a40518c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2526,5 +2526,10 @@ public final class CraftServer implements Server {
@@ -2531,5 +2531,10 @@ public final class CraftServer implements Server {
public String getServerName() {
return getProperties().serverName;
}

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Zombie horse naturally spawn
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 8ac7efc7a99a740f4c3078f926b626b38e15bb74..87113eff62442f350f8d97340ab868b9af721739 100644
index 2d72803f1c52acf8bc069777351a3ef4d75f6e6c..1421c3036c9a374f65f30ebfb2ccc015560ee04c 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1128,12 +1128,18 @@ public class WorldServer extends World implements GeneratorAccessSeed {

View File

@@ -47,10 +47,10 @@ index bbc92489fd2e9037834fdea3a4514b5687ae86d7..e46705e7ab5d5c69e5d2bdd29d5066c4
lagging = recentTps[0] < net.pl3x.purpur.PurpurConfig.laggingThreshold; // Purpur
tickSection = curTime;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 780b737e5c6b073fdf4b558f31306b6703178b17..0feaa113a2bd746b69a16f4fd7a11bb098580430 100644
index d73e68689a5dab8efd3e5d84cffa9ae67a40518c..e717f880a1e5f0d0ad6208e6d3c6969a7617afd6 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2306,6 +2306,7 @@ public final class CraftServer implements Server {
@@ -2311,6 +2311,7 @@ public final class CraftServer implements Server {
@Override
public double[] getTPS() {
return new double[] {

View File

@@ -22,7 +22,7 @@ index 829d4a7508e1656dbdc912096b7eafcf30cbb5b2..6aea156d7c7a9ca8a357aad6a6781d72
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 87113eff62442f350f8d97340ab868b9af721739..cc022113d68574b025142deede4219f81326d62f 100644
index 1421c3036c9a374f65f30ebfb2ccc015560ee04c..03e3c0250c399b29817285fb4f2db5714f5f66dc 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -418,14 +418,14 @@ public class WorldServer extends World implements GeneratorAccessSeed {

View File

@@ -4969,7 +4969,7 @@ index 404fcc307454e7f00dcc180dda53677c5a0f43e8..bb7cf83027ad0d0679fb208147f3481d
// Purpur end
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index cc022113d68574b025142deede4219f81326d62f..b7a17eafe7355b9c9247a9c79495134b43971aaf 100644
index 03e3c0250c399b29817285fb4f2db5714f5f66dc..dbeded3f0ede57877dc4ba01990760baa7c6b5bd 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -102,6 +102,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {

View File

@@ -42,7 +42,7 @@ index bb7cf83027ad0d0679fb208147f3481dbe280a82..42e06121f20b5366627b961299418706
this.generator = gen;
this.world = new CraftWorld((WorldServer) this, gen, env);
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index b7a17eafe7355b9c9247a9c79495134b43971aaf..5508211d5922ef8072d929a5eb38c4d34f04c686 100644
index dbeded3f0ede57877dc4ba01990760baa7c6b5bd..f2bbc31540224424dc224bbfc86c61ccf2d0e629 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -436,7 +436,24 @@ public class WorldServer extends World implements GeneratorAccessSeed {

View File

@@ -6,7 +6,7 @@ Subject: [PATCH] Despawn rate config options per projectile type
Default values of -1 respect vanilla behaviour.
diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java
index 77ddda8bd5b8a37ed51324e9769da4978173e744..10cbddae4ede09ccec3b9c459c09fa18e2211238 100644
index 7532e4e6fc561645e7e7a4f703025af77825b0bd..ee24500e63830b34dd575feed4ef8ecb021d3501 100644
--- a/src/main/java/net/minecraft/server/EntityArrow.java
+++ b/src/main/java/net/minecraft/server/EntityArrow.java
@@ -23,7 +23,7 @@ public abstract class EntityArrow extends IProjectile {
@@ -96,7 +96,7 @@ index e42dd066e76a3d2bc3270774f48bb8c8fd47cc38..44dbe818b19c927098c1e6b2bcb55637
+ // Purpur end
}
diff --git a/src/main/java/net/minecraft/server/EntityFireworks.java b/src/main/java/net/minecraft/server/EntityFireworks.java
index d8faa18724baa240fca78a35c362cf661615ec4d..e4c2bf2de6c032332b7557c240bb458297bdd33f 100644
index 7ec62d734542d64809c71776eb865ff8ca51dc7f..dad470dacd6a94d2b37ee1aff6c0d7f54fa61794 100644
--- a/src/main/java/net/minecraft/server/EntityFireworks.java
+++ b/src/main/java/net/minecraft/server/EntityFireworks.java
@@ -301,4 +301,11 @@ public class EntityFireworks extends IProjectile {

View File

@@ -18,7 +18,7 @@ index 1b9b43ee696575d986c25cafec07d863acb951a7..e837db171545ceacbc84a2b360cf0d95
public PacketPlayOutUpdateTime() {}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 5508211d5922ef8072d929a5eb38c4d34f04c686..f33b3ef2bf54eba4aa29447426f744a4f42d4b53 100644
index f2bbc31540224424dc224bbfc86c61ccf2d0e629..8146e86aacfac80f06906c8d421899fcca2be50a 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -94,6 +94,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {

View File

@@ -7,7 +7,7 @@ This prevents keeping arrows alive indefinitely (such as when the block
the arrow is stuck in gets removed, like a piston head going up/down)
diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java
index 10cbddae4ede09ccec3b9c459c09fa18e2211238..ed662d59384a718a56149ea24f01115f62c30d91 100644
index ee24500e63830b34dd575feed4ef8ecb021d3501..1c2cf3ca08671872b5641ab0b3469f947c229e41 100644
--- a/src/main/java/net/minecraft/server/EntityArrow.java
+++ b/src/main/java/net/minecraft/server/EntityArrow.java
@@ -245,7 +245,7 @@ public abstract class EntityArrow extends IProjectile {