Fixing logic in getCurrentRailPosition to correctly identify the rail… (#7276)

This commit is contained in:
NoahBeech 2020-09-08 16:23:18 -04:00 committed by GitHub
parent 887bc37209
commit a477671c03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -55,8 +55,8 @@ public interface IForgeEntityMinecart
int x = MathHelper.floor(getMinecart().getPosX());
int y = MathHelper.floor(getMinecart().getPosY());
int z = MathHelper.floor(getMinecart().getPosZ());
BlockPos pos = new BlockPos(x, y - 1, z);
if (getMinecart().world.getBlockState(pos).func_235714_a_(BlockTags.RAILS)) pos = pos.down();
BlockPos pos = new BlockPos(x, y, z);
if (getMinecart().world.getBlockState(pos.down()).func_235714_a_(BlockTags.RAILS)) pos = pos.down();
return pos;
}