Fixed orientation and transient doors
This commit is contained in:
@@ -424,9 +424,10 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initDoorTE(World world, int x, int y, int z)
|
public TileEntity initDoorTE(World world, int x, int y, int z)
|
||||||
{
|
{
|
||||||
TileEntity te = this.createNewTileEntity(world);
|
TileEntity te = this.createNewTileEntity(world);
|
||||||
world.setBlockTileEntity(x, y, z, te);
|
world.setBlockTileEntity(x, y, z, te);
|
||||||
|
return te;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package StevenDimDoors.mod_pocketDim.blocks;
|
package StevenDimDoors.mod_pocketDim.blocks;
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public interface IDimDoor
|
public interface IDimDoor
|
||||||
@@ -11,5 +12,5 @@ public interface IDimDoor
|
|||||||
|
|
||||||
public int getDrops();
|
public int getDrops();
|
||||||
|
|
||||||
public void initDoorTE(World world, int x, int y, int z);
|
public TileEntity initDoorTE(World world, int x, int y, int z);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,9 +120,10 @@ public class TransTrapdoor extends BlockTrapDoor implements IDimDoor, ITileEntit
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initDoorTE(World world, int x, int y, int z)
|
public TileEntity initDoorTE(World world, int x, int y, int z)
|
||||||
{
|
{
|
||||||
TileEntity te = this.createNewTileEntity(world);
|
TileEntity te = this.createNewTileEntity(world);
|
||||||
world.setBlockTileEntity(x, y, z, te);
|
world.setBlockTileEntity(x, y, z, te);
|
||||||
|
return te;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -25,6 +25,7 @@ import net.minecraftforge.common.network.packet.DimensionRegisterPacket;
|
|||||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||||
import StevenDimDoors.mod_pocketDim.Point3D;
|
import StevenDimDoors.mod_pocketDim.Point3D;
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||||
|
import StevenDimDoors.mod_pocketDim.blocks.BaseDimDoor;
|
||||||
import StevenDimDoors.mod_pocketDim.helpers.yCoordHelper;
|
import StevenDimDoors.mod_pocketDim.helpers.yCoordHelper;
|
||||||
import StevenDimDoors.mod_pocketDim.items.BaseItemDoor;
|
import StevenDimDoors.mod_pocketDim.items.BaseItemDoor;
|
||||||
import StevenDimDoors.mod_pocketDim.items.ItemDimensionalDoor;
|
import StevenDimDoors.mod_pocketDim.items.ItemDimensionalDoor;
|
||||||
@@ -600,7 +601,9 @@ public class DDTeleporter
|
|||||||
}
|
}
|
||||||
|
|
||||||
BaseItemDoor.placeDoorBlock(destWorld, link.destination().getX(), link.destination().getY()-1, link.destination().getZ(),link.getDestinationOrientation(), door);
|
BaseItemDoor.placeDoorBlock(destWorld, link.destination().getX(), link.destination().getY()-1, link.destination().getZ(),link.getDestinationOrientation(), door);
|
||||||
TileEntity doorDestTE = startWorld.getBlockTileEntity(link.destination().getX(), link.destination().getY(), link.destination().getZ());
|
|
||||||
|
TileEntity doorDestTE = ((BaseDimDoor)door).initDoorTE(destWorld, link.destination().getX(), link.destination().getY(), link.destination().getZ());
|
||||||
|
|
||||||
|
|
||||||
if(doorDestTE instanceof TileEntityDimDoor)
|
if(doorDestTE instanceof TileEntityDimDoor)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -62,7 +62,12 @@ public abstract class DimLink
|
|||||||
}
|
}
|
||||||
public int getDestinationOrientation()
|
public int getDestinationOrientation()
|
||||||
{
|
{
|
||||||
return PocketManager.getLink(link.point.getX(), link.point.getY(), link.point.getZ(), link.point.getDimension()).link().orientation;
|
DimLink link = PocketManager.getLink(this.destination().getX(), this.destination().getY(), this.destination().getZ(), this.destination().getDimension());
|
||||||
|
if(link !=null)
|
||||||
|
{
|
||||||
|
return link.orientation();
|
||||||
|
}
|
||||||
|
return (this.orientation()+2)%4;
|
||||||
}
|
}
|
||||||
public boolean hasDestination()
|
public boolean hasDestination()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ public class ItemRiftSignature extends Item
|
|||||||
@Override
|
@Override
|
||||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||||
{
|
{
|
||||||
//TODO- recognize doors and intelligently place rifts on them.
|
|
||||||
// We must use onItemUseFirst() instead of onItemUse() because Minecraft checks
|
// We must use onItemUseFirst() instead of onItemUse() because Minecraft checks
|
||||||
// whether the user is in creative mode after calling onItemUse() and undoes any
|
// whether the user is in creative mode after calling onItemUse() and undoes any
|
||||||
// damage we might set to indicate the rift sig has been activated. Otherwise,
|
// damage we might set to indicate the rift sig has been activated. Otherwise,
|
||||||
|
|||||||
@@ -71,10 +71,10 @@ public class RenderMobObelisk extends RenderLiving
|
|||||||
|
|
||||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
exception.printStackTrace();
|
exception.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
|
OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
|
||||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||||
|
|||||||
Reference in New Issue
Block a user