Created
June 15, 2020 02:00
-
-
Save phase/99f83e67ee7aa53733a100689e33710b to your computer and use it in GitHub Desktop.
1.16-pre5 Level FernFlower vs ForgeFlower
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- net/minecraft/world/level/Level.java | |
+++ net/minecraft/world/level/Level.java | |
@@ -1,11 +1,10 @@ | |
package net.minecraft.world.level; | |
import com.google.common.collect.Lists; | |
import com.mojang.serialization.Codec; | |
import java.io.IOException; | |
-import java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.Random; | |
import java.util.function.Consumer; | |
@@ -66,15 +65,15 @@ | |
import org.apache.logging.log4j.LogManager; | |
import org.apache.logging.log4j.Logger; | |
public abstract class Level implements LevelAccessor, AutoCloseable { | |
protected static final Logger LOGGER = LogManager.getLogger(); | |
- public static final Codec<ResourceKey<Level>> RESOURCE_KEY_CODEC; | |
- public static final ResourceKey<Level> OVERWORLD; | |
- public static final ResourceKey<Level> NETHER; | |
- public static final ResourceKey<Level> END; | |
- private static final Direction[] DIRECTIONS; | |
+ public static final Codec<ResourceKey<Level>> RESOURCE_KEY_CODEC = ResourceLocation.CODEC.xmap(ResourceKey.elementKey(Registry.DIMENSION_REGISTRY), ResourceKey::location); | |
+ public static final ResourceKey<Level> OVERWORLD = ResourceKey.create(Registry.DIMENSION_REGISTRY, new ResourceLocation("overworld")); | |
+ public static final ResourceKey<Level> NETHER = ResourceKey.create(Registry.DIMENSION_REGISTRY, new ResourceLocation("the_nether")); | |
+ public static final ResourceKey<Level> END = ResourceKey.create(Registry.DIMENSION_REGISTRY, new ResourceLocation("the_end")); | |
+ private static final Direction[] DIRECTIONS = Direction.values(); | |
public final List<BlockEntity> blockEntityList = Lists.newArrayList(); | |
public final List<BlockEntity> tickableBlockEntities = Lists.newArrayList(); | |
protected final List<BlockEntity> pendingBlockEntities = Lists.newArrayList(); | |
protected final List<BlockEntity> blockEntitiesToUnload = Lists.newArrayList(); | |
private final Thread thread; | |
@@ -96,17 +95,17 @@ | |
private final BiomeManager biomeManager; | |
private final ResourceKey<Level> dimension; | |
private final ResourceKey<DimensionType> dimensionTypeKey; | |
protected Level(WritableLevelData var1, ResourceKey<Level> var2, ResourceKey<DimensionType> var3, DimensionType var4, Supplier<ProfilerFiller> var5, boolean var6, boolean var7, long var8) { | |
- this.profiler = var5; | |
- this.levelData = var1; | |
- this.dimensionType = var4; | |
- this.dimension = var2; | |
- this.dimensionTypeKey = var3; | |
- this.isClientSide = var6; | |
- if (var4.shrunk()) { | |
+ this.profiler = ☃; | |
+ this.levelData = ☃; | |
+ this.dimensionType = ☃; | |
+ this.dimension = ☃; | |
+ this.dimensionTypeKey = ☃; | |
+ this.isClientSide = ☃; | |
+ if (☃.shrunk()) { | |
this.worldBorder = new WorldBorder() { | |
public double getCenterX() { | |
return super.getCenterX() / 8.0D; | |
} | |
@@ -117,12 +116,12 @@ | |
} else { | |
this.worldBorder = new WorldBorder(); | |
} | |
this.thread = Thread.currentThread(); | |
- this.biomeManager = new BiomeManager(this, var8, var4.getBiomeZoomer()); | |
- this.isDebug = var7; | |
+ this.biomeManager = new BiomeManager(this, ☃, ☃.getBiomeZoomer()); | |
+ this.isDebug = ☃; | |
} | |
public boolean isClientSide() { | |
return this.isClientSide; | |
} | |
@@ -131,131 +130,129 @@ | |
public MinecraftServer getServer() { | |
return null; | |
} | |
public static boolean isInWorldBounds(BlockPos var0) { | |
- return !isOutsideBuildHeight(var0) && isInWorldBoundsHorizontal(var0); | |
+ return !isOutsideBuildHeight(☃) && isInWorldBoundsHorizontal(☃); | |
} | |
public static boolean isInSpawnableBounds(BlockPos var0) { | |
- return !isOutsideSpawnableHeight(var0.getY()) && isInWorldBoundsHorizontal(var0); | |
+ return !isOutsideSpawnableHeight(☃.getY()) && isInWorldBoundsHorizontal(☃); | |
} | |
private static boolean isInWorldBoundsHorizontal(BlockPos var0) { | |
- return var0.getX() >= -30000000 && var0.getZ() >= -30000000 && var0.getX() < 30000000 && var0.getZ() < 30000000; | |
+ return ☃.getX() >= -30000000 && ☃.getZ() >= -30000000 && ☃.getX() < 30000000 && ☃.getZ() < 30000000; | |
} | |
private static boolean isOutsideSpawnableHeight(int var0) { | |
- return var0 < -20000000 || var0 >= 20000000; | |
+ return ☃ < -20000000 || ☃ >= 20000000; | |
} | |
public static boolean isOutsideBuildHeight(BlockPos var0) { | |
- return isOutsideBuildHeight(var0.getY()); | |
+ return isOutsideBuildHeight(☃.getY()); | |
} | |
public static boolean isOutsideBuildHeight(int var0) { | |
- return var0 < 0 || var0 >= 256; | |
+ return ☃ < 0 || ☃ >= 256; | |
} | |
public double getRelativeFloorHeight(BlockPos var1) { | |
- return this.getRelativeFloorHeight(var1, (var0) -> { | |
- return false; | |
- }); | |
+ return this.getRelativeFloorHeight(☃, (var0) -> false); | |
} | |
public double getRelativeFloorHeight(BlockPos var1, Predicate<BlockState> var2) { | |
- BlockState var3 = this.getBlockState(var1); | |
- VoxelShape var4 = var2.test(var3) ? Shapes.empty() : var3.getCollisionShape(this, var1); | |
- if (var4.isEmpty()) { | |
- BlockPos var5 = var1.below(); | |
- BlockState var6 = this.getBlockState(var5); | |
- VoxelShape var7 = var2.test(var6) ? Shapes.empty() : var6.getCollisionShape(this, var5); | |
- double var8 = var7.max(Direction.Axis.Y); | |
- return var8 >= 1.0D ? var8 - 1.0D : Double.NEGATIVE_INFINITY; | |
+ BlockState blockstate = this.getBlockState(☃); | |
+ VoxelShape voxelshape = ☃.test(blockstate) ? Shapes.empty() : blockstate.getCollisionShape(this, ☃); | |
+ if (voxelshape.isEmpty()) { | |
+ BlockPos blockpos = ☃.below(); | |
+ BlockState blockstate1 = this.getBlockState(blockpos); | |
+ VoxelShape voxelshape1 = ☃.test(blockstate1) ? Shapes.empty() : blockstate1.getCollisionShape(this, blockpos); | |
+ double d0 = voxelshape1.max(Direction.Axis.Y); | |
+ return d0 >= 1.0D ? d0 - 1.0D : Double.NEGATIVE_INFINITY; | |
} else { | |
- return var4.max(Direction.Axis.Y); | |
+ return voxelshape.max(Direction.Axis.Y); | |
} | |
} | |
public double getRelativeCeilingHeight(BlockPos var1, double var2) { | |
- BlockPos.MutableBlockPos var4 = var1.mutable(); | |
- int var5 = Mth.ceil(var2); | |
- int var6 = 0; | |
+ BlockPos.MutableBlockPos blockpos$mutableblockpos = ☃.mutable(); | |
+ int i = Mth.ceil(☃); | |
+ int j = 0; | |
- while(var6 < var5) { | |
- VoxelShape var7 = this.getBlockState(var4).getCollisionShape(this, var4); | |
- if (!var7.isEmpty()) { | |
- return (double)var6 + var7.min(Direction.Axis.Y); | |
+ while(j < i) { | |
+ VoxelShape voxelshape = this.getBlockState(blockpos$mutableblockpos).getCollisionShape(this, blockpos$mutableblockpos); | |
+ if (!voxelshape.isEmpty()) { | |
+ return (double)j + voxelshape.min(Direction.Axis.Y); | |
} | |
- ++var6; | |
- var4.move(Direction.UP); | |
+ ++j; | |
+ blockpos$mutableblockpos.move(Direction.UP); | |
} | |
return Double.POSITIVE_INFINITY; | |
} | |
public LevelChunk getChunkAt(BlockPos var1) { | |
- return this.getChunk(var1.getX() >> 4, var1.getZ() >> 4); | |
+ return this.getChunk(☃.getX() >> 4, ☃.getZ() >> 4); | |
} | |
public LevelChunk getChunk(int var1, int var2) { | |
- return (LevelChunk)this.getChunk(var1, var2, ChunkStatus.FULL); | |
+ return (LevelChunk)this.getChunk(☃, ☃, ChunkStatus.FULL); | |
} | |
public ChunkAccess getChunk(int var1, int var2, ChunkStatus var3, boolean var4) { | |
- ChunkAccess var5 = this.getChunkSource().getChunk(var1, var2, var3, var4); | |
- if (var5 == null && var4) { | |
+ ChunkAccess chunkaccess = this.getChunkSource().getChunk(☃, ☃, ☃, ☃); | |
+ if (chunkaccess == null && ☃) { | |
throw new IllegalStateException("Should always be able to create a chunk!"); | |
} else { | |
- return var5; | |
+ return chunkaccess; | |
} | |
} | |
public boolean setBlock(BlockPos var1, BlockState var2, int var3) { | |
- if (isOutsideBuildHeight(var1)) { | |
+ if (isOutsideBuildHeight(☃)) { | |
return false; | |
} else if (!this.isClientSide && this.isDebug()) { | |
return false; | |
} else { | |
- LevelChunk var4 = this.getChunkAt(var1); | |
- Block var5 = var2.getBlock(); | |
- BlockState var6 = var4.setBlockState(var1, var2, (var3 & 64) != 0); | |
- if (var6 == null) { | |
+ LevelChunk levelchunk = this.getChunkAt(☃); | |
+ Block block = ☃.getBlock(); | |
+ BlockState blockstate = levelchunk.setBlockState(☃, ☃, (☃ & 64) != 0); | |
+ if (blockstate == null) { | |
return false; | |
} else { | |
- BlockState var7 = this.getBlockState(var1); | |
- if (var7 != var6 && (var7.getLightBlock(this, var1) != var6.getLightBlock(this, var1) || var7.getLightEmission() != var6.getLightEmission() || var7.useShapeForLightOcclusion() || var6.useShapeForLightOcclusion())) { | |
+ BlockState blockstate1 = this.getBlockState(☃); | |
+ if (blockstate1 != blockstate && (blockstate1.getLightBlock(this, ☃) != blockstate.getLightBlock(this, ☃) || blockstate1.getLightEmission() != blockstate.getLightEmission() || blockstate1.useShapeForLightOcclusion() || blockstate.useShapeForLightOcclusion())) { | |
this.getProfiler().push("queueCheckLight"); | |
- this.getChunkSource().getLightEngine().checkBlock(var1); | |
+ this.getChunkSource().getLightEngine().checkBlock(☃); | |
this.getProfiler().pop(); | |
} | |
- if (var7 == var2) { | |
- if (var6 != var7) { | |
- this.setBlocksDirty(var1, var6, var7); | |
+ if (blockstate1 == ☃) { | |
+ if (blockstate != blockstate1) { | |
+ this.setBlocksDirty(☃, blockstate, blockstate1); | |
} | |
- if ((var3 & 2) != 0 && (!this.isClientSide || (var3 & 4) == 0) && (this.isClientSide || var4.getFullStatus() != null && var4.getFullStatus().isOrAfter(ChunkHolder.FullChunkStatus.TICKING))) { | |
- this.sendBlockUpdated(var1, var6, var2, var3); | |
+ if ((☃ & 2) != 0 && (!this.isClientSide || (☃ & 4) == 0) && (this.isClientSide || levelchunk.getFullStatus() != null && levelchunk.getFullStatus().isOrAfter(ChunkHolder.FullChunkStatus.TICKING))) { | |
+ this.sendBlockUpdated(☃, blockstate, ☃, ☃); | |
} | |
- if ((var3 & 1) != 0) { | |
- this.blockUpdated(var1, var6.getBlock()); | |
- if (!this.isClientSide && var2.hasAnalogOutputSignal()) { | |
- this.updateNeighbourForOutputSignal(var1, var5); | |
+ if ((☃ & 1) != 0) { | |
+ this.blockUpdated(☃, blockstate.getBlock()); | |
+ if (!this.isClientSide && ☃.hasAnalogOutputSignal()) { | |
+ this.updateNeighbourForOutputSignal(☃, block); | |
} | |
} | |
- if ((var3 & 16) == 0) { | |
- int var8 = var3 & -34; | |
- var6.updateIndirectNeighbourShapes(this, var1, var8); | |
- var2.updateNeighbourShapes(this, var1, var8); | |
- var2.updateIndirectNeighbourShapes(this, var1, var8); | |
+ if ((☃ & 16) == 0) { | |
+ int i = ☃ & -34; | |
+ blockstate.updateIndirectNeighbourShapes(this, ☃, i); | |
+ ☃.updateNeighbourShapes(this, ☃, i); | |
+ ☃.updateIndirectNeighbourShapes(this, ☃, i); | |
} | |
- this.onBlockStateChange(var1, var6, var7); | |
+ this.onBlockStateChange(☃, blockstate, blockstate1); | |
} | |
return true; | |
} | |
} | |
@@ -263,134 +260,134 @@ | |
public void onBlockStateChange(BlockPos var1, BlockState var2, BlockState var3) { | |
} | |
public boolean removeBlock(BlockPos var1, boolean var2) { | |
- FluidState var3 = this.getFluidState(var1); | |
- return this.setBlock(var1, var3.createLegacyBlock(), 3 | (var2 ? 64 : 0)); | |
+ FluidState fluidstate = this.getFluidState(☃); | |
+ return this.setBlock(☃, fluidstate.createLegacyBlock(), 3 | (☃ ? 64 : 0)); | |
} | |
public boolean destroyBlock(BlockPos var1, boolean var2, @Nullable Entity var3) { | |
- BlockState var4 = this.getBlockState(var1); | |
- if (var4.isAir()) { | |
+ BlockState blockstate = this.getBlockState(☃); | |
+ if (blockstate.isAir()) { | |
return false; | |
} else { | |
- FluidState var5 = this.getFluidState(var1); | |
- if (!(var4.getBlock() instanceof BaseFireBlock)) { | |
- this.levelEvent(2001, var1, Block.getId(var4)); | |
+ FluidState fluidstate = this.getFluidState(☃); | |
+ if (!(blockstate.getBlock() instanceof BaseFireBlock)) { | |
+ this.levelEvent(2001, ☃, Block.getId(blockstate)); | |
} | |
- if (var2) { | |
- BlockEntity var6 = var4.getBlock().isEntityBlock() ? this.getBlockEntity(var1) : null; | |
- Block.dropResources(var4, this, var1, var6, var3, ItemStack.EMPTY); | |
+ if (☃) { | |
+ BlockEntity blockentity = blockstate.getBlock().isEntityBlock() ? this.getBlockEntity(☃) : null; | |
+ Block.dropResources(blockstate, this, ☃, blockentity, ☃, ItemStack.EMPTY); | |
} | |
- return this.setBlock(var1, var5.createLegacyBlock(), 3); | |
+ return this.setBlock(☃, fluidstate.createLegacyBlock(), 3); | |
} | |
} | |
public boolean setBlockAndUpdate(BlockPos var1, BlockState var2) { | |
- return this.setBlock(var1, var2, 3); | |
+ return this.setBlock(☃, ☃, 3); | |
} | |
public abstract void sendBlockUpdated(BlockPos var1, BlockState var2, BlockState var3, int var4); | |
public void setBlocksDirty(BlockPos var1, BlockState var2, BlockState var3) { | |
} | |
public void updateNeighborsAt(BlockPos var1, Block var2) { | |
- this.neighborChanged(var1.west(), var2, var1); | |
- this.neighborChanged(var1.east(), var2, var1); | |
- this.neighborChanged(var1.below(), var2, var1); | |
- this.neighborChanged(var1.above(), var2, var1); | |
- this.neighborChanged(var1.north(), var2, var1); | |
- this.neighborChanged(var1.south(), var2, var1); | |
+ this.neighborChanged(☃.west(), ☃, ☃); | |
+ this.neighborChanged(☃.east(), ☃, ☃); | |
+ this.neighborChanged(☃.below(), ☃, ☃); | |
+ this.neighborChanged(☃.above(), ☃, ☃); | |
+ this.neighborChanged(☃.north(), ☃, ☃); | |
+ this.neighborChanged(☃.south(), ☃, ☃); | |
} | |
public void updateNeighborsAtExceptFromFacing(BlockPos var1, Block var2, Direction var3) { | |
- if (var3 != Direction.WEST) { | |
- this.neighborChanged(var1.west(), var2, var1); | |
+ if (☃ != Direction.WEST) { | |
+ this.neighborChanged(☃.west(), ☃, ☃); | |
} | |
- if (var3 != Direction.EAST) { | |
- this.neighborChanged(var1.east(), var2, var1); | |
+ if (☃ != Direction.EAST) { | |
+ this.neighborChanged(☃.east(), ☃, ☃); | |
} | |
- if (var3 != Direction.DOWN) { | |
- this.neighborChanged(var1.below(), var2, var1); | |
+ if (☃ != Direction.DOWN) { | |
+ this.neighborChanged(☃.below(), ☃, ☃); | |
} | |
- if (var3 != Direction.UP) { | |
- this.neighborChanged(var1.above(), var2, var1); | |
+ if (☃ != Direction.UP) { | |
+ this.neighborChanged(☃.above(), ☃, ☃); | |
} | |
- if (var3 != Direction.NORTH) { | |
- this.neighborChanged(var1.north(), var2, var1); | |
+ if (☃ != Direction.NORTH) { | |
+ this.neighborChanged(☃.north(), ☃, ☃); | |
} | |
- if (var3 != Direction.SOUTH) { | |
- this.neighborChanged(var1.south(), var2, var1); | |
+ if (☃ != Direction.SOUTH) { | |
+ this.neighborChanged(☃.south(), ☃, ☃); | |
} | |
} | |
public void neighborChanged(BlockPos var1, Block var2, BlockPos var3) { | |
if (!this.isClientSide) { | |
- BlockState var4 = this.getBlockState(var1); | |
+ BlockState blockstate = this.getBlockState(☃); | |
try { | |
- var4.neighborChanged(this, var1, var2, var3, false); | |
- } catch (Throwable var8) { | |
- CrashReport var6 = CrashReport.forThrowable(var8, "Exception while updating neighbours"); | |
- CrashReportCategory var7 = var6.addCategory("Block being updated"); | |
- var7.setDetail("Source block type", () -> { | |
+ blockstate.neighborChanged(this, ☃, ☃, ☃, false); | |
+ } catch (Throwable throwable) { | |
+ CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception while updating neighbours"); | |
+ CrashReportCategory crashreportcategory = crashreport.addCategory("Block being updated"); | |
+ crashreportcategory.setDetail("Source block type", () -> { | |
try { | |
- return String.format("ID #%s (%s // %s)", Registry.BLOCK.getKey(var2), var2.getDescriptionId(), var2.getClass().getCanonicalName()); | |
- } catch (Throwable var2x) { | |
- return "ID #" + Registry.BLOCK.getKey(var2); | |
+ return String.format("ID #%s (%s // %s)", Registry.BLOCK.getKey(☃), ☃.getDescriptionId(), ☃.getClass().getCanonicalName()); | |
+ } catch (Throwable throwable1) { | |
+ return "ID #" + Registry.BLOCK.getKey(☃); | |
} | |
}); | |
- CrashReportCategory.populateBlockDetails(var7, var1, var4); | |
- throw new ReportedException(var6); | |
+ CrashReportCategory.populateBlockDetails(crashreportcategory, ☃, blockstate); | |
+ throw new ReportedException(crashreport); | |
} | |
} | |
} | |
public int getHeight(Heightmap.Types var1, int var2, int var3) { | |
- int var4; | |
- if (var2 >= -30000000 && var3 >= -30000000 && var2 < 30000000 && var3 < 30000000) { | |
- if (this.hasChunk(var2 >> 4, var3 >> 4)) { | |
- var4 = this.getChunk(var2 >> 4, var3 >> 4).getHeight(var1, var2 & 15, var3 & 15) + 1; | |
+ int i; | |
+ if (☃ >= -30000000 && ☃ >= -30000000 && ☃ < 30000000 && ☃ < 30000000) { | |
+ if (this.hasChunk(☃ >> 4, ☃ >> 4)) { | |
+ i = this.getChunk(☃ >> 4, ☃ >> 4).getHeight(☃, ☃ & 15, ☃ & 15) + 1; | |
} else { | |
- var4 = 0; | |
+ i = 0; | |
} | |
} else { | |
- var4 = this.getSeaLevel() + 1; | |
+ i = this.getSeaLevel() + 1; | |
} | |
- return var4; | |
+ return i; | |
} | |
public LevelLightEngine getLightEngine() { | |
return this.getChunkSource().getLightEngine(); | |
} | |
public BlockState getBlockState(BlockPos var1) { | |
- if (isOutsideBuildHeight(var1)) { | |
+ if (isOutsideBuildHeight(☃)) { | |
return Blocks.VOID_AIR.defaultBlockState(); | |
} else { | |
- LevelChunk var2 = this.getChunk(var1.getX() >> 4, var1.getZ() >> 4); | |
- return var2.getBlockState(var1); | |
+ LevelChunk levelchunk = this.getChunk(☃.getX() >> 4, ☃.getZ() >> 4); | |
+ return levelchunk.getBlockState(☃); | |
} | |
} | |
public FluidState getFluidState(BlockPos var1) { | |
- if (isOutsideBuildHeight(var1)) { | |
+ if (isOutsideBuildHeight(☃)) { | |
return Fluids.EMPTY.defaultFluidState(); | |
} else { | |
- LevelChunk var2 = this.getChunkAt(var1); | |
- return var2.getFluidState(var1); | |
+ LevelChunk levelchunk = this.getChunkAt(☃); | |
+ return levelchunk.getFluidState(☃); | |
} | |
} | |
public boolean isDay() { | |
return !this.dimensionType().hasFixedTime() && this.skyDarken < 4; | |
@@ -399,11 +396,11 @@ | |
public boolean isNight() { | |
return !this.dimensionType().hasFixedTime() && !this.isDay(); | |
} | |
public void playSound(@Nullable Player var1, BlockPos var2, SoundEvent var3, SoundSource var4, float var5, float var6) { | |
- this.playSound(var1, (double)var2.getX() + 0.5D, (double)var2.getY() + 0.5D, (double)var2.getZ() + 0.5D, var3, var4, var5, var6); | |
+ this.playSound(☃, (double)☃.getX() + 0.5D, (double)☃.getY() + 0.5D, (double)☃.getZ() + 0.5D, ☃, ☃, ☃, ☃); | |
} | |
public abstract void playSound(@Nullable Player var1, double var2, double var4, double var6, SoundEvent var8, SoundSource var9, float var10, float var11); | |
public abstract void playSound(@Nullable Player var1, Entity var2, SoundEvent var3, SoundSource var4, float var5, float var6); | |
@@ -422,254 +419,247 @@ | |
public void addAlwaysVisibleParticle(ParticleOptions var1, boolean var2, double var3, double var5, double var7, double var9, double var11, double var13) { | |
} | |
public float getSunAngle(float var1) { | |
- float var2 = this.getTimeOfDay(var1); | |
- return var2 * 6.2831855F; | |
+ float f = this.getTimeOfDay(☃); | |
+ return f * ((float)Math.PI * 2F); | |
} | |
public boolean addBlockEntity(BlockEntity var1) { | |
if (this.updatingBlockEntities) { | |
- LOGGER.error("Adding block entity while ticking: {} @ {}", new org.apache.logging.log4j.util.Supplier[]{() -> { | |
- return Registry.BLOCK_ENTITY_TYPE.getKey(var1.getType()); | |
- }, var1::getBlockPos}); | |
+ LOGGER.error("Adding block entity while ticking: {} @ {}", new org.apache.logging.log4j.util.Supplier[]{() -> Registry.BLOCK_ENTITY_TYPE.getKey(☃.getType()), ☃::getBlockPos}); | |
} | |
- boolean var2 = this.blockEntityList.add(var1); | |
- if (var2 && var1 instanceof TickableBlockEntity) { | |
- this.tickableBlockEntities.add(var1); | |
+ boolean flag = this.blockEntityList.add(☃); | |
+ if (flag && ☃ instanceof TickableBlockEntity) { | |
+ this.tickableBlockEntities.add(☃); | |
} | |
if (this.isClientSide) { | |
- BlockPos var3 = var1.getBlockPos(); | |
- BlockState var4 = this.getBlockState(var3); | |
- this.sendBlockUpdated(var3, var4, var4, 2); | |
+ BlockPos blockpos = ☃.getBlockPos(); | |
+ BlockState blockstate = this.getBlockState(blockpos); | |
+ this.sendBlockUpdated(blockpos, blockstate, blockstate, 2); | |
} | |
- return var2; | |
+ return flag; | |
} | |
public void addAllPendingBlockEntities(Collection<BlockEntity> var1) { | |
if (this.updatingBlockEntities) { | |
- this.pendingBlockEntities.addAll(var1); | |
+ this.pendingBlockEntities.addAll(☃); | |
} else { | |
- Iterator var2 = var1.iterator(); | |
- | |
- while(var2.hasNext()) { | |
- BlockEntity var3 = (BlockEntity)var2.next(); | |
- this.addBlockEntity(var3); | |
+ for(BlockEntity blockentity : ☃) { | |
+ this.addBlockEntity(blockentity); | |
} | |
} | |
} | |
public void tickBlockEntities() { | |
- ProfilerFiller var1 = this.getProfiler(); | |
- var1.push("blockEntities"); | |
+ ProfilerFiller profilerfiller = this.getProfiler(); | |
+ profilerfiller.push("blockEntities"); | |
if (!this.blockEntitiesToUnload.isEmpty()) { | |
this.tickableBlockEntities.removeAll(this.blockEntitiesToUnload); | |
this.blockEntityList.removeAll(this.blockEntitiesToUnload); | |
this.blockEntitiesToUnload.clear(); | |
} | |
this.updatingBlockEntities = true; | |
- Iterator var2 = this.tickableBlockEntities.iterator(); | |
+ Iterator iterator = this.tickableBlockEntities.iterator(); | |
- while(var2.hasNext()) { | |
- BlockEntity var3 = (BlockEntity)var2.next(); | |
- if (!var3.isRemoved() && var3.hasLevel()) { | |
- BlockPos var4 = var3.getBlockPos(); | |
- if (this.getChunkSource().isTickingChunk(var4) && this.getWorldBorder().isWithinBounds(var4)) { | |
+ while(iterator.hasNext()) { | |
+ BlockEntity blockentity = iterator.next(); | |
+ if (!blockentity.isRemoved() && blockentity.hasLevel()) { | |
+ BlockPos blockpos = blockentity.getBlockPos(); | |
+ if (this.getChunkSource().isTickingChunk(blockpos) && this.getWorldBorder().isWithinBounds(blockpos)) { | |
try { | |
- var1.push(() -> { | |
- return String.valueOf(BlockEntityType.getKey(var3.getType())); | |
- }); | |
- if (var3.getType().isValid(this.getBlockState(var4).getBlock())) { | |
- ((TickableBlockEntity)var3).tick(); | |
+ profilerfiller.push(() -> String.valueOf((Object)BlockEntityType.getKey(blockentity.getType()))); | |
+ if (blockentity.getType().isValid(this.getBlockState(blockpos).getBlock())) { | |
+ ((TickableBlockEntity)blockentity).tick(); | |
} else { | |
- var3.logInvalidState(); | |
+ blockentity.logInvalidState(); | |
} | |
- var1.pop(); | |
- } catch (Throwable var8) { | |
- CrashReport var6 = CrashReport.forThrowable(var8, "Ticking block entity"); | |
- CrashReportCategory var7 = var6.addCategory("Block entity being ticked"); | |
- var3.fillCrashReportCategory(var7); | |
- throw new ReportedException(var6); | |
+ profilerfiller.pop(); | |
+ } catch (Throwable throwable) { | |
+ CrashReport crashreport = CrashReport.forThrowable(throwable, "Ticking block entity"); | |
+ CrashReportCategory crashreportcategory = crashreport.addCategory("Block entity being ticked"); | |
+ blockentity.fillCrashReportCategory(crashreportcategory); | |
+ throw new ReportedException(crashreport); | |
} | |
} | |
} | |
- if (var3.isRemoved()) { | |
- var2.remove(); | |
- this.blockEntityList.remove(var3); | |
- if (this.hasChunkAt(var3.getBlockPos())) { | |
- this.getChunkAt(var3.getBlockPos()).removeBlockEntity(var3.getBlockPos()); | |
+ if (blockentity.isRemoved()) { | |
+ iterator.remove(); | |
+ this.blockEntityList.remove(blockentity); | |
+ if (this.hasChunkAt(blockentity.getBlockPos())) { | |
+ this.getChunkAt(blockentity.getBlockPos()).removeBlockEntity(blockentity.getBlockPos()); | |
} | |
} | |
} | |
this.updatingBlockEntities = false; | |
- var1.popPush("pendingBlockEntities"); | |
+ profilerfiller.popPush("pendingBlockEntities"); | |
if (!this.pendingBlockEntities.isEmpty()) { | |
- for(int var9 = 0; var9 < this.pendingBlockEntities.size(); ++var9) { | |
- BlockEntity var10 = (BlockEntity)this.pendingBlockEntities.get(var9); | |
- if (!var10.isRemoved()) { | |
- if (!this.blockEntityList.contains(var10)) { | |
- this.addBlockEntity(var10); | |
+ for(int i = 0; i < this.pendingBlockEntities.size(); ++i) { | |
+ BlockEntity blockentity1 = this.pendingBlockEntities.get(i); | |
+ if (!blockentity1.isRemoved()) { | |
+ if (!this.blockEntityList.contains(blockentity1)) { | |
+ this.addBlockEntity(blockentity1); | |
} | |
- if (this.hasChunkAt(var10.getBlockPos())) { | |
- LevelChunk var5 = this.getChunkAt(var10.getBlockPos()); | |
- BlockState var11 = var5.getBlockState(var10.getBlockPos()); | |
- var5.setBlockEntity(var10.getBlockPos(), var10); | |
- this.sendBlockUpdated(var10.getBlockPos(), var11, var11, 3); | |
+ if (this.hasChunkAt(blockentity1.getBlockPos())) { | |
+ LevelChunk levelchunk = this.getChunkAt(blockentity1.getBlockPos()); | |
+ BlockState blockstate = levelchunk.getBlockState(blockentity1.getBlockPos()); | |
+ levelchunk.setBlockEntity(blockentity1.getBlockPos(), blockentity1); | |
+ this.sendBlockUpdated(blockentity1.getBlockPos(), blockstate, blockstate, 3); | |
} | |
} | |
} | |
this.pendingBlockEntities.clear(); | |
} | |
- var1.pop(); | |
+ profilerfiller.pop(); | |
} | |
public void guardEntityTick(Consumer<Entity> var1, Entity var2) { | |
try { | |
- var1.accept(var2); | |
- } catch (Throwable var6) { | |
- CrashReport var4 = CrashReport.forThrowable(var6, "Ticking entity"); | |
- CrashReportCategory var5 = var4.addCategory("Entity being ticked"); | |
- var2.fillCrashReportCategory(var5); | |
- throw new ReportedException(var4); | |
+ ☃.accept(☃); | |
+ } catch (Throwable throwable) { | |
+ CrashReport crashreport = CrashReport.forThrowable(throwable, "Ticking entity"); | |
+ CrashReportCategory crashreportcategory = crashreport.addCategory("Entity being ticked"); | |
+ ☃.fillCrashReportCategory(crashreportcategory); | |
+ throw new ReportedException(crashreport); | |
} | |
} | |
public Explosion explode(@Nullable Entity var1, double var2, double var4, double var6, float var8, Explosion.BlockInteraction var9) { | |
- return this.explode(var1, (DamageSource)null, (ExplosionDamageCalculator)null, var2, var4, var6, var8, false, var9); | |
+ return this.explode(☃, (DamageSource)null, (ExplosionDamageCalculator)null, ☃, ☃, ☃, ☃, false, ☃); | |
} | |
public Explosion explode(@Nullable Entity var1, double var2, double var4, double var6, float var8, boolean var9, Explosion.BlockInteraction var10) { | |
- return this.explode(var1, (DamageSource)null, (ExplosionDamageCalculator)null, var2, var4, var6, var8, var9, var10); | |
+ return this.explode(☃, (DamageSource)null, (ExplosionDamageCalculator)null, ☃, ☃, ☃, ☃, ☃, ☃); | |
} | |
public Explosion explode(@Nullable Entity var1, @Nullable DamageSource var2, @Nullable ExplosionDamageCalculator var3, double var4, double var6, double var8, float var10, boolean var11, Explosion.BlockInteraction var12) { | |
- Explosion var13 = new Explosion(this, var1, var2, var3, var4, var6, var8, var10, var11, var12); | |
- var13.explode(); | |
- var13.finalizeExplosion(true); | |
- return var13; | |
+ Explosion explosion = new Explosion(this, ☃, ☃, ☃, ☃, ☃, ☃, ☃, ☃, ☃); | |
+ explosion.explode(); | |
+ explosion.finalizeExplosion(true); | |
+ return explosion; | |
} | |
public String gatherChunkSourceStats() { | |
return this.getChunkSource().gatherStats(); | |
} | |
@Nullable | |
public BlockEntity getBlockEntity(BlockPos var1) { | |
- if (isOutsideBuildHeight(var1)) { | |
+ if (isOutsideBuildHeight(☃)) { | |
return null; | |
} else if (!this.isClientSide && Thread.currentThread() != this.thread) { | |
return null; | |
} else { | |
- BlockEntity var2 = null; | |
+ BlockEntity blockentity = null; | |
if (this.updatingBlockEntities) { | |
- var2 = this.getPendingBlockEntityAt(var1); | |
+ blockentity = this.getPendingBlockEntityAt(☃); | |
} | |
- if (var2 == null) { | |
- var2 = this.getChunkAt(var1).getBlockEntity(var1, LevelChunk.EntityCreationType.IMMEDIATE); | |
+ if (blockentity == null) { | |
+ blockentity = this.getChunkAt(☃).getBlockEntity(☃, LevelChunk.EntityCreationType.IMMEDIATE); | |
} | |
- if (var2 == null) { | |
- var2 = this.getPendingBlockEntityAt(var1); | |
+ if (blockentity == null) { | |
+ blockentity = this.getPendingBlockEntityAt(☃); | |
} | |
- return var2; | |
+ return blockentity; | |
} | |
} | |
@Nullable | |
private BlockEntity getPendingBlockEntityAt(BlockPos var1) { | |
- for(int var2 = 0; var2 < this.pendingBlockEntities.size(); ++var2) { | |
- BlockEntity var3 = (BlockEntity)this.pendingBlockEntities.get(var2); | |
- if (!var3.isRemoved() && var3.getBlockPos().equals(var1)) { | |
- return var3; | |
+ for(int i = 0; i < this.pendingBlockEntities.size(); ++i) { | |
+ BlockEntity blockentity = this.pendingBlockEntities.get(i); | |
+ if (!blockentity.isRemoved() && blockentity.getBlockPos().equals(☃)) { | |
+ return blockentity; | |
} | |
} | |
return null; | |
} | |
public void setBlockEntity(BlockPos var1, @Nullable BlockEntity var2) { | |
- if (!isOutsideBuildHeight(var1)) { | |
- if (var2 != null && !var2.isRemoved()) { | |
+ if (!isOutsideBuildHeight(☃)) { | |
+ if (☃ != null && !☃.isRemoved()) { | |
if (this.updatingBlockEntities) { | |
- var2.setLevelAndPosition(this, var1); | |
- Iterator var3 = this.pendingBlockEntities.iterator(); | |
+ ☃.setLevelAndPosition(this, ☃); | |
+ Iterator iterator = this.pendingBlockEntities.iterator(); | |
- while(var3.hasNext()) { | |
- BlockEntity var4 = (BlockEntity)var3.next(); | |
- if (var4.getBlockPos().equals(var1)) { | |
- var4.setRemoved(); | |
- var3.remove(); | |
+ while(iterator.hasNext()) { | |
+ BlockEntity blockentity = iterator.next(); | |
+ if (blockentity.getBlockPos().equals(☃)) { | |
+ blockentity.setRemoved(); | |
+ iterator.remove(); | |
} | |
} | |
- this.pendingBlockEntities.add(var2); | |
+ this.pendingBlockEntities.add(☃); | |
} else { | |
- this.getChunkAt(var1).setBlockEntity(var1, var2); | |
- this.addBlockEntity(var2); | |
+ this.getChunkAt(☃).setBlockEntity(☃, ☃); | |
+ this.addBlockEntity(☃); | |
} | |
} | |
} | |
} | |
public void removeBlockEntity(BlockPos var1) { | |
- BlockEntity var2 = this.getBlockEntity(var1); | |
- if (var2 != null && this.updatingBlockEntities) { | |
- var2.setRemoved(); | |
- this.pendingBlockEntities.remove(var2); | |
+ BlockEntity blockentity = this.getBlockEntity(☃); | |
+ if (blockentity != null && this.updatingBlockEntities) { | |
+ blockentity.setRemoved(); | |
+ this.pendingBlockEntities.remove(blockentity); | |
} else { | |
- if (var2 != null) { | |
- this.pendingBlockEntities.remove(var2); | |
- this.blockEntityList.remove(var2); | |
- this.tickableBlockEntities.remove(var2); | |
+ if (blockentity != null) { | |
+ this.pendingBlockEntities.remove(blockentity); | |
+ this.blockEntityList.remove(blockentity); | |
+ this.tickableBlockEntities.remove(blockentity); | |
} | |
- this.getChunkAt(var1).removeBlockEntity(var1); | |
+ this.getChunkAt(☃).removeBlockEntity(☃); | |
} | |
} | |
public boolean isLoaded(BlockPos var1) { | |
- return isOutsideBuildHeight(var1) ? false : this.getChunkSource().hasChunk(var1.getX() >> 4, var1.getZ() >> 4); | |
+ return isOutsideBuildHeight(☃) ? false : this.getChunkSource().hasChunk(☃.getX() >> 4, ☃.getZ() >> 4); | |
} | |
public boolean loadedAndEntityCanStandOnFace(BlockPos var1, Entity var2, Direction var3) { | |
- if (isOutsideBuildHeight(var1)) { | |
+ if (isOutsideBuildHeight(☃)) { | |
return false; | |
} else { | |
- ChunkAccess var4 = this.getChunk(var1.getX() >> 4, var1.getZ() >> 4, ChunkStatus.FULL, false); | |
- return var4 == null ? false : var4.getBlockState(var1).entityCanStandOnFace(this, var1, var2, var3); | |
+ ChunkAccess chunkaccess = this.getChunk(☃.getX() >> 4, ☃.getZ() >> 4, ChunkStatus.FULL, false); | |
+ return chunkaccess == null ? false : chunkaccess.getBlockState(☃).entityCanStandOnFace(this, ☃, ☃, ☃); | |
} | |
} | |
public boolean loadedAndEntityCanStandOn(BlockPos var1, Entity var2) { | |
- return this.loadedAndEntityCanStandOnFace(var1, var2, Direction.UP); | |
+ return this.loadedAndEntityCanStandOnFace(☃, ☃, Direction.UP); | |
} | |
public void updateSkyBrightness() { | |
- double var1 = 1.0D - (double)(this.getRainLevel(1.0F) * 5.0F) / 16.0D; | |
- double var3 = 1.0D - (double)(this.getThunderLevel(1.0F) * 5.0F) / 16.0D; | |
- double var5 = 0.5D + 2.0D * Mth.clamp((double)Mth.cos(this.getTimeOfDay(1.0F) * 6.2831855F), -0.25D, 0.25D); | |
- this.skyDarken = (int)((1.0D - var5 * var1 * var3) * 11.0D); | |
+ double d0 = 1.0D - (double)(this.getRainLevel(1.0F) * 5.0F) / 16.0D; | |
+ double d1 = 1.0D - (double)(this.getThunderLevel(1.0F) * 5.0F) / 16.0D; | |
+ double d2 = 0.5D + 2.0D * Mth.clamp((double)Mth.cos(this.getTimeOfDay(1.0F) * ((float)Math.PI * 2F)), -0.25D, 0.25D); | |
+ this.skyDarken = (int)((1.0D - d2 * d0 * d1) * 11.0D); | |
} | |
public void setSpawnSettings(boolean var1, boolean var2) { | |
- this.getChunkSource().setSpawnSettings(var1, var2); | |
+ this.getChunkSource().setSpawnSettings(☃, ☃); | |
} | |
protected void prepareWeather() { | |
if (this.levelData.isRaining()) { | |
this.rainLevel = 1.0F; | |
@@ -684,102 +674,102 @@ | |
this.getChunkSource().close(); | |
} | |
@Nullable | |
public BlockGetter getChunkForCollisions(int var1, int var2) { | |
- return this.getChunk(var1, var2, ChunkStatus.FULL, false); | |
+ return this.getChunk(☃, ☃, ChunkStatus.FULL, false); | |
} | |
public List<Entity> getEntities(@Nullable Entity var1, AABB var2, @Nullable Predicate<? super Entity> var3) { | |
this.getProfiler().incrementCounter("getEntities"); | |
- ArrayList var4 = Lists.newArrayList(); | |
- int var5 = Mth.floor((var2.minX - 2.0D) / 16.0D); | |
- int var6 = Mth.floor((var2.maxX + 2.0D) / 16.0D); | |
- int var7 = Mth.floor((var2.minZ - 2.0D) / 16.0D); | |
- int var8 = Mth.floor((var2.maxZ + 2.0D) / 16.0D); | |
- ChunkSource var9 = this.getChunkSource(); | |
+ List list = Lists.newArrayList(); | |
+ int i = Mth.floor((☃.minX - 2.0D) / 16.0D); | |
+ int j = Mth.floor((☃.maxX + 2.0D) / 16.0D); | |
+ int k = Mth.floor((☃.minZ - 2.0D) / 16.0D); | |
+ int l = Mth.floor((☃.maxZ + 2.0D) / 16.0D); | |
+ ChunkSource chunksource = this.getChunkSource(); | |
- for(int var10 = var5; var10 <= var6; ++var10) { | |
- for(int var11 = var7; var11 <= var8; ++var11) { | |
- LevelChunk var12 = var9.getChunk(var10, var11, false); | |
- if (var12 != null) { | |
- var12.getEntities((Entity)var1, var2, var4, var3); | |
+ for(int i1 = i; i1 <= j; ++i1) { | |
+ for(int j1 = k; j1 <= l; ++j1) { | |
+ LevelChunk levelchunk = chunksource.getChunk(i1, j1, false); | |
+ if (levelchunk != null) { | |
+ levelchunk.getEntities(☃, ☃, list, ☃); | |
} | |
} | |
} | |
- return var4; | |
+ return list; | |
} | |
public <T extends Entity> List<T> getEntities(@Nullable EntityType<T> var1, AABB var2, Predicate<? super T> var3) { | |
this.getProfiler().incrementCounter("getEntities"); | |
- int var4 = Mth.floor((var2.minX - 2.0D) / 16.0D); | |
- int var5 = Mth.ceil((var2.maxX + 2.0D) / 16.0D); | |
- int var6 = Mth.floor((var2.minZ - 2.0D) / 16.0D); | |
- int var7 = Mth.ceil((var2.maxZ + 2.0D) / 16.0D); | |
- ArrayList var8 = Lists.newArrayList(); | |
+ int i = Mth.floor((☃.minX - 2.0D) / 16.0D); | |
+ int j = Mth.ceil((☃.maxX + 2.0D) / 16.0D); | |
+ int k = Mth.floor((☃.minZ - 2.0D) / 16.0D); | |
+ int l = Mth.ceil((☃.maxZ + 2.0D) / 16.0D); | |
+ List list = Lists.newArrayList(); | |
- for(int var9 = var4; var9 < var5; ++var9) { | |
- for(int var10 = var6; var10 < var7; ++var10) { | |
- LevelChunk var11 = this.getChunkSource().getChunk(var9, var10, false); | |
- if (var11 != null) { | |
- var11.getEntities((EntityType)var1, var2, var8, var3); | |
+ for(int i1 = i; i1 < j; ++i1) { | |
+ for(int j1 = k; j1 < l; ++j1) { | |
+ LevelChunk levelchunk = this.getChunkSource().getChunk(i1, j1, false); | |
+ if (levelchunk != null) { | |
+ levelchunk.getEntities(☃, ☃, list, ☃); | |
} | |
} | |
} | |
- return var8; | |
+ return list; | |
} | |
public <T extends Entity> List<T> getEntitiesOfClass(Class<? extends T> var1, AABB var2, @Nullable Predicate<? super T> var3) { | |
this.getProfiler().incrementCounter("getEntities"); | |
- int var4 = Mth.floor((var2.minX - 2.0D) / 16.0D); | |
- int var5 = Mth.ceil((var2.maxX + 2.0D) / 16.0D); | |
- int var6 = Mth.floor((var2.minZ - 2.0D) / 16.0D); | |
- int var7 = Mth.ceil((var2.maxZ + 2.0D) / 16.0D); | |
- ArrayList var8 = Lists.newArrayList(); | |
- ChunkSource var9 = this.getChunkSource(); | |
+ int i = Mth.floor((☃.minX - 2.0D) / 16.0D); | |
+ int j = Mth.ceil((☃.maxX + 2.0D) / 16.0D); | |
+ int k = Mth.floor((☃.minZ - 2.0D) / 16.0D); | |
+ int l = Mth.ceil((☃.maxZ + 2.0D) / 16.0D); | |
+ List list = Lists.newArrayList(); | |
+ ChunkSource chunksource = this.getChunkSource(); | |
- for(int var10 = var4; var10 < var5; ++var10) { | |
- for(int var11 = var6; var11 < var7; ++var11) { | |
- LevelChunk var12 = var9.getChunk(var10, var11, false); | |
- if (var12 != null) { | |
- var12.getEntitiesOfClass(var1, var2, var8, var3); | |
+ for(int i1 = i; i1 < j; ++i1) { | |
+ for(int j1 = k; j1 < l; ++j1) { | |
+ LevelChunk levelchunk = chunksource.getChunk(i1, j1, false); | |
+ if (levelchunk != null) { | |
+ levelchunk.getEntitiesOfClass(☃, ☃, list, ☃); | |
} | |
} | |
} | |
- return var8; | |
+ return list; | |
} | |
public <T extends Entity> List<T> getLoadedEntitiesOfClass(Class<? extends T> var1, AABB var2, @Nullable Predicate<? super T> var3) { | |
this.getProfiler().incrementCounter("getLoadedEntities"); | |
- int var4 = Mth.floor((var2.minX - 2.0D) / 16.0D); | |
- int var5 = Mth.ceil((var2.maxX + 2.0D) / 16.0D); | |
- int var6 = Mth.floor((var2.minZ - 2.0D) / 16.0D); | |
- int var7 = Mth.ceil((var2.maxZ + 2.0D) / 16.0D); | |
- ArrayList var8 = Lists.newArrayList(); | |
- ChunkSource var9 = this.getChunkSource(); | |
+ int i = Mth.floor((☃.minX - 2.0D) / 16.0D); | |
+ int j = Mth.ceil((☃.maxX + 2.0D) / 16.0D); | |
+ int k = Mth.floor((☃.minZ - 2.0D) / 16.0D); | |
+ int l = Mth.ceil((☃.maxZ + 2.0D) / 16.0D); | |
+ List list = Lists.newArrayList(); | |
+ ChunkSource chunksource = this.getChunkSource(); | |
- for(int var10 = var4; var10 < var5; ++var10) { | |
- for(int var11 = var6; var11 < var7; ++var11) { | |
- LevelChunk var12 = var9.getChunkNow(var10, var11); | |
- if (var12 != null) { | |
- var12.getEntitiesOfClass(var1, var2, var8, var3); | |
+ for(int i1 = i; i1 < j; ++i1) { | |
+ for(int j1 = k; j1 < l; ++j1) { | |
+ LevelChunk levelchunk = chunksource.getChunkNow(i1, j1); | |
+ if (levelchunk != null) { | |
+ levelchunk.getEntitiesOfClass(☃, ☃, list, ☃); | |
} | |
} | |
} | |
- return var8; | |
+ return list; | |
} | |
@Nullable | |
public abstract Entity getEntity(int var1); | |
public void blockEntityChanged(BlockPos var1, BlockEntity var2) { | |
- if (this.hasChunkAt(var1)) { | |
- this.getChunkAt(var1).markUnsaved(); | |
+ if (this.hasChunkAt(☃)) { | |
+ this.getChunkAt(☃).markUnsaved(); | |
} | |
} | |
public int getSeaLevel() { | |
@@ -789,84 +779,81 @@ | |
public Level getLevel() { | |
return this; | |
} | |
public int getDirectSignalTo(BlockPos var1) { | |
- byte var2 = 0; | |
- int var3 = Math.max(var2, this.getDirectSignal(var1.below(), Direction.DOWN)); | |
- if (var3 >= 15) { | |
- return var3; | |
+ int i = 0; | |
+ i = Math.max(i, this.getDirectSignal(☃.below(), Direction.DOWN)); | |
+ if (i >= 15) { | |
+ return i; | |
} else { | |
- var3 = Math.max(var3, this.getDirectSignal(var1.above(), Direction.UP)); | |
- if (var3 >= 15) { | |
- return var3; | |
+ i = Math.max(i, this.getDirectSignal(☃.above(), Direction.UP)); | |
+ if (i >= 15) { | |
+ return i; | |
} else { | |
- var3 = Math.max(var3, this.getDirectSignal(var1.north(), Direction.NORTH)); | |
- if (var3 >= 15) { | |
- return var3; | |
+ i = Math.max(i, this.getDirectSignal(☃.north(), Direction.NORTH)); | |
+ if (i >= 15) { | |
+ return i; | |
} else { | |
- var3 = Math.max(var3, this.getDirectSignal(var1.south(), Direction.SOUTH)); | |
- if (var3 >= 15) { | |
- return var3; | |
+ i = Math.max(i, this.getDirectSignal(☃.south(), Direction.SOUTH)); | |
+ if (i >= 15) { | |
+ return i; | |
} else { | |
- var3 = Math.max(var3, this.getDirectSignal(var1.west(), Direction.WEST)); | |
- if (var3 >= 15) { | |
- return var3; | |
+ i = Math.max(i, this.getDirectSignal(☃.west(), Direction.WEST)); | |
+ if (i >= 15) { | |
+ return i; | |
} else { | |
- var3 = Math.max(var3, this.getDirectSignal(var1.east(), Direction.EAST)); | |
- return var3 >= 15 ? var3 : var3; | |
+ i = Math.max(i, this.getDirectSignal(☃.east(), Direction.EAST)); | |
+ return i >= 15 ? i : i; | |
} | |
} | |
} | |
} | |
} | |
} | |
public boolean hasSignal(BlockPos var1, Direction var2) { | |
- return this.getSignal(var1, var2) > 0; | |
+ return this.getSignal(☃, ☃) > 0; | |
} | |
public int getSignal(BlockPos var1, Direction var2) { | |
- BlockState var3 = this.getBlockState(var1); | |
- int var4 = var3.getSignal(this, var1, var2); | |
- return var3.isRedstoneConductor(this, var1) ? Math.max(var4, this.getDirectSignalTo(var1)) : var4; | |
+ BlockState blockstate = this.getBlockState(☃); | |
+ int i = blockstate.getSignal(this, ☃, ☃); | |
+ return blockstate.isRedstoneConductor(this, ☃) ? Math.max(i, this.getDirectSignalTo(☃)) : i; | |
} | |
public boolean hasNeighborSignal(BlockPos var1) { | |
- if (this.getSignal(var1.below(), Direction.DOWN) > 0) { | |
+ if (this.getSignal(☃.below(), Direction.DOWN) > 0) { | |
return true; | |
- } else if (this.getSignal(var1.above(), Direction.UP) > 0) { | |
+ } else if (this.getSignal(☃.above(), Direction.UP) > 0) { | |
return true; | |
- } else if (this.getSignal(var1.north(), Direction.NORTH) > 0) { | |
+ } else if (this.getSignal(☃.north(), Direction.NORTH) > 0) { | |
return true; | |
- } else if (this.getSignal(var1.south(), Direction.SOUTH) > 0) { | |
+ } else if (this.getSignal(☃.south(), Direction.SOUTH) > 0) { | |
return true; | |
- } else if (this.getSignal(var1.west(), Direction.WEST) > 0) { | |
+ } else if (this.getSignal(☃.west(), Direction.WEST) > 0) { | |
return true; | |
} else { | |
- return this.getSignal(var1.east(), Direction.EAST) > 0; | |
+ return this.getSignal(☃.east(), Direction.EAST) > 0; | |
} | |
} | |
public int getBestNeighborSignal(BlockPos var1) { | |
- int var2 = 0; | |
- Direction[] var3 = DIRECTIONS; | |
- int var4 = var3.length; | |
+ int i = 0; | |
- for(int var5 = 0; var5 < var4; ++var5) { | |
- Direction var6 = var3[var5]; | |
- int var7 = this.getSignal(var1.relative(var6), var6); | |
- if (var7 >= 15) { | |
+ for(Direction direction : DIRECTIONS) { | |
+ int j = this.getSignal(☃.relative(direction), direction); | |
+ if (j >= 15) { | |
return 15; | |
} | |
- if (var7 > var2) { | |
- var2 = var7; | |
+ if (j > i) { | |
+ i = j; | |
} | |
} | |
- return var2; | |
+ return i; | |
} | |
public void disconnect() { | |
} | |
@@ -884,11 +871,11 @@ | |
public void broadcastEntityEvent(Entity var1, byte var2) { | |
} | |
public void blockEvent(BlockPos var1, Block var2, int var3, int var4) { | |
- this.getBlockState(var1).triggerEvent(this, var1, var3, var4); | |
+ this.getBlockState(☃).triggerEvent(this, ☃, ☃, ☃); | |
} | |
public LevelData getLevelData() { | |
return this.levelData; | |
} | |
@@ -896,25 +883,25 @@ | |
public GameRules getGameRules() { | |
return this.levelData.getGameRules(); | |
} | |
public float getThunderLevel(float var1) { | |
- return Mth.lerp(var1, this.oThunderLevel, this.thunderLevel) * this.getRainLevel(var1); | |
+ return Mth.lerp(☃, this.oThunderLevel, this.thunderLevel) * this.getRainLevel(☃); | |
} | |
public void setThunderLevel(float var1) { | |
- this.oThunderLevel = var1; | |
- this.thunderLevel = var1; | |
+ this.oThunderLevel = ☃; | |
+ this.thunderLevel = ☃; | |
} | |
public float getRainLevel(float var1) { | |
- return Mth.lerp(var1, this.oRainLevel, this.rainLevel); | |
+ return Mth.lerp(☃, this.oRainLevel, this.rainLevel); | |
} | |
public void setRainLevel(float var1) { | |
- this.oRainLevel = var1; | |
- this.rainLevel = var1; | |
+ this.oRainLevel = ☃; | |
+ this.rainLevel = ☃; | |
} | |
public boolean isThundering() { | |
if (this.dimensionType().hasSkyLight() && !this.dimensionType().hasCeiling()) { | |
return (double)this.getThunderLevel(1.0F) > 0.9D; | |
@@ -928,23 +915,23 @@ | |
} | |
public boolean isRainingAt(BlockPos var1) { | |
if (!this.isRaining()) { | |
return false; | |
- } else if (!this.canSeeSky(var1)) { | |
+ } else if (!this.canSeeSky(☃)) { | |
return false; | |
- } else if (this.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, var1).getY() > var1.getY()) { | |
+ } else if (this.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, ☃).getY() > ☃.getY()) { | |
return false; | |
} else { | |
- Biome var2 = this.getBiome(var1); | |
- return var2.getPrecipitation() == Biome.Precipitation.RAIN && var2.getTemperature(var1) >= 0.15F; | |
+ Biome biome = this.getBiome(☃); | |
+ return biome.getPrecipitation() == Biome.Precipitation.RAIN && biome.getTemperature(☃) >= 0.15F; | |
} | |
} | |
public boolean isHumidAt(BlockPos var1) { | |
- Biome var2 = this.getBiome(var1); | |
- return var2.isHumid(); | |
+ Biome biome = this.getBiome(☃); | |
+ return biome.isHumid(); | |
} | |
@Nullable | |
public abstract MapItemSavedData getMapData(String var1); | |
@@ -954,67 +941,59 @@ | |
public void globalLevelEvent(int var1, BlockPos var2, int var3) { | |
} | |
public CrashReportCategory fillReportDetails(CrashReport var1) { | |
- CrashReportCategory var2 = var1.addCategory("Affected level", 1); | |
- var2.setDetail("All players", () -> { | |
- return this.players().size() + " total; " + this.players(); | |
- }); | |
- ChunkSource var10002 = this.getChunkSource(); | |
- var2.setDetail("Chunk stats", var10002::gatherStats); | |
- var2.setDetail("Level dimension", () -> { | |
- return this.dimension().location().toString(); | |
- }); | |
+ CrashReportCategory crashreportcategory = ☃.addCategory("Affected level", 1); | |
+ crashreportcategory.setDetail("All players", () -> this.players().size() + " total; " + this.players()); | |
+ crashreportcategory.setDetail("Chunk stats", this.getChunkSource()::gatherStats); | |
+ crashreportcategory.setDetail("Level dimension", () -> this.dimension().location().toString()); | |
try { | |
- this.levelData.fillCrashReportCategory(var2); | |
- } catch (Throwable var4) { | |
- var2.setDetailError("Level Data Unobtainable", var4); | |
+ this.levelData.fillCrashReportCategory(crashreportcategory); | |
+ } catch (Throwable throwable) { | |
+ crashreportcategory.setDetailError("Level Data Unobtainable", throwable); | |
} | |
- return var2; | |
+ return crashreportcategory; | |
} | |
public abstract void destroyBlockProgress(int var1, BlockPos var2, int var3); | |
public void createFireworks(double var1, double var3, double var5, double var7, double var9, double var11, @Nullable CompoundTag var13) { | |
} | |
public abstract Scoreboard getScoreboard(); | |
public void updateNeighbourForOutputSignal(BlockPos var1, Block var2) { | |
- Iterator var3 = Direction.Plane.HORIZONTAL.iterator(); | |
- | |
- while(var3.hasNext()) { | |
- Direction var4 = (Direction)var3.next(); | |
- BlockPos var5 = var1.relative(var4); | |
- if (this.hasChunkAt(var5)) { | |
- BlockState var6 = this.getBlockState(var5); | |
- if (var6.is(Blocks.COMPARATOR)) { | |
- var6.neighborChanged(this, var5, var2, var1, false); | |
- } else if (var6.isRedstoneConductor(this, var5)) { | |
- var5 = var5.relative(var4); | |
- var6 = this.getBlockState(var5); | |
- if (var6.is(Blocks.COMPARATOR)) { | |
- var6.neighborChanged(this, var5, var2, var1, false); | |
+ for(Direction direction : Direction.Plane.HORIZONTAL) { | |
+ BlockPos blockpos = ☃.relative(direction); | |
+ if (this.hasChunkAt(blockpos)) { | |
+ BlockState blockstate = this.getBlockState(blockpos); | |
+ if (blockstate.is(Blocks.COMPARATOR)) { | |
+ blockstate.neighborChanged(this, blockpos, ☃, ☃, false); | |
+ } else if (blockstate.isRedstoneConductor(this, blockpos)) { | |
+ blockpos = blockpos.relative(direction); | |
+ blockstate = this.getBlockState(blockpos); | |
+ if (blockstate.is(Blocks.COMPARATOR)) { | |
+ blockstate.neighborChanged(this, blockpos, ☃, ☃, false); | |
} | |
} | |
} | |
} | |
} | |
public DifficultyInstance getCurrentDifficultyAt(BlockPos var1) { | |
- long var2 = 0L; | |
- float var4 = 0.0F; | |
- if (this.hasChunkAt(var1)) { | |
- var4 = this.getMoonBrightness(); | |
- var2 = this.getChunkAt(var1).getInhabitedTime(); | |
+ long i = 0L; | |
+ float f = 0.0F; | |
+ if (this.hasChunkAt(☃)) { | |
+ f = this.getMoonBrightness(); | |
+ i = this.getChunkAt(☃).getInhabitedTime(); | |
} | |
- return new DifficultyInstance(this.getDifficulty(), this.getDayTime(), var2, var4); | |
+ return new DifficultyInstance(this.getDifficulty(), this.getDayTime(), i, f); | |
} | |
public int getSkyDarken() { | |
return this.skyDarken; | |
} | |
@@ -1045,29 +1024,29 @@ | |
public Random getRandom() { | |
return this.random; | |
} | |
public boolean isStateAtPosition(BlockPos var1, Predicate<BlockState> var2) { | |
- return var2.test(this.getBlockState(var1)); | |
+ return ☃.test(this.getBlockState(☃)); | |
} | |
public abstract RecipeManager getRecipeManager(); | |
public abstract TagManager getTagManager(); | |
public BlockPos getBlockRandomPos(int var1, int var2, int var3, int var4) { | |
this.randValue = this.randValue * 3 + 1013904223; | |
- int var5 = this.randValue >> 2; | |
- return new BlockPos(var1 + (var5 & 15), var2 + (var5 >> 16 & var4), var3 + (var5 >> 8 & 15)); | |
+ int i = this.randValue >> 2; | |
+ return new BlockPos(☃ + (i & 15), ☃ + (i >> 16 & ☃), ☃ + (i >> 8 & 15)); | |
} | |
public boolean noSave() { | |
return false; | |
} | |
public ProfilerFiller getProfiler() { | |
- return (ProfilerFiller)this.profiler.get(); | |
+ return this.profiler.get(); | |
} | |
public Supplier<ProfilerFiller> getProfilerSupplier() { | |
return this.profiler; | |
} | |
@@ -1077,14 +1056,6 @@ | |
} | |
public final boolean isDebug() { | |
return this.isDebug; | |
} | |
- | |
- static { | |
- RESOURCE_KEY_CODEC = ResourceLocation.CODEC.xmap(ResourceKey.elementKey(Registry.DIMENSION_REGISTRY), ResourceKey::location); | |
- OVERWORLD = ResourceKey.create(Registry.DIMENSION_REGISTRY, new ResourceLocation("overworld")); | |
- NETHER = ResourceKey.create(Registry.DIMENSION_REGISTRY, new ResourceLocation("the_nether")); | |
- END = ResourceKey.create(Registry.DIMENSION_REGISTRY, new ResourceLocation("the_end")); | |
- DIRECTIONS = Direction.values(); | |
- } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment