Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void onBlockAdded(World world, int x, int y, int z) {
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase placer, ItemStack itemStack) {
double blockRotation = (double) (placer.rotationYaw * 4.0F / 360.0F) + 0.5D;
boolean flipped = Math.abs(blockRotation - (int) blockRotation) < 0.5;
boolean flipped = blockRotation - MathHelper.floor_double(blockRotation) < 0.5;
int orientation = MathHelper.floor_double(blockRotation) & 3;
if (orientation == 0) {
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public void onBlockAdded(World world, int x, int y, int z) {
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase placer, ItemStack itemStack) {
double blockRotation = (double) (placer.rotationYaw * 4.0F / 360.0F) + 0.5D;
boolean flipped = Math.abs(blockRotation - (int) blockRotation) < 0.5;
boolean flipped = blockRotation - MathHelper.floor_double(blockRotation) < 0.5;
int orientation = MathHelper.floor_double(blockRotation) & 3;
if (orientation == 0) {
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
Expand Down