From 6639ae97f500bc9f4c43610f96e9d7ce2007dc96 Mon Sep 17 00:00:00 2001 From: Justin Aquadro Date: Thu, 12 Sep 2019 02:42:40 -0400 Subject: [PATCH] Fix left/right reversed slots for some directions in some map quadrants --- gradle.properties | 2 +- .../storagedrawers/block/BlockDrawers.java | 4 ++-- .../storagedrawers/block/BlockStandardDrawers.java | 13 ++++++++++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/gradle.properties b/gradle.properties index b564eb3ab..badb19549 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ minecraft_base_version=1.14 minecraft_version=1.14.4 forge_version=1.14.4-28.0.104 forge_mappings=20190719-1.14.3 -mod_version=6.0.3 +mod_version=6.0.4 chameleon_version=5.0.0 chameleon_max_version=6.0.0 diff --git a/src/main/java/com/jaquadro/minecraft/storagedrawers/block/BlockDrawers.java b/src/main/java/com/jaquadro/minecraft/storagedrawers/block/BlockDrawers.java index 883bcdab4..9e279f8c6 100644 --- a/src/main/java/com/jaquadro/minecraft/storagedrawers/block/BlockDrawers.java +++ b/src/main/java/com/jaquadro/minecraft/storagedrawers/block/BlockDrawers.java @@ -392,9 +392,9 @@ protected boolean hitTop (double hitY) { protected boolean hitLeft (Direction side, double hitX, double hitZ) { switch (side) { case NORTH: - return hitX < .5; - case SOUTH: return hitX > .5; + case SOUTH: + return hitX < .5; case WEST: return hitZ < .5; case EAST: diff --git a/src/main/java/com/jaquadro/minecraft/storagedrawers/block/BlockStandardDrawers.java b/src/main/java/com/jaquadro/minecraft/storagedrawers/block/BlockStandardDrawers.java index ffbb3f95a..584ca3e05 100644 --- a/src/main/java/com/jaquadro/minecraft/storagedrawers/block/BlockStandardDrawers.java +++ b/src/main/java/com/jaquadro/minecraft/storagedrawers/block/BlockStandardDrawers.java @@ -58,9 +58,16 @@ public boolean causesSuffocation (BlockState state, IBlockReader worldIn, BlockP @Override protected int getDrawerSlot (Direction side, double hitX, double hitY, double hitZ) { - hitX = Math.abs(hitX % 1); - hitY = Math.abs(hitY % 1); - hitZ = Math.abs(hitZ % 1); + if (hitX < 0) + hitX -= Math.floor(hitX); + if (hitY < 0) + hitY -= Math.floor(hitY); + if (hitZ < 0) + hitZ -= Math.floor(hitZ); + + hitX %= 1; + hitY %= 1; + hitZ %= 1; if (getDrawerCount() == 1) return 0;