Some additional fixes from other branch.

This commit is contained in:
Sebastian Hartte
2020-05-30 22:18:26 +02:00
parent 16d6d55d7f
commit ec3b464655
139 changed files with 1489 additions and 1485 deletions
@@ -43,7 +43,6 @@ import appeng.api.recipes.ResolverResult;
import appeng.core.localization.ButtonToolTips;
import appeng.entity.EntityGrowingCrystal;
import appeng.items.AEBaseItem;
import appeng.util.Platform;
public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
@@ -76,7 +75,7 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
crystalSeedStack.setItemDamage( certus2 );
crystalSeedStack = newStyle( crystalSeedStack );
String itemName = crystalSeedStack.getItem().getRegistryName().getResourcePath();
return new ResolverResult( itemName, crystalSeedStack.getItemDamage(), crystalSeedStack.getTagCompound() );
return new ResolverResult( itemName, crystalSeedStack.getDamage(), crystalSeedStack.getTagCompound() );
} )
.orElse( null );
@@ -90,16 +89,16 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
static int getProgress( final ItemStack is )
{
if( is.hasTagCompound() )
if( is.hasTag() )
{
return is.getTagCompound().getInteger( "progress" );
}
else
{
final int progress;
final CompoundNBT comp = Platform.openNbtData( is );
comp.setInteger( "progress", progress = is.getItemDamage() );
is.setItemDamage( ( is.getItemDamage() / SINGLE_OFFSET ) * SINGLE_OFFSET );
final CompoundNBT comp = is.getOrCreateTag();
comp.setInteger( "progress", progress = is.getDamage() );
is.setItemDamage( ( is.getDamage() / SINGLE_OFFSET ) * SINGLE_OFFSET );
return progress;
}
}
@@ -147,9 +146,9 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
private void setProgress( final ItemStack is, final int newDamage )
{
final CompoundNBT comp = Platform.openNbtData( is );
final CompoundNBT comp = is.getOrCreateTag();
comp.setInteger( "progress", newDamage );
is.setItemDamage( is.getItemDamage() / LEVEL_OFFSET * LEVEL_OFFSET );
is.setItemDamage( is.getDamage() / LEVEL_OFFSET * LEVEL_OFFSET );
}
@Override
@@ -225,7 +224,7 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
@Override
public Entity createEntity( final World world, final Entity location, final ItemStack itemstack )
{
final EntityGrowingCrystal egc = new EntityGrowingCrystal( world, location.posX, location.posY, location.posZ, itemstack );
final EntityGrowingCrystal egc = new EntityGrowingCrystal( world, location.getPosX(), location.getPosY(), location.getPosZ(), itemstack );
egc.motionX = location.motionX;
egc.motionY = location.motionY;
@@ -109,7 +109,7 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
if( details == null )
{
if( !stack.hasTagCompound() )
if( !stack.hasTag() )
{
return;
}
@@ -46,12 +46,12 @@ public class ItemPaintBall extends AEBaseItem
private String getExtraName( final ItemStack is )
{
return ( is.getItemDamage() >= DAMAGE_THRESHOLD ? GuiText.Lumen.getLocal() + ' ' : "" ) + this.getColor( is );
return ( is.getDamage() >= DAMAGE_THRESHOLD ? GuiText.Lumen.getLocal() + ' ' : "" ) + this.getColor( is );
}
public AEColor getColor( final ItemStack is )
{
int dmg = is.getItemDamage();
int dmg = is.getDamage();
if( dmg >= DAMAGE_THRESHOLD )
{
dmg -= DAMAGE_THRESHOLD;
@@ -87,7 +87,7 @@ public class ItemPaintBall extends AEBaseItem
public static boolean isLumen( final ItemStack is )
{
final int dmg = is.getItemDamage();
final int dmg = is.getDamage();
return dmg >= DAMAGE_THRESHOLD;
}
@@ -45,12 +45,12 @@ public class ItemPaintBallRendering extends ItemRenderingCustomizer
{
final AEColor col = ( (ItemPaintBall) stack.getItem() ).getColor( stack );
final int colorValue = stack.getItemDamage() >= 20 ? col.mediumVariant : col.mediumVariant;
final int colorValue = stack.getDamage() >= 20 ? col.mediumVariant : col.mediumVariant;
final int r = ( colorValue >> 16 ) & 0xff;
final int g = ( colorValue >> 8 ) & 0xff;
final int b = ( colorValue ) & 0xff;
if( stack.getItemDamage() >= 20 )
if( stack.getDamage() >= 20 )
{
final float fail = 0.7f;
final int full = (int) ( 255 * 0.3 );