Port to 1.11

This commit is contained in:
yueh
2016-12-08 12:42:00 +01:00
parent 589730bfad
commit ed9e6dd21c
262 changed files with 4027 additions and 3954 deletions
@@ -32,6 +32,8 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.EntityRegistry;
@@ -62,7 +64,7 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
{
this.setHasSubtypes( true );
EntityRegistry.registerModEntity( EntityGrowingCrystal.class, EntityGrowingCrystal.class.getSimpleName(), EntityIds.get( EntityGrowingCrystal.class ), AppEng.instance(), 16, 4, true );
EntityRegistry.registerModEntity( new ResourceLocation( EntityGrowingCrystal.class.getName() ), EntityGrowingCrystal.class, EntityGrowingCrystal.class.getSimpleName(), EntityIds.get( EntityGrowingCrystal.class ), AppEng.instance(), 16, 4, true );
}
@Nullable
@@ -109,7 +111,7 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
{
final int newDamage = getProgress( is ) + 1;
final IMaterials materials = AEApi.instance().definitions().materials();
final int size = is.stackSize;
final int size = is.getCount();
if( newDamage == CERTUS + SINGLE_OFFSET )
{
@@ -237,7 +239,7 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
}
@Override
protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final List<ItemStack> itemStacks )
protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final NonNullList<ItemStack> itemStacks )
{
// lvl 0
itemStacks.add( newStyle( new ItemStack( this, 1, CERTUS ) ) );
@@ -38,7 +38,7 @@ import appeng.api.AEApi;
import appeng.api.implementations.ICraftingPatternItem;
import appeng.api.networking.crafting.ICraftingPatternDetails;
import appeng.api.storage.data.IAEItemStack;
import appeng.core.CommonHelper;
import appeng.core.AppEng;
import appeng.core.localization.GuiText;
import appeng.helpers.PatternHelper;
import appeng.items.AEBaseItem;
@@ -56,17 +56,17 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
}
@Override
public ActionResult<ItemStack> onItemRightClick( final ItemStack stack, final World w, final EntityPlayer player, final EnumHand hand )
public ActionResult<ItemStack> onItemRightClick( final World w, final EntityPlayer player, final EnumHand hand )
{
this.clearPattern( stack, player );
this.clearPattern( player.getHeldItemMainhand(), player );
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, stack );
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, player.getHeldItemMainhand() );
}
@Override
public EnumActionResult onItemUseFirst( final ItemStack stack, final EntityPlayer player, final World world, final BlockPos pos, final EnumFacing side, final float hitX, final float hitY, final float hitZ, final EnumHand hand )
public EnumActionResult onItemUseFirst( final EntityPlayer player, final World world, final BlockPos pos, final EnumFacing side, final float hitX, final float hitY, final float hitZ, final EnumHand hand )
{
return this.clearPattern( stack, player ) ? EnumActionResult.SUCCESS : EnumActionResult.FAIL;
return this.clearPattern( player.getHeldItemMainhand(), player ) ? EnumActionResult.SUCCESS : EnumActionResult.FAIL;
}
private boolean clearPattern( final ItemStack stack, final EntityPlayer player )
@@ -80,7 +80,7 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
final InventoryPlayer inv = player.inventory;
ItemStack is = AEApi.instance().definitions().materials().blankPattern().maybeStack( stack.stackSize ).orElse( null );
ItemStack is = AEApi.instance().definitions().materials().blankPattern().maybeStack( stack.getCount() ).orElse( null );
if( is != null )
{
for( int s = 0; s < player.inventory.getSizeInventory(); s++ )
@@ -100,7 +100,7 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
@Override
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
{
final ICraftingPatternDetails details = this.getPatternForItem( stack, player.worldObj );
final ICraftingPatternDetails details = this.getPatternForItem( stack, player.world );
if( details == null )
{
@@ -172,7 +172,7 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
return out;
}
final World w = CommonHelper.proxy.getWorld();
final World w = AppEng.proxy.getWorld();
if( w == null )
{
return null;
@@ -19,11 +19,10 @@
package appeng.items.misc;
import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import appeng.api.util.AEColor;
import appeng.core.localization.GuiText;
@@ -68,7 +67,7 @@ public class ItemPaintBall extends AEBaseItem
}
@Override
protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final List<ItemStack> itemStacks )
protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final NonNullList<ItemStack> itemStacks )
{
for( final AEColor c : AEColor.values() )
{