2020-08-03 18:48:42 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: JellySquid <jellysquid+atwork@protonmail.com>
|
|
|
|
Date: Fri, 31 Jul 2020 21:44:22 -0500
|
|
|
|
Subject: [PATCH] lithium enum_values
|
|
|
|
|
2020-08-03 21:25:54 +02:00
|
|
|
Original code by JellySquid, licensed under GNU Lesser General Public License v3.0
|
2020-08-06 23:02:30 +02:00
|
|
|
you can find the original code on https://github.com/jellysquid3/lithium-fabric/tree/1.16.x/fabric (Yarn mappings)
|
2020-08-03 18:48:42 +02:00
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/BlockPiston.java b/src/main/java/net/minecraft/server/BlockPiston.java
|
2020-08-13 17:53:32 +02:00
|
|
|
index 5d3bb5f393a1e0e4a2e8b9a466530a91279697a9..7f084e7f11a829c10d113c7fb39eec0b8ad77080 100644
|
2020-08-03 18:48:42 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/BlockPiston.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/BlockPiston.java
|
2020-08-13 17:53:32 +02:00
|
|
|
@@ -127,9 +127,10 @@ public class BlockPiston extends BlockDirectional {
|
2020-08-03 18:48:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2020-08-13 17:53:32 +02:00
|
|
|
+ private static final EnumDirection[] aenumdirection = EnumDirection.values(); // Yatopia
|
2020-08-03 18:48:42 +02:00
|
|
|
|
|
|
|
private boolean a(World world, BlockPosition blockposition, EnumDirection enumdirection) {
|
|
|
|
- EnumDirection[] aenumdirection = EnumDirection.values();
|
2020-08-13 17:53:32 +02:00
|
|
|
+ //EnumDirection[] aenumdirection = EnumDirection.values(); // Yatopia
|
2020-08-03 18:48:42 +02:00
|
|
|
int i = aenumdirection.length;
|
|
|
|
|
|
|
|
int j;
|
2020-08-13 17:53:32 +02:00
|
|
|
@@ -146,12 +147,12 @@ public class BlockPiston extends BlockDirectional {
|
2020-08-03 18:48:42 +02:00
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
BlockPosition blockposition1 = blockposition.up();
|
|
|
|
- EnumDirection[] aenumdirection1 = EnumDirection.values();
|
2020-08-13 17:53:32 +02:00
|
|
|
+ //EnumDirection[] aenumdirection1 = EnumDirection.values(); // Yatopia
|
2020-08-03 18:48:42 +02:00
|
|
|
|
|
|
|
- j = aenumdirection1.length;
|
2020-08-13 17:53:32 +02:00
|
|
|
+ j = aenumdirection.length; // Yatopia
|
2020-08-03 18:48:42 +02:00
|
|
|
|
|
|
|
for (int k = 0; k < j; ++k) {
|
|
|
|
- EnumDirection enumdirection2 = aenumdirection1[k];
|
2020-08-13 17:53:32 +02:00
|
|
|
+ EnumDirection enumdirection2 = aenumdirection[k]; // Yatopia
|
2020-08-03 18:48:42 +02:00
|
|
|
|
|
|
|
if (enumdirection2 != EnumDirection.DOWN && world.isBlockFacePowered(blockposition1.shift(enumdirection2), enumdirection2)) {
|
|
|
|
return true;
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
2020-11-07 08:02:33 +01:00
|
|
|
index e5e8bfbcc9505e2a9615ac0149817eaf4c79d8a4..2a698a60bbd4ad40c4f18879877f003456398ac9 100644
|
2020-08-03 18:48:42 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
2020-09-11 08:03:00 +02:00
|
|
|
@@ -2580,10 +2580,12 @@ public abstract class EntityLiving extends Entity {
|
2020-08-03 18:48:42 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-08-13 17:53:32 +02:00
|
|
|
+ private static final EnumItemSlot[] aenumitemslot = EnumItemSlot.values(); // Yatopia
|
|
|
|
+
|
2020-08-03 18:48:42 +02:00
|
|
|
@Nullable
|
2020-08-13 17:53:32 +02:00
|
|
|
private Map<EnumItemSlot, ItemStack> q() {
|
2020-08-03 18:48:42 +02:00
|
|
|
Map<EnumItemSlot, ItemStack> map = null;
|
|
|
|
- EnumItemSlot[] aenumitemslot = EnumItemSlot.values();
|
2020-08-13 17:53:32 +02:00
|
|
|
+ //EnumItemSlot[] aenumitemslot = EnumItemSlot.values(); // Yatopia
|
2020-08-03 18:48:42 +02:00
|
|
|
int i = aenumitemslot.length;
|
|
|
|
|
|
|
|
for (int j = 0; j < i; ++j) {
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EnumAxisCycle.java b/src/main/java/net/minecraft/server/EnumAxisCycle.java
|
2020-08-13 17:53:32 +02:00
|
|
|
index a7c2543fdd4d5f6a04c45ec42472837ccaea9619..92ab79532d29341e8840341ff5ee8f5203cb4aad 100644
|
2020-08-03 18:48:42 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/EnumAxisCycle.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EnumAxisCycle.java
|
2020-08-13 17:53:32 +02:00
|
|
|
@@ -26,12 +26,24 @@ public enum EnumAxisCycle {
|
2020-08-03 18:48:42 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public EnumDirection.EnumAxis a(EnumDirection.EnumAxis enumdirection_enumaxis) {
|
|
|
|
- return null.d[Math.floorMod(enumdirection_enumaxis.ordinal() + 1, 3)];
|
2020-08-13 17:53:32 +02:00
|
|
|
+ // Yatopia start - replace logic
|
|
|
|
+ //return null.d[Math.floorMod(enumdirection_enumaxis.ordinal() + 1, 3)];
|
2020-08-03 18:48:42 +02:00
|
|
|
+ switch (enumdirection_enumaxis) {
|
|
|
|
+ case X:
|
|
|
|
+ return EnumDirection.EnumAxis.Y;
|
|
|
|
+ case Y:
|
|
|
|
+ return EnumDirection.EnumAxis.Z;
|
|
|
|
+ case Z:
|
|
|
|
+ return EnumDirection.EnumAxis.X;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ throw new IllegalArgumentException();
|
2020-08-13 17:53:32 +02:00
|
|
|
+ // Yatopia end
|
2020-08-03 18:48:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public EnumAxisCycle a() {
|
|
|
|
- return null.BACKWARD;
|
2020-08-13 17:53:32 +02:00
|
|
|
+ return BACKWARD; // Yatopia
|
2020-08-03 18:48:42 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
BACKWARD {
|
2020-08-13 17:53:32 +02:00
|
|
|
@@ -42,12 +54,24 @@ public enum EnumAxisCycle {
|
2020-08-03 18:48:42 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public EnumDirection.EnumAxis a(EnumDirection.EnumAxis enumdirection_enumaxis) {
|
|
|
|
- return null.d[Math.floorMod(enumdirection_enumaxis.ordinal() - 1, 3)];
|
2020-08-13 17:53:32 +02:00
|
|
|
+ // Yatopia start - replaced logic
|
|
|
|
+ //return null.d[Math.floorMod(enumdirection_enumaxis.ordinal() - 1, 3)];
|
2020-08-03 18:48:42 +02:00
|
|
|
+ switch (enumdirection_enumaxis) {
|
|
|
|
+ case X:
|
|
|
|
+ return EnumDirection.EnumAxis.Z;
|
|
|
|
+ case Y:
|
|
|
|
+ return EnumDirection.EnumAxis.X;
|
|
|
|
+ case Z:
|
|
|
|
+ return EnumDirection.EnumAxis.Y;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ throw new IllegalArgumentException();
|
2020-08-13 17:53:32 +02:00
|
|
|
+ // Yatopia end
|
2020-08-03 18:48:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public EnumAxisCycle a() {
|
|
|
|
- return null.FORWARD;
|
2020-08-13 17:53:32 +02:00
|
|
|
+ return FORWARD; // Yatopia
|
2020-08-03 18:48:42 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PistonExtendsChecker.java b/src/main/java/net/minecraft/server/PistonExtendsChecker.java
|
2020-09-01 08:38:17 +02:00
|
|
|
index 71636ce642efcd3453b6c5bfb2b2ef0edc6baee7..1f70536e1cb51a895f46297f891aca7dd2e8590a 100644
|
2020-08-03 18:48:42 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/PistonExtendsChecker.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PistonExtendsChecker.java
|
2020-08-13 17:53:32 +02:00
|
|
|
@@ -166,10 +166,11 @@ public class PistonExtendsChecker {
|
2020-08-03 18:48:42 +02:00
|
|
|
this.f.addAll(list1);
|
|
|
|
this.f.addAll(list2);
|
|
|
|
}
|
2020-08-13 17:53:32 +02:00
|
|
|
+ private static final EnumDirection[] aenumdirection = EnumDirection.values(); // Yatopia
|
2020-08-03 18:48:42 +02:00
|
|
|
|
|
|
|
private boolean a(BlockPosition blockposition) {
|
|
|
|
IBlockData iblockdata = this.a.getType(blockposition);
|
|
|
|
- EnumDirection[] aenumdirection = EnumDirection.values();
|
2020-08-13 17:53:32 +02:00
|
|
|
+ //EnumDirection[] aenumdirection = EnumDirection.values(); // Yatopia
|
2020-08-03 18:48:42 +02:00
|
|
|
int i = aenumdirection.length;
|
|
|
|
|
|
|
|
for (int j = 0; j < i; ++j) {
|