1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2026-03-06 08:19:45 +00:00

Use IBlockState instead of Block methods

There was a crash in RedstoneUtil when redstone state was changing next
to a full block due to the incorrect state being passed. By using
IBlockState methods we ensure that this cannot happen again.

The old IBlockState methods were also deprecated, so this reduces the
warning count a little. I've also moved string translation into
StringUtils, to reduce the number of deprecation warnings from there.
This commit is contained in:
SquidDev
2017-05-06 15:31:06 +01:00
parent 06b63980eb
commit c7f5d039b2
13 changed files with 57 additions and 66 deletions

View File

@@ -23,4 +23,22 @@ public class StringUtil
return builder.toString();
}
/**
* Translates a Stat name
*/
@SuppressWarnings("deprecation")
public static String translateToLocal( String key )
{
return net.minecraft.util.text.translation.I18n.translateToLocal( key );
}
/**
* Translates a Stat name with format args
*/
@SuppressWarnings("deprecation")
public static String translateToLocalFormatted( String key, Object... format )
{
return net.minecraft.util.text.translation.I18n.translateToLocalFormatted( key, format );
}
}