Skip to content

Commit

Permalink
Fix left/right reversed slots for some directions in some map quadrants
Browse files Browse the repository at this point in the history
  • Loading branch information
jaquadro committed Sep 12, 2019
1 parent 9b196e8 commit 6639ae9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6639ae9

Please sign in to comment.