mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 02:20:01 +03:00
205 lines
7.1 KiB
Diff
205 lines
7.1 KiB
Diff
--- ../src-base/minecraft/net/minecraft/util/EnumFacing.java
|
|
+++ ../src-work/minecraft/net/minecraft/util/EnumFacing.java
|
|
@@ -12,30 +12,28 @@
|
|
import net.minecraft.util.math.BlockPos;
|
|
import net.minecraft.util.math.MathHelper;
|
|
import net.minecraft.util.math.Vec3i;
|
|
-import net.minecraftforge.fml.relauncher.Side;
|
|
-import net.minecraftforge.fml.relauncher.SideOnly;
|
|
|
|
public enum EnumFacing implements IStringSerializable
|
|
{
|
|
- DOWN(0, 1, -1, "down", EnumFacing.AxisDirection.NEGATIVE, EnumFacing.Axis.Y, new Vec3i(0, -1, 0)),
|
|
- UP(1, 0, -1, "up", EnumFacing.AxisDirection.POSITIVE, EnumFacing.Axis.Y, new Vec3i(0, 1, 0)),
|
|
- NORTH(2, 3, 2, "north", EnumFacing.AxisDirection.NEGATIVE, EnumFacing.Axis.Z, new Vec3i(0, 0, -1)),
|
|
- SOUTH(3, 2, 0, "south", EnumFacing.AxisDirection.POSITIVE, EnumFacing.Axis.Z, new Vec3i(0, 0, 1)),
|
|
- WEST(4, 5, 1, "west", EnumFacing.AxisDirection.NEGATIVE, EnumFacing.Axis.X, new Vec3i(-1, 0, 0)),
|
|
- EAST(5, 4, 3, "east", EnumFacing.AxisDirection.POSITIVE, EnumFacing.Axis.X, new Vec3i(1, 0, 0));
|
|
+ DOWN(0, 1, -1, "down", AxisDirection.NEGATIVE, Axis.Y, new Vec3i(0, -1, 0)),
|
|
+ UP(1, 0, -1, "up", AxisDirection.POSITIVE, Axis.Y, new Vec3i(0, 1, 0)),
|
|
+ NORTH(2, 3, 2, "north", AxisDirection.NEGATIVE, Axis.Z, new Vec3i(0, 0, -1)),
|
|
+ SOUTH(3, 2, 0, "south", AxisDirection.POSITIVE, Axis.Z, new Vec3i(0, 0, 1)),
|
|
+ WEST(4, 5, 1, "west", AxisDirection.NEGATIVE, Axis.X, new Vec3i(-1, 0, 0)),
|
|
+ EAST(5, 4, 3, "east", AxisDirection.POSITIVE, Axis.X, new Vec3i(1, 0, 0));
|
|
|
|
private final int index;
|
|
private final int opposite;
|
|
private final int horizontalIndex;
|
|
private final String name;
|
|
- private final EnumFacing.Axis axis;
|
|
- private final EnumFacing.AxisDirection axisDirection;
|
|
+ private final Axis axis;
|
|
+ private final AxisDirection axisDirection;
|
|
private final Vec3i directionVec;
|
|
public static final EnumFacing[] VALUES = new EnumFacing[6];
|
|
public static final EnumFacing[] HORIZONTALS = new EnumFacing[4];
|
|
private static final Map<String, EnumFacing> NAME_LOOKUP = Maps.<String, EnumFacing>newHashMap();
|
|
|
|
- private EnumFacing(int indexIn, int oppositeIn, int horizontalIndexIn, String nameIn, EnumFacing.AxisDirection axisDirectionIn, EnumFacing.Axis axisIn, Vec3i directionVecIn)
|
|
+ private EnumFacing(int indexIn, int oppositeIn, int horizontalIndexIn, String nameIn, AxisDirection axisDirectionIn, Axis axisIn, Vec3i directionVecIn)
|
|
{
|
|
this.index = indexIn;
|
|
this.horizontalIndex = horizontalIndexIn;
|
|
@@ -56,7 +54,7 @@
|
|
return this.horizontalIndex;
|
|
}
|
|
|
|
- public EnumFacing.AxisDirection getAxisDirection()
|
|
+ public AxisDirection getAxisDirection()
|
|
{
|
|
return this.axisDirection;
|
|
}
|
|
@@ -66,8 +64,7 @@
|
|
return getFront(this.opposite);
|
|
}
|
|
|
|
- @SideOnly(Side.CLIENT)
|
|
- public EnumFacing rotateAround(EnumFacing.Axis axis)
|
|
+ public EnumFacing rotateAround(Axis axis)
|
|
{
|
|
switch (axis)
|
|
{
|
|
@@ -117,7 +114,6 @@
|
|
}
|
|
}
|
|
|
|
- @SideOnly(Side.CLIENT)
|
|
private EnumFacing rotateX()
|
|
{
|
|
switch (this)
|
|
@@ -137,7 +133,6 @@
|
|
}
|
|
}
|
|
|
|
- @SideOnly(Side.CLIENT)
|
|
private EnumFacing rotateZ()
|
|
{
|
|
switch (this)
|
|
@@ -175,17 +170,17 @@
|
|
|
|
public int getFrontOffsetX()
|
|
{
|
|
- return this.axis == EnumFacing.Axis.X ? this.axisDirection.getOffset() : 0;
|
|
+ return this.axis == Axis.X ? this.axisDirection.getOffset() : 0;
|
|
}
|
|
|
|
public int getFrontOffsetY()
|
|
{
|
|
- return this.axis == EnumFacing.Axis.Y ? this.axisDirection.getOffset() : 0;
|
|
+ return this.axis == Axis.Y ? this.axisDirection.getOffset() : 0;
|
|
}
|
|
|
|
public int getFrontOffsetZ()
|
|
{
|
|
- return this.axis == EnumFacing.Axis.Z ? this.axisDirection.getOffset() : 0;
|
|
+ return this.axis == Axis.Z ? this.axisDirection.getOffset() : 0;
|
|
}
|
|
|
|
public String getName2()
|
|
@@ -193,13 +188,12 @@
|
|
return this.name;
|
|
}
|
|
|
|
- public EnumFacing.Axis getAxis()
|
|
+ public Axis getAxis()
|
|
{
|
|
return this.axis;
|
|
}
|
|
|
|
@Nullable
|
|
- @SideOnly(Side.CLIENT)
|
|
public static EnumFacing byName(String name)
|
|
{
|
|
return name == null ? null : (EnumFacing)NAME_LOOKUP.get(name.toLowerCase(Locale.ROOT));
|
|
@@ -230,7 +224,6 @@
|
|
return values()[rand.nextInt(values().length)];
|
|
}
|
|
|
|
- @SideOnly(Side.CLIENT)
|
|
public static EnumFacing getFacingFromVector(float x, float y, float z)
|
|
{
|
|
EnumFacing enumfacing = NORTH;
|
|
@@ -260,7 +253,7 @@
|
|
return this.name;
|
|
}
|
|
|
|
- public static EnumFacing getFacingFromAxis(EnumFacing.AxisDirection axisDirectionIn, EnumFacing.Axis axisIn)
|
|
+ public static EnumFacing getFacingFromAxis(AxisDirection axisDirectionIn, Axis axisIn)
|
|
{
|
|
for (EnumFacing enumfacing : values())
|
|
{
|
|
@@ -293,7 +286,6 @@
|
|
return placer.getHorizontalFacing().getOpposite();
|
|
}
|
|
|
|
- @SideOnly(Side.CLIENT)
|
|
public Vec3i getDirectionVec()
|
|
{
|
|
return this.directionVec;
|
|
@@ -315,25 +307,24 @@
|
|
}
|
|
|
|
public static enum Axis implements Predicate<EnumFacing>, IStringSerializable {
|
|
- X("x", EnumFacing.Plane.HORIZONTAL),
|
|
- Y("y", EnumFacing.Plane.VERTICAL),
|
|
- Z("z", EnumFacing.Plane.HORIZONTAL);
|
|
+ X("x", Plane.HORIZONTAL),
|
|
+ Y("y", Plane.VERTICAL),
|
|
+ Z("z", Plane.HORIZONTAL);
|
|
|
|
- private static final Map<String, EnumFacing.Axis> NAME_LOOKUP = Maps.<String, EnumFacing.Axis>newHashMap();
|
|
+ private static final Map<String, Axis> NAME_LOOKUP = Maps.<String, Axis>newHashMap();
|
|
private final String name;
|
|
- private final EnumFacing.Plane plane;
|
|
+ private final Plane plane;
|
|
|
|
- private Axis(String name, EnumFacing.Plane plane)
|
|
+ private Axis(String name, Plane plane)
|
|
{
|
|
this.name = name;
|
|
this.plane = plane;
|
|
}
|
|
|
|
@Nullable
|
|
- @SideOnly(Side.CLIENT)
|
|
public static EnumFacing.Axis byName(String name)
|
|
{
|
|
- return name == null ? null : (EnumFacing.Axis)NAME_LOOKUP.get(name.toLowerCase(Locale.ROOT));
|
|
+ return name == null ? null : (Axis)NAME_LOOKUP.get(name.toLowerCase(Locale.ROOT));
|
|
}
|
|
|
|
public String getName2()
|
|
@@ -343,12 +334,12 @@
|
|
|
|
public boolean isVertical()
|
|
{
|
|
- return this.plane == EnumFacing.Plane.VERTICAL;
|
|
+ return this.plane == Plane.VERTICAL;
|
|
}
|
|
|
|
public boolean isHorizontal()
|
|
{
|
|
- return this.plane == EnumFacing.Plane.HORIZONTAL;
|
|
+ return this.plane == Plane.HORIZONTAL;
|
|
}
|
|
|
|
public String toString()
|
|
@@ -361,7 +352,7 @@
|
|
return p_apply_1_ != null && p_apply_1_.getAxis() == this;
|
|
}
|
|
|
|
- public EnumFacing.Plane getPlane()
|
|
+ public Plane getPlane()
|
|
{
|
|
return this.plane;
|
|
}
|
|
@@ -373,7 +364,7 @@
|
|
|
|
static
|
|
{
|
|
- for (EnumFacing.Axis enumfacing$axis : values())
|
|
+ for (Axis enumfacing$axis : values())
|
|
{
|
|
NAME_LOOKUP.put(enumfacing$axis.getName2().toLowerCase(Locale.ROOT), enumfacing$axis);
|
|
}
|