Update #48 - Added some features from OptiFine

This commit is contained in:
lax1dude
2025-01-24 18:39:36 -08:00
parent 1f0d593a8c
commit e83a912e38
1056 changed files with 17706 additions and 898 deletions

View File

@ -0,0 +1,22 @@
package net.optifine.util;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.IWorldNameable;
public class TileEntityUtils {
public static String getTileEntityName(IBlockAccess blockAccess, BlockPos blockPos) {
TileEntity tileentity = blockAccess.getTileEntity(blockPos);
return getTileEntityName(tileentity);
}
public static String getTileEntityName(TileEntity te) {
if (!(te instanceof IWorldNameable)) {
return null;
} else {
IWorldNameable iworldnameable = (IWorldNameable) te;
return !iworldnameable.hasCustomName() ? null : iworldnameable.getName();
}
}
}