1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-09-29 23:40:46 +00:00

Merge pull request #259 from SquidDev-CC/hotfix/check-palette

Add some sanity checks to Palette.readFromNBT
This commit is contained in:
Daniel Ratcliffe 2017-05-19 13:06:35 +01:00 committed by GitHub
commit ffa075cd3d

View File

@ -89,8 +89,11 @@ public class Palette
public void readFromNBT( NBTTagCompound nbt )
{
if( !nbt.hasKey( "term_palette" ) ) return;
int[] rgb8 = nbt.getIntArray( "term_palette" );
if( rgb8.length != colours.length ) return;
for(int i = 0; i < colours.length; ++i)
{
colours[i] = decodeRGB8( rgb8[i] );