Port to 1.11
This commit is contained in:
@@ -38,6 +38,7 @@ import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
@@ -69,9 +70,9 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumActionResult onItemUseFirst( final ItemStack is, 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 AEApi.instance().partHelper().placeBus( is, pos, side, player, hand, world );
|
||||
return AEApi.instance().partHelper().placeBus( player.getHeldItemMainhand(), pos, side, player, hand, world );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -94,7 +95,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
}
|
||||
|
||||
@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 )
|
||||
{
|
||||
this.calculateSubTypes();
|
||||
itemStacks.addAll( this.subTypes );
|
||||
@@ -116,7 +117,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
continue;
|
||||
}
|
||||
|
||||
final List<ItemStack> tmpList = new ArrayList<ItemStack>( 100 );
|
||||
final NonNullList<ItemStack> tmpList = NonNullList.create();
|
||||
b.getSubBlocks( item, b.getCreativeTabToDisplayOn(), tmpList );
|
||||
for( final ItemStack l : tmpList )
|
||||
{
|
||||
@@ -336,6 +337,6 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
}
|
||||
|
||||
Block blk = blockState.getBlock();
|
||||
return blk.canRenderInLayer( BlockRenderLayer.TRANSLUCENT );
|
||||
return blk.canRenderInLayer( blockState, BlockRenderLayer.TRANSLUCENT );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -152,14 +153,14 @@ public final class ItemPart extends AEBaseItem implements IPartItem, IItemGroup
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumActionResult onItemUse( final ItemStack is, final EntityPlayer player, final World w, final BlockPos pos, final EnumHand hand, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
||||
public EnumActionResult onItemUse( final EntityPlayer player, final World w, final BlockPos pos, final EnumHand hand, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
if( this.getTypeByStack( is ) == PartType.InvalidType )
|
||||
if( this.getTypeByStack( player.getHeldItemMainhand() ) == PartType.InvalidType )
|
||||
{
|
||||
return EnumActionResult.FAIL;
|
||||
}
|
||||
|
||||
return AEApi.instance().partHelper().placeBus( is, pos, side, player, hand, w );
|
||||
return AEApi.instance().partHelper().placeBus( player.getHeldItemMainhand(), pos, side, player, hand, w );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -195,7 +196,7 @@ public final class ItemPart extends AEBaseItem implements IPartItem, IItemGroup
|
||||
}
|
||||
|
||||
@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 )
|
||||
{
|
||||
final List<Entry<Integer, PartTypeWithVariant>> types = new ArrayList<Entry<Integer, PartTypeWithVariant>>( this.registered.entrySet() );
|
||||
Collections.sort( types, REGISTERED_COMPARATOR );
|
||||
|
||||
@@ -59,10 +59,8 @@ import appeng.parts.networking.PartCableGlass;
|
||||
import appeng.parts.networking.PartCableSmart;
|
||||
import appeng.parts.networking.PartDenseCable;
|
||||
import appeng.parts.networking.PartQuartzFiber;
|
||||
import appeng.parts.p2p.PartP2PIC2Power;
|
||||
import appeng.parts.p2p.PartP2PItems;
|
||||
import appeng.parts.p2p.PartP2PLight;
|
||||
import appeng.parts.p2p.PartP2PLiquids;
|
||||
import appeng.parts.p2p.PartP2PRedstone;
|
||||
import appeng.parts.p2p.PartP2PTunnelME;
|
||||
import appeng.parts.reporting.PartConversionMonitor;
|
||||
@@ -226,25 +224,25 @@ public enum PartType
|
||||
}
|
||||
},
|
||||
|
||||
P2PTunnelLiquids( 463, "p2p_tunnel_liquids", EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_LIQUIDS ), EnumSet
|
||||
.noneOf( IntegrationType.class ), PartP2PLiquids.class, GuiText.FluidTunnel )
|
||||
{
|
||||
@Override
|
||||
String getUnlocalizedName()
|
||||
{
|
||||
return "P2PTunnel";
|
||||
}
|
||||
},
|
||||
|
||||
P2PTunnelEU( 465, "p2p_tunnel_ic2", EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_EU ), EnumSet
|
||||
.of( IntegrationType.IC2 ), PartP2PIC2Power.class, GuiText.EUTunnel )
|
||||
{
|
||||
@Override
|
||||
String getUnlocalizedName()
|
||||
{
|
||||
return "P2PTunnel";
|
||||
}
|
||||
},
|
||||
// P2PTunnelLiquids( 463, "p2p_tunnel_liquids", EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_LIQUIDS ), EnumSet
|
||||
// .noneOf( IntegrationType.class ), PartP2PLiquids.class, GuiText.FluidTunnel )
|
||||
// {
|
||||
// @Override
|
||||
// String getUnlocalizedName()
|
||||
// {
|
||||
// return "P2PTunnel";
|
||||
// }
|
||||
// },
|
||||
//
|
||||
// P2PTunnelEU( 465, "p2p_tunnel_ic2", EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_EU ), EnumSet
|
||||
// .of( IntegrationType.IC2 ), PartP2PIC2Power.class, GuiText.EUTunnel )
|
||||
// {
|
||||
// @Override
|
||||
// String getUnlocalizedName()
|
||||
// {
|
||||
// return "P2PTunnel";
|
||||
// }
|
||||
// },
|
||||
|
||||
// P2PTunnelRF( 466, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelRF ), EnumSet.of( IntegrationType.RF ),
|
||||
// PartP2PRFPower.class, GuiText.RFTunnel ),
|
||||
|
||||
Reference in New Issue
Block a user