1.15 port

This commit is contained in:
yueh
2020-05-18 14:02:45 +02:00
parent 0ea86c939c
commit 16d6d55d7f
630 changed files with 4211 additions and 12664 deletions
+27 -27
View File
@@ -32,19 +32,19 @@ import io.netty.buffer.ByteBuf;
import net.minecraft.crash.CrashReportCategory;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.items.IItemHandler;
import appeng.api.AEApi;
@@ -92,7 +92,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
this.is = is;
this.proxy = new AENetworkProxy( this, "part", is, this instanceof PartCable );
this.proxy.setValidSides( EnumSet.noneOf( EnumFacing.class ) );
this.proxy.setValidSides( EnumSet.noneOf( Direction.class ) );
}
public IPartHost getHost()
@@ -222,7 +222,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
}
@Override
public void onNeighborChanged( IBlockAccess w, BlockPos pos, BlockPos neighbor )
public void onNeighborChanged( IBlockReader w, BlockPos pos, BlockPos neighbor )
{
}
@@ -234,13 +234,13 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
}
@Override
public void readFromNBT( final NBTTagCompound data )
public void readFromNBT( final CompoundNBT data )
{
this.proxy.readFromNBT( data );
}
@Override
public void writeToNBT( final NBTTagCompound data )
public void writeToNBT( final CompoundNBT data )
{
this.proxy.writeToNBT( data );
}
@@ -308,7 +308,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
}
@Override
@SideOnly( Side.CLIENT )
@OnlyIn( Dist.CLIENT )
public void randomDisplayTick( final World world, final BlockPos pos, final Random r )
{
@@ -333,7 +333,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
}
@Override
public boolean isLadder( final EntityLivingBase entity )
public boolean isLadder( final LivingEntity entity )
{
return false;
}
@@ -356,7 +356,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
* @param from source of settings
* @param compound compound of source
*/
private void uploadSettings( final SettingsFrom from, final NBTTagCompound compound )
private void uploadSettings( final SettingsFrom from, final CompoundNBT compound )
{
if( compound != null )
{
@@ -393,9 +393,9 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
*
* @return compound of source
*/
private NBTTagCompound downloadSettings( final SettingsFrom from )
private CompoundNBT downloadSettings( final SettingsFrom from )
{
final NBTTagCompound output = new NBTTagCompound();
final CompoundNBT output = new CompoundNBT();
final IConfigManager cm = this.getConfigManager();
if( cm != null )
@@ -423,7 +423,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
return true;
}
private boolean useMemoryCard( final EntityPlayer player )
private boolean useMemoryCard( final PlayerEntity player )
{
final ItemStack memCardIS = player.inventory.getCurrentItem();
@@ -444,11 +444,11 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
}
}
final String name = is.getUnlocalizedName();
final String name = is.getTranslationKey();
if( player.isSneaking() )
if( player.isShiftKeyDown() )
{
final NBTTagCompound data = this.downloadSettings( SettingsFrom.MEMORY_CARD );
final CompoundNBT data = this.downloadSettings( SettingsFrom.MEMORY_CARD );
if( data != null )
{
memoryCard.setMemoryCardContents( memCardIS, name, data );
@@ -458,7 +458,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
else
{
final String storedName = memoryCard.getSettingsName( memCardIS );
final NBTTagCompound data = memoryCard.getData( memCardIS );
final CompoundNBT data = memoryCard.getData( memCardIS );
if( name.equals( storedName ) )
{
this.uploadSettings( SettingsFrom.MEMORY_CARD, data );
@@ -475,7 +475,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
}
@Override
public final boolean onActivate( final EntityPlayer player, final EnumHand hand, final Vec3d pos )
public final boolean onActivate( final PlayerEntity player, final Hand hand, final Vec3d pos )
{
if( this.useMemoryCard( player ) )
{
@@ -486,7 +486,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
}
@Override
public final boolean onShiftActivate( final EntityPlayer player, final EnumHand hand, final Vec3d pos )
public final boolean onShiftActivate( final PlayerEntity player, final Hand hand, final Vec3d pos )
{
if( this.useMemoryCard( player ) )
{
@@ -496,18 +496,18 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
return this.onPartShiftActivate( player, hand, pos );
}
public boolean onPartActivate( final EntityPlayer player, final EnumHand hand, final Vec3d pos )
public boolean onPartActivate( final PlayerEntity player, final Hand hand, final Vec3d pos )
{
return false;
}
public boolean onPartShiftActivate( final EntityPlayer player, final EnumHand hand, final Vec3d pos )
public boolean onPartShiftActivate( final PlayerEntity player, final Hand hand, final Vec3d pos )
{
return false;
}
@Override
public void onPlacement( final EntityPlayer player, final EnumHand hand, final ItemStack held, final AEPartLocation side )
public void onPlacement( final PlayerEntity player, final Hand hand, final ItemStack held, final AEPartLocation side )
{
this.proxy.setOwner( player );
}