13
0
geforkt von Mirrors/Paper

[ci skip] Small cleanup to mc utils patch

Dieser Commit ist enthalten in:
Nassim Jahnke 2024-01-12 21:58:54 +01:00
Ursprung af61e5fa1e
Commit 12960f7064
5 geänderte Dateien mit 6 neuen und 66 gelöschten Zeilen

Datei anzeigen

@ -3024,7 +3024,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class BlockBehaviour implements FeatureElement {
this.instrument = blockbase_info.instrument;
this.replaceable = blockbase_info.replaceable;
this.conditionallyFullOpaque = this.isOpaque() & this.isTransparentOnSomeFaces(); // Paper
this.conditionallyFullOpaque = this.canOcclude & this.useShapeForLightOcclusion; // Paper
+ // Paper start - optimise collisions
+ this.id1 = it.unimi.dsi.fastutil.HashCommon.murmurHash3(it.unimi.dsi.fastutil.HashCommon.murmurHash3(ID_GENERATOR.getAndIncrement() + RANDOM_OFFSET) + RANDOM_OFFSET);
+ this.id2 = it.unimi.dsi.fastutil.HashCommon.murmurHash3(it.unimi.dsi.fastutil.HashCommon.murmurHash3(ID_GENERATOR.getAndIncrement() + RANDOM_OFFSET) + RANDOM_OFFSET);

Datei anzeigen

@ -5926,26 +5926,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
public static long getEpochMillis() {
diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/core/BlockPos.java
+++ b/src/main/java/net/minecraft/core/BlockPos.java
@@ -0,0 +0,0 @@ public class BlockPos extends Vec3i {
}
}
+ // Paper start - comment out useless overrides @Override - TODO figure out why this is suddenly important to keep
@Override
public BlockPos.MutableBlockPos setX(int i) {
super.setX(i);
@@ -0,0 +0,0 @@ public class BlockPos extends Vec3i {
super.setZ(i);
return this;
}
+ // Paper end
@Override
public BlockPos immutable() {
diff --git a/src/main/java/net/minecraft/nbt/CompoundTag.java b/src/main/java/net/minecraft/nbt/CompoundTag.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/nbt/CompoundTag.java
@ -6985,14 +6965,6 @@ diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/mai
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -0,0 +0,0 @@ import org.bukkit.event.weather.LightningStrikeEvent;
import org.bukkit.event.world.GenericGameEvent;
import org.bukkit.event.world.TimeSkipEvent;
// CraftBukkit end
+import it.unimi.dsi.fastutil.ints.IntArrayList; // Paper
public class ServerLevel extends Level implements WorldGenLevel {
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel {
return this.convertable.dimensionType;
}
@ -7358,11 +7330,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return longKey; // Paper
}
- public static long asLong(int chunkX, int chunkZ) {
+ public static long asLong(int chunkX, int chunkZ) {
return (long)chunkX & 4294967295L | ((long)chunkZ & 4294967295L) << 32;
}
public static long asLong(int chunkX, int chunkZ) {
diff --git a/src/main/java/net/minecraft/world/level/EmptyBlockGetter.java b/src/main/java/net/minecraft/world/level/EmptyBlockGetter.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/EmptyBlockGetter.java
@ -7543,26 +7511,6 @@ diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
@@ -0,0 +0,0 @@ public abstract class BlockBehaviour implements FeatureElement {
public abstract static class BlockStateBase extends StateHolder<Block, BlockState> {
- private final int lightEmission;
- private final boolean useShapeForLightOcclusion;
+ private final int lightEmission; public final int getEmittedLight() { return this.lightEmission; } // Paper - OBFHELPER
+ private final boolean useShapeForLightOcclusion; public final boolean isTransparentOnSomeFaces() { return this.useShapeForLightOcclusion; } // Paper - OBFHELPER
private final boolean isAir;
private final boolean ignitedByLava;
/** @deprecated */
@@ -0,0 +0,0 @@ public abstract class BlockBehaviour implements FeatureElement {
private final MapColor mapColor;
public final float destroySpeed;
private final boolean requiresCorrectToolForDrops;
- private final boolean canOcclude;
+ private final boolean canOcclude; public final boolean isOpaque() { return this.canOcclude; } // Paper - OBFHELPER
private final BlockBehaviour.StatePredicate isRedstoneConductor;
private final BlockBehaviour.StatePredicate isSuffocating;
private final BlockBehaviour.StatePredicate isViewBlocking;
@@ -0,0 +0,0 @@ public abstract class BlockBehaviour implements FeatureElement {
}
}
@ -7752,14 +7700,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public FluidState getFluidState(BlockPos pos) {
return this.getFluidState(pos.getX(), pos.getY(), pos.getZ());
@@ -0,0 +0,0 @@ public class LevelChunk extends ChunkAccess {
return this.getBlockEntity(pos, LevelChunk.EntityCreationType.CHECK);
}
+ @Deprecated @Nullable public final BlockEntity getTileEntityImmediately(BlockPos pos) { return this.getBlockEntity(pos, EntityCreationType.IMMEDIATE); } // Paper - OBFHELPER
@Nullable
public BlockEntity getBlockEntity(BlockPos pos, LevelChunk.EntityCreationType creationType) {
// CraftBukkit start
@@ -0,0 +0,0 @@ public class LevelChunk extends ChunkAccess {
// CraftBukkit start
public void loadCallback() {

Datei anzeigen

@ -22,7 +22,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
@@ -0,0 +0,0 @@ public class BlockPos extends Vec3i {
// Paper start - comment out useless overrides @Override - TODO figure out why this is suddenly important to keep
@Override
public BlockPos.MutableBlockPos setX(int i) {
- super.setX(i);
@ -43,7 +43,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.z = i; // Paper
return this;
}
// Paper end
diff --git a/src/main/java/net/minecraft/core/Vec3i.java b/src/main/java/net/minecraft/core/Vec3i.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/core/Vec3i.java

Datei anzeigen

@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
@@ -0,0 +0,0 @@ public abstract class BlockBehaviour implements FeatureElement {
this.replaceable = blockbase_info.replaceable;
this.conditionallyFullOpaque = this.isOpaque() & this.isTransparentOnSomeFaces(); // Paper
this.conditionallyFullOpaque = this.canOcclude & this.useShapeForLightOcclusion; // Paper
}
+ // Paper start - impl cached craft block data, lazy load to fix issue with loading at the wrong time
+ private org.bukkit.craftbukkit.block.data.CraftBlockData cachedCraftBlockData;

Datei anzeigen

@ -4890,7 +4890,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.spawnTerrainParticles = blockbase_info.spawnTerrainParticles;
this.instrument = blockbase_info.instrument;
this.replaceable = blockbase_info.replaceable;
+ this.conditionallyFullOpaque = this.isOpaque() & this.isTransparentOnSomeFaces(); // Paper
+ this.conditionallyFullOpaque = this.canOcclude & this.useShapeForLightOcclusion; // Paper
}
private boolean calculateSolid() {