13
0
geforkt von Mirrors/Paper

fix some compile issues

Dieser Commit ist enthalten in:
Jake Potrebic 2023-06-07 14:46:56 -07:00
Ursprung 27f97c0f4e
Commit eb4be91142
5 geänderte Dateien mit 13 neuen und 18 gelöschten Zeilen

Datei anzeigen

@ -104,7 +104,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import java.io.IOException;
@@ -0,0 +0,0 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Paper start - Prevent tile entity and entity crashes
final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level.getWorld().getName(), entity.getX(), entity.getY(), entity.getZ());
final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level().getWorld().getName(), entity.getX(), entity.getY(), entity.getZ());
MinecraftServer.LOGGER.error(msg, throwable);
+ getCraftServer().getPluginManager().callEvent(new ServerExceptionEvent(new ServerInternalException(msg, throwable)));
entity.discard();

Datei anzeigen

@ -20,18 +20,22 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start - Get flow speed. Throttle if its water and flowing adjacent to lava
+ public int getFlowSpeed(Level world, BlockPos blockposition) {
+ if (this.material == net.minecraft.world.level.material.Material.WATER) {
+ if (net.minecraft.core.registries.BuiltInRegistries.FLUID.wrapAsHolder(this.fluid).is(FluidTags.WATER)) {
+ if (
+ world.getMaterialIfLoaded(blockposition.north(1)) == net.minecraft.world.level.material.Material.LAVA ||
+ world.getMaterialIfLoaded(blockposition.south(1)) == net.minecraft.world.level.material.Material.LAVA ||
+ world.getMaterialIfLoaded(blockposition.west(1)) == net.minecraft.world.level.material.Material.LAVA ||
+ world.getMaterialIfLoaded(blockposition.east(1)) == net.minecraft.world.level.material.Material.LAVA
+ isLava(world, blockposition.north(1)) ||
+ isLava(world, blockposition.south(1)) ||
+ isLava(world, blockposition.west(1)) ||
+ isLava(world, blockposition.east(1))
+ ) {
+ return world.paperConfig().environment.waterOverLavaFlowSpeed;
+ }
+ }
+ return this.fluid.getTickDelay(world);
+ }
+ private static boolean isLava(Level world, BlockPos blockPos) {
+ final FluidState fluidState = world.getFluidIfLoaded(blockPos);
+ return fluidState != null && fluidState.is(FluidTags.LAVA);
+ }
+ // Paper end
+
@Override

Datei anzeigen

@ -6738,21 +6738,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.FluidState;
+import net.minecraft.world.level.material.Material;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.Vec3;
@@ -0,0 +0,0 @@ public interface BlockGetter extends LevelHeightAccessor {
}
BlockState getBlockState(BlockPos pos);
+ // Paper start - if loaded util
+ @Nullable BlockState getBlockStateIfLoaded(BlockPos blockposition);
+ default @Nullable Material getMaterialIfLoaded(BlockPos blockposition) {
+ BlockState type = this.getBlockStateIfLoaded(blockposition);
+ return type == null ? null : type.getMaterial();
+ }
+
+ default @Nullable Block getBlockIfLoaded(BlockPos blockposition) {
+ BlockState type = this.getBlockStateIfLoaded(blockposition);
@ -7071,7 +7062,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// CraftBukkit end
+ // Paper start
+ public @Nullable ChunkHolder playerChunk;
+ public @Nullable net.minecraft.server.level.ChunkHolder playerChunk;
+
+ static final int NEIGHBOUR_CACHE_RADIUS = 3;
+ public static int getNeighbourCacheRadius() {

Datei anzeigen

@ -27,7 +27,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start - Prevent armor stands from doing entity lookups
+ @Override
+ public boolean noCollision(@Nullable Entity entity, AABB box) {
+ if (entity instanceof net.minecraft.world.entity.decoration.ArmorStand && !entity.level.paperConfig().entities.armorStands.doCollisionEntityLookups) return false;
+ if (entity instanceof net.minecraft.world.entity.decoration.ArmorStand && !entity.level().paperConfig().entities.armorStands.doCollisionEntityLookups) return false;
+ return LevelAccessor.super.noCollision(entity, box);
+ }
+ // Paper end

Datei anzeigen

@ -18,7 +18,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- entity.fillCrashReportCategory(crashreportsystemdetails);
- throw new ReportedException(crashreport);
+ // Paper start - Prevent tile entity and entity crashes
+ final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level.getWorld().getName(), entity.getX(), entity.getY(), entity.getZ());
+ final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level().getWorld().getName(), entity.getX(), entity.getY(), entity.getZ());
+ MinecraftServer.LOGGER.error(msg, throwable);
+ entity.discard();
+ // Paper end