commit 43ea022d5f4f798a817dd00b7c7b090db3c9cccf
parent 98c98f55bbc721f8ba0691ab5062fcf160363ed0
Author: Amb0s <ambos@disroot.org>
Date: Sat, 26 Aug 2023 16:39:18 +0200
Reverted to custom helper
Diffstat:
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/main/java/turniplabs/simpletech/SimpleTech.java b/src/main/java/turniplabs/simpletech/SimpleTech.java
@@ -131,6 +131,10 @@ public class SimpleTech implements ModInitializer {
return setBit(metadata, invertedOffset, inverted);
}
+ public static int get3DDirectionFromMeta(int meta) {
+ return meta & 7;
+ }
+
public static int getOppositeDirectionById(int i) {
return Direction.getDirectionById(i).getOpposite().getId();
}
diff --git a/src/main/java/turniplabs/simpletech/block/BlockAllocator.java b/src/main/java/turniplabs/simpletech/block/BlockAllocator.java
@@ -2,7 +2,6 @@ package turniplabs.simpletech.block;
import net.minecraft.client.Minecraft;
import net.minecraft.core.block.Block;
-import net.minecraft.core.block.BlockChest;
import net.minecraft.core.block.BlockTileEntity;
import net.minecraft.core.block.entity.TileEntity;
import net.minecraft.core.block.entity.TileEntityChest;
@@ -116,7 +115,7 @@ public class BlockAllocator extends BlockTileEntity {
@Override
public int getBlockTextureFromSideAndMetadata(Side side, int meta) {
- int direction = BlockChest.getDirectionFromMeta(meta).ordinal();
+ int direction = SimpleTech.get3DDirectionFromMeta(meta);
if (direction > 5) {
return texCoordToIndex(this.top[0], this.top[1]);
diff --git a/src/main/java/turniplabs/simpletech/block/BlockFan.java b/src/main/java/turniplabs/simpletech/block/BlockFan.java
@@ -1,6 +1,5 @@
package turniplabs.simpletech.block;
-import net.minecraft.core.block.BlockChest;
import net.minecraft.core.block.BlockTileEntity;
import net.minecraft.core.block.entity.TileEntity;
import net.minecraft.core.block.material.Material;
@@ -45,7 +44,7 @@ public class BlockFan extends BlockTileEntity {
@Override
public int getBlockTextureFromSideAndMetadata(Side side, int j) {
- int direction = BlockChest.getDirectionFromMeta(j).ordinal();
+ int direction = SimpleTech.get3DDirectionFromMeta(j);
if (direction > Direction.EAST.getId()) {
// Defaults to top/bottom texture.
return texCoordToIndex(this.topBottom[0], this.topBottom[1]);