1.15 port
This commit is contained in:
@@ -26,7 +26,7 @@ import io.netty.buffer.ByteBuf;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.parts.IFacadeContainer;
|
||||
@@ -102,15 +102,15 @@ public class FacadeContainer implements IFacadeContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( final NBTTagCompound c )
|
||||
public void writeToNBT( final CompoundNBT c )
|
||||
{
|
||||
for( int x = 0; x < this.facades; x++ )
|
||||
{
|
||||
if( this.storage.getFacade( x ) != null )
|
||||
{
|
||||
final NBTTagCompound data = new NBTTagCompound();
|
||||
this.storage.getFacade( x ).getItemStack().writeToNBT( data );
|
||||
c.setTag( "facade:" + x, data );
|
||||
final CompoundNBT data = new CompoundNBT();
|
||||
this.storage.getFacade( x ).getItemStack().write( data );
|
||||
c.put( "facade:" + x, data );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -156,16 +156,16 @@ public class FacadeContainer implements IFacadeContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( final NBTTagCompound c )
|
||||
public void readFromNBT( final CompoundNBT c )
|
||||
{
|
||||
for( int x = 0; x < this.facades; x++ )
|
||||
{
|
||||
this.storage.setFacade( x, null );
|
||||
|
||||
final NBTTagCompound t = c.getCompoundTag( "facade:" + x );
|
||||
final CompoundNBT t = c.getCompound( "facade:" + x );
|
||||
if( t != null )
|
||||
{
|
||||
final ItemStack is = new ItemStack( t );
|
||||
final ItemStack is = ItemStack.read( t );
|
||||
if( !is.isEmpty() )
|
||||
{
|
||||
final Item i = is.getItem();
|
||||
|
||||
@@ -19,13 +19,13 @@
|
||||
package appeng.facade;
|
||||
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.parts.IBoxProvider;
|
||||
@@ -65,7 +65,7 @@ public class FacadePart implements IFacadePart, IBoxProvider
|
||||
@Override
|
||||
public void getBoxes( final IPartCollisionHelper ch, final Entity e )
|
||||
{
|
||||
if( e instanceof EntityLivingBase )
|
||||
if( e instanceof LivingEntity )
|
||||
{
|
||||
// prevent weird snag behavior
|
||||
ch.addBox( 0.0, 0.0, 14, 16.0, 16.0, 16.0 );
|
||||
@@ -94,17 +94,6 @@ public class FacadePart implements IFacadePart, IBoxProvider
|
||||
return is.getItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemDamage()
|
||||
{
|
||||
final ItemStack is = this.getTextureItem();
|
||||
if( is.isEmpty() )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return is.getItemDamage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean notAEFacade()
|
||||
{
|
||||
@@ -139,7 +128,7 @@ public class FacadePart implements IFacadePart, IBoxProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getBlockState()
|
||||
public BlockState getBlockState()
|
||||
{
|
||||
final Item maybeFacade = this.facade.getItem();
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package appeng.facade;
|
||||
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.util.AEPartLocation;
|
||||
@@ -32,6 +32,6 @@ public interface IFacadeItem
|
||||
|
||||
ItemStack getTextureItem( ItemStack is );
|
||||
|
||||
IBlockState getTextureBlockState( ItemStack is );
|
||||
BlockState getTextureBlockState( ItemStack is );
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user