Fix facade recipes. Hopefully the last null check fix.

This commit is contained in:
Gunther De Wachter
2017-06-27 20:39:06 +02:00
parent b819fe4adb
commit 61b81fc802
52 changed files with 101 additions and 83 deletions
@@ -44,7 +44,7 @@ public class AchievementCraftingHandler
@SubscribeEvent
public void onPlayerCraftingEvent( final PlayerEvent.ItemCraftedEvent event )
{
if( this.differentiator.isNoPlayer( event.player ) || event.crafting == null )
if( this.differentiator.isNoPlayer( event.player ) || event.crafting.isEmpty() )
{
return;
}
@@ -45,7 +45,7 @@ public class AchievementPickupHandler
@SubscribeEvent
public void onItemPickUp( final PlayerEvent.ItemPickupEvent event )
{
if( this.differentiator.isNoPlayer( event.player ) || event.pickedUp == null || event.pickedUp.getEntityItem() == null )
if( this.differentiator.isNoPlayer( event.player ) || event.pickedUp == null || event.pickedUp.getEntityItem().isEmpty() )
{
return;
}
@@ -116,7 +116,7 @@ public enum Achievements
Achievements( final int x, final int y, final AEColoredItemDefinition which, final AchievementType type )
{
this.stack = ( which != null ) ? which.stack( AEColor.TRANSPARENT, 1 ) : null;
this.stack = ( which != null ) ? which.stack( AEColor.TRANSPARENT, 1 ) : ItemStack.EMPTY;
this.type = type;
this.x = x;
this.y = y;
@@ -145,7 +145,7 @@ public enum Achievements
public Achievement getAchievement()
{
if( this.stat == null && this.getStack() != null )
if( this.stat == null && !this.getStack().isEmpty() )
{
this.stat = new Achievement( "achievement.ae2." + this.name(), "ae2." + this.name(), this.x, this.y, this.getStack(), this.parent );
this.stat.registerStat();