Ported to 1.7
This commit is contained in:
@@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.ChunkCoordIntPair;
|
||||
import net.minecraftforge.common.ForgeChunkManager;
|
||||
import net.minecraftforge.common.ForgeChunkManager.Ticket;
|
||||
@@ -60,7 +61,7 @@ public class TileChunkLoader extends AEBaseTile
|
||||
List<EntityPlayerMP> pl = server.getConfigurationManager().playerEntityList;
|
||||
for (EntityPlayerMP p : pl)
|
||||
{
|
||||
p.addChatMessage( "Can't chunk load.." );
|
||||
p.addChatMessage( new ChatComponentText( "Can't chunk load.." ) );
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -19,9 +19,9 @@ public class TileItemGen extends AEBaseTile implements IInventory
|
||||
public TileItemGen() {
|
||||
if ( possibleItems.isEmpty() )
|
||||
{
|
||||
for (int x = 0; x < Item.itemsList.length; x++)
|
||||
for (Object obj : Item.itemRegistry)
|
||||
{
|
||||
Item mi = Item.itemsList[x];
|
||||
Item mi = (Item) obj;
|
||||
if ( mi != null )
|
||||
{
|
||||
if ( mi.isDamageable() )
|
||||
@@ -32,7 +32,7 @@ public class TileItemGen extends AEBaseTile implements IInventory
|
||||
else
|
||||
{
|
||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
||||
mi.getSubItems( x, mi.getCreativeTab(), list );
|
||||
mi.getSubItems( mi, mi.getCreativeTab(), list );
|
||||
possibleItems.addAll( list );
|
||||
}
|
||||
}
|
||||
@@ -80,13 +80,13 @@ public class TileItemGen extends AEBaseTile implements IInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInvName()
|
||||
public String getInventoryName()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInvNameLocalized()
|
||||
public boolean hasCustomInventoryName()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -98,13 +98,13 @@ public class TileItemGen extends AEBaseTile implements IInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openChest()
|
||||
public void openInventory()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeChest()
|
||||
public void closeInventory()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@ import java.util.EnumSet;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.networking.IGridConnection;
|
||||
import appeng.api.networking.IGridHost;
|
||||
import appeng.api.networking.IGridNode;
|
||||
@@ -63,7 +63,7 @@ public class ToolDebugCard extends AEBaseItem
|
||||
}
|
||||
else
|
||||
{
|
||||
TileEntity te = world.getBlockTileEntity( x, y, z );
|
||||
TileEntity te = world.getTileEntity( x, y, z );
|
||||
|
||||
if ( te instanceof IGridHost )
|
||||
{
|
||||
@@ -144,7 +144,7 @@ public class ToolDebugCard extends AEBaseItem
|
||||
|
||||
private void outputMsg(EntityPlayer player, String string)
|
||||
{
|
||||
player.sendChatToPlayer( ChatMessageComponent.createFromText( string ) );
|
||||
player.addChatMessage( new ChatComponentText( string ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.networking.IGrid;
|
||||
import appeng.api.networking.IGridHost;
|
||||
import appeng.api.networking.IGridNode;
|
||||
@@ -36,7 +36,7 @@ public class ToolReplicatorCard extends AEBaseItem
|
||||
|
||||
if ( player.isSneaking() )
|
||||
{
|
||||
if ( world.getBlockTileEntity( x, y, z ) instanceof IGridHost )
|
||||
if ( world.getTileEntity( x, y, z ) instanceof IGridHost )
|
||||
{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setInteger( "x", x );
|
||||
@@ -61,7 +61,7 @@ public class ToolReplicatorCard extends AEBaseItem
|
||||
int dimid = ish.getInteger( "dimid" );
|
||||
World src_w = DimensionManager.getWorld( dimid );
|
||||
|
||||
TileEntity te = src_w.getBlockTileEntity( src_x, src_y, src_z );
|
||||
TileEntity te = src_w.getTileEntity( src_x, src_y, src_z );
|
||||
if ( te instanceof IGridHost )
|
||||
{
|
||||
IGridHost gh = (IGridHost) te;
|
||||
@@ -99,19 +99,18 @@ public class ToolReplicatorCard extends AEBaseItem
|
||||
for (int j = 1; j < scale_y; j++)
|
||||
for (int k = 1; k < scale_z; k++)
|
||||
{
|
||||
int id = src_w.getBlockId( min_x + i, min_y + j, min_z + k );
|
||||
Block blk = src_w.getBlock( min_x + i, min_y + j, min_z + k );
|
||||
int meta = src_w.getBlockMetadata( min_x + i, min_y + j, min_z + k );
|
||||
world.setBlock( i + rel_x, j + rel_y, k + rel_z, id, meta, 4 );
|
||||
world.setBlock( i + rel_x, j + rel_y, k + rel_z, blk, meta, 4 );
|
||||
|
||||
Block blk = Block.blocksList[id];
|
||||
if ( blk != null && blk.hasTileEntity( meta ) )
|
||||
{
|
||||
TileEntity ote = src_w.getBlockTileEntity( min_x + i, min_y + j, min_z + k );
|
||||
TileEntity ote = src_w.getTileEntity( min_x + i, min_y + j, min_z + k );
|
||||
TileEntity nte = blk.createTileEntity( world, meta );
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
ote.writeToNBT( data );
|
||||
nte.readFromNBT( (NBTTagCompound) data.copy() );
|
||||
world.setBlockTileEntity( i + rel_x, j + rel_y, k + rel_z, nte );
|
||||
world.setTileEntity( i + rel_x, j + rel_y, k + rel_z, nte );
|
||||
}
|
||||
world.markBlockForUpdate( i + rel_x, j + rel_y, k + rel_z );
|
||||
}
|
||||
@@ -137,7 +136,7 @@ public class ToolReplicatorCard extends AEBaseItem
|
||||
|
||||
private void outputMsg(EntityPlayer player, String string)
|
||||
{
|
||||
player.sendChatToPlayer( ChatMessageComponent.createFromText( string ) );
|
||||
player.addChatMessage( new ChatComponentText( string ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user