Minor Changes
Made various minor changes to eliminate warnings or to improve clarity.
This commit is contained in:
parent
58d5f6dd14
commit
dc55359aaf
6 changed files with 28 additions and 45 deletions
|
@ -11,7 +11,6 @@ import net.minecraft.client.renderer.texture.IconRegister;
|
|||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
@ -22,7 +21,6 @@ import StevenDimDoors.mod_pocketDim.config.DDProperties;
|
|||
import StevenDimDoors.mod_pocketDim.core.DDTeleporter;
|
||||
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
import StevenDimDoors.mod_pocketDim.schematic.BlockRotator;
|
||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityDimDoor;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
@ -159,16 +157,13 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||
reversed = !reversed;
|
||||
}
|
||||
}
|
||||
|
||||
if (isUpperDoorBlock(fullMetadata))
|
||||
{
|
||||
return this.upperTextures[reversed ? 1 : 0];
|
||||
else
|
||||
return this.lowerTextures[reversed ? 1 : 0];
|
||||
}
|
||||
else
|
||||
{
|
||||
return this.lowerTextures[0];
|
||||
}
|
||||
return this.lowerTextures[reversed ? 1 : 0];
|
||||
}
|
||||
return this.lowerTextures[0];
|
||||
}
|
||||
|
||||
//Called to update the render information on the tile entity. Could probably implement a data watcher,
|
||||
|
@ -180,29 +175,23 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||
{
|
||||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
TileEntityDimDoor dimTile = (TileEntityDimDoor) tile;
|
||||
dimTile.openOrClosed = this.isDoorOnRift(world, x, y, z)&&this.isUpperDoorBlock(metadata);
|
||||
dimTile.openOrClosed = isDoorOnRift(world, x, y, z) && isUpperDoorBlock(metadata);
|
||||
dimTile.orientation = this.getFullMetadata(world, x, y, z) & 7;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isDoorOnRift(World world, int x, int y, int z)
|
||||
public static boolean isDoorOnRift(World world, int x, int y, int z)
|
||||
{
|
||||
if(this.isUpperDoorBlock( world.getBlockMetadata(x, y, z)))
|
||||
if (isUpperDoorBlock(world.getBlockMetadata(x, y, z)))
|
||||
{
|
||||
if(PocketManager.getLink(x, y, z, world.provider.dimensionId) != null||PocketManager.getLink(x, y-1, z, world.provider.dimensionId) != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// Target block is the upper block
|
||||
return (PocketManager.getLink(x, y, z, world.provider.dimensionId) != null ||
|
||||
PocketManager.getLink(x, y - 1, z, world.provider.dimensionId) != null);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(PocketManager.getLink(x, y, z, world.provider.dimensionId) != null||PocketManager.getLink(x, y+1, z, world.provider.dimensionId) != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
// Target block is the lower block
|
||||
return (PocketManager.getLink(x, y, z, world.provider.dimensionId) != null ||
|
||||
PocketManager.getLink(x, y + 1, z, world.provider.dimensionId) != null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -359,7 +348,8 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||
/**
|
||||
* Returns the ID of the items to drop on destruction.
|
||||
*/
|
||||
public int idDropped(int metadata, Random random, int fortune)
|
||||
@Override
|
||||
public int idDropped(int metadata, Random random, int fortune)
|
||||
{
|
||||
return isUpperDoorBlock(metadata) ? 0 : this.getDrops();
|
||||
}
|
||||
|
|
|
@ -88,6 +88,7 @@ public class BlockDimWall extends Block
|
|||
subItems.add(new ItemStack(this, 1, ix));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {}
|
||||
|
||||
|
|
|
@ -2,17 +2,15 @@ package StevenDimDoors.mod_pocketDim.blocks;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import StevenDimDoors.mod_pocketDim.config.DDProperties;
|
||||
import net.minecraft.block.BlockDoor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.IconFlipped;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockDoorGold extends BlockDoor
|
||||
{
|
||||
|
@ -110,15 +108,12 @@ public class BlockDoorGold extends BlockDoor
|
|||
reversed = !reversed;
|
||||
}
|
||||
}
|
||||
|
||||
if (BaseDimDoor.isUpperDoorBlock(fullMetadata))
|
||||
{
|
||||
return this.upperTextures[reversed ? 1 : 0];
|
||||
else
|
||||
return this.lowerTextures[reversed ? 1 : 0];
|
||||
}
|
||||
else
|
||||
{
|
||||
return this.lowerTextures[0];
|
||||
}
|
||||
return this.lowerTextures[reversed ? 1 : 0];
|
||||
}
|
||||
return this.lowerTextures[0];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,10 +9,8 @@ import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
|||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class DimensionalDoor extends BaseDimDoor
|
||||
{
|
||||
|
||||
public DimensionalDoor(int blockID, Material material, DDProperties properties)
|
||||
{
|
||||
super(blockID, material, properties);
|
||||
|
@ -27,10 +25,11 @@ public class DimensionalDoor extends BaseDimDoor
|
|||
DimLink link = dimension.getLink(x, y, z);
|
||||
if (link == null)
|
||||
{
|
||||
dimension.createLink(x, y, z, LinkTypes.POCKET,world.getBlockMetadata(x, y - 1, z));
|
||||
dimension.createLink(x, y, z, LinkTypes.POCKET, world.getBlockMetadata(x, y - 1, z));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDrops()
|
||||
{
|
||||
|
|
|
@ -18,7 +18,6 @@ import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
|||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityTransTrapdoor;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class TransTrapdoor extends BlockTrapDoor implements IDimDoor, ITileEntityProvider
|
||||
{
|
||||
|
||||
|
@ -61,7 +60,7 @@ public class TransTrapdoor extends BlockTrapDoor implements IDimDoor, ITileEntit
|
|||
{
|
||||
this.placeLink(world, x, y, z);
|
||||
world.setBlockTileEntity(x, y, z, this.createNewTileEntity(world));
|
||||
this.updateAttachedTile(world, x, y, z);
|
||||
updateAttachedTile(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -76,8 +75,8 @@ public class TransTrapdoor extends BlockTrapDoor implements IDimDoor, ITileEntit
|
|||
{
|
||||
return new TileEntityTransTrapdoor();
|
||||
}
|
||||
|
||||
public void updateAttachedTile(World world, int x, int y, int z)
|
||||
|
||||
public static void updateAttachedTile(World world, int x, int y, int z)
|
||||
{
|
||||
TileEntity tile = world.getBlockTileEntity(x, y, z);
|
||||
if (tile instanceof TileEntityTransTrapdoor)
|
||||
|
|
|
@ -9,7 +9,6 @@ import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
|||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class WarpDoor extends BaseDimDoor
|
||||
{
|
||||
public WarpDoor(int blockID, Material material, DDProperties properties)
|
||||
|
|
Loading…
Add table
Reference in a new issue