|
|
|
|
@@ -0,0 +1,692 @@
|
|
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From: Yive <6853318+Yive@users.noreply.github.com>
|
|
|
|
|
Date: Tue, 6 May 2025 22:14:55 -0700
|
|
|
|
|
Subject: [PATCH] Pluto: Expose Direction$Plane's faces
|
|
|
|
|
|
|
|
|
|
The JMH benchmark of this patch can be found in SunBox's `CachedEnumValuesForLoop`
|
|
|
|
|
|
|
|
|
|
Original license: GPL-3.0
|
|
|
|
|
Original project: https://github.com/Yive/Pluto
|
|
|
|
|
|
|
|
|
|
diff --git a/net/minecraft/core/Direction.java b/net/minecraft/core/Direction.java
|
|
|
|
|
index 8447557b808f420f22c54882bf51a308965063fe..22428e3cdbcc2f6fa15d57010076bed84a9a880b 100644
|
|
|
|
|
--- a/net/minecraft/core/Direction.java
|
|
|
|
|
+++ b/net/minecraft/core/Direction.java
|
|
|
|
|
@@ -627,7 +627,7 @@ public enum Direction implements StringRepresentable, ca.spottedleaf.moonrise.pa
|
|
|
|
|
HORIZONTAL(new Direction[]{Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST}, new Direction.Axis[]{Direction.Axis.X, Direction.Axis.Z}),
|
|
|
|
|
VERTICAL(new Direction[]{Direction.UP, Direction.DOWN}, new Direction.Axis[]{Direction.Axis.Y});
|
|
|
|
|
|
|
|
|
|
- private final Direction[] faces;
|
|
|
|
|
+ public final Direction[] faces; // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
private final Direction.Axis[] axis;
|
|
|
|
|
|
|
|
|
|
private Plane(final Direction[] faces, final Direction.Axis[] axis) {
|
|
|
|
|
diff --git a/net/minecraft/data/worldgen/features/VegetationFeatures.java b/net/minecraft/data/worldgen/features/VegetationFeatures.java
|
|
|
|
|
index 45093451fb25ae3bb1e57d2e53c49a1ae666e31e..c228135032b5f74fd1ec96a2cf52aa3e9cac19cd 100644
|
|
|
|
|
--- a/net/minecraft/data/worldgen/features/VegetationFeatures.java
|
|
|
|
|
+++ b/net/minecraft/data/worldgen/features/VegetationFeatures.java
|
|
|
|
|
@@ -812,7 +812,7 @@ public class VegetationFeatures {
|
|
|
|
|
WeightedList.Builder<BlockState> builder = WeightedList.builder();
|
|
|
|
|
|
|
|
|
|
for (int i = minAmount; i <= maxAmount; i++) {
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
builder.add(block.defaultBlockState().setValue(amountProperty, i).setValue(directionProperty, direction), 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
|
|
|
|
index c5fea3948be691c42e9a94ddb0acd04fcc0b4415..7f6eda550ad99dad49aa3d47800213b7ba2d341a 100644
|
|
|
|
|
--- a/net/minecraft/server/level/ServerLevel.java
|
|
|
|
|
+++ b/net/minecraft/server/level/ServerLevel.java
|
|
|
|
|
@@ -1179,7 +1179,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
|
|
|
// We only need to check blocks that are taller than the minimum step height
|
|
|
|
|
if (org.purpurmc.purpur.PurpurConfig.smoothSnowAccumulationStep > 0 && layersValue >= org.purpurmc.purpur.PurpurConfig.smoothSnowAccumulationStep) {
|
|
|
|
|
int layersValueMin = layersValue - org.purpurmc.purpur.PurpurConfig.smoothSnowAccumulationStep;
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
BlockPos blockPosNeighbor = heightmapPos.relative(direction);
|
|
|
|
|
BlockState blockStateNeighbor = this.getBlockState(blockPosNeighbor);
|
|
|
|
|
if (blockStateNeighbor.is(Blocks.SNOW)) {
|
|
|
|
|
diff --git a/net/minecraft/world/entity/ai/behavior/PrepareRamNearestTarget.java b/net/minecraft/world/entity/ai/behavior/PrepareRamNearestTarget.java
|
|
|
|
|
index dfd39ff8f4a17b42bda60f2bcec5ebc163c25954..e1039aa68f996c94a98f17c89320d4539c022d77 100644
|
|
|
|
|
--- a/net/minecraft/world/entity/ai/behavior/PrepareRamNearestTarget.java
|
|
|
|
|
+++ b/net/minecraft/world/entity/ai/behavior/PrepareRamNearestTarget.java
|
|
|
|
|
@@ -145,7 +145,7 @@ public class PrepareRamNearestTarget<E extends PathfinderMob> extends Behavior<E
|
|
|
|
|
List<BlockPos> list = Lists.newArrayList();
|
|
|
|
|
BlockPos.MutableBlockPos mutableBlockPos = blockPos.mutable();
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
mutableBlockPos.set(blockPos);
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < this.maxRamDistance; i++) {
|
|
|
|
|
diff --git a/net/minecraft/world/entity/ai/behavior/TryFindLandNearWater.java b/net/minecraft/world/entity/ai/behavior/TryFindLandNearWater.java
|
|
|
|
|
index d11840ec223d8429131e797a83e12709e2d8bfe3..c6eddfc59c345507b6e6b57c4ed41e2c6c3bed9f 100644
|
|
|
|
|
--- a/net/minecraft/world/entity/ai/behavior/TryFindLandNearWater.java
|
|
|
|
|
+++ b/net/minecraft/world/entity/ai/behavior/TryFindLandNearWater.java
|
|
|
|
|
@@ -40,7 +40,7 @@ public class TryFindLandNearWater {
|
|
|
|
|
&& !level.getBlockState(mutableBlockPos.setWithOffset(blockPos1, Direction.DOWN))
|
|
|
|
|
.getCollisionShape(level, blockPos1, collisionContext)
|
|
|
|
|
.isEmpty()) {
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
mutableBlockPos.setWithOffset(blockPos1, direction);
|
|
|
|
|
if (level.getBlockState(mutableBlockPos).isAir()
|
|
|
|
|
&& level.getBlockState(mutableBlockPos.move(Direction.DOWN)).is(Blocks.WATER)) {
|
|
|
|
|
diff --git a/net/minecraft/world/entity/ai/behavior/TryLaySpawnOnWaterNearLand.java b/net/minecraft/world/entity/ai/behavior/TryLaySpawnOnWaterNearLand.java
|
|
|
|
|
index 011d82078041b51eb32b0b9f6ef3b9c0a95092ae..d149b1114ccace06bdbe608014099ba986503cb6 100644
|
|
|
|
|
--- a/net/minecraft/world/entity/ai/behavior/TryLaySpawnOnWaterNearLand.java
|
|
|
|
|
+++ b/net/minecraft/world/entity/ai/behavior/TryLaySpawnOnWaterNearLand.java
|
|
|
|
|
@@ -26,7 +26,7 @@ public class TryLaySpawnOnWaterNearLand {
|
|
|
|
|
if (!entity.isInWater() && entity.onGround()) {
|
|
|
|
|
BlockPos blockPos = entity.blockPosition().below();
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
BlockPos blockPos1 = blockPos.relative(direction);
|
|
|
|
|
if (level.getBlockState(blockPos1).getCollisionShape(level, blockPos1).getFaceShape(Direction.UP).isEmpty()
|
|
|
|
|
&& level.getFluidState(blockPos1).is(Fluids.WATER)) {
|
|
|
|
|
diff --git a/net/minecraft/world/entity/projectile/AbstractThrownPotion.java b/net/minecraft/world/entity/projectile/AbstractThrownPotion.java
|
|
|
|
|
index d26867def6c549c8c909213d4f91895f1168cae6..44e7b63e91d298c6c014ca45f356f82f53561f39 100644
|
|
|
|
|
--- a/net/minecraft/world/entity/projectile/AbstractThrownPotion.java
|
|
|
|
|
+++ b/net/minecraft/world/entity/projectile/AbstractThrownPotion.java
|
|
|
|
|
@@ -57,7 +57,7 @@ public abstract class AbstractThrownPotion extends ThrowableItemProjectile {
|
|
|
|
|
this.dowseFire(blockPos1);
|
|
|
|
|
this.dowseFire(blockPos1.relative(direction.getOpposite()));
|
|
|
|
|
|
|
|
|
|
- for (Direction direction1 : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction1 : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
this.dowseFire(blockPos1.relative(direction1));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
|
|
|
|
|
index 2ec44cbd781426b4c8983f47665fe0aac1b4f214..50a80610645f225ef24cb774feec87d462f80662 100644
|
|
|
|
|
--- a/net/minecraft/world/level/Level.java
|
|
|
|
|
+++ b/net/minecraft/world/level/Level.java
|
|
|
|
|
@@ -2065,7 +2065,7 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
|
|
|
|
public abstract Scoreboard getScoreboard();
|
|
|
|
|
|
|
|
|
|
public void updateNeighbourForOutputSignal(BlockPos pos, Block block) {
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
BlockPos blockPos = pos.relative(direction);
|
|
|
|
|
if (this.hasChunkAt(blockPos)) {
|
|
|
|
|
BlockState blockState = this.getBlockState(blockPos);
|
|
|
|
|
diff --git a/net/minecraft/world/level/block/CactusBlock.java b/net/minecraft/world/level/block/CactusBlock.java
|
|
|
|
|
index 292260b769956f25c280e4a767382823ba500b58..d6f963f0cf53e0daac7688c0dd2ec4d48b5d52b1 100644
|
|
|
|
|
--- a/net/minecraft/world/level/block/CactusBlock.java
|
|
|
|
|
+++ b/net/minecraft/world/level/block/CactusBlock.java
|
|
|
|
|
@@ -141,7 +141,7 @@ public class CactusBlock extends Block implements BonemealableBlock { // Purpur
|
|
|
|
|
}
|
|
|
|
|
protected boolean canSurvive(LevelReader level, BlockPos pos) {
|
|
|
|
|
// Pluto end - Check if the cactus can even survive being placed
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
BlockState blockState = level.getBlockState(pos.relative(direction));
|
|
|
|
|
if ((level.getWorldBorder().world.purpurConfig.cactusBreaksFromSolidNeighbors && blockState.isSolid()) || level.getFluidState(pos.relative(direction)).is(FluidTags.LAVA)) { // Purpur - Cactus breaks from solid neighbors config
|
|
|
|
|
return false;
|
|
|
|
|
diff --git a/net/minecraft/world/level/block/ChorusFlowerBlock.java b/net/minecraft/world/level/block/ChorusFlowerBlock.java
|
|
|
|
|
index 32ba79c568ef9e75639f03cd7cc34be569638742..faf9e7c08f0b49325f78e4dd49e2924d3e518699 100644
|
|
|
|
|
--- a/net/minecraft/world/level/block/ChorusFlowerBlock.java
|
|
|
|
|
+++ b/net/minecraft/world/level/block/ChorusFlowerBlock.java
|
|
|
|
|
@@ -152,7 +152,7 @@ public class ChorusFlowerBlock extends Block {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static boolean allNeighborsEmpty(LevelReader level, BlockPos pos, @Nullable Direction excludingSide) {
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
if (direction != excludingSide && !level.isEmptyBlock(pos.relative(direction))) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
@@ -188,7 +188,7 @@ public class ChorusFlowerBlock extends Block {
|
|
|
|
|
} else {
|
|
|
|
|
boolean flag = false;
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
BlockState blockState1 = level.getBlockState(pos.relative(direction));
|
|
|
|
|
if (blockState1.is(this.plant)) {
|
|
|
|
|
if (flag) {
|
|
|
|
|
diff --git a/net/minecraft/world/level/block/ChorusPlantBlock.java b/net/minecraft/world/level/block/ChorusPlantBlock.java
|
|
|
|
|
index 47f3b008b252678105368dc577ed66353ff50eb3..47df6c8bc4b024463011c9cc380b433636458151 100644
|
|
|
|
|
--- a/net/minecraft/world/level/block/ChorusPlantBlock.java
|
|
|
|
|
+++ b/net/minecraft/world/level/block/ChorusPlantBlock.java
|
|
|
|
|
@@ -95,7 +95,7 @@ public class ChorusPlantBlock extends PipeBlock {
|
|
|
|
|
BlockState blockState = level.getBlockState(pos.below());
|
|
|
|
|
boolean flag = !level.getBlockState(pos.above()).isAir() && !blockState.isAir();
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
BlockPos blockPos = pos.relative(direction);
|
|
|
|
|
BlockState blockState1 = level.getBlockState(blockPos);
|
|
|
|
|
if (blockState1.is(this)) {
|
|
|
|
|
diff --git a/net/minecraft/world/level/block/MossyCarpetBlock.java b/net/minecraft/world/level/block/MossyCarpetBlock.java
|
|
|
|
|
index 8e0e66e1ae6fea2460fdef154bb26af01394b6df..73af154f381c676cc2cc096cdc689d2125ce50e0 100644
|
|
|
|
|
--- a/net/minecraft/world/level/block/MossyCarpetBlock.java
|
|
|
|
|
+++ b/net/minecraft/world/level/block/MossyCarpetBlock.java
|
|
|
|
|
@@ -134,7 +134,7 @@ public class MossyCarpetBlock extends Block implements BonemealableBlock {
|
|
|
|
|
BlockState blockState1 = null;
|
|
|
|
|
tip |= state.getValue(BASE);
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
EnumProperty<WallSide> propertyForFace = getPropertyForFace(direction);
|
|
|
|
|
WallSide wallSide = canSupportAtFace(level, pos, direction) ? (tip ? WallSide.LOW : state.getValue(propertyForFace)) : WallSide.NONE;
|
|
|
|
|
if (wallSide == WallSide.LOW) {
|
|
|
|
|
@@ -200,7 +200,7 @@ public class MossyCarpetBlock extends Block implements BonemealableBlock {
|
|
|
|
|
BlockState blockState1 = Blocks.PALE_MOSS_CARPET.defaultBlockState().setValue(BASE, false);
|
|
|
|
|
BlockState updatedState = getUpdatedState(blockState1, level, pos.above(), true);
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
EnumProperty<WallSide> propertyForFace = getPropertyForFace(direction);
|
|
|
|
|
if (updatedState.getValue(propertyForFace) != WallSide.NONE && !placeSide.getAsBoolean()) {
|
|
|
|
|
updatedState = updatedState.setValue(propertyForFace, WallSide.NONE);
|
|
|
|
|
diff --git a/net/minecraft/world/level/block/RailState.java b/net/minecraft/world/level/block/RailState.java
|
|
|
|
|
index 3b69f9502c30a69519b7b722aecb9e25da8c55f0..b2c6af1dc9fa8330ee7d525b588725aca71184ca 100644
|
|
|
|
|
--- a/net/minecraft/world/level/block/RailState.java
|
|
|
|
|
+++ b/net/minecraft/world/level/block/RailState.java
|
|
|
|
|
@@ -133,7 +133,7 @@ public class RailState {
|
|
|
|
|
protected int countPotentialConnections() {
|
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
if (this.hasRail(this.pos.relative(direction))) {
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
diff --git a/net/minecraft/world/level/block/RedStoneWireBlock.java b/net/minecraft/world/level/block/RedStoneWireBlock.java
|
|
|
|
|
index a4e26381dcc831361c2d6bef6427d1d6eb7cef18..0b3d8fdd053ad74f32c33cb17e65aeeedd24d520 100644
|
|
|
|
|
--- a/net/minecraft/world/level/block/RedStoneWireBlock.java
|
|
|
|
|
+++ b/net/minecraft/world/level/block/RedStoneWireBlock.java
|
|
|
|
|
@@ -160,7 +160,7 @@ public class RedStoneWireBlock extends Block {
|
|
|
|
|
private BlockState getMissingConnections(BlockGetter level, BlockState state, BlockPos pos) {
|
|
|
|
|
boolean flag = !level.getBlockState(pos.above()).isRedstoneConductor(level, pos);
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
if (!state.getValue(PROPERTY_BY_DIRECTION.get(direction)).isConnected()) {
|
|
|
|
|
RedstoneSide connectingSide = this.getConnectingSide(level, pos, direction, flag);
|
|
|
|
|
state = state.setValue(PROPERTY_BY_DIRECTION.get(direction), connectingSide);
|
|
|
|
|
@@ -213,7 +213,7 @@ public class RedStoneWireBlock extends Block {
|
|
|
|
|
protected void updateIndirectNeighbourShapes(BlockState state, LevelAccessor level, BlockPos pos, int flags, int recursionLeft) {
|
|
|
|
|
BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos();
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
RedstoneSide redstoneSide = state.getValue(PROPERTY_BY_DIRECTION.get(direction));
|
|
|
|
|
if (redstoneSide != RedstoneSide.NONE && !level.getBlockState(mutableBlockPos.setWithOffset(pos, direction)).is(this)) {
|
|
|
|
|
mutableBlockPos.move(Direction.DOWN);
|
|
|
|
|
@@ -377,7 +377,7 @@ public class RedStoneWireBlock extends Block {
|
|
|
|
|
}
|
|
|
|
|
// Paper end - optimize redstone
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.VERTICAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.VERTICAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
level.updateNeighborsAt(pos.relative(direction), this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -404,11 +404,11 @@ public class RedStoneWireBlock extends Block {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void updateNeighborsOfNeighboringWires(Level level, BlockPos pos) {
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
this.checkCornerChangeAt(level, pos.relative(direction));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
BlockPos blockPos = pos.relative(direction);
|
|
|
|
|
if (level.getBlockState(blockPos).isRedstoneConductor(level, blockPos)) {
|
|
|
|
|
this.checkCornerChangeAt(level, blockPos.above());
|
|
|
|
|
@@ -521,7 +521,7 @@ public class RedStoneWireBlock extends Block {
|
|
|
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
|
|
|
int powerValue = state.getValue(POWER);
|
|
|
|
|
if (powerValue != 0) {
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
RedstoneSide redstoneSide = state.getValue(PROPERTY_BY_DIRECTION.get(direction));
|
|
|
|
|
switch (redstoneSide) {
|
|
|
|
|
case UP:
|
|
|
|
|
@@ -600,7 +600,7 @@ public class RedStoneWireBlock extends Block {
|
|
|
|
|
private void updatesOnShapeChange(Level level, BlockPos pos, BlockState oldState, BlockState newState) {
|
|
|
|
|
Orientation orientation = ExperimentalRedstoneUtils.initialOrientation(level, null, Direction.UP);
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
BlockPos blockPos = pos.relative(direction);
|
|
|
|
|
if (oldState.getValue(PROPERTY_BY_DIRECTION.get(direction)).isConnected() != newState.getValue(PROPERTY_BY_DIRECTION.get(direction)).isConnected()
|
|
|
|
|
&& level.getBlockState(blockPos).isRedstoneConductor(level, blockPos)) {
|
|
|
|
|
diff --git a/net/minecraft/world/level/block/ScaffoldingBlock.java b/net/minecraft/world/level/block/ScaffoldingBlock.java
|
|
|
|
|
index 1fa344f0a48ce1411fa369fd2f2e7ef3bdb7079e..d8af8eaa654b520d44d742614c13a4c6bab3c855 100644
|
|
|
|
|
--- a/net/minecraft/world/level/block/ScaffoldingBlock.java
|
|
|
|
|
+++ b/net/minecraft/world/level/block/ScaffoldingBlock.java
|
|
|
|
|
@@ -165,7 +165,7 @@ public class ScaffoldingBlock extends Block implements SimpleWaterloggedBlock {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
BlockState blockState1 = level.getBlockState(mutableBlockPos.setWithOffset(pos, direction));
|
|
|
|
|
if (blockState1.is(Blocks.SCAFFOLDING)) {
|
|
|
|
|
i = Math.min(i, blockState1.getValue(DISTANCE) + 1);
|
|
|
|
|
diff --git a/net/minecraft/world/level/block/SugarCaneBlock.java b/net/minecraft/world/level/block/SugarCaneBlock.java
|
|
|
|
|
index baa56c6422c0924bb8b7c5a78db17acf784f28d6..7d5e1e773056bf426b71b0971c23646cfe6daf5a 100644
|
|
|
|
|
--- a/net/minecraft/world/level/block/SugarCaneBlock.java
|
|
|
|
|
+++ b/net/minecraft/world/level/block/SugarCaneBlock.java
|
|
|
|
|
@@ -95,7 +95,7 @@ public class SugarCaneBlock extends Block implements BonemealableBlock { // Purp
|
|
|
|
|
if (blockState.is(BlockTags.DIRT) || blockState.is(BlockTags.SAND)) {
|
|
|
|
|
BlockPos blockPos = pos.below();
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
BlockState blockState1 = level.getBlockState(blockPos.relative(direction));
|
|
|
|
|
FluidState fluidState = level.getFluidState(blockPos.relative(direction));
|
|
|
|
|
if (fluidState.is(FluidTags.WATER) || blockState1.is(Blocks.FROSTED_ICE)) {
|
|
|
|
|
diff --git a/net/minecraft/world/level/block/VineBlock.java b/net/minecraft/world/level/block/VineBlock.java
|
|
|
|
|
index 5aed66756201c3f0e75675705f2a67adb554d048..f9d65aabc85a5015871c64399087a817f7f81d38 100644
|
|
|
|
|
--- a/net/minecraft/world/level/block/VineBlock.java
|
|
|
|
|
+++ b/net/minecraft/world/level/block/VineBlock.java
|
|
|
|
|
@@ -125,7 +125,7 @@ public class VineBlock extends Block {
|
|
|
|
|
|
|
|
|
|
BlockState blockState = null;
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
BooleanProperty propertyForFace = getPropertyForFace(direction);
|
|
|
|
|
if (state.getValue(propertyForFace)) {
|
|
|
|
|
boolean canSupportAtFace = this.canSupportAtFace(level, pos, direction);
|
|
|
|
|
@@ -215,7 +215,7 @@ public class VineBlock extends Block {
|
|
|
|
|
|
|
|
|
|
BlockState blockState1 = state;
|
|
|
|
|
|
|
|
|
|
- for (Direction clockWise : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction clockWise : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
if (random.nextBoolean() || !isAcceptableNeighbour(level, blockPos.relative(clockWise), clockWise)) {
|
|
|
|
|
blockState1 = blockState1.setValue(getPropertyForFace(clockWise), false);
|
|
|
|
|
}
|
|
|
|
|
@@ -246,7 +246,7 @@ public class VineBlock extends Block {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private BlockState copyRandomFaces(BlockState sourceState, BlockState spreadState, RandomSource random) {
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
if (random.nextBoolean()) {
|
|
|
|
|
BooleanProperty propertyForFace = getPropertyForFace(direction);
|
|
|
|
|
if (sourceState.getValue(propertyForFace)) {
|
|
|
|
|
diff --git a/net/minecraft/world/level/block/sounds/AmbientDesertBlockSoundsPlayer.java b/net/minecraft/world/level/block/sounds/AmbientDesertBlockSoundsPlayer.java
|
|
|
|
|
index ebb3a5d68e5bf3ad5d2c7d12f82fcce1192c476b..0f43e03723e438ed8211c7cc5ebd02378758248d 100644
|
|
|
|
|
--- a/net/minecraft/world/level/block/sounds/AmbientDesertBlockSoundsPlayer.java
|
|
|
|
|
+++ b/net/minecraft/world/level/block/sounds/AmbientDesertBlockSoundsPlayer.java
|
|
|
|
|
@@ -58,7 +58,7 @@ public class AmbientDesertBlockSoundsPlayer {
|
|
|
|
|
int i1 = 0;
|
|
|
|
|
BlockPos.MutableBlockPos mutableBlockPos = pos.mutable();
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
mutableBlockPos.set(pos).move(direction, 8);
|
|
|
|
|
if (columnContainsTriggeringBlock(level, mutableBlockPos) && i++ >= 3) {
|
|
|
|
|
return true;
|
|
|
|
|
diff --git a/net/minecraft/world/level/dimension/end/EndDragonFight.java b/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
|
|
|
|
index 62ffb8e88b76f9765283d40d5ddcd9320063ca55..d4991a3ae015cfde4496e67e228f0bfd43867e54 100644
|
|
|
|
|
--- a/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
|
|
|
|
+++ b/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
|
|
|
|
@@ -556,7 +556,7 @@ public class EndDragonFight {
|
|
|
|
|
List<EndCrystal> list = Lists.newArrayList();
|
|
|
|
|
BlockPos blockPos1 = blockPos.above(1);
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
List<EndCrystal> entitiesOfClass = this.level.getEntitiesOfClass(EndCrystal.class, new AABB(blockPos1.relative(direction, 2)));
|
|
|
|
|
if (entitiesOfClass.isEmpty()) {
|
|
|
|
|
return false; // CraftBukkit - return value
|
|
|
|
|
diff --git a/net/minecraft/world/level/levelgen/blending/Blender.java b/net/minecraft/world/level/levelgen/blending/Blender.java
|
|
|
|
|
index 001b3cec50498186ab4f309118776c2ed6cce911..05cd9596a9dcbe967df5a0a1fd5528a0b01c2b70 100644
|
|
|
|
|
--- a/net/minecraft/world/level/levelgen/blending/Blender.java
|
|
|
|
|
+++ b/net/minecraft/world/level/levelgen/blending/Blender.java
|
|
|
|
|
@@ -270,7 +270,7 @@ public class Blender {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
if (region.getChunk(pos.x + direction.getStepX(), pos.z + direction.getStepZ()).isOldNoiseGeneration() != isOldNoiseGeneration) {
|
|
|
|
|
int i2 = direction == Direction.EAST ? 15 : 0;
|
|
|
|
|
int i3 = direction == Direction.WEST ? 0 : 15;
|
|
|
|
|
diff --git a/net/minecraft/world/level/levelgen/feature/BonusChestFeature.java b/net/minecraft/world/level/levelgen/feature/BonusChestFeature.java
|
|
|
|
|
index 0b97b575f6f19dae37002e1be12db51331359b1f..e0ca4c2cfd8c27e1d7449f9eee7f29dd6bcbecf8 100644
|
|
|
|
|
--- a/net/minecraft/world/level/levelgen/feature/BonusChestFeature.java
|
|
|
|
|
+++ b/net/minecraft/world/level/levelgen/feature/BonusChestFeature.java
|
|
|
|
|
@@ -40,7 +40,7 @@ public class BonusChestFeature extends Feature<NoneFeatureConfiguration> {
|
|
|
|
|
RandomizableContainer.setBlockEntityLootTable(worldGenLevel, randomSource, heightmapPos, BuiltInLootTables.SPAWN_BONUS_CHEST);
|
|
|
|
|
BlockState blockState = Blocks.TORCH.defaultBlockState();
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
BlockPos blockPos = heightmapPos.relative(direction);
|
|
|
|
|
if (blockState.canSurvive(worldGenLevel, blockPos)) {
|
|
|
|
|
worldGenLevel.setBlock(blockPos, blockState, 2);
|
|
|
|
|
diff --git a/net/minecraft/world/level/levelgen/feature/CoralFeature.java b/net/minecraft/world/level/levelgen/feature/CoralFeature.java
|
|
|
|
|
index 2569754d96694edbc1fe64e6048d6ec26cbe243e..22463f65084ccbfefc9be94a32a8557433be1667 100644
|
|
|
|
|
--- a/net/minecraft/world/level/levelgen/feature/CoralFeature.java
|
|
|
|
|
+++ b/net/minecraft/world/level/levelgen/feature/CoralFeature.java
|
|
|
|
|
@@ -47,7 +47,7 @@ public abstract class CoralFeature extends Feature<NoneFeatureConfiguration> {
|
|
|
|
|
level.setBlock(blockPos, Blocks.SEA_PICKLE.defaultBlockState().setValue(SeaPickleBlock.PICKLES, random.nextInt(4) + 1), 2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
if (random.nextFloat() < 0.2F) {
|
|
|
|
|
BlockPos blockPos1 = pos.relative(direction);
|
|
|
|
|
if (level.getBlockState(blockPos1).is(Blocks.WATER)) {
|
|
|
|
|
diff --git a/net/minecraft/world/level/levelgen/feature/DesertWellFeature.java b/net/minecraft/world/level/levelgen/feature/DesertWellFeature.java
|
|
|
|
|
index e88df07637c14cf98daa7d00059728f27bcdef49..c1e271311904efa1ec7f4d7577505e3feb1a3273 100644
|
|
|
|
|
--- a/net/minecraft/world/level/levelgen/feature/DesertWellFeature.java
|
|
|
|
|
+++ b/net/minecraft/world/level/levelgen/feature/DesertWellFeature.java
|
|
|
|
|
@@ -56,14 +56,14 @@ public class DesertWellFeature extends Feature<NoneFeatureConfiguration> {
|
|
|
|
|
|
|
|
|
|
worldGenLevel.setBlock(blockPos, this.water, 2);
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
worldGenLevel.setBlock(blockPos.relative(direction), this.water, 2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BlockPos blockPos1 = blockPos.below();
|
|
|
|
|
worldGenLevel.setBlock(blockPos1, this.sand, 2);
|
|
|
|
|
|
|
|
|
|
- for (Direction direction1 : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction1 : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
worldGenLevel.setBlock(blockPos1.relative(direction1), this.sand, 2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
diff --git a/net/minecraft/world/level/levelgen/feature/DripstoneClusterFeature.java b/net/minecraft/world/level/levelgen/feature/DripstoneClusterFeature.java
|
|
|
|
|
index e41abe1bf5f848ddde604b1b94537650166b7bd0..d0288105519973b74602a81ee877d29746832d5c 100644
|
|
|
|
|
--- a/net/minecraft/world/level/levelgen/feature/DripstoneClusterFeature.java
|
|
|
|
|
+++ b/net/minecraft/world/level/levelgen/feature/DripstoneClusterFeature.java
|
|
|
|
|
@@ -163,7 +163,7 @@ public class DripstoneClusterFeature extends Feature<DripstoneClusterConfigurati
|
|
|
|
|
if (level.getBlockState(pos.above()).getFluidState().is(FluidTags.WATER)) {
|
|
|
|
|
return false;
|
|
|
|
|
} else {
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
if (!this.canBeAdjacentToWater(level, pos.relative(direction))) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
diff --git a/net/minecraft/world/level/levelgen/feature/EndPodiumFeature.java b/net/minecraft/world/level/levelgen/feature/EndPodiumFeature.java
|
|
|
|
|
index f80c3c074c9eef742388b2636d11d895b0712876..4372f9abd26922a2381a9f4eb54e5a06c4e97a45 100644
|
|
|
|
|
--- a/net/minecraft/world/level/levelgen/feature/EndPodiumFeature.java
|
|
|
|
|
+++ b/net/minecraft/world/level/levelgen/feature/EndPodiumFeature.java
|
|
|
|
|
@@ -68,7 +68,7 @@ public class EndPodiumFeature extends Feature<NoneFeatureConfiguration> {
|
|
|
|
|
|
|
|
|
|
BlockPos blockPos2 = blockPos.above(2);
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
this.setBlock(worldGenLevel, blockPos2.relative(direction), Blocks.WALL_TORCH.defaultBlockState().setValue(WallTorchBlock.FACING, direction));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
diff --git a/net/minecraft/world/level/levelgen/feature/MonsterRoomFeature.java b/net/minecraft/world/level/levelgen/feature/MonsterRoomFeature.java
|
|
|
|
|
index 586097d1535113016dfad4ccb096917b9cdbbd2a..36f71c162d7568c92ddce10c8f143bf1cdf7117f 100644
|
|
|
|
|
--- a/net/minecraft/world/level/levelgen/feature/MonsterRoomFeature.java
|
|
|
|
|
+++ b/net/minecraft/world/level/levelgen/feature/MonsterRoomFeature.java
|
|
|
|
|
@@ -100,7 +100,7 @@ public class MonsterRoomFeature extends Feature<NoneFeatureConfiguration> {
|
|
|
|
|
if (worldGenLevel.isEmptyBlock(blockPos2)) {
|
|
|
|
|
int i14 = 0;
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
if (worldGenLevel.getBlockState(blockPos2.relative(direction)).isSolid()) {
|
|
|
|
|
i14++;
|
|
|
|
|
}
|
|
|
|
|
diff --git a/net/minecraft/world/level/levelgen/feature/PointedDripstoneFeature.java b/net/minecraft/world/level/levelgen/feature/PointedDripstoneFeature.java
|
|
|
|
|
index 900de7123cacf30a1f044616f9707898963b4a5e..2d2509185d31ee3ee8e0e905fcdd8b43f8137453 100644
|
|
|
|
|
--- a/net/minecraft/world/level/levelgen/feature/PointedDripstoneFeature.java
|
|
|
|
|
+++ b/net/minecraft/world/level/levelgen/feature/PointedDripstoneFeature.java
|
|
|
|
|
@@ -49,7 +49,7 @@ public class PointedDripstoneFeature extends Feature<PointedDripstoneConfigurati
|
|
|
|
|
private static void createPatchOfDripstoneBlocks(LevelAccessor level, RandomSource random, BlockPos pos, PointedDripstoneConfiguration config) {
|
|
|
|
|
DripstoneUtils.placeDripstoneBlockIfPossible(level, pos);
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
if (!(random.nextFloat() > config.chanceOfDirectionalSpread)) {
|
|
|
|
|
BlockPos blockPos = pos.relative(direction);
|
|
|
|
|
DripstoneUtils.placeDripstoneBlockIfPossible(level, blockPos);
|
|
|
|
|
diff --git a/net/minecraft/world/level/levelgen/feature/UnderwaterMagmaFeature.java b/net/minecraft/world/level/levelgen/feature/UnderwaterMagmaFeature.java
|
|
|
|
|
index 5934fb6a6d4ddb7d8bd5d697ce63d655bc07aed6..de5beb0d9b5e8111f399849ee5a49cb949331d27 100644
|
|
|
|
|
--- a/net/minecraft/world/level/levelgen/feature/UnderwaterMagmaFeature.java
|
|
|
|
|
+++ b/net/minecraft/world/level/levelgen/feature/UnderwaterMagmaFeature.java
|
|
|
|
|
@@ -59,7 +59,7 @@ public class UnderwaterMagmaFeature extends Feature<UnderwaterMagmaConfiguration
|
|
|
|
|
|
|
|
|
|
private boolean isValidPlacement(WorldGenLevel level, BlockPos pos) {
|
|
|
|
|
if (!this.isWaterOrAir(level, pos) && !this.isWaterOrAir(level, pos.below())) {
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
if (this.isWaterOrAir(level, pos.relative(direction))) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
diff --git a/net/minecraft/world/level/levelgen/feature/configurations/MultifaceGrowthConfiguration.java b/net/minecraft/world/level/levelgen/feature/configurations/MultifaceGrowthConfiguration.java
|
|
|
|
|
index 10f0e59029f269278c7511b159f8759e379dd22a..538522c9babec35006f8544a1822b4bea8340939 100644
|
|
|
|
|
--- a/net/minecraft/world/level/levelgen/feature/configurations/MultifaceGrowthConfiguration.java
|
|
|
|
|
+++ b/net/minecraft/world/level/levelgen/feature/configurations/MultifaceGrowthConfiguration.java
|
|
|
|
|
@@ -75,7 +75,7 @@ public class MultifaceGrowthConfiguration implements FeatureConfiguration {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (canPlaceOnWall) {
|
|
|
|
|
- Direction.Plane.HORIZONTAL.forEach(this.validDirections::add);
|
|
|
|
|
+ this.validDirections.addElements(this.validDirections.size(), Direction.Plane.HORIZONTAL.faces); // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
diff --git a/net/minecraft/world/level/levelgen/feature/foliageplacers/FoliagePlacer.java b/net/minecraft/world/level/levelgen/feature/foliageplacers/FoliagePlacer.java
|
|
|
|
|
index 8c6791796c18bc5906c6d72a07c13d2326476c74..f74dffc26460bf3a853d67f1e76d7f02d5588af7 100644
|
|
|
|
|
--- a/net/minecraft/world/level/levelgen/feature/foliageplacers/FoliagePlacer.java
|
|
|
|
|
+++ b/net/minecraft/world/level/levelgen/feature/foliageplacers/FoliagePlacer.java
|
|
|
|
|
@@ -128,7 +128,7 @@ public abstract class FoliagePlacer {
|
|
|
|
|
BlockPos blockPos = pos.below();
|
|
|
|
|
BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos();
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
Direction clockWise = direction.getClockWise();
|
|
|
|
|
int i1 = clockWise.getAxisDirection() == Direction.AxisDirection.POSITIVE ? range + i : range;
|
|
|
|
|
mutableBlockPos.setWithOffset(pos, 0, localY - 1, 0).move(clockWise, i1).move(direction, -range);
|
|
|
|
|
diff --git a/net/minecraft/world/level/levelgen/feature/rootplacers/MangroveRootPlacer.java b/net/minecraft/world/level/levelgen/feature/rootplacers/MangroveRootPlacer.java
|
|
|
|
|
index 9917a138a92967b079b90e8e1b05bd887e048dfe..14058c16445d26df5d8f546aab6652321036a07b 100644
|
|
|
|
|
--- a/net/minecraft/world/level/levelgen/feature/rootplacers/MangroveRootPlacer.java
|
|
|
|
|
+++ b/net/minecraft/world/level/levelgen/feature/rootplacers/MangroveRootPlacer.java
|
|
|
|
|
@@ -54,7 +54,7 @@ public class MangroveRootPlacer extends RootPlacer {
|
|
|
|
|
|
|
|
|
|
list.add(trunkOrigin.below());
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
BlockPos blockPos = trunkOrigin.relative(direction);
|
|
|
|
|
List<BlockPos> list1 = Lists.newArrayList();
|
|
|
|
|
if (!this.simulateRoots(level, random, blockPos, direction, trunkOrigin, list1, 0)) {
|
|
|
|
|
diff --git a/net/minecraft/world/level/levelgen/feature/treedecorators/CocoaDecorator.java b/net/minecraft/world/level/levelgen/feature/treedecorators/CocoaDecorator.java
|
|
|
|
|
index 203e3899be4a86fdeeb4ad4c021a7411b6173c45..103369405a139f992cb09865ae8297b3eeaeeec5 100644
|
|
|
|
|
--- a/net/minecraft/world/level/levelgen/feature/treedecorators/CocoaDecorator.java
|
|
|
|
|
+++ b/net/minecraft/world/level/levelgen/feature/treedecorators/CocoaDecorator.java
|
|
|
|
|
@@ -36,7 +36,7 @@ public class CocoaDecorator extends TreeDecorator {
|
|
|
|
|
.filter(pos -> pos.getY() - y <= 2)
|
|
|
|
|
.forEach(
|
|
|
|
|
blockPos -> {
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
if (randomSource.nextFloat() <= 0.25F) {
|
|
|
|
|
Direction opposite = direction.getOpposite();
|
|
|
|
|
BlockPos blockPos1 = blockPos.offset(opposite.getStepX(), 0, opposite.getStepZ());
|
|
|
|
|
diff --git a/net/minecraft/world/level/levelgen/structure/StructurePiece.java b/net/minecraft/world/level/levelgen/structure/StructurePiece.java
|
|
|
|
|
index a41b156f14b7f9ffcaa32f7bcdff57692e6df2cd..58e162396008bdc4696b0dbfb23a1498413230db 100644
|
|
|
|
|
--- a/net/minecraft/world/level/levelgen/structure/StructurePiece.java
|
|
|
|
|
+++ b/net/minecraft/world/level/levelgen/structure/StructurePiece.java
|
|
|
|
|
@@ -419,7 +419,7 @@ public abstract class StructurePiece {
|
|
|
|
|
public static BlockState reorient(BlockGetter level, BlockPos pos, BlockState state) {
|
|
|
|
|
Direction direction = null;
|
|
|
|
|
|
|
|
|
|
- for (Direction direction1 : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction1 : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
BlockPos blockPos = pos.relative(direction1);
|
|
|
|
|
BlockState blockState = level.getBlockState(blockPos);
|
|
|
|
|
if (blockState.is(Blocks.CHEST)) {
|
|
|
|
|
diff --git a/net/minecraft/world/level/levelgen/structure/structures/DesertPyramidPiece.java b/net/minecraft/world/level/levelgen/structure/structures/DesertPyramidPiece.java
|
|
|
|
|
index 0d2451a9ade43650dbbcbab69ce0f6e8f69b5aee..25884acf1f322575b97ee9c1e743508a4366db98 100644
|
|
|
|
|
--- a/net/minecraft/world/level/levelgen/structure/structures/DesertPyramidPiece.java
|
|
|
|
|
+++ b/net/minecraft/world/level/levelgen/structure/structures/DesertPyramidPiece.java
|
|
|
|
|
@@ -286,7 +286,7 @@ public class DesertPyramidPiece extends ScatteredFeaturePiece {
|
|
|
|
|
this.placeBlock(level, Blocks.CHISELED_SANDSTONE.defaultBlockState(), 10, -10, 13, box);
|
|
|
|
|
this.placeBlock(level, Blocks.CUT_SANDSTONE.defaultBlockState(), 10, -11, 13, box);
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
if (!this.hasPlacedChest[direction.get2DDataValue()]) {
|
|
|
|
|
int i4 = direction.getStepX() * 2;
|
|
|
|
|
int i5 = direction.getStepZ() * 2;
|
|
|
|
|
diff --git a/net/minecraft/world/level/levelgen/structure/structures/WoodlandMansionPieces.java b/net/minecraft/world/level/levelgen/structure/structures/WoodlandMansionPieces.java
|
|
|
|
|
index 750162571a2277966fcddd01053f38b81e9f636f..b7b21fa8ee6824e8d646133c8a0eb269f74a08c6 100644
|
|
|
|
|
--- a/net/minecraft/world/level/levelgen/structure/structures/WoodlandMansionPieces.java
|
|
|
|
|
+++ b/net/minecraft/world/level/levelgen/structure/structures/WoodlandMansionPieces.java
|
|
|
|
|
@@ -168,7 +168,7 @@ public class WoodlandMansionPieces {
|
|
|
|
|
|
|
|
|
|
@Nullable
|
|
|
|
|
public Direction get1x2RoomDirection(WoodlandMansionPieces.SimpleGrid layout, int x, int y, int floor, int roomId) {
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
if (this.isRoomId(layout, x + direction.getStepX(), y + direction.getStepZ(), floor, roomId)) {
|
|
|
|
|
return direction;
|
|
|
|
|
}
|
|
|
|
|
@@ -284,7 +284,7 @@ public class WoodlandMansionPieces {
|
|
|
|
|
|
|
|
|
|
List<Direction> list1 = Lists.newArrayList();
|
|
|
|
|
|
|
|
|
|
- for (Direction direction1 : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction1 : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
if (this.thirdFloorGrid.get(i3 + direction1.getStepX(), i4 + direction1.getStepZ()) == 0) {
|
|
|
|
|
list1.add(direction1);
|
|
|
|
|
}
|
|
|
|
|
@@ -537,7 +537,7 @@ public class WoodlandMansionPieces {
|
|
|
|
|
flag1 = flag1 && (i8 & 8388608) == 8388608;
|
|
|
|
|
list.clear();
|
|
|
|
|
if ((i8 & 2097152) == 2097152) {
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
if (simpleGrid3.get(i7 + direction.getStepX(), i6 + direction.getStepZ()) == 1) {
|
|
|
|
|
list.add(direction);
|
|
|
|
|
}
|
|
|
|
|
diff --git a/net/minecraft/world/level/material/FlowingFluid.java b/net/minecraft/world/level/material/FlowingFluid.java
|
|
|
|
|
index bcda72fbd920a087ea7d10171da933b13adc1813..69aba8d4d83608685acb7facfb19fcf97f2500db 100644
|
|
|
|
|
--- a/net/minecraft/world/level/material/FlowingFluid.java
|
|
|
|
|
+++ b/net/minecraft/world/level/material/FlowingFluid.java
|
|
|
|
|
@@ -98,7 +98,7 @@ public abstract class FlowingFluid extends Fluid {
|
|
|
|
|
double d1 = 0.0;
|
|
|
|
|
BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos();
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
mutableBlockPos.setWithOffset(pos, direction);
|
|
|
|
|
FluidState fluidState1 = blockReader.getFluidState(mutableBlockPos);
|
|
|
|
|
if (this.affectsFlow(fluidState1)) {
|
|
|
|
|
@@ -128,7 +128,7 @@ public abstract class FlowingFluid extends Fluid {
|
|
|
|
|
|
|
|
|
|
Vec3 vec3 = new Vec3(d, 0.0, d1);
|
|
|
|
|
if (fluidState.getValue(FALLING)) {
|
|
|
|
|
- for (Direction direction1 : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction1 : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
mutableBlockPos.setWithOffset(pos, direction1);
|
|
|
|
|
if (this.isSolidFace(blockReader, mutableBlockPos, direction1) || this.isSolidFace(blockReader, mutableBlockPos.above(), direction1)) {
|
|
|
|
|
vec3 = vec3.normalize().add(0.0, -6.0, 0.0);
|
|
|
|
|
@@ -218,7 +218,7 @@ public abstract class FlowingFluid extends Fluid {
|
|
|
|
|
int i1 = 0;
|
|
|
|
|
BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos();
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
BlockPos blockPos = mutableBlockPos.setWithOffset(pos, direction);
|
|
|
|
|
BlockState blockState = level.getBlockStateIfLoaded(blockPos); // Paper - Prevent chunk loading from fluid flowing
|
|
|
|
|
if (blockState == null) continue; // Paper - Prevent chunk loading from fluid flowing
|
|
|
|
|
@@ -349,7 +349,7 @@ public abstract class FlowingFluid extends Fluid {
|
|
|
|
|
visited.clear();
|
|
|
|
|
queue.clear();
|
|
|
|
|
|
|
|
|
|
- for (Direction dir : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction dir : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
if (dir == excludedDirection) continue;
|
|
|
|
|
|
|
|
|
|
BlockPos neighborPos = startPos.relative(dir); // immutable
|
|
|
|
|
@@ -379,7 +379,7 @@ public abstract class FlowingFluid extends Fluid {
|
|
|
|
|
|
|
|
|
|
if (current.depth >= slopeFindDistance) continue;
|
|
|
|
|
|
|
|
|
|
- for (Direction dir : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction dir : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
if (dir == current.excludedDir) continue;
|
|
|
|
|
|
|
|
|
|
BlockPos nextPos = current.pos.relative(dir); // immutable
|
|
|
|
|
@@ -490,7 +490,7 @@ public abstract class FlowingFluid extends Fluid {
|
|
|
|
|
private int sourceNeighborCount(LevelReader level, BlockPos pos) {
|
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
BlockPos blockPos = pos.relative(direction);
|
|
|
|
|
FluidState fluidState = level.getFluidState(blockPos);
|
|
|
|
|
if (this.isSourceBlockOfThisType(fluidState)) {
|
|
|
|
|
@@ -506,7 +506,7 @@ public abstract class FlowingFluid extends Fluid {
|
|
|
|
|
Map<Direction, FluidState> map = Maps.newEnumMap(Direction.class);
|
|
|
|
|
FlowingFluid.SpreadContext spreadContext = null;
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
BlockPos blockPos = pos.relative(direction);
|
|
|
|
|
BlockState blockState = level.getBlockStateIfLoaded(blockPos); // Paper - Prevent chunk loading from fluid flowing
|
|
|
|
|
if (blockState == null) continue; // Paper - Prevent chunk loading from fluid flowing
|
|
|
|
|
diff --git a/net/minecraft/world/level/pathfinder/SwimNodeEvaluator.java b/net/minecraft/world/level/pathfinder/SwimNodeEvaluator.java
|
|
|
|
|
index c598d91cd9fb711bc9aaa068fbb806619c0d4fe2..da19fcb30c00b29140763605333badc3069aa11f 100644
|
|
|
|
|
--- a/net/minecraft/world/level/pathfinder/SwimNodeEvaluator.java
|
|
|
|
|
+++ b/net/minecraft/world/level/pathfinder/SwimNodeEvaluator.java
|
|
|
|
|
@@ -59,7 +59,7 @@ public class SwimNodeEvaluator extends NodeEvaluator {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- for (Direction direction1 : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction1 : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
Direction clockWise = direction1.getClockWise();
|
|
|
|
|
if (hasMalus(map.get(direction1)) && hasMalus(map.get(clockWise))) {
|
|
|
|
|
Node node2 = this.findAcceptedNode(
|
|
|
|
|
diff --git a/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java b/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
|
|
|
|
|
index 7eb7a8a4b4c000d543d2a6bc181421493164df34..be0ed27b13b5d7e5a71e6c9bdd48891f0d267e4b 100644
|
|
|
|
|
--- a/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
|
|
|
|
|
+++ b/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
|
|
|
|
|
@@ -129,7 +129,7 @@ public class WalkNodeEvaluator extends NodeEvaluator {
|
|
|
|
|
|
|
|
|
|
double floorLevel = this.getFloorLevel(new BlockPos(node.x, node.y, node.z));
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
Node node1 = this.findAcceptedNode(node.x + direction.getStepX(), node.y, node.z + direction.getStepZ(), i1, floorLevel, direction, cachedPathType1);
|
|
|
|
|
this.reusableNeighbors[direction.get2DDataValue()] = node1;
|
|
|
|
|
if (this.isNeighborValid(node1, node)) {
|
|
|
|
|
@@ -137,7 +137,7 @@ public class WalkNodeEvaluator extends NodeEvaluator {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- for (Direction directionx : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction directionx : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
Direction clockWise = directionx.getClockWise();
|
|
|
|
|
if (this.isDiagonalValid(node, this.reusableNeighbors[directionx.get2DDataValue()], this.reusableNeighbors[clockWise.get2DDataValue()])) {
|
|
|
|
|
Node node2 = this.findAcceptedNode(
|
|
|
|
|
diff --git a/net/minecraft/world/level/redstone/RedstoneWireEvaluator.java b/net/minecraft/world/level/redstone/RedstoneWireEvaluator.java
|
|
|
|
|
index 865da6563ec6ec04d255d0b14aea75ebd95a671b..c5ed04d28ee9e33bfbf62be01965b8595a4eec78 100644
|
|
|
|
|
--- a/net/minecraft/world/level/redstone/RedstoneWireEvaluator.java
|
|
|
|
|
+++ b/net/minecraft/world/level/redstone/RedstoneWireEvaluator.java
|
|
|
|
|
@@ -27,7 +27,7 @@ public abstract class RedstoneWireEvaluator {
|
|
|
|
|
protected int getIncomingWireSignal(Level level, BlockPos pos) {
|
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
|
|
- for (Direction direction : Direction.Plane.HORIZONTAL) {
|
|
|
|
|
+ for (Direction direction : Direction.Plane.HORIZONTAL.faces) { // Pluto - Expose Direction$Plane's faces
|
|
|
|
|
BlockPos blockPos = pos.relative(direction);
|
|
|
|
|
BlockState blockState = level.getBlockState(blockPos);
|
|
|
|
|
i = Math.max(i, this.getWireSignal(blockPos, blockState));
|