Mazes #117
@@ -29,7 +29,7 @@ public class BlankTeleporter extends Teleporter
|
|||||||
public void setEntityPosition(Entity entity, double x, double y, double z)
|
public void setEntityPosition(Entity entity, double x, double y, double z)
|
||||||
{
|
{
|
||||||
entity.lastTickPosX = entity.prevPosX = entity.posX = x;
|
entity.lastTickPosX = entity.prevPosX = entity.posX = x;
|
||||||
entity.lastTickPosY = entity.prevPosY = entity.posY = y + (double)entity.yOffset;
|
entity.lastTickPosY = entity.prevPosY = entity.posY = y + entity.yOffset;
|
||||||
entity.lastTickPosZ = entity.prevPosZ = entity.posZ = z;
|
entity.lastTickPosZ = entity.prevPosZ = entity.posZ = z;
|
||||||
entity.setPosition(x, y, z);
|
entity.setPosition(x, y, z);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||||||
|
|
||||||
public class CloudRenderBlank extends IRenderHandler
|
public class CloudRenderBlank extends IRenderHandler
|
||||||
{
|
{
|
||||||
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void render(float partialTicks, WorldClient world, Minecraft mc)
|
public void render(float partialTicks, WorldClient world, Minecraft mc)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import net.minecraft.network.packet.NetHandler;
|
|||||||
import net.minecraft.network.packet.Packet1Login;
|
import net.minecraft.network.packet.Packet1Login;
|
||||||
import net.minecraft.network.packet.Packet250CustomPayload;
|
import net.minecraft.network.packet.Packet250CustomPayload;
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
|
import net.minecraft.server.integrated.IntegratedServer;
|
||||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||||
import cpw.mods.fml.common.network.IConnectionHandler;
|
import cpw.mods.fml.common.network.IConnectionHandler;
|
||||||
import cpw.mods.fml.common.network.Player;
|
import cpw.mods.fml.common.network.Player;
|
||||||
@@ -40,6 +41,28 @@ public class ConnectionHandler implements IConnectionHandler
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void connectionOpened(NetHandler netClientHandler, String server, int port, INetworkManager manager)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void connectionOpened(NetHandler netClientHandler,MinecraftServer server, INetworkManager manager)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void connectionClosed(INetworkManager manager)
|
||||||
|
{
|
||||||
|
if(PocketManager.isConnected)
|
||||||
|
{
|
||||||
|
PocketManager.unload();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void connectionOpened(NetHandler netClientHandler, String server, int port, INetworkManager manager) { }
|
public void connectionOpened(NetHandler netClientHandler, String server, int port, INetworkManager manager) { }
|
||||||
|
|
||||||
@@ -64,4 +87,16 @@ public class ConnectionHandler implements IConnectionHandler
|
|||||||
//Send information about all the registered dimensions and links to the client
|
//Send information about all the registered dimensions and links to the client
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clientLoggedIn(NetHandler clientHandler, INetworkManager manager, Packet1Login login)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void playerLoggedIn(Player player, NetHandler netHandler, INetworkManager manager)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
package StevenDimDoors.mod_pocketDim;
|
||||||
|
|
||||||
import paulscode.sound.SoundSystem;
|
import paulscode.sound.SoundSystem;
|
||||||
|
import net.minecraft.client.audio.SoundManager;
|
||||||
|
import net.minecraft.client.audio.SoundPool;
|
||||||
import net.minecraft.client.audio.SoundPoolEntry;
|
import net.minecraft.client.audio.SoundPoolEntry;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
@@ -36,15 +38,15 @@ public class EventHookContainer
|
|||||||
@ForgeSubscribe
|
@ForgeSubscribe
|
||||||
public void onSoundLoad(SoundLoadEvent event)
|
public void onSoundLoad(SoundLoadEvent event)
|
||||||
{
|
{
|
||||||
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/monk.ogg");
|
event.manager.addSound(mod_pocketDim.modid+":monk.ogg");
|
||||||
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/crack.ogg");
|
event.manager.addSound(mod_pocketDim.modid+":crack.ogg");
|
||||||
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/tearing.ogg");
|
event.manager.addSound(mod_pocketDim.modid+":tearing.ogg");
|
||||||
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/rift.ogg");
|
event.manager.addSound(mod_pocketDim.modid+":rift.ogg");
|
||||||
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/riftStart.ogg");
|
event.manager.addSound(mod_pocketDim.modid+":riftStart.ogg");
|
||||||
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/riftEnd.ogg");
|
event.manager.addSound(mod_pocketDim.modid+":riftEnd.ogg");
|
||||||
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/riftClose.ogg");
|
event.manager.addSound(mod_pocketDim.modid+":riftClose.ogg");
|
||||||
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/riftDoor.ogg");
|
event.manager.addSound(mod_pocketDim.modid+":riftDoor.ogg");
|
||||||
event.manager.soundPoolMusic.addSound("mods/DimDoors/sfx/creepy.ogg");
|
event.manager.addMusic(mod_pocketDim.modid+":creepy.ogg");
|
||||||
|
|
||||||
}
|
}
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@@ -93,6 +95,7 @@ public class EventHookContainer
|
|||||||
{
|
{
|
||||||
player.inventory.clearInventory(-1, -1);
|
player.inventory.clearInventory(-1, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
ChunkCoordinates coords = LimboProvider.getLimboSkySpawn(player.worldObj.rand);
|
ChunkCoordinates coords = LimboProvider.getLimboSkySpawn(player.worldObj.rand);
|
||||||
Point4D destination = new Point4D((int) (coords.posX+entity.posX), coords.posY, (int) (coords.posZ+entity.posZ ), mod_pocketDim.properties.LimboDimensionID);
|
Point4D destination = new Point4D((int) (coords.posX+entity.posX), coords.posY, (int) (coords.posZ+entity.posZ ), mod_pocketDim.properties.LimboDimensionID);
|
||||||
DDTeleporter.teleportEntity(player, destination, false);
|
DDTeleporter.teleportEntity(player, destination, false);
|
||||||
@@ -114,17 +117,24 @@ public class EventHookContainer
|
|||||||
|
|
||||||
public void playMusicForDim(World world)
|
public void playMusicForDim(World world)
|
||||||
{
|
{
|
||||||
if(world.isRemote&&world.provider instanceof LimboProvider)
|
if(world.isRemote)
|
||||||
{
|
{
|
||||||
SoundSystem sndSystem = FMLClientHandler.instance().getClient().sndManager.sndSystem;
|
SoundManager sndManager = FMLClientHandler.instance().getClient().sndManager;
|
||||||
sndSystem.stop("BgMusic");
|
|
||||||
SoundPoolEntry soundPoolEntry = FMLClientHandler.instance().getClient().sndManager.soundPoolMusic.getRandomSoundFromSoundPool("mods.DimDoors.sfx.creepy");
|
if(world.provider instanceof LimboProvider)
|
||||||
sndSystem.backgroundMusic("LimboMusic", soundPoolEntry.getSoundUrl(), soundPoolEntry.getSoundName(), false);
|
{
|
||||||
sndSystem.play("LimboMusic");
|
sndManager.sndSystem.stop("BgMusic");
|
||||||
|
SoundPoolEntry soundPoolEntry = sndManager.soundPoolMusic.getRandomSoundFromSoundPool(mod_pocketDim.modid+":creepy");
|
||||||
|
if(soundPoolEntry!=null)
|
||||||
|
{
|
||||||
|
sndManager.sndSystem.backgroundMusic("LimboMusic", soundPoolEntry.getSoundUrl(), soundPoolEntry.getSoundName(), false);
|
||||||
|
sndManager.sndSystem.play("LimboMusic");
|
||||||
}
|
}
|
||||||
else if(world.isRemote && !(world.provider instanceof LimboProvider))
|
}
|
||||||
|
else if(!(world.provider instanceof LimboProvider))
|
||||||
{
|
{
|
||||||
FMLClientHandler.instance().getClient().sndManager.sndSystem.stop("LimboMusic");
|
sndManager.sndSystem.stop("LimboMusic");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
package StevenDimDoors.mod_pocketDim;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InvalidClassException;
|
import java.io.InvalidClassException;
|
||||||
@@ -6,7 +7,7 @@ import java.io.ObjectInputStream;
|
|||||||
import java.io.ObjectStreamClass;
|
import java.io.ObjectStreamClass;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
public class ObjectSaveInputStream extends ObjectInputStream {
|
public class ObjectSaveInputStream extends ObjectInputStream {
|
||||||
|
|
||||||
// private static Logger logger = LoggerFactory.getLogger(ObjectSaveInputStream.class);
|
// private static Logger logger = LoggerFactory.getLogger(ObjectSaveInputStream.class);
|
||||||
@@ -18,7 +19,7 @@ public class ObjectSaveInputStream extends ObjectInputStream {
|
|||||||
@Override
|
@Override
|
||||||
protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException {
|
protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException {
|
||||||
ObjectStreamClass resultClassDescriptor = super.readClassDescriptor(); // initially streams descriptor
|
ObjectStreamClass resultClassDescriptor = super.readClassDescriptor(); // initially streams descriptor
|
||||||
Class localClass; // the class in the local JVM that this descriptor represents.
|
Class<?> localClass; // the class in the local JVM that this descriptor represents.
|
||||||
try {
|
try {
|
||||||
localClass = Class.forName(resultClassDescriptor.getName());
|
localClass = Class.forName(resultClassDescriptor.getName());
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
|
|||||||
@@ -11,4 +11,6 @@ public class PacketConstants
|
|||||||
public static final byte DELETE_DIM_PACKET_ID = 3;
|
public static final byte DELETE_DIM_PACKET_ID = 3;
|
||||||
public static final byte CREATE_LINK_PACKET_ID = 4;
|
public static final byte CREATE_LINK_PACKET_ID = 4;
|
||||||
public static final byte DELETE_LINK_PACKET_ID = 5;
|
public static final byte DELETE_LINK_PACKET_ID = 5;
|
||||||
|
public static final byte CLIENT_LOGIN_DIM_REGISTER = 6;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ public class Point3D implements Serializable {
|
|||||||
return this.z = z;
|
return this.z = z;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Point3D clone()
|
public Point3D clone()
|
||||||
{
|
{
|
||||||
return new Point3D(x, y, z);
|
return new Point3D(x, y, z);
|
||||||
@@ -75,6 +76,7 @@ public class Point3D implements Serializable {
|
|||||||
return (this.x == other.x && this.y == other.y && this.z == other.z);
|
return (this.x == other.x && this.y == other.y && this.z == other.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean equals(Object other)
|
public boolean equals(Object other)
|
||||||
{
|
{
|
||||||
return equals((Point3D) other);
|
return equals((Point3D) other);
|
||||||
|
|||||||
@@ -6,12 +6,10 @@ import net.minecraft.block.Block;
|
|||||||
import net.minecraft.block.BlockDoor;
|
import net.minecraft.block.BlockDoor;
|
||||||
import net.minecraft.block.ITileEntityProvider;
|
import net.minecraft.block.ITileEntityProvider;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.particle.EntityFX;
|
|
||||||
import net.minecraft.client.renderer.texture.IconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLiving;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemDoor;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.Icon;
|
import net.minecraft.util.Icon;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
@@ -22,12 +20,12 @@ import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
|||||||
import StevenDimDoors.mod_pocketDim.core.DDTeleporter;
|
import StevenDimDoors.mod_pocketDim.core.DDTeleporter;
|
||||||
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
||||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||||
import StevenDimDoors.mod_pocketDim.items.BaseItemDoor;
|
|
||||||
import StevenDimDoors.mod_pocketDim.schematic.BlockRotator;
|
import StevenDimDoors.mod_pocketDim.schematic.BlockRotator;
|
||||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityDimDoor;
|
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityDimDoor;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEntityProvider
|
public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEntityProvider
|
||||||
{
|
{
|
||||||
protected final DDProperties properties;
|
protected final DDProperties properties;
|
||||||
@@ -40,12 +38,14 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||||||
this.properties = properties;
|
this.properties = properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void registerIcons(IconRegister par1IconRegister)
|
public void registerIcons(IconRegister par1IconRegister)
|
||||||
{
|
{
|
||||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5)+"_top");
|
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName()+"_top");
|
||||||
this.blockIconBottom = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5)+"_bottom");
|
this.blockIconBottom = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName()+"_bottom");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -64,6 +64,7 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||||||
this.enterDimDoor(world, x, y, z, entity);
|
this.enterDimDoor(world, x, y, z, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -77,7 +78,7 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||||||
shouldOpen = false;
|
shouldOpen = false;
|
||||||
if (!world.isRemote && world.getBlockId(x, y-1, z) == this.blockID)
|
if (!world.isRemote && world.getBlockId(x, y-1, z) == this.blockID)
|
||||||
{
|
{
|
||||||
int var12 = (int) (MathHelper.floor_double((double)((player.rotationYaw+90) * 4.0F / 360.0F) + 0.5D) & 3);
|
int var12 = MathHelper.floor_double((player.rotationYaw+90) * 4.0F / 360.0F + 0.5D) & 3;
|
||||||
|
|
||||||
if (world.getBlockMetadata(x, y-1, z) == var12)
|
if (world.getBlockMetadata(x, y-1, z) == var12)
|
||||||
{
|
{
|
||||||
@@ -87,7 +88,7 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||||||
}
|
}
|
||||||
if (!world.isRemote && world.getBlockId(x, y+1, z) == this.blockID)
|
if (!world.isRemote && world.getBlockId(x, y+1, z) == this.blockID)
|
||||||
{
|
{
|
||||||
int var12 = (int) (MathHelper.floor_double((double)((player.rotationYaw+90) * 4.0F / 360.0F) + 0.5D) & 3);
|
int var12 = MathHelper.floor_double((player.rotationYaw+90) * 4.0F / 360.0F + 0.5D) & 3;
|
||||||
if(world.getBlockMetadata(x, y, z)==var12)
|
if(world.getBlockMetadata(x, y, z)==var12)
|
||||||
{
|
{
|
||||||
var12 = BlockRotator.transformMetadata(var12, 1, this.blockID);
|
var12 = BlockRotator.transformMetadata(var12, 1, this.blockID);
|
||||||
@@ -144,6 +145,7 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||||||
/**
|
/**
|
||||||
* Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side
|
* Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
||||||
{
|
{
|
||||||
@@ -175,6 +177,7 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||||||
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
|
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
|
||||||
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
|
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
||||||
{
|
{
|
||||||
TileEntityDimDoor tile = (TileEntityDimDoor) par1World.getBlockTileEntity(par2, par3, par4);
|
TileEntityDimDoor tile = (TileEntityDimDoor) par1World.getBlockTileEntity(par2, par3, par4);
|
||||||
@@ -386,7 +389,7 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||||||
if (canUse && entity instanceof EntityPlayer)
|
if (canUse && entity instanceof EntityPlayer)
|
||||||
{
|
{
|
||||||
// Dont check for non-player entites
|
// Dont check for non-player entites
|
||||||
canUse = isEntityFacingDoor(metadata, (EntityLiving) entity);
|
canUse = isEntityFacingDoor(metadata, (EntityLivingBase) entity);
|
||||||
}
|
}
|
||||||
if (canUse)
|
if (canUse)
|
||||||
{
|
{
|
||||||
@@ -418,12 +421,12 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||||||
return (metadata & 4) != 0;
|
return (metadata & 4) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static boolean isEntityFacingDoor(int metadata, EntityLiving entity)
|
protected static boolean isEntityFacingDoor(int metadata, EntityLivingBase entity)
|
||||||
{
|
{
|
||||||
// Although any entity has the proper fields for this check,
|
// Although any entity has the proper fields for this check,
|
||||||
// we should only apply it to living entities since things
|
// we should only apply it to living entities since things
|
||||||
// like Minecarts might come in backwards.
|
// like Minecarts might come in backwards.
|
||||||
int direction = (int) (MathHelper.floor_double((double) ((entity.rotationYaw + 90) * 4.0F / 360.0F) + 0.5D) & 3);
|
int direction = MathHelper.floor_double((entity.rotationYaw + 90) * 4.0F / 360.0F + 0.5D) & 3;
|
||||||
return ((metadata & 3) == direction);
|
return ((metadata & 3) == direction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -57,10 +57,11 @@ public class BlockDimWall extends Block
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void registerIcons(IconRegister par1IconRegister)
|
public void registerIcons(IconRegister par1IconRegister)
|
||||||
{
|
{
|
||||||
this.blockIcon[0] = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5));
|
this.blockIcon[0] = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName());
|
||||||
this.blockIcon[1] = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5) + "Perm");
|
this.blockIcon[1] = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName() + "Perm");
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@@ -77,6 +78,7 @@ public class BlockDimWall extends Block
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubBlocks(int unknown, CreativeTabs tab, List subItems)
|
public void getSubBlocks(int unknown, CreativeTabs tab, List subItems)
|
||||||
@@ -86,13 +88,16 @@ public class BlockDimWall extends Block
|
|||||||
subItems.add(new ItemStack(this, 1, ix));
|
subItems.add(new ItemStack(this, 1, ix));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {}
|
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected boolean canSilkHarvest()
|
protected boolean canSilkHarvest()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int quantityDropped(Random par1Random)
|
public int quantityDropped(Random par1Random)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
@@ -101,6 +106,7 @@ public class BlockDimWall extends Block
|
|||||||
/**
|
/**
|
||||||
* replaces the block clicked with the held block, instead of placing the block on top of it. Shift click to disable.
|
* replaces the block clicked with the held block, instead of placing the block on top of it. Shift click to disable.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9)
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9)
|
||||||
{
|
{
|
||||||
//Check if the metadata value is 0 -- we don't want the user to replace Ancient Fabric
|
//Check if the metadata value is 0 -- we don't want the user to replace Ancient Fabric
|
||||||
|
|||||||
@@ -30,21 +30,25 @@ public class BlockDimWallPerm extends Block
|
|||||||
properties = DDProperties.instance();
|
properties = DDProperties.instance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void registerIcons(IconRegister par1IconRegister)
|
public void registerIcons(IconRegister par1IconRegister)
|
||||||
{
|
{
|
||||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5));
|
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int quantityDropped(Random par1Random)
|
public int quantityDropped(Random par1Random)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {}
|
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Only matters if the player is in limbo, acts to teleport the player from limbo back to dim 0
|
* Only matters if the player is in limbo, acts to teleport the player from limbo back to dim 0
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void onEntityWalking(World world, int x, int y, int z, Entity entity)
|
public void onEntityWalking(World world, int x, int y, int z, Entity entity)
|
||||||
{
|
{
|
||||||
if (!world.isRemote && world.provider.dimensionId == properties.LimboDimensionID)
|
if (!world.isRemote && world.provider.dimensionId == properties.LimboDimensionID)
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ public class BlockDoorGold extends BlockDoor
|
|||||||
{
|
{
|
||||||
|
|
||||||
private Icon blockIconBottom;
|
private Icon blockIconBottom;
|
||||||
|
@SuppressWarnings("unused") // ??
|
||||||
private DDProperties properties;
|
private DDProperties properties;
|
||||||
|
|
||||||
public BlockDoorGold(int par1, Material par2Material,DDProperties properties)
|
public BlockDoorGold(int par1, Material par2Material,DDProperties properties)
|
||||||
@@ -26,22 +27,25 @@ public class BlockDoorGold extends BlockDoor
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IconRegister par1IconRegister)
|
||||||
|
{
|
||||||
|
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName()+"_top");
|
||||||
|
this.blockIconBottom = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName()+"_bottom");
|
||||||
|
}
|
||||||
|
|
||||||
public int idDropped(int par1, Random par2Random, int par3)
|
public int idDropped(int par1, Random par2Random, int par3)
|
||||||
{
|
{
|
||||||
return mod_pocketDim.itemGoldDoor.itemID;
|
return mod_pocketDim.itemGoldDoor.itemID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void registerIcons(IconRegister par1IconRegister)
|
@Override
|
||||||
{
|
|
||||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5)+"_top");
|
|
||||||
this.blockIconBottom = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5)+"_bottom");
|
|
||||||
}
|
|
||||||
|
|
||||||
public Icon getIcon(int par1, int par2)
|
public Icon getIcon(int par1, int par2)
|
||||||
{
|
{
|
||||||
return this.blockIcon;
|
return this.blockIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,27 +1,24 @@
|
|||||||
package StevenDimDoors.mod_pocketDim.blocks;
|
package StevenDimDoors.mod_pocketDim.blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||||
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
||||||
import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
||||||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityDimDoor;
|
|
||||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityDimDoorGold;
|
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityDimDoorGold;
|
||||||
|
|
||||||
public class BlockGoldDimDoor extends BaseDimDoor implements IDimDoor
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
public class BlockGoldDimDoor extends BaseDimDoor
|
||||||
{
|
{
|
||||||
|
|
||||||
public BlockGoldDimDoor(int blockID, Material material,
|
public BlockGoldDimDoor(int blockID, Material material,
|
||||||
DDProperties properties) {
|
DDProperties properties) {
|
||||||
super(blockID, material, properties);
|
super(blockID, material, properties);
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class BlockLimbo extends Block
|
|||||||
@Override
|
@Override
|
||||||
public void registerIcons(IconRegister iconRegister)
|
public void registerIcons(IconRegister iconRegister)
|
||||||
{
|
{
|
||||||
this.blockIcon = iconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5));
|
this.blockIcon = iconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class BlockRift extends BlockContainer
|
|||||||
@Override
|
@Override
|
||||||
public void registerIcons(IconRegister par1IconRegister)
|
public void registerIcons(IconRegister par1IconRegister)
|
||||||
{
|
{
|
||||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5));
|
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName());
|
||||||
}
|
}
|
||||||
|
|
||||||
//sends a packet informing the client that there is a link present so it renders properly. (when placed)
|
//sends a packet informing the client that there is a link present so it renders properly. (when placed)
|
||||||
@@ -313,10 +313,10 @@ public class BlockRift extends BlockContainer
|
|||||||
yChange=(float) ((yGrowth+yGrowthn)+rand.nextGaussian()*.05F);
|
yChange=(float) ((yGrowth+yGrowthn)+rand.nextGaussian()*.05F);
|
||||||
zChange=(float) ((zGrowth+zGrowthn)+rand.nextGaussian()*.05F);
|
zChange=(float) ((zGrowth+zGrowthn)+rand.nextGaussian()*.05F);
|
||||||
|
|
||||||
Xoffset= (float) ((0.25F/(1+Math.abs(xChange))));
|
Xoffset= ((0.25F/(1+Math.abs(xChange))));
|
||||||
|
|
||||||
Yoffset= (float) ((0.25F/(1+Math.abs(yChange))));
|
Yoffset= ((0.25F/(1+Math.abs(yChange))));
|
||||||
Zoffset= (float) ((0.25F/(1+Math.abs(zChange))));
|
Zoffset= ((0.25F/(1+Math.abs(zChange))));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
|||||||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public class DimensionalDoor extends BaseDimDoor
|
public class DimensionalDoor extends BaseDimDoor
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import net.minecraft.block.ITileEntityProvider;
|
|||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.item.ItemDoor;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||||
@@ -17,9 +16,9 @@ import StevenDimDoors.mod_pocketDim.core.DimLink;
|
|||||||
import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
||||||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||||
import StevenDimDoors.mod_pocketDim.items.BaseItemDoor;
|
|
||||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityTransTrapdoor;
|
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityTransTrapdoor;
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public class TransTrapdoor extends BlockTrapDoor implements IDimDoor, ITileEntityProvider
|
public class TransTrapdoor extends BlockTrapDoor implements IDimDoor, ITileEntityProvider
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -32,7 +31,7 @@ public class TransTrapdoor extends BlockTrapDoor implements IDimDoor, ITileEntit
|
|||||||
@Override
|
@Override
|
||||||
public void registerIcons(IconRegister par1IconRegister)
|
public void registerIcons(IconRegister par1IconRegister)
|
||||||
{
|
{
|
||||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5));
|
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName());
|
||||||
}
|
}
|
||||||
|
|
||||||
//Teleports the player to the exit link of that dimension, assuming it is a pocket
|
//Teleports the player to the exit link of that dimension, assuming it is a pocket
|
||||||
@@ -65,6 +64,7 @@ public class TransTrapdoor extends BlockTrapDoor implements IDimDoor, ITileEntit
|
|||||||
this.updateAttachedTile(world, x, y, z);
|
this.updateAttachedTile(world, x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void updateTick(World world, int x, int y, int z, Random random)
|
public void updateTick(World world, int x, int y, int z, Random random)
|
||||||
{
|
{
|
||||||
TileEntityTransTrapdoor tile = (TileEntityTransTrapdoor) world.getBlockTileEntity(x, y, z);
|
TileEntityTransTrapdoor tile = (TileEntityTransTrapdoor) world.getBlockTileEntity(x, y, z);
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
package StevenDimDoors.mod_pocketDim.blocks;
|
package StevenDimDoors.mod_pocketDim.blocks;
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.client.particle.EntityFX;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.EntityLiving;
|
|
||||||
import net.minecraft.item.ItemDoor;
|
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
|
||||||
import StevenDimDoors.mod_pocketDim.core.DDTeleporter;
|
import StevenDimDoors.mod_pocketDim.core.DDTeleporter;
|
||||||
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
||||||
import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
||||||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||||
import StevenDimDoors.mod_pocketDim.items.BaseItemDoor;
|
|
||||||
|
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.particle.EntityFX;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public class TransientDoor extends BaseDimDoor
|
public class TransientDoor extends BaseDimDoor
|
||||||
{
|
{
|
||||||
public TransientDoor(int blockID, Material material, DDProperties properties)
|
public TransientDoor(int blockID, Material material, DDProperties properties)
|
||||||
@@ -37,10 +37,10 @@ public class TransientDoor extends BaseDimDoor
|
|||||||
{
|
{
|
||||||
boolean canUse = true;
|
boolean canUse = true;
|
||||||
int metadata = world.getBlockMetadata(x, y - 1, z);
|
int metadata = world.getBlockMetadata(x, y - 1, z);
|
||||||
if (canUse && entity instanceof EntityLiving)
|
if (canUse && entity instanceof EntityPlayer)
|
||||||
{
|
{
|
||||||
// Don't check for non-living entities since it might not work right
|
// Don't check for non-living entities since it might not work right
|
||||||
canUse = BaseDimDoor.isEntityFacingDoor(metadata, (EntityLiving) entity);
|
canUse = BaseDimDoor.isEntityFacingDoor(metadata, (EntityLivingBase) entity);
|
||||||
}
|
}
|
||||||
if (canUse)
|
if (canUse)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
|||||||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public class WarpDoor extends BaseDimDoor
|
public class WarpDoor extends BaseDimDoor
|
||||||
{
|
{
|
||||||
public WarpDoor(int blockID, Material material, DDProperties properties)
|
public WarpDoor(int blockID, Material material, DDProperties properties)
|
||||||
|
|||||||
@@ -1,10 +1,5 @@
|
|||||||
package StevenDimDoors.mod_pocketDim.commands;
|
package StevenDimDoors.mod_pocketDim.commands;
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
import net.minecraft.command.ICommandSender;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||||
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
||||||
import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
||||||
@@ -14,6 +9,13 @@ import StevenDimDoors.mod_pocketDim.dungeon.DungeonData;
|
|||||||
import StevenDimDoors.mod_pocketDim.helpers.DungeonHelper;
|
import StevenDimDoors.mod_pocketDim.helpers.DungeonHelper;
|
||||||
import StevenDimDoors.mod_pocketDim.world.PocketBuilder;
|
import StevenDimDoors.mod_pocketDim.world.PocketBuilder;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import net.minecraft.command.ICommandSender;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public class CommandCreateDungeonRift extends DDCommandBase
|
public class CommandCreateDungeonRift extends DDCommandBase
|
||||||
{
|
{
|
||||||
private static CommandCreateDungeonRift instance = null;
|
private static CommandCreateDungeonRift instance = null;
|
||||||
@@ -62,9 +64,9 @@ public class CommandCreateDungeonRift extends DDCommandBase
|
|||||||
Collection<String> dungeonNames = dungeonHelper.getDungeonNames();
|
Collection<String> dungeonNames = dungeonHelper.getDungeonNames();
|
||||||
for (String name : dungeonNames)
|
for (String name : dungeonNames)
|
||||||
{
|
{
|
||||||
sender.addChatMessage(name);
|
sendChat(sender,(name));
|
||||||
}
|
}
|
||||||
sender.addChatMessage("");
|
sendChat(sender,(""));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -73,7 +75,7 @@ public class CommandCreateDungeonRift extends DDCommandBase
|
|||||||
int x = MathHelper.floor_double(sender.posX);
|
int x = MathHelper.floor_double(sender.posX);
|
||||||
int y = MathHelper.floor_double(sender.posY);
|
int y = MathHelper.floor_double(sender.posY);
|
||||||
int z = MathHelper.floor_double (sender.posZ);
|
int z = MathHelper.floor_double (sender.posZ);
|
||||||
int orientation = MathHelper.floor_double((double) ((sender.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
|
int orientation = MathHelper.floor_double((sender.rotationYaw + 180.0F) * 4.0F / 360.0F - 0.5D) & 3;
|
||||||
|
|
||||||
if (command[0].equals("random"))
|
if (command[0].equals("random"))
|
||||||
{
|
{
|
||||||
@@ -82,7 +84,7 @@ public class CommandCreateDungeonRift extends DDCommandBase
|
|||||||
link = dimension.createLink(x, y + 1, z, LinkTypes.DUNGEON,orientation);
|
link = dimension.createLink(x, y + 1, z, LinkTypes.DUNGEON,orientation);
|
||||||
sender.worldObj.setBlock(x, y + 1, z,mod_pocketDim.blockRift.blockID,0,3);
|
sender.worldObj.setBlock(x, y + 1, z,mod_pocketDim.blockRift.blockID,0,3);
|
||||||
|
|
||||||
sender.addChatMessage("Created a rift to a random dungeon.");
|
sendChat(sender,("Created a rift to a random dungeon."));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -101,7 +103,7 @@ public class CommandCreateDungeonRift extends DDCommandBase
|
|||||||
PocketBuilder.generateSelectedDungeonPocket(link, mod_pocketDim.properties, result);
|
PocketBuilder.generateSelectedDungeonPocket(link, mod_pocketDim.properties, result);
|
||||||
|
|
||||||
sender.worldObj.setBlock(x, y + 1, z,mod_pocketDim.blockRift.blockID,0,3);
|
sender.worldObj.setBlock(x, y + 1, z,mod_pocketDim.blockRift.blockID,0,3);
|
||||||
sender.addChatMessage("Created a rift to \"" + result.schematicName() + "\" dungeon (Dimension ID = " + link.destination().getDimension() + ").");
|
sendChat(sender,("Created a rift to \"" + result.schematicName() + "\" dungeon (Dimension ID = " + link.destination().getDimension() + ")."));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public class CommandCreatePocket extends DDCommandBase
|
|||||||
DungeonHelper.instance().createCustomDungeonDoor(sender.worldObj, x, y, z);
|
DungeonHelper.instance().createCustomDungeonDoor(sender.worldObj, x, y, z);
|
||||||
|
|
||||||
//Notify the player
|
//Notify the player
|
||||||
sender.addChatMessage("Created a door to a pocket dimension. Please build your dungeon there.");
|
sendChat(sender,("Created a door to a pocket dimension. Please build your dungeon there."));
|
||||||
}
|
}
|
||||||
return DDCommandResult.SUCCESS;
|
return DDCommandResult.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
package StevenDimDoors.mod_pocketDim.commands;
|
package StevenDimDoors.mod_pocketDim.commands;
|
||||||
|
|
||||||
|
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
||||||
|
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||||
|
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import net.minecraft.command.ICommandSender;
|
import net.minecraft.command.ICommandSender;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.DimensionManager;
|
|
||||||
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
|
||||||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
|
||||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public class CommandDeleteAllLinks extends DDCommandBase
|
public class CommandDeleteAllLinks extends DDCommandBase
|
||||||
{
|
{
|
||||||
private static CommandDeleteAllLinks instance = null;
|
private static CommandDeleteAllLinks instance = null;
|
||||||
@@ -47,7 +48,7 @@ public class CommandDeleteAllLinks extends DDCommandBase
|
|||||||
{
|
{
|
||||||
targetDim=0;
|
targetDim=0;
|
||||||
shouldGo=false;
|
shouldGo=false;
|
||||||
sender.addChatMessage("Error-Invalid argument, delete_all_links <targetDimID>");
|
sendChat(sender, ("Error-Invalid argument, delete_all_links <targetDimID>"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(shouldGo)
|
if(shouldGo)
|
||||||
@@ -65,7 +66,7 @@ public class CommandDeleteAllLinks extends DDCommandBase
|
|||||||
|
|
||||||
linksRemoved++;
|
linksRemoved++;
|
||||||
}
|
}
|
||||||
sender.addChatMessage("Removed " + linksRemoved + " links.");
|
sendChat(sender,("Removed " + linksRemoved + " links."));
|
||||||
|
|
||||||
}
|
}
|
||||||
return DDCommandResult.SUCCESS; //TEMPORARY HACK
|
return DDCommandResult.SUCCESS; //TEMPORARY HACK
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import StevenDimDoors.mod_pocketDim.core.DimLink;
|
|||||||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public class CommandDeleteRifts extends DDCommandBase
|
public class CommandDeleteRifts extends DDCommandBase
|
||||||
{
|
{
|
||||||
private static CommandDeleteRifts instance = null;
|
private static CommandDeleteRifts instance = null;
|
||||||
@@ -47,7 +48,7 @@ public class CommandDeleteRifts extends DDCommandBase
|
|||||||
{
|
{
|
||||||
targetDim=0;
|
targetDim=0;
|
||||||
shouldGo=false;
|
shouldGo=false;
|
||||||
sender.addChatMessage("Error-Invalid argument, delete_all_links <targetDimID>");
|
sendChat(sender,("Error-Invalid argument, delete_all_links <targetDimID>"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(shouldGo)
|
if(shouldGo)
|
||||||
@@ -67,7 +68,7 @@ public class CommandDeleteRifts extends DDCommandBase
|
|||||||
dim.deleteLink(link);
|
dim.deleteLink(link);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sender.addChatMessage("Removed " + linksRemoved + " rifts.");
|
sendChat(sender,("Removed " + linksRemoved + " rifts."));
|
||||||
|
|
||||||
}
|
}
|
||||||
return DDCommandResult.SUCCESS; //TEMPORARY HACK
|
return DDCommandResult.SUCCESS; //TEMPORARY HACK
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ public class CommandExportDungeon extends DDCommandBase
|
|||||||
String exportPath = properties.CustomSchematicDirectory + File.separator + name + ".schematic";
|
String exportPath = properties.CustomSchematicDirectory + File.separator + name + ".schematic";
|
||||||
if (dungeonHelper.exportDungeon(player.worldObj, x, y, z, exportPath))
|
if (dungeonHelper.exportDungeon(player.worldObj, x, y, z, exportPath))
|
||||||
{
|
{
|
||||||
player.addChatMessage("Saved dungeon schematic in " + exportPath);
|
sendChat(player,("Saved dungeon schematic in " + exportPath));
|
||||||
dungeonHelper.registerDungeon(exportPath, dungeonHelper.getDungeonPack("ruins"), false, true);
|
dungeonHelper.registerDungeon(exportPath, dungeonHelper.getDungeonPack("ruins"), false, true);
|
||||||
return DDCommandResult.SUCCESS;
|
return DDCommandResult.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
|||||||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public class CommandResetDungeons extends DDCommandBase
|
public class CommandResetDungeons extends DDCommandBase
|
||||||
{
|
{
|
||||||
private static CommandResetDungeons instance = null;
|
private static CommandResetDungeons instance = null;
|
||||||
@@ -90,7 +91,7 @@ public class CommandResetDungeons extends DDCommandBase
|
|||||||
//TODO- for some reason the parent field of loaded dimenions get reset to null if I call .setParentToRoot() before I delete the pockets.
|
//TODO- for some reason the parent field of loaded dimenions get reset to null if I call .setParentToRoot() before I delete the pockets.
|
||||||
//TODO implement blackList
|
//TODO implement blackList
|
||||||
//Notify the user of the results
|
//Notify the user of the results
|
||||||
sender.addChatMessage("Reset complete. " + resetCount + " out of " + dungeonCount + " dungeons were reset.");
|
sendChat(sender,("Reset complete. " + resetCount + " out of " + dungeonCount + " dungeons were reset."));
|
||||||
return DDCommandResult.SUCCESS;
|
return DDCommandResult.SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,24 +1,16 @@
|
|||||||
package StevenDimDoors.mod_pocketDim.commands;
|
package StevenDimDoors.mod_pocketDim.commands;
|
||||||
import java.util.ArrayList;
|
|
||||||
|
import StevenDimDoors.mod_pocketDim.core.DDTeleporter;
|
||||||
|
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||||
|
import StevenDimDoors.mod_pocketDim.util.Point4D;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
|
||||||
|
|
||||||
import StevenDimDoors.mod_pocketDim.BlankTeleporter;
|
|
||||||
import StevenDimDoors.mod_pocketDim.core.DDTeleporter;
|
|
||||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
|
||||||
import StevenDimDoors.mod_pocketDim.helpers.yCoordHelper;
|
|
||||||
import StevenDimDoors.mod_pocketDim.util.Point4D;
|
|
||||||
|
|
||||||
import net.minecraft.command.ICommandSender;
|
import net.minecraft.command.ICommandSender;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.WorldServer;
|
|
||||||
import net.minecraftforge.common.DimensionManager;
|
import net.minecraftforge.common.DimensionManager;
|
||||||
|
|
||||||
|
|
||||||
public class CommandTeleportPlayer extends DDCommandBase
|
public class CommandTeleportPlayer extends DDCommandBase
|
||||||
{
|
{
|
||||||
private static CommandTeleportPlayer instance = null;
|
private static CommandTeleportPlayer instance = null;
|
||||||
@@ -48,7 +40,7 @@ public class CommandTeleportPlayer extends DDCommandBase
|
|||||||
@Override
|
@Override
|
||||||
protected DDCommandResult processCommand(EntityPlayer sender, String[] command)
|
protected DDCommandResult processCommand(EntityPlayer sender, String[] command)
|
||||||
{
|
{
|
||||||
List dimensionIDs = Arrays.asList(DimensionManager.getStaticDimensionIDs()); //Gets list of all registered dimensions, regardless if loaded or not
|
List<Integer> dimensionIDs = Arrays.asList(DimensionManager.getStaticDimensionIDs()); //Gets list of all registered dimensions, regardless if loaded or not
|
||||||
EntityPlayer targetPlayer = sender;
|
EntityPlayer targetPlayer = sender;
|
||||||
int dimDestinationID = sender.worldObj.provider.dimensionId;
|
int dimDestinationID = sender.worldObj.provider.dimensionId;
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package StevenDimDoors.mod_pocketDim.commands;
|
|||||||
import net.minecraft.command.CommandBase;
|
import net.minecraft.command.CommandBase;
|
||||||
import net.minecraft.command.ICommandSender;
|
import net.minecraft.command.ICommandSender;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.util.ChatMessageComponent;
|
||||||
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -32,6 +33,7 @@ public abstract class DDCommandBase extends CommandBase
|
|||||||
*/
|
*/
|
||||||
protected abstract DDCommandResult processCommand(EntityPlayer sender, String[] command);
|
protected abstract DDCommandResult processCommand(EntityPlayer sender, String[] command);
|
||||||
|
|
||||||
|
@Override
|
||||||
public final String getCommandName()
|
public final String getCommandName()
|
||||||
{
|
{
|
||||||
return name;
|
return name;
|
||||||
@@ -49,6 +51,7 @@ public abstract class DDCommandBase extends CommandBase
|
|||||||
* Method invoked by the server to execute a command. The call is forwarded to a derived class
|
* Method invoked by the server to execute a command. The call is forwarded to a derived class
|
||||||
* to provide the sending player directly.
|
* to provide the sending player directly.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final void processCommand(ICommandSender sender, String[] command)
|
public final void processCommand(ICommandSender sender, String[] command)
|
||||||
{
|
{
|
||||||
//Forward the command
|
//Forward the command
|
||||||
@@ -63,10 +66,10 @@ public abstract class DDCommandBase extends CommandBase
|
|||||||
//Send the argument formats for this command
|
//Send the argument formats for this command
|
||||||
for (String format : formats)
|
for (String format : formats)
|
||||||
{
|
{
|
||||||
player.addChatMessage("Usage: " + name + " " + format);
|
sendChat(player,("Usage: " + name + " " + format));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.addChatMessage(result.getMessage());
|
sendChat(player,(result.getMessage()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import net.minecraft.entity.EntityList;
|
|||||||
import net.minecraft.entity.item.EntityMinecart;
|
import net.minecraft.entity.item.EntityMinecart;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.item.ItemDoor;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.network.packet.Packet41EntityEffect;
|
import net.minecraft.network.packet.Packet41EntityEffect;
|
||||||
import net.minecraft.network.packet.Packet43Experience;
|
import net.minecraft.network.packet.Packet43Experience;
|
||||||
@@ -23,8 +22,6 @@ import net.minecraftforge.common.DimensionManager;
|
|||||||
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.BlockRift;
|
|
||||||
import StevenDimDoors.mod_pocketDim.blocks.IDimDoor;
|
|
||||||
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;
|
||||||
@@ -34,6 +31,7 @@ import StevenDimDoors.mod_pocketDim.util.Point4D;
|
|||||||
import StevenDimDoors.mod_pocketDim.world.PocketBuilder;
|
import StevenDimDoors.mod_pocketDim.world.PocketBuilder;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public class DDTeleporter
|
public class DDTeleporter
|
||||||
{
|
{
|
||||||
private static final Random random = new Random();
|
private static final Random random = new Random();
|
||||||
@@ -235,7 +233,7 @@ public class DDTeleporter
|
|||||||
private static void setEntityPosition(Entity entity, double x, double y, double z)
|
private static void setEntityPosition(Entity entity, double x, double y, double z)
|
||||||
{
|
{
|
||||||
entity.lastTickPosX = entity.prevPosX = entity.posX = x;
|
entity.lastTickPosX = entity.prevPosX = entity.posX = x;
|
||||||
entity.lastTickPosY = entity.prevPosY = entity.posY = y + (double)entity.yOffset;
|
entity.lastTickPosY = entity.prevPosY = entity.posY = y + entity.yOffset;
|
||||||
entity.lastTickPosZ = entity.prevPosZ = entity.posZ = z;
|
entity.lastTickPosZ = entity.prevPosZ = entity.posZ = z;
|
||||||
entity.setPosition(x, y, z);
|
entity.setPosition(x, y, z);
|
||||||
}
|
}
|
||||||
@@ -304,7 +302,7 @@ public class DDTeleporter
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
newWorld = (WorldServer) oldWorld;
|
newWorld = oldWorld;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -327,6 +325,7 @@ public class DDTeleporter
|
|||||||
// the last non-sleeping player leaves the Overworld
|
// the last non-sleeping player leaves the Overworld
|
||||||
// for a pocket dimension, causing all sleeping players
|
// for a pocket dimension, causing all sleeping players
|
||||||
// to remain asleep instead of progressing to day.
|
// to remain asleep instead of progressing to day.
|
||||||
|
((WorldServer)entity.worldObj).getPlayerManager().removePlayer(player);
|
||||||
oldWorld.removePlayerEntityDangerously(player);
|
oldWorld.removePlayerEntityDangerously(player);
|
||||||
player.isDead = false;
|
player.isDead = false;
|
||||||
|
|
||||||
@@ -399,7 +398,6 @@ public class DDTeleporter
|
|||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
newWorld.getChunkProvider().loadChunk(MathHelper.floor_double(entity.posX) >> 4, MathHelper.floor_double(entity.posZ) >> 4);
|
newWorld.getChunkProvider().loadChunk(MathHelper.floor_double(entity.posX) >> 4, MathHelper.floor_double(entity.posZ) >> 4);
|
||||||
|
|
||||||
// Tell Forge we're moving its players so everyone else knows.
|
// Tell Forge we're moving its players so everyone else knows.
|
||||||
// Let's try doing this down here in case this is what's killing NEI.
|
// Let's try doing this down here in case this is what's killing NEI.
|
||||||
GameRegistry.onPlayerChangedDimension((EntityPlayer)entity);
|
GameRegistry.onPlayerChangedDimension((EntityPlayer)entity);
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import StevenDimDoors.mod_pocketDim.dungeon.pack.DungeonPack;
|
|||||||
import StevenDimDoors.mod_pocketDim.util.Point4D;
|
import StevenDimDoors.mod_pocketDim.util.Point4D;
|
||||||
import StevenDimDoors.mod_pocketDim.watcher.IUpdateWatcher;
|
import StevenDimDoors.mod_pocketDim.watcher.IUpdateWatcher;
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public abstract class NewDimData
|
public abstract class NewDimData
|
||||||
{
|
{
|
||||||
private static class InnerDimLink extends DimLink
|
private static class InnerDimLink extends DimLink
|
||||||
@@ -244,7 +245,6 @@ public abstract class NewDimData
|
|||||||
{
|
{
|
||||||
return Math.abs(i) + Math.abs(j) + Math.abs(k);
|
return Math.abs(i) + Math.abs(j) + Math.abs(k);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DimLink createLink(int x, int y, int z, int linkType,int orientation)
|
public DimLink createLink(int x, int y, int z, int linkType,int orientation)
|
||||||
{
|
{
|
||||||
return createLink(new Point4D(x, y, z, id), linkType,orientation);
|
return createLink(new Point4D(x, y, z, id), linkType,orientation);
|
||||||
@@ -333,7 +333,11 @@ public abstract class NewDimData
|
|||||||
{
|
{
|
||||||
linkList.remove(target);
|
linkList.remove(target);
|
||||||
//Raise deletion event
|
//Raise deletion event
|
||||||
|
//TODO why is source null here?
|
||||||
|
if(target.source!=null)
|
||||||
|
{
|
||||||
linkWatcher.onDeleted(target.source);
|
linkWatcher.onDeleted(target.source);
|
||||||
|
}
|
||||||
target.clear();
|
target.clear();
|
||||||
}
|
}
|
||||||
return (target != null);
|
return (target != null);
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import StevenDimDoors.mod_pocketDim.watcher.UpdateWatcherProxy;
|
|||||||
* This class regulates all the operations involving the storage and manipulation of dimensions. It handles saving dim data, teleporting the player, and
|
* This class regulates all the operations involving the storage and manipulation of dimensions. It handles saving dim data, teleporting the player, and
|
||||||
* creating/registering new dimensions as well as loading old dimensions on startup
|
* creating/registering new dimensions as well as loading old dimensions on startup
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public class PocketManager
|
public class PocketManager
|
||||||
{
|
{
|
||||||
private static class InnerDimData extends NewDimData implements IPackable<PackedDimData>
|
private static class InnerDimData extends NewDimData implements IPackable<PackedDimData>
|
||||||
@@ -276,6 +277,7 @@ public class PocketManager
|
|||||||
dimData.parent=dimData;
|
dimData.parent=dimData;
|
||||||
dimData.isFilled=packedData.IsFilled;
|
dimData.isFilled=packedData.IsFilled;
|
||||||
dimData.origin = new Point4D(packedData.Origin.getX(),packedData.Origin.getY(),packedData.Origin.getZ(),packedData.ID);
|
dimData.origin = new Point4D(packedData.Origin.getX(),packedData.Origin.getY(),packedData.Origin.getZ(),packedData.ID);
|
||||||
|
|
||||||
PocketManager.rootDimensions.add(dimData);
|
PocketManager.rootDimensions.add(dimData);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -284,6 +286,7 @@ public class PocketManager
|
|||||||
dimData = new InnerDimData(packedData.ID, test,true, packedData.IsDungeon, linkWatcher);
|
dimData = new InnerDimData(packedData.ID, test,true, packedData.IsDungeon, linkWatcher);
|
||||||
dimData.isFilled=packedData.IsFilled;
|
dimData.isFilled=packedData.IsFilled;
|
||||||
dimData.origin = new Point4D(packedData.Origin.getX(),packedData.Origin.getY(),packedData.Origin.getZ(),packedData.ID);
|
dimData.origin = new Point4D(packedData.Origin.getX(),packedData.Origin.getY(),packedData.Origin.getZ(),packedData.ID);
|
||||||
|
|
||||||
dimData.root=PocketManager.getDimensionData(packedData.RootID);
|
dimData.root=PocketManager.getDimensionData(packedData.RootID);
|
||||||
|
|
||||||
if(packedData.DungeonData!=null)
|
if(packedData.DungeonData!=null)
|
||||||
@@ -596,8 +599,7 @@ public class PocketManager
|
|||||||
|
|
||||||
public static void unload()
|
public static void unload()
|
||||||
{
|
{
|
||||||
System.out.println("Dimensional Doors unloading...");
|
System.out.println("Unloading Pocket Dimensions...");
|
||||||
|
|
||||||
if (!isLoaded)
|
if (!isLoaded)
|
||||||
{
|
{
|
||||||
throw new IllegalStateException("Pocket dimensions have already been unloaded!");
|
throw new IllegalStateException("Pocket dimensions have already been unloaded!");
|
||||||
@@ -685,9 +687,10 @@ public class PocketManager
|
|||||||
}
|
}
|
||||||
public static void readPacket(DataInputStream input) throws IOException
|
public static void readPacket(DataInputStream input) throws IOException
|
||||||
{
|
{
|
||||||
|
//TODO- figure out why this is getting called so frequently
|
||||||
if (isLoaded)
|
if (isLoaded)
|
||||||
{
|
{
|
||||||
throw new IllegalStateException("Pocket dimensions have already been loaded!");
|
return;
|
||||||
}
|
}
|
||||||
if (isLoading)
|
if (isLoading)
|
||||||
{
|
{
|
||||||
@@ -696,8 +699,12 @@ public class PocketManager
|
|||||||
// Load compacted client-side dimension data
|
// Load compacted client-side dimension data
|
||||||
load();
|
load();
|
||||||
Compactor.readDimensions(input, new DimRegistrationCallback());
|
Compactor.readDimensions(input, new DimRegistrationCallback());
|
||||||
isConnected = true;
|
|
||||||
|
// Register pocket dimensions
|
||||||
|
DDProperties properties = DDProperties.instance();
|
||||||
|
|
||||||
isLoaded = true;
|
isLoaded = true;
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
|
isConnected = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ public class DungeonSchematic extends Schematic {
|
|||||||
|
|
||||||
public static DungeonSchematic readFromFile(File schematicFile) throws FileNotFoundException, InvalidSchematicException
|
public static DungeonSchematic readFromFile(File schematicFile) throws FileNotFoundException, InvalidSchematicException
|
||||||
{
|
{
|
||||||
|
// TODO: fix resource leak
|
||||||
return readFromStream(new FileInputStream(schematicFile));
|
return readFromStream(new FileInputStream(schematicFile));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ public class DungeonPackConfigReader extends BaseConfigurationProcessor<DungeonP
|
|||||||
|
|
||||||
public DungeonPackConfigReader() { }
|
public DungeonPackConfigReader() { }
|
||||||
|
|
||||||
|
@SuppressWarnings("resource")
|
||||||
@Override
|
@Override
|
||||||
public DungeonPackConfig readFromStream(InputStream inputStream) throws ConfigurationProcessingException
|
public DungeonPackConfig readFromStream(InputStream inputStream) throws ConfigurationProcessingException
|
||||||
{
|
{
|
||||||
@@ -206,6 +207,7 @@ public class DungeonPackConfigReader extends BaseConfigurationProcessor<DungeonP
|
|||||||
|
|
||||||
private class DungeonTypeProcessor implements ILineProcessor
|
private class DungeonTypeProcessor implements ILineProcessor
|
||||||
{
|
{
|
||||||
|
@Override
|
||||||
public void process(String line, DungeonPackConfig config) throws ConfigurationProcessingException
|
public void process(String line, DungeonPackConfig config) throws ConfigurationProcessingException
|
||||||
{
|
{
|
||||||
List<String> typeNames = config.getTypeNames();
|
List<String> typeNames = config.getTypeNames();
|
||||||
@@ -229,6 +231,7 @@ public class DungeonPackConfigReader extends BaseConfigurationProcessor<DungeonP
|
|||||||
|
|
||||||
private class DungeonSettingsParser implements ILineProcessor
|
private class DungeonSettingsParser implements ILineProcessor
|
||||||
{
|
{
|
||||||
|
@Override
|
||||||
public void process(String line, DungeonPackConfig config) throws ConfigurationProcessingException
|
public void process(String line, DungeonPackConfig config) throws ConfigurationProcessingException
|
||||||
{
|
{
|
||||||
//The various settings that we support will be hardcoded here.
|
//The various settings that we support will be hardcoded here.
|
||||||
@@ -295,6 +298,7 @@ public class DungeonPackConfigReader extends BaseConfigurationProcessor<DungeonP
|
|||||||
|
|
||||||
private class RuleDefinitionParser implements ILineProcessor
|
private class RuleDefinitionParser implements ILineProcessor
|
||||||
{
|
{
|
||||||
|
@Override
|
||||||
public void process(String definition, DungeonPackConfig config) throws ConfigurationProcessingException
|
public void process(String definition, DungeonPackConfig config) throws ConfigurationProcessingException
|
||||||
{
|
{
|
||||||
String[] ruleParts;
|
String[] ruleParts;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public class BlockRotationHelper
|
|||||||
{
|
{
|
||||||
HashMap<Integer,HashMap<Integer, Integer>> orientation0 = new HashMap<Integer,HashMap<Integer, Integer>>();
|
HashMap<Integer,HashMap<Integer, Integer>> orientation0 = new HashMap<Integer,HashMap<Integer, Integer>>();
|
||||||
|
|
||||||
HashMap<Integer,Integer> stairs0 = new HashMap();
|
HashMap<Integer,Integer> stairs0 = new HashMap<Integer,Integer>();
|
||||||
|
|
||||||
stairs0.put(0, 2);
|
stairs0.put(0, 2);
|
||||||
stairs0.put(1, 3);
|
stairs0.put(1, 3);
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
package StevenDimDoors.mod_pocketDim.helpers;
|
package StevenDimDoors.mod_pocketDim.helpers;
|
||||||
|
|
||||||
|
import StevenDimDoors.mod_pocketDim.IChunkLoader;
|
||||||
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||||
|
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||||
|
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -8,16 +15,6 @@ import net.minecraftforge.common.DimensionManager;
|
|||||||
import net.minecraftforge.common.ForgeChunkManager;
|
import net.minecraftforge.common.ForgeChunkManager;
|
||||||
import net.minecraftforge.common.ForgeChunkManager.LoadingCallback;
|
import net.minecraftforge.common.ForgeChunkManager.LoadingCallback;
|
||||||
import net.minecraftforge.common.ForgeChunkManager.Ticket;
|
import net.minecraftforge.common.ForgeChunkManager.Ticket;
|
||||||
import StevenDimDoors.mod_pocketDim.IChunkLoader;
|
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
|
||||||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
|
||||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
|
||||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityDimDoorGold;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
|
|
||||||
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
|
||||||
|
|
||||||
|
|
||||||
public class ChunkLoaderHelper implements LoadingCallback
|
public class ChunkLoaderHelper implements LoadingCallback
|
||||||
{
|
{
|
||||||
@@ -42,8 +39,6 @@ public class ChunkLoaderHelper implements LoadingCallback
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void loadChunkForcedWorlds(FMLServerStartingEvent event)
|
public static void loadChunkForcedWorlds(FMLServerStartingEvent event)
|
||||||
{
|
{
|
||||||
for(NewDimData data : PocketManager.getDimensions())
|
for(NewDimData data : PocketManager.getDimensions())
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import StevenDimDoors.mod_pocketDim.watcher.ClientLinkData;
|
|||||||
public class Compactor
|
public class Compactor
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@SuppressWarnings("unused") // ?
|
||||||
private static class DimComparator implements Comparator<NewDimData>
|
private static class DimComparator implements Comparator<NewDimData>
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -140,7 +140,11 @@ public class DungeonHelper
|
|||||||
config.setName(name);
|
config.setName(name);
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
catch (ConfigurationProcessingException e)
|
catch (FileNotFoundException e)
|
||||||
|
{
|
||||||
|
System.err.println("Could not find a dungeon pack config file: " + configPath);
|
||||||
|
}
|
||||||
|
catch (Exception e) // handles IOException and ConfigurationProcessingException
|
||||||
{
|
{
|
||||||
System.err.println(e.getMessage());
|
System.err.println(e.getMessage());
|
||||||
if (e.getCause() != null)
|
if (e.getCause() != null)
|
||||||
@@ -148,10 +152,6 @@ public class DungeonHelper
|
|||||||
System.err.println(e.getCause());
|
System.err.println(e.getCause());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (FileNotFoundException e)
|
|
||||||
{
|
|
||||||
System.err.println("Could not find a dungeon pack config file: " + configPath);
|
|
||||||
}
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -442,6 +442,7 @@ public class DungeonHelper
|
|||||||
System.out.println("Registering bundled dungeon pack: " + name);
|
System.out.println("Registering bundled dungeon pack: " + name);
|
||||||
|
|
||||||
InputStream listStream = this.getClass().getResourceAsStream(listPath);
|
InputStream listStream = this.getClass().getResourceAsStream(listPath);
|
||||||
|
// chance of leak?
|
||||||
if (listStream == null)
|
if (listStream == null)
|
||||||
{
|
{
|
||||||
System.err.println("Unable to open list of bundled dungeon schematics for " + name);
|
System.err.println("Unable to open list of bundled dungeon schematics for " + name);
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ public abstract class BaseItemDoor extends ItemDoor
|
|||||||
properties = DDProperties.instance();
|
properties = DDProperties.instance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void registerIcons(IconRegister par1IconRegister)
|
public void registerIcons(IconRegister par1IconRegister)
|
||||||
{
|
{
|
||||||
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().replace("item.", ""));
|
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().replace("item.", ""));
|
||||||
@@ -59,7 +60,7 @@ public abstract class BaseItemDoor extends ItemDoor
|
|||||||
player.canPlayerEdit(x, y, z, side, stack) && player.canPlayerEdit(x, y + 1, z, side, stack) &&
|
player.canPlayerEdit(x, y, z, side, stack) && player.canPlayerEdit(x, y + 1, z, side, stack) &&
|
||||||
(!requireLink || PocketManager.getLink(x, y + 1, z, world) != null)&&stack.stackSize>0)
|
(!requireLink || PocketManager.getLink(x, y + 1, z, world) != null)&&stack.stackSize>0)
|
||||||
{
|
{
|
||||||
int orientation = MathHelper.floor_double((double) ((player.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
|
int orientation = MathHelper.floor_double((player.rotationYaw + 180.0F) * 4.0F / 360.0F - 0.5D) & 3;
|
||||||
placeDoorBlock(world, x, y, z, orientation, doorBlock);
|
placeDoorBlock(world, x, y, z, orientation, doorBlock);
|
||||||
|
|
||||||
if (!player.capabilities.isCreativeMode && reduceStack)
|
if (!player.capabilities.isCreativeMode && reduceStack)
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ public class ItemBlockDimWall extends ItemBlock
|
|||||||
this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab);
|
this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab);
|
||||||
setHasSubtypes(true);
|
setHasSubtypes(true);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public void registerIcons(IconRegister par1IconRegister)
|
public void registerIcons(IconRegister par1IconRegister)
|
||||||
{
|
{
|
||||||
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().replace("tile.", ""));
|
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().replace("tile.", ""));
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package StevenDimDoors.mod_pocketDim.items;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|||||||
@@ -12,18 +12,18 @@ import net.minecraft.world.World;
|
|||||||
|
|
||||||
public class ItemGoldDoor extends ItemDoor
|
public class ItemGoldDoor extends ItemDoor
|
||||||
{
|
{
|
||||||
|
|
||||||
public ItemGoldDoor(int par1, Material par2Material)
|
public ItemGoldDoor(int par1, Material par2Material)
|
||||||
{
|
{
|
||||||
super(par1, par2Material);
|
super(par1, par2Material);
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void registerIcons(IconRegister par1IconRegister)
|
public void registerIcons(IconRegister par1IconRegister)
|
||||||
{
|
{
|
||||||
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().replace("item.", ""));
|
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().replace("item.", ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
||||||
{
|
{
|
||||||
if (par7 != 1)
|
if (par7 != 1)
|
||||||
@@ -35,8 +35,6 @@ public class ItemGoldDoor extends ItemDoor
|
|||||||
++par5;
|
++par5;
|
||||||
Block block = mod_pocketDim.goldDoor;
|
Block block = mod_pocketDim.goldDoor;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack))
|
if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack))
|
||||||
{
|
{
|
||||||
if (!block.canPlaceBlockAt(par3World, par4, par5, par6))
|
if (!block.canPlaceBlockAt(par3World, par4, par5, par6))
|
||||||
@@ -45,7 +43,7 @@ public class ItemGoldDoor extends ItemDoor
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int i1 = MathHelper.floor_double((double)((par2EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
|
int i1 = MathHelper.floor_double((par2EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F - 0.5D) & 3;
|
||||||
placeDoorBlock(par3World, par4, par5, par6, i1, block);
|
placeDoorBlock(par3World, par4, par5, par6, i1, block);
|
||||||
--par1ItemStack.stackSize;
|
--par1ItemStack.stackSize;
|
||||||
return true;
|
return true;
|
||||||
@@ -57,8 +55,4 @@ public class ItemGoldDoor extends ItemDoor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package StevenDimDoors.mod_pocketDim.items;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.google.common.collect.Multimap;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
@@ -24,6 +23,7 @@ import net.minecraft.world.World;
|
|||||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||||
|
import com.google.common.collect.Multimap;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
@@ -91,9 +91,9 @@ public class ItemRiftBlade extends ItemSword
|
|||||||
float var4 = 1.0F;
|
float var4 = 1.0F;
|
||||||
float var5 = par2EntityPlayer.prevRotationPitch + (par2EntityPlayer.rotationPitch - par2EntityPlayer.prevRotationPitch) * var4;
|
float var5 = par2EntityPlayer.prevRotationPitch + (par2EntityPlayer.rotationPitch - par2EntityPlayer.prevRotationPitch) * var4;
|
||||||
float var6 = par2EntityPlayer.prevRotationYaw + (par2EntityPlayer.rotationYaw - par2EntityPlayer.prevRotationYaw) * var4;
|
float var6 = par2EntityPlayer.prevRotationYaw + (par2EntityPlayer.rotationYaw - par2EntityPlayer.prevRotationYaw) * var4;
|
||||||
double var7 = par2EntityPlayer.prevPosX + (par2EntityPlayer.posX - par2EntityPlayer.prevPosX) * (double)var4;
|
double var7 = par2EntityPlayer.prevPosX + (par2EntityPlayer.posX - par2EntityPlayer.prevPosX) * var4;
|
||||||
double var9 = par2EntityPlayer.prevPosY + (par2EntityPlayer.posY - par2EntityPlayer.prevPosY) * (double)var4 + 1.62D - (double)par2EntityPlayer.yOffset;
|
double var9 = par2EntityPlayer.prevPosY + (par2EntityPlayer.posY - par2EntityPlayer.prevPosY) * var4 + 1.62D - par2EntityPlayer.yOffset;
|
||||||
double var11 = par2EntityPlayer.prevPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.prevPosZ) * (double)var4;
|
double var11 = par2EntityPlayer.prevPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.prevPosZ) * var4;
|
||||||
Vec3 var13 = par1World.getWorldVec3Pool().getVecFromPool(var7, var9, var11);
|
Vec3 var13 = par1World.getWorldVec3Pool().getVecFromPool(var7, var9, var11);
|
||||||
float var14 = MathHelper.cos(-var6 * 0.017453292F - (float)Math.PI);
|
float var14 = MathHelper.cos(-var6 * 0.017453292F - (float)Math.PI);
|
||||||
float var15 = MathHelper.sin(-var6 * 0.017453292F - (float)Math.PI);
|
float var15 = MathHelper.sin(-var6 * 0.017453292F - (float)Math.PI);
|
||||||
@@ -106,13 +106,13 @@ public class ItemRiftBlade extends ItemSword
|
|||||||
{
|
{
|
||||||
var21 = 7;
|
var21 = 7;
|
||||||
}
|
}
|
||||||
Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21);
|
Vec3 var23 = var13.addVector(var18 * var21, var17 * var21, var20 * var21);
|
||||||
return par1World.rayTraceBlocks_do_do(var13, var23, true, false);
|
return par1World.rayTraceBlocks_do_do(var13, var23, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean teleportToEntity(ItemStack item, Entity par1Entity, EntityPlayer holder)
|
private boolean teleportToEntity(ItemStack item, Entity par1Entity, EntityPlayer holder)
|
||||||
{
|
{
|
||||||
Vec3 var2 = holder.worldObj.getWorldVec3Pool().getVecFromPool(holder.posX - par1Entity.posX, holder.boundingBox.minY + (double)(holder.height / 2.0F) - par1Entity.posY + (double)par1Entity.getEyeHeight(), holder.posZ - par1Entity.posZ);
|
Vec3 var2 = holder.worldObj.getWorldVec3Pool().getVecFromPool(holder.posX - par1Entity.posX, holder.boundingBox.minY + holder.height / 2.0F - par1Entity.posY + par1Entity.getEyeHeight(), holder.posZ - par1Entity.posZ);
|
||||||
|
|
||||||
double cooef =( var2.lengthVector()-2.5)/var2.lengthVector();
|
double cooef =( var2.lengthVector()-2.5)/var2.lengthVector();
|
||||||
var2.xCoord*=cooef;
|
var2.xCoord*=cooef;
|
||||||
@@ -147,13 +147,13 @@ public class ItemRiftBlade extends ItemSword
|
|||||||
if (!world.isRemote)
|
if (!world.isRemote)
|
||||||
{
|
{
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
List<EntityLiving> list = (List<EntityLiving>) world.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox(player.posX-8,player.posY-8, player.posZ-8, player.posX+8,player.posY+8, player.posZ+8));
|
List<EntityLiving> list = world.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox(player.posX-8,player.posY-8, player.posZ-8, player.posX+8,player.posY+8, player.posZ+8));
|
||||||
list.remove(player);
|
list.remove(player);
|
||||||
|
|
||||||
for (EntityLiving ent : list)
|
for (EntityLiving ent : list)
|
||||||
{
|
{
|
||||||
Vec3 var3 = player.getLook(1.0F).normalize();
|
Vec3 var3 = player.getLook(1.0F).normalize();
|
||||||
Vec3 var4 = player.worldObj.getWorldVec3Pool().getVecFromPool(ent.posX - player.posX, ent.boundingBox.minY + (double)((ent.height) / 2.0F) - ( player.posY + (double) player.getEyeHeight()), ent.posZ - player.posZ);
|
Vec3 var4 = player.worldObj.getWorldVec3Pool().getVecFromPool(ent.posX - player.posX, ent.boundingBox.minY + (ent.height) / 2.0F - ( player.posY + player.getEyeHeight()), ent.posZ - player.posZ);
|
||||||
double var5 = var4.lengthVector();
|
double var5 = var4.lengthVector();
|
||||||
var4 = var4.normalize();
|
var4 = var4.normalize();
|
||||||
double var7 = var3.dotProduct(var4);
|
double var7 = var3.dotProduct(var4);
|
||||||
@@ -178,13 +178,13 @@ public class ItemRiftBlade extends ItemSword
|
|||||||
if (player.canPlayerEdit(x, y, z, hit.sideHit, stack) &&
|
if (player.canPlayerEdit(x, y, z, hit.sideHit, stack) &&
|
||||||
player.canPlayerEdit(x, y + 1, z, hit.sideHit, stack))
|
player.canPlayerEdit(x, y + 1, z, hit.sideHit, stack))
|
||||||
{
|
{
|
||||||
int orientation = MathHelper.floor_double((double)((player.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
|
int orientation = MathHelper.floor_double((player.rotationYaw + 180.0F) * 4.0F / 360.0F - 0.5D) & 3;
|
||||||
|
|
||||||
if (BaseItemDoor.canPlace(world, x, y, z) &&
|
if (BaseItemDoor.canPlace(world, x, y, z) &&
|
||||||
BaseItemDoor.canPlace(world, x, y - 1, z))
|
BaseItemDoor.canPlace(world, x, y - 1, z))
|
||||||
{
|
{
|
||||||
ItemDimensionalDoor.placeDoorBlock(world, x, y - 1, z, orientation, mod_pocketDim.transientDoor);
|
ItemDimensionalDoor.placeDoorBlock(world, x, y - 1, z, orientation, mod_pocketDim.transientDoor);
|
||||||
player.worldObj.playSoundAtEntity(player,"mods.DimDoors.sfx.riftDoor", 0.6f, 1);
|
player.worldObj.playSoundAtEntity(player,mod_pocketDim.modid+":riftDoor", 0.6f, 1);
|
||||||
stack.damageItem(3, player);
|
stack.damageItem(3, player);
|
||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
@@ -218,6 +218,7 @@ public class ItemRiftBlade extends ItemSword
|
|||||||
/**
|
/**
|
||||||
* allows items to add custom lines of information to the mouseover description
|
* allows items to add custom lines of information to the mouseover description
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||||
|
|||||||
@@ -98,15 +98,15 @@ public class ItemRiftSignature extends Item
|
|||||||
stack.stackSize--;
|
stack.stackSize--;
|
||||||
}
|
}
|
||||||
clearSource(stack);
|
clearSource(stack);
|
||||||
player.addChatMessage("Rift Created");
|
mod_pocketDim.sendChat(player,("Rift Created"));
|
||||||
world.playSoundAtEntity(player,"mods.DimDoors.sfx.riftEnd", 0.6f, 1);
|
world.playSoundAtEntity(player,mod_pocketDim.modid+":riftEnd", 0.6f, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//The link signature has not been used. Store its current target as the first location.
|
//The link signature has not been used. Store its current target as the first location.
|
||||||
setSource(stack, x, adjustedY, z,orientation, PocketManager.getDimensionData(world));
|
setSource(stack, x, adjustedY, z,orientation, PocketManager.getDimensionData(world));
|
||||||
player.addChatMessage("Location Stored in Rift Signature");
|
mod_pocketDim.sendChat(player,("Location Stored in Rift Signature"));
|
||||||
world.playSoundAtEntity(player,"mods.DimDoors.sfx.riftStart", 0.6f, 1);
|
world.playSoundAtEntity(player,mod_pocketDim.modid+":riftStart", 0.6f, 1);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ public class ItemStabilizedRiftSignature extends ItemRiftSignature
|
|||||||
super(itemID);
|
super(itemID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void registerIcons(IconRegister par1IconRegister)
|
public void registerIcons(IconRegister par1IconRegister)
|
||||||
{
|
{
|
||||||
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().replace("item.", ""));
|
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().replace("item.", ""));
|
||||||
@@ -49,14 +50,17 @@ public class ItemStabilizedRiftSignature extends ItemRiftSignature
|
|||||||
int adjustedY = adjustYForSpecialBlocks(world,x,y,z);
|
int adjustedY = adjustYForSpecialBlocks(world,x,y,z);
|
||||||
|
|
||||||
// Check if the Stabilized Rift Signature has been initialized
|
// Check if the Stabilized Rift Signature has been initialized
|
||||||
int orientation = MathHelper.floor_double((double) ((player.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
|
int orientation = MathHelper.floor_double((player.rotationYaw + 180.0F) * 4.0F / 360.0F - 0.5D) & 3;
|
||||||
if (source != null)
|
if (source != null)
|
||||||
{
|
{
|
||||||
// Yes, it's initialized. Check if the player is in creative
|
// Yes, it's initialized. Check if the player is in creative
|
||||||
// or if the player can pay an Ender Pearl to create a rift.
|
// or if the player can pay an Ender Pearl to create a rift.
|
||||||
if (!player.capabilities.isCreativeMode && !player.inventory.hasItem(Item.enderPearl.itemID))
|
if (!player.capabilities.isCreativeMode && !player.inventory.hasItem(Item.enderPearl.itemID))
|
||||||
{
|
{
|
||||||
player.addChatMessage("You don't have any Ender Pearls!");
|
mod_pocketDim.sendChat(player,"You don't have any Ender Pearls!");
|
||||||
|
// I won't do this, but this is the chance to localize chat
|
||||||
|
// messages sent to the player; look at ChatMessageComponent
|
||||||
|
// and how MFR does it with items like the safari net launcher
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,14 +90,14 @@ public class ItemStabilizedRiftSignature extends ItemRiftSignature
|
|||||||
{
|
{
|
||||||
player.inventory.consumeInventoryItem(Item.enderPearl.itemID);
|
player.inventory.consumeInventoryItem(Item.enderPearl.itemID);
|
||||||
}
|
}
|
||||||
player.addChatMessage("Rift Created");
|
mod_pocketDim.sendChat(player,"Rift Created");
|
||||||
world.playSoundAtEntity(player,"mods.DimDoors.sfx.riftEnd", 0.6f, 1);
|
world.playSoundAtEntity(player,"mods.DimDoors.sfx.riftEnd", 0.6f, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//The link signature has not been used. Store its current target as the first location.
|
//The link signature has not been used. Store its current target as the first location.
|
||||||
setSource(stack, x, adjustedY, z, orientation, PocketManager.getDimensionData(world));
|
setSource(stack, x, adjustedY, z, orientation, PocketManager.getDimensionData(world));
|
||||||
player.addChatMessage("Location Stored in Rift Signature");
|
mod_pocketDim.sendChat(player,"Location Stored in Rift Signature");
|
||||||
world.playSoundAtEntity(player,"mods.DimDoors.sfx.riftStart", 0.6f, 1);
|
world.playSoundAtEntity(player,"mods.DimDoors.sfx.riftStart", 0.6f, 1);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ public class ItemStableFabric extends Item
|
|||||||
this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab);
|
this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void registerIcons(IconRegister par1IconRegister)
|
public void registerIcons(IconRegister par1IconRegister)
|
||||||
{
|
{
|
||||||
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().replace("item.", ""));
|
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().replace("item.", ""));
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ public class ItemWorldThread extends Item
|
|||||||
this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab);
|
this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void registerIcons(IconRegister par1IconRegister)
|
public void registerIcons(IconRegister par1IconRegister)
|
||||||
{
|
{
|
||||||
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().replace("item.", ""));
|
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().replace("item.", ""));
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ public class itemRiftRemover extends Item
|
|||||||
this.setMaxDamage(4);
|
this.setMaxDamage(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void registerIcons(IconRegister par1IconRegister)
|
public void registerIcons(IconRegister par1IconRegister)
|
||||||
{
|
{
|
||||||
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName());
|
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName());
|
||||||
@@ -114,7 +115,7 @@ public class itemRiftRemover extends Item
|
|||||||
{
|
{
|
||||||
stack.damageItem(1, player);
|
stack.damageItem(1, player);
|
||||||
}
|
}
|
||||||
player.worldObj.playSoundAtEntity(player, "mods.DimDoors.sfx.riftClose", 0.8f, 1);
|
player.worldObj.playSoundAtEntity(player, mod_pocketDim.modid+":riftClose", 0.8f, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,5 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
package StevenDimDoors.mod_pocketDim;
|
||||||
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.entity.EntityEggInfo;
|
|
||||||
import net.minecraft.entity.EntityList;
|
|
||||||
import net.minecraft.item.EnumToolMaterial;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.biome.BiomeGenBase;
|
|
||||||
import net.minecraftforge.common.DimensionManager;
|
|
||||||
import net.minecraftforge.common.ForgeChunkManager;
|
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
|
||||||
import StevenDimDoors.mod_pocketDim.blocks.BlockDimWall;
|
import StevenDimDoors.mod_pocketDim.blocks.BlockDimWall;
|
||||||
import StevenDimDoors.mod_pocketDim.blocks.BlockDimWallPerm;
|
import StevenDimDoors.mod_pocketDim.blocks.BlockDimWallPerm;
|
||||||
import StevenDimDoors.mod_pocketDim.blocks.BlockDoorGold;
|
import StevenDimDoors.mod_pocketDim.blocks.BlockDoorGold;
|
||||||
@@ -62,13 +49,10 @@ import StevenDimDoors.mod_pocketDim.world.LimboProvider;
|
|||||||
import StevenDimDoors.mod_pocketDim.world.PocketProvider;
|
import StevenDimDoors.mod_pocketDim.world.PocketProvider;
|
||||||
import StevenDimDoors.mod_pocketDimClient.ClientPacketHandler;
|
import StevenDimDoors.mod_pocketDimClient.ClientPacketHandler;
|
||||||
import StevenDimDoors.mod_pocketDimClient.ClientTickHandler;
|
import StevenDimDoors.mod_pocketDimClient.ClientTickHandler;
|
||||||
|
|
||||||
import cpw.mods.fml.common.Mod;
|
import cpw.mods.fml.common.Mod;
|
||||||
import cpw.mods.fml.common.Mod.Init;
|
import cpw.mods.fml.common.Mod.EventHandler;
|
||||||
import cpw.mods.fml.common.Mod.Instance;
|
import cpw.mods.fml.common.Mod.Instance;
|
||||||
import cpw.mods.fml.common.Mod.PostInit;
|
|
||||||
import cpw.mods.fml.common.Mod.PreInit;
|
|
||||||
import cpw.mods.fml.common.Mod.ServerStarting;
|
|
||||||
import cpw.mods.fml.common.Mod.ServerStopping;
|
|
||||||
import cpw.mods.fml.common.SidedProxy;
|
import cpw.mods.fml.common.SidedProxy;
|
||||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||||
@@ -83,6 +67,22 @@ import cpw.mods.fml.common.registry.LanguageRegistry;
|
|||||||
import cpw.mods.fml.common.registry.TickRegistry;
|
import cpw.mods.fml.common.registry.TickRegistry;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.entity.EntityEggInfo;
|
||||||
|
import net.minecraft.entity.EntityList;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.EnumToolMaterial;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.ChatMessageComponent;
|
||||||
|
import net.minecraft.world.biome.BiomeGenBase;
|
||||||
|
import net.minecraftforge.common.DimensionManager;
|
||||||
|
import net.minecraftforge.common.ForgeChunkManager;
|
||||||
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
|
||||||
@Mod(modid = mod_pocketDim.modid, name = "Dimensional Doors", version = mod_pocketDim.version)
|
@Mod(modid = mod_pocketDim.modid, name = "Dimensional Doors", version = mod_pocketDim.version)
|
||||||
|
|
||||||
@@ -91,11 +91,10 @@ clientPacketHandlerSpec =
|
|||||||
@SidedPacketHandler(channels = {PacketConstants.CHANNEL_NAME}, packetHandler = ClientPacketHandler.class),
|
@SidedPacketHandler(channels = {PacketConstants.CHANNEL_NAME}, packetHandler = ClientPacketHandler.class),
|
||||||
serverPacketHandlerSpec =
|
serverPacketHandlerSpec =
|
||||||
@SidedPacketHandler(channels = {PacketConstants.CHANNEL_NAME}, packetHandler = ServerPacketHandler.class))
|
@SidedPacketHandler(channels = {PacketConstants.CHANNEL_NAME}, packetHandler = ServerPacketHandler.class))
|
||||||
|
|
||||||
public class mod_pocketDim
|
public class mod_pocketDim
|
||||||
{
|
{
|
||||||
public static final String version = "$VERSION$";
|
public static final String version = "$VERSION$";
|
||||||
public static final String modid = "DimDoors";
|
public static final String modid = "dimdoors";
|
||||||
|
|
||||||
//need to clean up
|
//need to clean up
|
||||||
@SidedProxy(clientSide = "StevenDimDoors.mod_pocketDimClient.ClientProxy", serverSide = "StevenDimDoors.mod_pocketDim.CommonProxy")
|
@SidedProxy(clientSide = "StevenDimDoors.mod_pocketDimClient.ClientProxy", serverSide = "StevenDimDoors.mod_pocketDim.CommonProxy")
|
||||||
@@ -155,12 +154,14 @@ public class mod_pocketDim
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@PreInit
|
@EventHandler
|
||||||
public void onPreInitialization(FMLPreInitializationEvent event)
|
public void onPreInitialization(FMLPreInitializationEvent event)
|
||||||
{
|
{
|
||||||
this.instance = this;
|
instance = this;
|
||||||
//This should be the FIRST thing that gets done.
|
//This should be the FIRST thing that gets done.
|
||||||
properties = DDProperties.initialize(event.getSuggestedConfigurationFile());
|
String path = event.getSuggestedConfigurationFile().getAbsolutePath().replace(modid, "DimDoors");
|
||||||
|
|
||||||
|
properties = DDProperties.initialize(new File(path));
|
||||||
|
|
||||||
//Now do other stuff
|
//Now do other stuff
|
||||||
MinecraftForge.EVENT_BUS.register(new EventHookContainer(properties));
|
MinecraftForge.EVENT_BUS.register(new EventHookContainer(properties));
|
||||||
@@ -168,7 +169,8 @@ public class mod_pocketDim
|
|||||||
riftGen = new GatewayGenerator(properties);
|
riftGen = new GatewayGenerator(properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Init
|
@SuppressWarnings("unused")
|
||||||
|
@EventHandler
|
||||||
public void onInitialization(FMLInitializationEvent event)
|
public void onInitialization(FMLInitializationEvent event)
|
||||||
{
|
{
|
||||||
CommonTickHandler commonTickHandler = new CommonTickHandler();
|
CommonTickHandler commonTickHandler = new CommonTickHandler();
|
||||||
@@ -282,14 +284,14 @@ public class mod_pocketDim
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@PostInit
|
@EventHandler
|
||||||
public void onPostInitialization(FMLPostInitializationEvent event)
|
public void onPostInitialization(FMLPostInitializationEvent event)
|
||||||
{
|
{
|
||||||
ForgeChunkManager.setForcedChunkLoadingCallback(instance, new ChunkLoaderHelper());
|
ForgeChunkManager.setForcedChunkLoadingCallback(instance, new ChunkLoaderHelper());
|
||||||
//Register loot chests
|
//Register loot chests
|
||||||
DDLoot.registerInfo();
|
DDLoot.registerInfo();
|
||||||
}
|
}
|
||||||
@ServerStopping
|
@EventHandler
|
||||||
public void onServerStopping(FMLServerStoppingEvent event)
|
public void onServerStopping(FMLServerStoppingEvent event)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -302,7 +304,7 @@ public class mod_pocketDim
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ServerStarting
|
@EventHandler
|
||||||
public void onServerStarting(FMLServerStartingEvent event)
|
public void onServerStarting(FMLServerStartingEvent event)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -328,4 +330,12 @@ public class mod_pocketDim
|
|||||||
System.out.println("Loading chunkloaders failed");
|
System.out.println("Loading chunkloaders failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void sendChat(EntityPlayer player, String message)
|
||||||
|
{
|
||||||
|
ChatMessageComponent cmp = new ChatMessageComponent();
|
||||||
|
cmp.addText(message);
|
||||||
|
player.sendChatToPlayer(cmp);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ public class BlacklistProcessor extends BaseConfigurationProcessor<List<Integer>
|
|||||||
{
|
{
|
||||||
JsonReader reader = new JsonReader(new InputStreamReader(inputStream, "UTF-8"));
|
JsonReader reader = new JsonReader(new InputStreamReader(inputStream, "UTF-8"));
|
||||||
List<Integer> data = this.createBlacklistFromJson(reader);
|
List<Integer> data = this.createBlacklistFromJson(reader);
|
||||||
|
reader.close();
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
catch (IOException e)
|
catch (IOException e)
|
||||||
|
|||||||
@@ -144,6 +144,7 @@ public class DDSaveHandler
|
|||||||
linkType = LinkTypes.NORMAL;
|
linkType = LinkTypes.NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
DimLink link = data.createLink(packedLink.source, linkType, packedLink.orientation);
|
DimLink link = data.createLink(packedLink.source, linkType, packedLink.orientation);
|
||||||
Point4D destination = packedLink.tail.destination;
|
Point4D destination = packedLink.tail.destination;
|
||||||
if(destination!=null)
|
if(destination!=null)
|
||||||
|
|||||||
@@ -1,22 +1,16 @@
|
|||||||
package StevenDimDoors.mod_pocketDim.saving;
|
package StevenDimDoors.mod_pocketDim.saving;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.io.OutputStreamWriter;
|
|
||||||
import java.io.PrintWriter;
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
import com.google.gson.JsonObject;
|
|
||||||
import com.google.gson.stream.JsonReader;
|
import com.google.gson.stream.JsonReader;
|
||||||
import com.google.gson.stream.JsonToken;
|
import com.google.gson.stream.JsonToken;
|
||||||
import com.google.gson.stream.JsonWriter;
|
|
||||||
|
|
||||||
import StevenDimDoors.mod_pocketDim.Point3D;
|
import StevenDimDoors.mod_pocketDim.Point3D;
|
||||||
import StevenDimDoors.mod_pocketDim.util.BaseConfigurationProcessor;
|
import StevenDimDoors.mod_pocketDim.util.BaseConfigurationProcessor;
|
||||||
@@ -33,6 +27,7 @@ public class DimDataProcessor extends BaseConfigurationProcessor<PackedDimData>
|
|||||||
{
|
{
|
||||||
JsonReader reader = new JsonReader(new InputStreamReader(inputStream, "UTF-8"));
|
JsonReader reader = new JsonReader(new InputStreamReader(inputStream, "UTF-8"));
|
||||||
PackedDimData data = this.createDImDataFromJson(reader);
|
PackedDimData data = this.createDImDataFromJson(reader);
|
||||||
|
reader.close();
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
catch (IOException e)
|
catch (IOException e)
|
||||||
@@ -92,7 +87,7 @@ public class DimDataProcessor extends BaseConfigurationProcessor<PackedDimData>
|
|||||||
reader.beginObject();
|
reader.beginObject();
|
||||||
|
|
||||||
reader.nextName();
|
reader.nextName();
|
||||||
if(reader.nextLong()!=PackedDimData.SAVE_DATA_VERSION_ID)
|
if (reader.nextLong() != PackedDimData.SAVE_DATA_VERSION_ID)
|
||||||
{
|
{
|
||||||
throw new IOException("Save data version mismatch");
|
throw new IOException("Save data version mismatch");
|
||||||
}
|
}
|
||||||
@@ -182,7 +177,7 @@ public class DimDataProcessor extends BaseConfigurationProcessor<PackedDimData>
|
|||||||
List<Integer> list = new ArrayList<Integer>();
|
List<Integer> list = new ArrayList<Integer>();
|
||||||
reader.beginArray();
|
reader.beginArray();
|
||||||
|
|
||||||
while(reader.peek()!= JsonToken.END_ARRAY)
|
while (reader.peek() != JsonToken.END_ARRAY)
|
||||||
{
|
{
|
||||||
list.add(reader.nextInt());
|
list.add(reader.nextInt());
|
||||||
|
|
||||||
@@ -197,7 +192,7 @@ public class DimDataProcessor extends BaseConfigurationProcessor<PackedDimData>
|
|||||||
|
|
||||||
reader.beginArray();
|
reader.beginArray();
|
||||||
|
|
||||||
while(reader.peek()!= JsonToken.END_ARRAY)
|
while (reader.peek() != JsonToken.END_ARRAY)
|
||||||
{
|
{
|
||||||
list.add(createLinkDataFromJson(reader));
|
list.add(createLinkDataFromJson(reader));
|
||||||
}
|
}
|
||||||
@@ -230,7 +225,7 @@ public class DimDataProcessor extends BaseConfigurationProcessor<PackedDimData>
|
|||||||
reader.nextName();
|
reader.nextName();
|
||||||
reader.beginArray();
|
reader.beginArray();
|
||||||
|
|
||||||
while(reader.peek() != JsonToken.END_ARRAY)
|
while (reader.peek() != JsonToken.END_ARRAY)
|
||||||
{
|
{
|
||||||
children.add(this.createPointFromJson(reader));
|
children.add(this.createPointFromJson(reader));
|
||||||
}
|
}
|
||||||
@@ -250,6 +245,7 @@ public class DimDataProcessor extends BaseConfigurationProcessor<PackedDimData>
|
|||||||
String DungeonPackName;
|
String DungeonPackName;
|
||||||
|
|
||||||
reader.beginObject();
|
reader.beginObject();
|
||||||
|
@SuppressWarnings("unused")
|
||||||
JsonToken test = reader.peek();
|
JsonToken test = reader.peek();
|
||||||
|
|
||||||
if(reader.peek() == JsonToken.END_OBJECT)
|
if(reader.peek() == JsonToken.END_OBJECT)
|
||||||
@@ -283,13 +279,14 @@ public class DimDataProcessor extends BaseConfigurationProcessor<PackedDimData>
|
|||||||
}
|
}
|
||||||
private PackedLinkTail createLinkTailFromJson(JsonReader reader) throws IOException
|
private PackedLinkTail createLinkTailFromJson(JsonReader reader) throws IOException
|
||||||
{
|
{
|
||||||
Point4D destination=null;
|
Point4D destination = null;
|
||||||
int linkType;
|
int linkType;
|
||||||
reader.beginObject();
|
reader.beginObject();
|
||||||
reader.nextName();
|
reader.nextName();
|
||||||
|
|
||||||
JsonToken test =reader.peek();
|
@SuppressWarnings("unused")
|
||||||
if(reader.peek()==JsonToken.BEGIN_OBJECT)
|
JsonToken test = reader.peek();
|
||||||
|
if (reader.peek() == JsonToken.BEGIN_OBJECT)
|
||||||
{
|
{
|
||||||
destination = this.createPoint4DFromJson(reader);
|
destination = this.createPoint4DFromJson(reader);
|
||||||
reader.nextName();
|
reader.nextName();
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
package StevenDimDoors.mod_pocketDim.saving;
|
package StevenDimDoors.mod_pocketDim.saving;
|
||||||
|
|
||||||
import StevenDimDoors.mod_pocketDim.dungeon.pack.DungeonType;
|
|
||||||
|
|
||||||
public class PackedDungeonData
|
public class PackedDungeonData
|
||||||
{
|
{
|
||||||
|
|
||||||
public final int Weight;
|
public final int Weight;
|
||||||
public final boolean IsOpen;
|
public final boolean IsOpen;
|
||||||
public final boolean IsInternal;
|
public final boolean IsInternal;
|
||||||
@@ -23,7 +20,4 @@ public class PackedDungeonData
|
|||||||
this.DungeonTypeName=dungeonTypeName;
|
this.DungeonTypeName=dungeonTypeName;
|
||||||
this.DungeonPackName=dungeonPackName;
|
this.DungeonPackName=dungeonPackName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package StevenDimDoors.mod_pocketDim.saving;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import StevenDimDoors.mod_pocketDim.Point3D;
|
import StevenDimDoors.mod_pocketDim.Point3D;
|
||||||
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
|
||||||
import StevenDimDoors.mod_pocketDim.util.Point4D;
|
import StevenDimDoors.mod_pocketDim.util.Point4D;
|
||||||
|
|
||||||
public class PackedLinkData
|
public class PackedLinkData
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ public class CompactBoundsOperation extends WorldOperation
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected boolean finish()
|
protected boolean finish()
|
||||||
{
|
{
|
||||||
if (minX == Integer.MAX_VALUE)
|
if (minX == Integer.MAX_VALUE)
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ public class Schematic {
|
|||||||
|
|
||||||
public static Schematic readFromFile(File schematicFile) throws FileNotFoundException, InvalidSchematicException
|
public static Schematic readFromFile(File schematicFile) throws FileNotFoundException, InvalidSchematicException
|
||||||
{
|
{
|
||||||
|
// TODO: fix resource leaks here
|
||||||
return readFromStream(new FileInputStream(schematicFile));
|
return readFromStream(new FileInputStream(schematicFile));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -329,7 +330,7 @@ public class Schematic {
|
|||||||
{
|
{
|
||||||
//Used when the result of this function will be passed outside this class.
|
//Used when the result of this function will be passed outside this class.
|
||||||
//Avoids exposing the private field to external modifications.
|
//Avoids exposing the private field to external modifications.
|
||||||
schematicTag.setTag("TileEntities", (NBTTagList) tileEntities.copy());
|
schematicTag.setTag("TileEntities", tileEntities.copy());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ public class SchematicFilter {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
return name;
|
return name;
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ package StevenDimDoors.mod_pocketDim.ticking;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.entity.DataWatcher;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityFlying;
|
import net.minecraft.entity.EntityFlying;
|
||||||
import net.minecraft.entity.EntityLiving;
|
import net.minecraft.entity.EntityLiving;
|
||||||
import net.minecraft.entity.SharedMonsterAttributes;
|
|
||||||
import net.minecraft.entity.monster.IMob;
|
import net.minecraft.entity.monster.IMob;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
@@ -14,6 +14,7 @@ import net.minecraft.util.ChunkCoordinates;
|
|||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.ForgeHooks;
|
||||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||||
import StevenDimDoors.mod_pocketDim.core.DDTeleporter;
|
import StevenDimDoors.mod_pocketDim.core.DDTeleporter;
|
||||||
@@ -30,10 +31,21 @@ public class MobMonolith extends EntityFlying implements IMob
|
|||||||
|
|
||||||
float scaleFactor = 0;
|
float scaleFactor = 0;
|
||||||
int aggroMax;
|
int aggroMax;
|
||||||
int destX=0;
|
int destX = 0; // unused fields?
|
||||||
int destY=0;
|
int destY = 0;
|
||||||
int destZ=0;
|
int destZ = 0;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void damageEntity(DamageSource par1DamageSource, float par2)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean attackEntityFrom(DamageSource par1DamageSource, float par2)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
public MobMonolith(World par1World)
|
public MobMonolith(World par1World)
|
||||||
{
|
{
|
||||||
super(par1World);
|
super(par1World);
|
||||||
@@ -67,6 +79,7 @@ public class MobMonolith extends EntityFlying implements IMob
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public float getRenderSizeModifier()
|
public float getRenderSizeModifier()
|
||||||
{
|
{
|
||||||
return this.scaleFactor;
|
return this.scaleFactor;
|
||||||
@@ -75,11 +88,12 @@ public class MobMonolith extends EntityFlying implements IMob
|
|||||||
public void setEntityPosition(Entity entity, double x, double y, double z)
|
public void setEntityPosition(Entity entity, double x, double y, double z)
|
||||||
{
|
{
|
||||||
entity.lastTickPosX = entity.prevPosX = entity.posX = x;
|
entity.lastTickPosX = entity.prevPosX = entity.posX = x;
|
||||||
entity.lastTickPosY = entity.prevPosY = entity.posY = y + (double)entity.yOffset;
|
entity.lastTickPosY = entity.prevPosY = entity.posY = y + entity.yOffset;
|
||||||
entity.lastTickPosZ = entity.prevPosZ = entity.posZ = z;
|
entity.lastTickPosZ = entity.prevPosZ = entity.posZ = z;
|
||||||
entity.setPosition(x, y, z);
|
entity.setPosition(x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void entityInit()
|
protected void entityInit()
|
||||||
{
|
{
|
||||||
super.entityInit();
|
super.entityInit();
|
||||||
@@ -107,7 +121,7 @@ public class MobMonolith extends EntityFlying implements IMob
|
|||||||
{
|
{
|
||||||
if(this.soundTime<=0)
|
if(this.soundTime<=0)
|
||||||
{
|
{
|
||||||
this.playSound("mods.DimDoors.sfx.monk", 1F, 1F);
|
this.playSound(mod_pocketDim.modid+":monk", 1F, 1F);
|
||||||
this.soundTime=100;
|
this.soundTime=100;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,12 +148,12 @@ public class MobMonolith extends EntityFlying implements IMob
|
|||||||
}
|
}
|
||||||
if (aggro>430&&this.soundTime<100)
|
if (aggro>430&&this.soundTime<100)
|
||||||
{
|
{
|
||||||
this.worldObj.playSoundEffect(entityPlayer.posX, entityPlayer.posY, entityPlayer.posZ,"mods.DimDoors.sfx.tearing",2F, 1F);
|
this.worldObj.playSoundEffect(entityPlayer.posX, entityPlayer.posY, entityPlayer.posZ,mod_pocketDim.modid+":tearing",2F, 1F);
|
||||||
this.soundTime=100;
|
this.soundTime=100;
|
||||||
}
|
}
|
||||||
if (aggro>445&&this.soundTime<200)
|
if (aggro>445&&this.soundTime<200)
|
||||||
{
|
{
|
||||||
this.worldObj.playSoundEffect(entityPlayer.posX, entityPlayer.posY, entityPlayer.posZ,"mods.DimDoors.sfx.tearing",5F, 1F);
|
this.worldObj.playSoundEffect(entityPlayer.posX, entityPlayer.posY, entityPlayer.posZ,mod_pocketDim.modid+":tearing",5F, 1F);
|
||||||
this.soundTime=200;
|
this.soundTime=200;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -150,13 +164,13 @@ public class MobMonolith extends EntityFlying implements IMob
|
|||||||
DDTeleporter.teleportEntity(entityPlayer, destination, false);
|
DDTeleporter.teleportEntity(entityPlayer, destination, false);
|
||||||
|
|
||||||
this.aggro = 0;
|
this.aggro = 0;
|
||||||
entityPlayer.worldObj.playSoundAtEntity(entityPlayer,"mods.DimDoors.sfx.crack",13, 1);
|
entityPlayer.worldObj.playSoundAtEntity(entityPlayer,mod_pocketDim.modid+":crack",13, 1);
|
||||||
}
|
}
|
||||||
if (!(this.worldObj.provider instanceof LimboProvider || this.worldObj.getClosestPlayerToEntity(this, 5) != null) || this.aggro > 300)
|
if (!(this.worldObj.provider instanceof LimboProvider || this.worldObj.getClosestPlayerToEntity(this, 5) != null) || this.aggro > 300)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < -1+this.textureState/2; ++i)
|
for (int i = 0; i < -1+this.textureState/2; ++i)
|
||||||
{
|
{
|
||||||
entityPlayer.worldObj.spawnParticle("portal", entityPlayer.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, entityPlayer.posY + this.rand.nextDouble() * (double)entityPlayer.height - 0.75D, entityPlayer.posZ + (this.rand.nextDouble() - 0.5D) * (double)entityPlayer.width, (this.rand.nextDouble() - 0.5D) * 2.0D, -this.rand.nextDouble(), (this.rand.nextDouble() - 0.5D) * 2.0D);
|
entityPlayer.worldObj.spawnParticle("portal", entityPlayer.posX + (this.rand.nextDouble() - 0.5D) * this.width, entityPlayer.posY + this.rand.nextDouble() * entityPlayer.height - 0.75D, entityPlayer.posZ + (this.rand.nextDouble() - 0.5D) * entityPlayer.width, (this.rand.nextDouble() - 0.5D) * 2.0D, -this.rand.nextDouble(), (this.rand.nextDouble() - 0.5D) * 2.0D);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -201,34 +215,20 @@ public class MobMonolith extends EntityFlying implements IMob
|
|||||||
return par1EntityPlayer.canEntityBeSeen(this);
|
return par1EntityPlayer.canEntityBeSeen(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isCourseTraversable(double par1, double par3, double par5, double par7)
|
|
||||||
{
|
|
||||||
double d4 = (par1 - this.posX) / par7;
|
|
||||||
double d5 = (par3 - this.posY) / par7;
|
|
||||||
double d6 = (par5 - this.posZ) / par7;
|
|
||||||
AxisAlignedBB axisalignedbb = this.boundingBox.copy();
|
|
||||||
|
|
||||||
for (int i = 1; (double)i < par7; ++i)
|
|
||||||
{
|
|
||||||
axisalignedbb.offset(d4, d5, d6);
|
|
||||||
|
|
||||||
if (!this.worldObj.getCollidingBoundingBoxes(this, axisalignedbb).isEmpty())
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean attackEntityFrom(DamageSource par1DamageSource, int par2)
|
public boolean attackEntityFrom(DamageSource par1DamageSource, int par2)
|
||||||
{
|
{
|
||||||
if(!(par1DamageSource==DamageSource.inWall))
|
if(!(par1DamageSource == DamageSource.inWall))
|
||||||
{
|
{
|
||||||
this.aggro=400;
|
this.aggro=400;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.posY=posY+1;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void faceEntity(Entity par1Entity, float par2, float par3)
|
public void faceEntity(Entity par1Entity, float par2, float par3)
|
||||||
{
|
{
|
||||||
double d0 = par1Entity.posX - this.posX;
|
double d0 = par1Entity.posX - this.posX;
|
||||||
@@ -238,14 +238,14 @@ public class MobMonolith extends EntityFlying implements IMob
|
|||||||
if (par1Entity instanceof EntityLiving)
|
if (par1Entity instanceof EntityLiving)
|
||||||
{
|
{
|
||||||
EntityLiving entityliving = (EntityLiving)par1Entity;
|
EntityLiving entityliving = (EntityLiving)par1Entity;
|
||||||
d2 = entityliving.posY + (double)entityliving.getEyeHeight() - (this.posY + (double)this.getEyeHeight());
|
d2 = entityliving.posY + entityliving.getEyeHeight() - (this.posY + this.getEyeHeight());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
d2 = (par1Entity.boundingBox.minY + par1Entity.boundingBox.maxY) - (this.posY + (double)this.getEyeHeight());
|
d2 = (par1Entity.boundingBox.minY + par1Entity.boundingBox.maxY) - (this.posY + this.getEyeHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
double d3 = (double)MathHelper.sqrt_double(d0 * d0 + d1 * d1);
|
double d3 = MathHelper.sqrt_double(d0 * d0 + d1 * d1);
|
||||||
float f2 = (float)(Math.atan2(d1, d0) * 180.0D / Math.PI) - 90.0F;
|
float f2 = (float)(Math.atan2(d1, d0) * 180.0D / Math.PI) - 90.0F;
|
||||||
float f3 = (float)(-(Math.atan2(d2, d3) * 180.0D / Math.PI));
|
float f3 = (float)(-(Math.atan2(d2, d3) * 180.0D / Math.PI));
|
||||||
this.rotationPitch = f3;
|
this.rotationPitch = f3;
|
||||||
@@ -256,28 +256,13 @@ public class MobMonolith extends EntityFlying implements IMob
|
|||||||
this.renderYawOffset=this.rotationYaw;
|
this.renderYawOffset=this.rotationYaw;
|
||||||
}
|
}
|
||||||
|
|
||||||
private float updateRotation(float par1, float par2, float par3)
|
@Override
|
||||||
{
|
|
||||||
float f3 = MathHelper.wrapAngleTo180_float(par2 - par1);
|
|
||||||
|
|
||||||
if (f3 > par3)
|
|
||||||
{
|
|
||||||
f3 = par3;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (f3 < -par3)
|
|
||||||
{
|
|
||||||
f3 = -par3;
|
|
||||||
}
|
|
||||||
|
|
||||||
return par1 + f3;
|
|
||||||
}
|
|
||||||
|
|
||||||
public float getRotationYawHead()
|
public float getRotationYawHead()
|
||||||
{
|
{
|
||||||
return 0.0F;
|
return 0.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
|
public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
|
||||||
{
|
{
|
||||||
super.writeEntityToNBT(par1NBTTagCompound);
|
super.writeEntityToNBT(par1NBTTagCompound);
|
||||||
@@ -299,8 +284,10 @@ public class MobMonolith extends EntityFlying implements IMob
|
|||||||
this.scaleFactor = par1NBTTagCompound.getFloat("scaleFactor");
|
this.scaleFactor = par1NBTTagCompound.getFloat("scaleFactor");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean getCanSpawnHere()
|
public boolean getCanSpawnHere()
|
||||||
{
|
{
|
||||||
|
@SuppressWarnings("rawtypes")
|
||||||
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, AxisAlignedBB.getBoundingBox( this.posX-15, posY-4, this.posZ-15, this.posX+15, this.posY+15, this.posZ+15));
|
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, AxisAlignedBB.getBoundingBox( this.posX-15, posY-4, this.posZ-15, this.posX+15, this.posY+15, this.posZ+15));
|
||||||
|
|
||||||
if(this.worldObj.provider.dimensionId==DDProperties.instance().LimboDimensionID)
|
if(this.worldObj.provider.dimensionId==DDProperties.instance().LimboDimensionID)
|
||||||
@@ -313,11 +300,19 @@ public class MobMonolith extends EntityFlying implements IMob
|
|||||||
}
|
}
|
||||||
else if(this.worldObj.provider instanceof PocketProvider)
|
else if(this.worldObj.provider instanceof PocketProvider)
|
||||||
{
|
{
|
||||||
if(list.size()>5||this.worldObj.canBlockSeeTheSky((int)this.posX, (int)this.posY, (int)this.posZ))
|
if (list.size() > 5 ||
|
||||||
|
this.worldObj.canBlockSeeTheSky((int)this.posX, (int)this.posY, (int)this.posZ))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox);
|
return this.worldObj.checkNoEntityCollision(this.boundingBox) &&
|
||||||
|
this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() &&
|
||||||
|
!this.worldObj.isAnyLiquid(this.boundingBox);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataWatcher getDataWatcher()
|
||||||
|
{
|
||||||
|
return this.dataWatcher;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -25,6 +25,7 @@ public class RiftRegenerator implements IRegularTickReceiver {
|
|||||||
regenerateRiftsInAllWorlds();
|
regenerateRiftsInAllWorlds();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public static void regenerateRiftsInAllWorlds()
|
public static void regenerateRiftsInAllWorlds()
|
||||||
{
|
{
|
||||||
//Regenerate rifts that have been replaced (not permanently removed) by players
|
//Regenerate rifts that have been replaced (not permanently removed) by players
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
package StevenDimDoors.mod_pocketDim.tileentities;
|
package StevenDimDoors.mod_pocketDim.tileentities;
|
||||||
|
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
|
||||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class TileEntityDimDoor extends TileEntity
|
public class TileEntityDimDoor extends TileEntity
|
||||||
|
|
||||||
{
|
{
|
||||||
public boolean openOrClosed;
|
public boolean openOrClosed;
|
||||||
public int orientation;
|
public int orientation;
|
||||||
@@ -15,45 +11,31 @@ public class TileEntityDimDoor extends TileEntity
|
|||||||
public boolean isDungeonChainLink;
|
public boolean isDungeonChainLink;
|
||||||
public boolean hasGennedPair=false;
|
public boolean hasGennedPair=false;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public boolean canUpdate()
|
public boolean canUpdate()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateEntity()
|
@Override
|
||||||
{
|
public void updateEntity() { }
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readFromNBT(NBTTagCompound nbt)
|
public void readFromNBT(NBTTagCompound nbt)
|
||||||
{
|
{
|
||||||
super.readFromNBT(nbt);
|
super.readFromNBT(nbt);
|
||||||
|
@SuppressWarnings("unused") // ???
|
||||||
int i = nbt.getInteger(("Size"));
|
int i = nbt.getInteger(("Size"));
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
this.openOrClosed = nbt.getBoolean("openOrClosed");
|
this.openOrClosed = nbt.getBoolean("openOrClosed");
|
||||||
|
|
||||||
this.orientation = nbt.getInteger("orientation");
|
this.orientation = nbt.getInteger("orientation");
|
||||||
|
|
||||||
this.hasExit = nbt.getBoolean("hasExit");
|
this.hasExit = nbt.getBoolean("hasExit");
|
||||||
|
|
||||||
this.isDungeonChainLink = nbt.getBoolean("isDungeonChainLink");
|
this.isDungeonChainLink = nbt.getBoolean("isDungeonChainLink");
|
||||||
|
|
||||||
this.hasGennedPair = nbt.getBoolean("hasGennedPair");
|
this.hasGennedPair = nbt.getBoolean("hasGennedPair");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e) // ???
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -62,17 +44,14 @@ public class TileEntityDimDoor extends TileEntity
|
|||||||
@Override
|
@Override
|
||||||
public void writeToNBT(NBTTagCompound nbt)
|
public void writeToNBT(NBTTagCompound nbt)
|
||||||
{
|
{
|
||||||
|
@SuppressWarnings("unused") // ?????
|
||||||
int i = 0;
|
int i = 0;
|
||||||
super.writeToNBT(nbt);
|
super.writeToNBT(nbt);
|
||||||
|
|
||||||
nbt.setBoolean("openOrClosed", this.openOrClosed);
|
nbt.setBoolean("openOrClosed", this.openOrClosed);
|
||||||
|
|
||||||
nbt.setBoolean("hasExit", this.hasExit);
|
nbt.setBoolean("hasExit", this.hasExit);
|
||||||
|
|
||||||
nbt.setInteger("orientation", this.orientation);
|
nbt.setInteger("orientation", this.orientation);
|
||||||
|
|
||||||
nbt.setBoolean("isDungeonChainLink", isDungeonChainLink);
|
nbt.setBoolean("isDungeonChainLink", isDungeonChainLink);
|
||||||
|
|
||||||
nbt.setBoolean("hasGennedPair", hasGennedPair);
|
nbt.setBoolean("hasGennedPair", hasGennedPair);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
package StevenDimDoors.mod_pocketDim.tileentities;
|
package StevenDimDoors.mod_pocketDim.tileentities;
|
||||||
|
|
||||||
|
import java.awt.List;
|
||||||
|
|
||||||
import StevenDimDoors.mod_pocketDim.IChunkLoader;
|
import StevenDimDoors.mod_pocketDim.IChunkLoader;
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||||
|
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||||
import StevenDimDoors.mod_pocketDim.util.Point4D;
|
import StevenDimDoors.mod_pocketDim.util.Point4D;
|
||||||
import StevenDimDoors.mod_pocketDim.world.PocketBuilder;
|
import StevenDimDoors.mod_pocketDim.world.PocketBuilder;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.world.ChunkCoordIntPair;
|
import net.minecraft.world.ChunkCoordIntPair;
|
||||||
import net.minecraftforge.common.ForgeChunkManager;
|
import net.minecraftforge.common.ForgeChunkManager;
|
||||||
@@ -13,9 +17,9 @@ import net.minecraftforge.common.ForgeChunkManager.Type;
|
|||||||
|
|
||||||
public class TileEntityDimDoorGold extends TileEntityDimDoor implements IChunkLoader
|
public class TileEntityDimDoorGold extends TileEntityDimDoor implements IChunkLoader
|
||||||
{
|
{
|
||||||
|
|
||||||
private Ticket chunkTicket;
|
private Ticket chunkTicket;
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean canUpdate()
|
public boolean canUpdate()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
@@ -34,11 +38,11 @@ public class TileEntityDimDoorGold extends TileEntityDimDoor implements IChunkLo
|
|||||||
}
|
}
|
||||||
if (this.chunkTicket == null)
|
if (this.chunkTicket == null)
|
||||||
{
|
{
|
||||||
|
chunkTicket = ForgeChunkManager.requestTicket(mod_pocketDim.instance, worldObj, Type.NORMAL);
|
||||||
if(chunkTicket == null)
|
if(chunkTicket == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
chunkTicket = ForgeChunkManager.requestTicket(mod_pocketDim.instance, worldObj, Type.NORMAL);
|
|
||||||
chunkTicket.getModData().setInteger("goldDimDoorX", xCoord);
|
chunkTicket.getModData().setInteger("goldDimDoorX", xCoord);
|
||||||
chunkTicket.getModData().setInteger("goldDimDoorY", yCoord);
|
chunkTicket.getModData().setInteger("goldDimDoorY", yCoord);
|
||||||
chunkTicket.getModData().setInteger("goldDimDoorZ", zCoord);
|
chunkTicket.getModData().setInteger("goldDimDoorZ", zCoord);
|
||||||
@@ -86,8 +90,6 @@ public class TileEntityDimDoorGold extends TileEntityDimDoor implements IChunkLo
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void invalidate()
|
public void invalidate()
|
||||||
{
|
{
|
||||||
@@ -95,29 +97,21 @@ public class TileEntityDimDoorGold extends TileEntityDimDoor implements IChunkLo
|
|||||||
super.invalidate();
|
super.invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readFromNBT(NBTTagCompound nbt)
|
public void readFromNBT(NBTTagCompound nbt)
|
||||||
{
|
{ // this and write both call user, and super saves/reads all the same data. why override at all?
|
||||||
super.readFromNBT(nbt);
|
super.readFromNBT(nbt);
|
||||||
|
@SuppressWarnings("unused") // ???
|
||||||
int i = nbt.getInteger(("Size"));
|
int i = nbt.getInteger(("Size"));
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
this.openOrClosed = nbt.getBoolean("openOrClosed");
|
this.openOrClosed = nbt.getBoolean("openOrClosed");
|
||||||
|
|
||||||
this.orientation = nbt.getInteger("orientation");
|
this.orientation = nbt.getInteger("orientation");
|
||||||
|
|
||||||
this.hasExit = nbt.getBoolean("hasExit");
|
this.hasExit = nbt.getBoolean("hasExit");
|
||||||
|
|
||||||
this.isDungeonChainLink = nbt.getBoolean("isDungeonChainLink");
|
this.isDungeonChainLink = nbt.getBoolean("isDungeonChainLink");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e) // ???
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -126,16 +120,13 @@ public class TileEntityDimDoorGold extends TileEntityDimDoor implements IChunkLo
|
|||||||
@Override
|
@Override
|
||||||
public void writeToNBT(NBTTagCompound nbt)
|
public void writeToNBT(NBTTagCompound nbt)
|
||||||
{
|
{
|
||||||
|
@SuppressWarnings("unused") // ?????
|
||||||
int i = 0;
|
int i = 0;
|
||||||
super.writeToNBT(nbt);
|
super.writeToNBT(nbt);
|
||||||
|
|
||||||
nbt.setBoolean("openOrClosed", this.openOrClosed);
|
nbt.setBoolean("openOrClosed", this.openOrClosed);
|
||||||
|
|
||||||
nbt.setBoolean("hasExit", this.hasExit);
|
nbt.setBoolean("hasExit", this.hasExit);
|
||||||
|
|
||||||
nbt.setInteger("orientation", this.orientation);
|
nbt.setInteger("orientation", this.orientation);
|
||||||
|
|
||||||
nbt.setBoolean("isDungeonChainLink", isDungeonChainLink);
|
nbt.setBoolean("isDungeonChainLink", isDungeonChainLink);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,10 +38,12 @@ public class TileEntityRift extends TileEntity
|
|||||||
public int age = 0;
|
public int age = 0;
|
||||||
|
|
||||||
public HashMap<Integer, double[]> renderingCenters = new HashMap<Integer, double[]>();
|
public HashMap<Integer, double[]> renderingCenters = new HashMap<Integer, double[]>();
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public DimLink nearestRiftData;
|
public DimLink nearestRiftData;
|
||||||
public int spawnedEndermenID=0;
|
public int spawnedEndermenID=0;
|
||||||
DataWatcher watcher = new DataWatcher();
|
DataWatcher watcher = new DataWatcher();
|
||||||
|
|
||||||
|
@Override
|
||||||
public void updateEntity()
|
public void updateEntity()
|
||||||
{
|
{
|
||||||
//Invalidate this tile entity if it shouldn't exist
|
//Invalidate this tile entity if it shouldn't exist
|
||||||
@@ -92,6 +94,7 @@ public class TileEntityRift extends TileEntity
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean canUpdate()
|
public boolean canUpdate()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
@@ -143,7 +146,7 @@ public class TileEntityRift extends TileEntity
|
|||||||
if (random.nextInt(30) == 0)
|
if (random.nextInt(30) == 0)
|
||||||
{
|
{
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
List<Entity> list = (List<Entity>) worldObj.getEntitiesWithinAABB(EntityEnderman.class,
|
List<Entity> list = worldObj.getEntitiesWithinAABB(EntityEnderman.class,
|
||||||
AxisAlignedBB.getBoundingBox(xCoord - 9, yCoord - 3, zCoord - 9, xCoord + 9, yCoord + 3, zCoord + 9));
|
AxisAlignedBB.getBoundingBox(xCoord - 9, yCoord - 3, zCoord - 9, xCoord + 9, yCoord + 3, zCoord + 9));
|
||||||
|
|
||||||
if (list.isEmpty())
|
if (list.isEmpty())
|
||||||
@@ -182,8 +185,11 @@ public class TileEntityRift extends TileEntity
|
|||||||
this.invalidate();
|
this.invalidate();
|
||||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||||
if (dimension.getLink(xCoord, yCoord, zCoord) != null)
|
if (dimension.getLink(xCoord, yCoord, zCoord) != null)
|
||||||
|
{
|
||||||
|
if(!this.worldObj.isRemote)
|
||||||
{
|
{
|
||||||
dimension.deleteLink(xCoord, yCoord, zCoord);
|
dimension.deleteLink(xCoord, yCoord, zCoord);
|
||||||
|
}
|
||||||
worldObj.playSound(xCoord, yCoord, zCoord, "mods.DimDoors.sfx.riftClose", (float) .7, 1, true);
|
worldObj.playSound(xCoord, yCoord, zCoord, "mods.DimDoors.sfx.riftClose", (float) .7, 1, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
package StevenDimDoors.mod_pocketDim.tileentities;
|
package StevenDimDoors.mod_pocketDim.tileentities;
|
||||||
|
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
|
||||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class TileEntityTransTrapdoor extends TileEntity
|
public class TileEntityTransTrapdoor extends TileEntity
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ package StevenDimDoors.mod_pocketDim.util;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
|
||||||
@@ -21,14 +21,17 @@ public abstract class BaseConfigurationProcessor<T>
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public T readFromFile(String path) throws FileNotFoundException, ConfigurationProcessingException
|
public T readFromFile(String path) throws ConfigurationProcessingException, IOException
|
||||||
{
|
{
|
||||||
return readFromFile(new File(path));
|
return readFromFile(new File(path));
|
||||||
}
|
}
|
||||||
|
|
||||||
public T readFromFile(File file) throws FileNotFoundException, ConfigurationProcessingException
|
public T readFromFile(File file) throws ConfigurationProcessingException, IOException
|
||||||
{
|
{
|
||||||
return readFromStream(new FileInputStream(file));
|
FileInputStream t = new FileInputStream(file);
|
||||||
|
T ret = readFromStream(t);
|
||||||
|
t.close();
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public T readFromResource(String resourcePath) throws ConfigurationProcessingException
|
public T readFromResource(String resourcePath) throws ConfigurationProcessingException
|
||||||
@@ -38,12 +41,14 @@ public abstract class BaseConfigurationProcessor<T>
|
|||||||
|
|
||||||
public abstract T readFromStream(InputStream inputStream) throws ConfigurationProcessingException;
|
public abstract T readFromStream(InputStream inputStream) throws ConfigurationProcessingException;
|
||||||
|
|
||||||
public void writeToFile(File file, T data) throws FileNotFoundException, ConfigurationProcessingException
|
public void writeToFile(File file, T data) throws ConfigurationProcessingException, IOException
|
||||||
{
|
{
|
||||||
writeToStream(new FileOutputStream(file), data);
|
FileOutputStream t = new FileOutputStream(file);
|
||||||
|
writeToStream(t, data);
|
||||||
|
t.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void writeToFile(String path, T data) throws FileNotFoundException, ConfigurationProcessingException
|
public void writeToFile(String path, T data) throws ConfigurationProcessingException, IOException
|
||||||
{
|
{
|
||||||
writeToFile(new File(path), data);
|
writeToFile(new File(path), data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ public class WeightedContainer<T> extends WeightedRandomItem {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public WeightedContainer<T> clone()
|
public WeightedContainer<T> clone()
|
||||||
{
|
{
|
||||||
return new WeightedContainer<T>(data, itemWeight);
|
return new WeightedContainer<T>(data, itemWeight);
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ public class BiomeGenLimbo extends BiomeGenBase
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public float getSpawningChance()
|
public float getSpawningChance()
|
||||||
{
|
{
|
||||||
return 0.00001F;
|
return 0.00001F;
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ public class CustomCaveGen extends MapGenBase
|
|||||||
*/
|
*/
|
||||||
protected void generateCaveNode(long par1, int par3, int par4, byte[] par5ArrayOfByte, double par6, double par8, double par10, float par12, float par13, float par14, int par15, int par16, double par17)
|
protected void generateCaveNode(long par1, int par3, int par4, byte[] par5ArrayOfByte, double par6, double par8, double par10, float par12, float par13, float par14, int par15, int par16, double par17)
|
||||||
{
|
{
|
||||||
double var19 = (double)(par3 * 16 + 8);
|
double var19 = par3 * 16 + 8;
|
||||||
double var21 = (double)(par4 * 16 + 8);
|
double var21 = par4 * 16 + 8;
|
||||||
float var23 = 0.0F;
|
float var23 = 0.0F;
|
||||||
float var24 = 0.0F;
|
float var24 = 0.0F;
|
||||||
Random var25 = new Random(par1);
|
Random var25 = new Random(par1);
|
||||||
@@ -55,13 +55,13 @@ public class CustomCaveGen extends MapGenBase
|
|||||||
|
|
||||||
for (boolean var28 = var25.nextInt(6) == 0; par15 < par16; ++par15)
|
for (boolean var28 = var25.nextInt(6) == 0; par15 < par16; ++par15)
|
||||||
{
|
{
|
||||||
double var29 = 1.5D + (double)(MathHelper.sin((float)par15 * (float)Math.PI / (float)par16) * par12 * 1.0F);
|
double var29 = 1.5D + MathHelper.sin(par15 * (float)Math.PI / par16) * par12 * 1.0F;
|
||||||
double var31 = var29 * par17;
|
double var31 = var29 * par17;
|
||||||
float var33 = MathHelper.cos(par14);
|
float var33 = MathHelper.cos(par14);
|
||||||
float var34 = MathHelper.sin(par14);
|
float var34 = MathHelper.sin(par14);
|
||||||
par6 += (double)(MathHelper.cos(par13) * var33);
|
par6 += MathHelper.cos(par13) * var33;
|
||||||
par8 += (double)var34;
|
par8 += var34;
|
||||||
par10 += (double)(MathHelper.sin(par13) * var33);
|
par10 += MathHelper.sin(par13) * var33;
|
||||||
|
|
||||||
if (var28)
|
if (var28)
|
||||||
{
|
{
|
||||||
@@ -90,8 +90,8 @@ public class CustomCaveGen extends MapGenBase
|
|||||||
{
|
{
|
||||||
double var35 = par6 - var19;
|
double var35 = par6 - var19;
|
||||||
double var37 = par10 - var21;
|
double var37 = par10 - var21;
|
||||||
double var39 = (double)(par16 - par15);
|
double var39 = par16 - par15;
|
||||||
double var41 = (double)(par12 + 2.0F + 16.0F);
|
double var41 = par12 + 2.0F + 16.0F;
|
||||||
|
|
||||||
if (var35 * var35 + var37 * var37 - var39 * var39 > var41 * var41)
|
if (var35 * var35 + var37 * var37 - var39 * var39 > var41 * var41)
|
||||||
{
|
{
|
||||||
@@ -169,11 +169,11 @@ public class CustomCaveGen extends MapGenBase
|
|||||||
{
|
{
|
||||||
for (var42 = var55; var42 < var36; ++var42)
|
for (var42 = var55; var42 < var36; ++var42)
|
||||||
{
|
{
|
||||||
double var59 = ((double)(var42 + par3 * 16) + 0.5D - par6) / var29;
|
double var59 = (var42 + par3 * 16 + 0.5D - par6) / var29;
|
||||||
|
|
||||||
for (var45 = var56; var45 < var40; ++var45)
|
for (var45 = var56; var45 < var40; ++var45)
|
||||||
{
|
{
|
||||||
double var46 = ((double)(var45 + par4 * 16) + 0.5D - par10) / var29;
|
double var46 = (var45 + par4 * 16 + 0.5D - par10) / var29;
|
||||||
int var48 = (var42 * 16 + var45) * 128 + var38;
|
int var48 = (var42 * 16 + var45) * 128 + var38;
|
||||||
boolean var49 = false;
|
boolean var49 = false;
|
||||||
|
|
||||||
@@ -181,7 +181,7 @@ public class CustomCaveGen extends MapGenBase
|
|||||||
{
|
{
|
||||||
for (int var50 = var38 - 1; var50 >= var57; --var50)
|
for (int var50 = var38 - 1; var50 >= var57; --var50)
|
||||||
{
|
{
|
||||||
double var51 = ((double)var50 + 0.5D - par8) / var31;
|
double var51 = (var50 + 0.5D - par8) / var31;
|
||||||
|
|
||||||
if (var51 > -0.7D && var59 * var59 + var51 * var51 + var46 * var46 < 1.0D)
|
if (var51 > -0.7D && var59 * var59 + var51 * var51 + var46 * var46 < 1.0D)
|
||||||
{
|
{
|
||||||
@@ -229,6 +229,7 @@ public class CustomCaveGen extends MapGenBase
|
|||||||
/**
|
/**
|
||||||
* Recursively called by generate() (generate) and optionally by itself.
|
* Recursively called by generate() (generate) and optionally by itself.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
protected void recursiveGenerate(World par1World, int par2, int par3, int par4, int par5, byte[] par6ArrayOfByte)
|
protected void recursiveGenerate(World par1World, int par2, int par3, int par4, int par5, byte[] par6ArrayOfByte)
|
||||||
{
|
{
|
||||||
int var7 = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(40) + 1) + 1);
|
int var7 = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(40) + 1) + 1);
|
||||||
@@ -240,9 +241,9 @@ public class CustomCaveGen extends MapGenBase
|
|||||||
|
|
||||||
for (int var8 = 0; var8 < var7; ++var8)
|
for (int var8 = 0; var8 < var7; ++var8)
|
||||||
{
|
{
|
||||||
double var9 = (double)(par2 * 16 + this.rand.nextInt(16));
|
double var9 = par2 * 16 + this.rand.nextInt(16);
|
||||||
double var11 = (double)this.rand.nextInt(this.rand.nextInt(120) + 8);
|
double var11 = this.rand.nextInt(this.rand.nextInt(120) + 8);
|
||||||
double var13 = (double)(par3 * 16 + this.rand.nextInt(16));
|
double var13 = par3 * 16 + this.rand.nextInt(16);
|
||||||
int var15 = 1;
|
int var15 = 1;
|
||||||
|
|
||||||
if (this.rand.nextInt(4) == 0)
|
if (this.rand.nextInt(4) == 0)
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package StevenDimDoors.mod_pocketDim.world;
|
package StevenDimDoors.mod_pocketDim.world;
|
||||||
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
@@ -9,6 +8,7 @@ import net.minecraft.client.renderer.GLAllocation;
|
|||||||
import net.minecraft.client.renderer.RenderHelper;
|
import net.minecraft.client.renderer.RenderHelper;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.Vec3;
|
import net.minecraft.util.Vec3;
|
||||||
import net.minecraftforge.client.IRenderHandler;
|
import net.minecraftforge.client.IRenderHandler;
|
||||||
|
|
||||||
@@ -18,14 +18,15 @@ public class CustomSkyProvider extends IRenderHandler
|
|||||||
int starGLCallList;
|
int starGLCallList;
|
||||||
int glSkyList;
|
int glSkyList;
|
||||||
int glSkyList2;
|
int glSkyList2;
|
||||||
|
private static final ResourceLocation locationEndSkyPng = new ResourceLocation("textures/environment/end_sky.png");
|
||||||
|
|
||||||
|
|
||||||
public String getMoonRenderPath()
|
public ResourceLocation getMoonRenderPath()
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSunRenderPath()
|
public ResourceLocation getSunRenderPath()
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -44,8 +45,7 @@ public class CustomSkyProvider extends IRenderHandler
|
|||||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||||
RenderHelper.disableStandardItemLighting();
|
RenderHelper.disableStandardItemLighting();
|
||||||
GL11.glDepthMask(false);
|
GL11.glDepthMask(false);
|
||||||
mc.renderEngine.bindTexture(new ResourceLocation("/misc/tunnel.png"));
|
mc.renderEngine.bindTexture((locationEndSkyPng));
|
||||||
Tessellator tessellator = Tessellator.instance;
|
|
||||||
|
|
||||||
if (mc.theWorld.provider.isSurfaceWorld())
|
if (mc.theWorld.provider.isSurfaceWorld())
|
||||||
{
|
{
|
||||||
@@ -114,10 +114,10 @@ public class CustomSkyProvider extends IRenderHandler
|
|||||||
|
|
||||||
for (int j = 0; j <= b0; ++j)
|
for (int j = 0; j <= b0; ++j)
|
||||||
{
|
{
|
||||||
f11 = (float)j * (float)Math.PI * 2.0F / (float)b0;
|
f11 = j * (float)Math.PI * 2.0F / b0;
|
||||||
float f12 = MathHelper.sin(f11);
|
float f12 = MathHelper.sin(f11);
|
||||||
float f13 = MathHelper.cos(f11);
|
float f13 = MathHelper.cos(f11);
|
||||||
tessellator1.addVertex((double)(f12 * 120.0F), (double)(f13 * 120.0F), (double)(-f13 * 40.0F * afloat[3]));
|
tessellator1.addVertex(f12 * 120.0F, f13 * 120.0F, -f13 * 40.0F * afloat[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
tessellator1.draw();
|
tessellator1.draw();
|
||||||
@@ -137,27 +137,27 @@ public class CustomSkyProvider extends IRenderHandler
|
|||||||
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
|
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
|
||||||
GL11.glRotatef(world.getCelestialAngle(par1) * 360.0F, 1.0F, 0.0F, 0.0F);
|
GL11.glRotatef(world.getCelestialAngle(par1) * 360.0F, 1.0F, 0.0F, 0.0F);
|
||||||
f10 = 30.0F;
|
f10 = 30.0F;
|
||||||
mc.renderEngine.bindTexture(new ResourceLocation(this.getSunRenderPath()));
|
mc.renderEngine.bindTexture(this.getSunRenderPath());
|
||||||
tessellator1.startDrawingQuads();
|
tessellator1.startDrawingQuads();
|
||||||
tessellator1.addVertexWithUV((double)(-f10), 100.0D, (double)(-f10), 0.0D, 0.0D);
|
tessellator1.addVertexWithUV((-f10), 100.0D, (-f10), 0.0D, 0.0D);
|
||||||
tessellator1.addVertexWithUV((double)f10, 100.0D, (double)(-f10), 1.0D, 0.0D);
|
tessellator1.addVertexWithUV(f10, 100.0D, (-f10), 1.0D, 0.0D);
|
||||||
tessellator1.addVertexWithUV((double)f10, 100.0D, (double)f10, 1.0D, 1.0D);
|
tessellator1.addVertexWithUV(f10, 100.0D, f10, 1.0D, 1.0D);
|
||||||
tessellator1.addVertexWithUV((double)(-f10), 100.0D, (double)f10, 0.0D, 1.0D);
|
tessellator1.addVertexWithUV((-f10), 100.0D, f10, 0.0D, 1.0D);
|
||||||
tessellator1.draw();
|
tessellator1.draw();
|
||||||
f10 = 20.0F;
|
f10 = 20.0F;
|
||||||
mc.renderEngine.bindTexture(new ResourceLocation(this.getMoonRenderPath()));
|
mc.renderEngine.bindTexture(this.getMoonRenderPath());
|
||||||
int k = world.getMoonPhase();
|
int k = world.getMoonPhase();
|
||||||
int l = k % 4;
|
int l = k % 4;
|
||||||
int i1 = k / 4 % 2;
|
int i1 = k / 4 % 2;
|
||||||
float f14 = (float)(l + 0) ;
|
float f14 = l + 0 ;
|
||||||
float f15 = (float)(i1 + 0);
|
float f15 = i1 + 0;
|
||||||
float f16 = (float)(l + 1) ;
|
float f16 = l + 1 ;
|
||||||
float f17 = (float)(i1 + 1);
|
float f17 = i1 + 1;
|
||||||
tessellator1.startDrawingQuads();
|
tessellator1.startDrawingQuads();
|
||||||
tessellator1.addVertexWithUV((double)(-f10), -100.0D, (double)f10, (double)f16, (double)f17);
|
tessellator1.addVertexWithUV((-f10), -100.0D, f10, f16, f17);
|
||||||
tessellator1.addVertexWithUV((double)f10, -100.0D, (double)f10, (double)f14, (double)f17);
|
tessellator1.addVertexWithUV(f10, -100.0D, f10, f14, f17);
|
||||||
tessellator1.addVertexWithUV((double)f10, -100.0D, (double)(-f10), (double)f14, (double)f15);
|
tessellator1.addVertexWithUV(f10, -100.0D, (-f10), f14, f15);
|
||||||
tessellator1.addVertexWithUV((double)(-f10), -100.0D, (double)(-f10), (double)f16, (double)f15);
|
tessellator1.addVertexWithUV((-f10), -100.0D, (-f10), f16, f15);
|
||||||
tessellator1.draw();
|
tessellator1.draw();
|
||||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||||
float f18 = world.getStarBrightness(par1) * f4;
|
float f18 = world.getStarBrightness(par1) * f4;
|
||||||
@@ -188,26 +188,26 @@ public class CustomSkyProvider extends IRenderHandler
|
|||||||
f10 = -f8;
|
f10 = -f8;
|
||||||
tessellator1.startDrawingQuads();
|
tessellator1.startDrawingQuads();
|
||||||
tessellator1.setColorRGBA_I(0, 255);
|
tessellator1.setColorRGBA_I(0, 255);
|
||||||
tessellator1.addVertex((double)(-f8), (double)f9, (double)f8);
|
tessellator1.addVertex((-f8), f9, f8);
|
||||||
tessellator1.addVertex((double)f8, (double)f9, (double)f8);
|
tessellator1.addVertex(f8, f9, f8);
|
||||||
tessellator1.addVertex((double)f8, (double)f10, (double)f8);
|
tessellator1.addVertex(f8, f10, f8);
|
||||||
tessellator1.addVertex((double)(-f8), (double)f10, (double)f8);
|
tessellator1.addVertex((-f8), f10, f8);
|
||||||
tessellator1.addVertex((double)(-f8), (double)f10, (double)(-f8));
|
tessellator1.addVertex((-f8), f10, (-f8));
|
||||||
tessellator1.addVertex((double)f8, (double)f10, (double)(-f8));
|
tessellator1.addVertex(f8, f10, (-f8));
|
||||||
tessellator1.addVertex((double)f8, (double)f9, (double)(-f8));
|
tessellator1.addVertex(f8, f9, (-f8));
|
||||||
tessellator1.addVertex((double)(-f8), (double)f9, (double)(-f8));
|
tessellator1.addVertex((-f8), f9, (-f8));
|
||||||
tessellator1.addVertex((double)f8, (double)f10, (double)(-f8));
|
tessellator1.addVertex(f8, f10, (-f8));
|
||||||
tessellator1.addVertex((double)f8, (double)f10, (double)f8);
|
tessellator1.addVertex(f8, f10, f8);
|
||||||
tessellator1.addVertex((double)f8, (double)f9, (double)f8);
|
tessellator1.addVertex(f8, f9, f8);
|
||||||
tessellator1.addVertex((double)f8, (double)f9, (double)(-f8));
|
tessellator1.addVertex(f8, f9, (-f8));
|
||||||
tessellator1.addVertex((double)(-f8), (double)f9, (double)(-f8));
|
tessellator1.addVertex((-f8), f9, (-f8));
|
||||||
tessellator1.addVertex((double)(-f8), (double)f9, (double)f8);
|
tessellator1.addVertex((-f8), f9, f8);
|
||||||
tessellator1.addVertex((double)(-f8), (double)f10, (double)f8);
|
tessellator1.addVertex((-f8), f10, f8);
|
||||||
tessellator1.addVertex((double)(-f8), (double)f10, (double)(-f8));
|
tessellator1.addVertex((-f8), f10, (-f8));
|
||||||
tessellator1.addVertex((double)(-f8), (double)f10, (double)(-f8));
|
tessellator1.addVertex((-f8), f10, (-f8));
|
||||||
tessellator1.addVertex((double)(-f8), (double)f10, (double)f8);
|
tessellator1.addVertex((-f8), f10, f8);
|
||||||
tessellator1.addVertex((double)f8, (double)f10, (double)f8);
|
tessellator1.addVertex(f8, f10, f8);
|
||||||
tessellator1.addVertex((double)f8, (double)f10, (double)(-f8));
|
tessellator1.addVertex(f8, f10, (-f8));
|
||||||
tessellator1.draw();
|
tessellator1.draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ public class GatewayGenerator implements IWorldGenerator
|
|||||||
int attempts;
|
int attempts;
|
||||||
int correction;
|
int correction;
|
||||||
boolean valid;
|
boolean valid;
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
DimLink link;
|
DimLink link;
|
||||||
NewDimData dimension;
|
NewDimData dimension;
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import net.minecraftforge.event.terraingen.ChunkProviderEvent;
|
|||||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||||
import StevenDimDoors.mod_pocketDim.ticking.MonolithSpawner;
|
import StevenDimDoors.mod_pocketDim.ticking.MonolithSpawner;
|
||||||
|
|
||||||
public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvider
|
public class LimboGenerator extends ChunkProviderGenerate
|
||||||
{
|
{
|
||||||
private static Random rand;
|
private static Random rand;
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvi
|
|||||||
public Chunk provideChunk(int chunkX, int chunkZ)
|
public Chunk provideChunk(int chunkX, int chunkZ)
|
||||||
{
|
{
|
||||||
//TODO: Wtf? Why do you reinitialize the seed when we already initialized it in the constructor?! ~SenseiKiwi
|
//TODO: Wtf? Why do you reinitialize the seed when we already initialized it in the constructor?! ~SenseiKiwi
|
||||||
LimboGenerator.rand.setSeed((long) chunkX * 341873128712L + (long) chunkZ * 132897987541L);
|
LimboGenerator.rand.setSeed(chunkX * 341873128712L + chunkZ * 132897987541L);
|
||||||
byte[] var3 = new byte[32768];
|
byte[] var3 = new byte[32768];
|
||||||
this.generateTerrain(chunkX, chunkZ, var3);
|
this.generateTerrain(chunkX, chunkZ, var3);
|
||||||
Chunk var4 = new Chunk(this.worldObj, var3, chunkX, chunkZ);
|
Chunk var4 = new Chunk(this.worldObj, var3, chunkX, chunkZ);
|
||||||
@@ -178,7 +178,7 @@ public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvi
|
|||||||
{
|
{
|
||||||
for (int var9 = -2; var9 <= 2; ++var9)
|
for (int var9 = -2; var9 <= 2; ++var9)
|
||||||
{
|
{
|
||||||
float var10 = 10.0F / MathHelper.sqrt_float((float)(var8 * var8 + var9 * var9) + 0.2F);
|
float var10 = 10.0F / MathHelper.sqrt_float(var8 * var8 + var9 * var9 + 0.2F);
|
||||||
this.parabolicField[var8 + 2 + (var9 + 2) * 5] = var10;
|
this.parabolicField[var8 + 2 + (var9 + 2) * 5] = var10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -191,8 +191,7 @@ public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvi
|
|||||||
this.noise3 = this.noiseGen3.generateNoiseOctaves(this.noise3, par2, par3, par4, par5, par6, par7, var44 / 80.0D, var45 / 160.0D, var44 / 80.0D);
|
this.noise3 = this.noiseGen3.generateNoiseOctaves(this.noise3, par2, par3, par4, par5, par6, par7, var44 / 80.0D, var45 / 160.0D, var44 / 80.0D);
|
||||||
this.noise1 = this.noiseGen1.generateNoiseOctaves(this.noise1, par2, par3, par4, par5, par6, par7, var44, var45, var44);
|
this.noise1 = this.noiseGen1.generateNoiseOctaves(this.noise1, par2, par3, par4, par5, par6, par7, var44, var45, var44);
|
||||||
this.noise2 = this.noiseGen2.generateNoiseOctaves(this.noise2, par2, par3, par4, par5, par6, par7, var44, var45, var44);
|
this.noise2 = this.noiseGen2.generateNoiseOctaves(this.noise2, par2, par3, par4, par5, par6, par7, var44, var45, var44);
|
||||||
boolean var43 = false;
|
|
||||||
boolean var42 = false;
|
|
||||||
int var12 = 0;
|
int var12 = 0;
|
||||||
int var13 = 0;
|
int var13 = 0;
|
||||||
|
|
||||||
@@ -204,7 +203,6 @@ public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvi
|
|||||||
float var17 = 0.0F;
|
float var17 = 0.0F;
|
||||||
float var18 = 0.0F;
|
float var18 = 0.0F;
|
||||||
byte var19 = 2;
|
byte var19 = 2;
|
||||||
BiomeGenBase var20 = this.biomesForGeneration[var14 + 2 + (var15 + 2) * (par5 + 5)];
|
|
||||||
|
|
||||||
for (int var21 = -var19; var21 <= var19; ++var21)
|
for (int var21 = -var19; var21 <= var19; ++var21)
|
||||||
{
|
{
|
||||||
@@ -260,13 +258,13 @@ public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvi
|
|||||||
|
|
||||||
for (int var46 = 0; var46 < par6; ++var46)
|
for (int var46 = 0; var46 < par6; ++var46)
|
||||||
{
|
{
|
||||||
double var48 = (double)var17;
|
double var48 = var17;
|
||||||
double var26 = (double)var16;
|
double var26 = var16;
|
||||||
var48 += var47 * 0.2D;
|
var48 += var47 * 0.2D;
|
||||||
var48 = var48 * (double)par6 / 16.0D;
|
var48 = var48 * par6 / 16.0D;
|
||||||
double var28 = (double)par6 / 2.0D + var48 * 4.0D;
|
double var28 = par6 / 2.0D + var48 * 4.0D;
|
||||||
double var30 = 0.0D;
|
double var30 = 0.0D;
|
||||||
double var32 = ((double)var46 - var28) * 12.0D * 128.0D / 128.0D / var26;
|
double var32 = (var46 - var28) * 12.0D * 128.0D / 128.0D / var26;
|
||||||
|
|
||||||
if (var32 < 0.0D)
|
if (var32 < 0.0D)
|
||||||
{
|
{
|
||||||
@@ -294,7 +292,7 @@ public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvi
|
|||||||
|
|
||||||
if (var46 > par6 - 4)
|
if (var46 > par6 - 4)
|
||||||
{
|
{
|
||||||
double var40 = (double)((float)(var46 - (par6 - 4)) / 3.0F);
|
double var40 = (var46 - (par6 - 4)) / 3.0F;
|
||||||
var30 = var30 * (1.0D - var40) + -10.0D * var40;
|
var30 = var30 * (1.0D - var40) + -10.0D * var40;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -306,6 +304,7 @@ public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvi
|
|||||||
|
|
||||||
return par1ArrayOfDouble;
|
return par1ArrayOfDouble;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public void generateTerrain(int par1, int par2, byte[] par3ArrayOfByte)
|
public void generateTerrain(int par1, int par2, byte[] par3ArrayOfByte)
|
||||||
{
|
{
|
||||||
byte var4 = 4;
|
byte var4 = 4;
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public class LimboProvider extends WorldProvider
|
|||||||
this.properties = mod_pocketDim.properties;
|
this.properties = mod_pocketDim.properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IRenderHandler getSkyRenderer()
|
public IRenderHandler getSkyRenderer()
|
||||||
{
|
{
|
||||||
@@ -55,11 +56,13 @@ public class LimboProvider extends WorldProvider
|
|||||||
return mod_pocketDim.limboBiome;
|
return mod_pocketDim.limboBiome;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean canRespawnHere()
|
public boolean canRespawnHere()
|
||||||
{
|
{
|
||||||
return properties.HardcoreLimboEnabled && properties.LimboEnabled;
|
return properties.HardcoreLimboEnabled && properties.LimboEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isBlockHighHumidity(int x, int y, int z)
|
public boolean isBlockHighHumidity(int x, int y, int z)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@@ -79,22 +82,24 @@ public class LimboProvider extends WorldProvider
|
|||||||
|
|
||||||
for (int steps = 0; steps <= 15; ++steps)
|
for (int steps = 0; steps <= 15; ++steps)
|
||||||
{
|
{
|
||||||
float var3 = 1.0F - (float)steps / 15.0F;
|
float var3 = 1.0F - steps / 15.0F;
|
||||||
this.lightBrightnessTable[steps] = ((0.0F + var3) / (var3 * 3.0F + 1.0F) * (1.0F - modifier) + modifier)*3;
|
this.lightBrightnessTable[steps] = ((0.0F + var3) / (var3 * 3.0F + 1.0F) * (1.0F - modifier) + modifier)*3;
|
||||||
// System.out.println( this.lightBrightnessTable[steps]+"light");
|
// System.out.println( this.lightBrightnessTable[steps]+"light");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ChunkCoordinates getSpawnPoint()
|
public ChunkCoordinates getSpawnPoint()
|
||||||
{
|
{
|
||||||
|
|
||||||
return this.getRandomizedSpawnPoint();
|
return this.getRandomizedSpawnPoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public float calculateCelestialAngle(long par1, float par3)
|
public float calculateCelestialAngle(long par1, float par3)
|
||||||
{
|
{
|
||||||
int var4 = (int)(par1 % 24000L);
|
int var4 = (int)(par1 % 24000L);
|
||||||
float var5 = ((float)var4 + par3) / 24000.0F - 0.25F;
|
float var5 = (var4 + par3) / 24000.0F - 0.25F;
|
||||||
|
|
||||||
if (var5 < 0.0F)
|
if (var5 < 0.0F)
|
||||||
{
|
{
|
||||||
@@ -107,7 +112,7 @@ public class LimboProvider extends WorldProvider
|
|||||||
}
|
}
|
||||||
|
|
||||||
float var6 = var5;
|
float var6 = var5;
|
||||||
var5 = 1.0F - (float)((Math.cos((double)var5 * Math.PI) + 1.0D) / 2.0D);
|
var5 = 1.0F - (float)((Math.cos(var5 * Math.PI) + 1.0D) / 2.0D);
|
||||||
var5 = var6 + (var5 - var6) / 3.0F;
|
var5 = var6 + (var5 - var6) / 3.0F;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -125,6 +130,7 @@ public class LimboProvider extends WorldProvider
|
|||||||
return (dimensionId == 0 ? null : "DimensionalDoors/Limbo" + dimensionId);
|
return (dimensionId == 0 ? null : "DimensionalDoors/Limbo" + dimensionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean canCoordinateBeSpawn(int par1, int par2)
|
public boolean canCoordinateBeSpawn(int par1, int par2)
|
||||||
{
|
{
|
||||||
int var3 = this.worldObj.getFirstUncoveredBlock(par1, par2);
|
int var3 = this.worldObj.getFirstUncoveredBlock(par1, par2);
|
||||||
@@ -135,19 +141,21 @@ public class LimboProvider extends WorldProvider
|
|||||||
{
|
{
|
||||||
return worldObj.getHeight()/4-800;
|
return worldObj.getHeight()/4-800;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public Vec3 getSkyColor(Entity cameraEntity, float partialTicks)
|
public Vec3 getSkyColor(Entity cameraEntity, float partialTicks)
|
||||||
{
|
{
|
||||||
setCloudRenderer( new CloudRenderBlank());
|
setCloudRenderer( new CloudRenderBlank());
|
||||||
return this.worldObj.getWorldVec3Pool().getVecFromPool((double)0, (double)0, (double)0);
|
return this.worldObj.getWorldVec3Pool().getVecFromPool(0, 0, 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public Vec3 getFogColor(float par1, float par2)
|
public Vec3 getFogColor(float par1, float par2)
|
||||||
{
|
{
|
||||||
return this.worldObj.getWorldVec3Pool().getVecFromPool((double).2, (double).2, (double).2);
|
return this.worldObj.getWorldVec3Pool().getVecFromPool(.2, .2, .2);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public int getRespawnDimension(EntityPlayerMP player)
|
public int getRespawnDimension(EntityPlayerMP player)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
@@ -160,6 +168,7 @@ public class LimboProvider extends WorldProvider
|
|||||||
return new LimboGenerator(worldObj, 45, spawner, properties);
|
return new LimboGenerator(worldObj, 45, spawner, properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean canBlockFreeze(int x, int y, int z, boolean byWater)
|
public boolean canBlockFreeze(int x, int y, int z, boolean byWater)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -1,27 +1,18 @@
|
|||||||
package StevenDimDoors.mod_pocketDim.world;
|
package StevenDimDoors.mod_pocketDim.world;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.multiplayer.WorldClient;
|
|
||||||
import net.minecraft.client.renderer.GLAllocation;
|
|
||||||
import net.minecraft.client.renderer.RenderHelper;
|
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
import net.minecraft.util.Vec3;
|
|
||||||
import net.minecraftforge.client.IRenderHandler;
|
|
||||||
|
|
||||||
public class LimboSkyProvider extends CustomSkyProvider
|
public class LimboSkyProvider extends CustomSkyProvider
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public String getMoonRenderPath()
|
public ResourceLocation getMoonRenderPath()
|
||||||
{
|
{
|
||||||
return "/mods/DimDoors/textures/other/limboMoon.png";
|
return new ResourceLocation("DimDoors:textures/other/limboMoon.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSunRenderPath()
|
public ResourceLocation getSunRenderPath()
|
||||||
{
|
{
|
||||||
return "/mods/DimDoors/textures/other/limboSun.png";
|
return new ResourceLocation("DimDoors:textures/other/limboSun.png");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,6 @@ package StevenDimDoors.mod_pocketDim.world;
|
|||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.item.ItemDoor;
|
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.chunk.Chunk;
|
import net.minecraft.world.chunk.Chunk;
|
||||||
@@ -11,7 +10,6 @@ import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
|
|||||||
import net.minecraftforge.common.DimensionManager;
|
import net.minecraftforge.common.DimensionManager;
|
||||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||||
import StevenDimDoors.mod_pocketDim.Point3D;
|
import StevenDimDoors.mod_pocketDim.Point3D;
|
||||||
import StevenDimDoors.mod_pocketDim.blocks.DimensionalDoor;
|
|
||||||
import StevenDimDoors.mod_pocketDim.blocks.IDimDoor;
|
import StevenDimDoors.mod_pocketDim.blocks.IDimDoor;
|
||||||
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
||||||
import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
||||||
@@ -25,9 +23,9 @@ import StevenDimDoors.mod_pocketDim.helpers.yCoordHelper;
|
|||||||
import StevenDimDoors.mod_pocketDim.schematic.BlockRotator;
|
import StevenDimDoors.mod_pocketDim.schematic.BlockRotator;
|
||||||
import StevenDimDoors.mod_pocketDim.util.Pair;
|
import StevenDimDoors.mod_pocketDim.util.Pair;
|
||||||
import StevenDimDoors.mod_pocketDim.util.Point4D;
|
import StevenDimDoors.mod_pocketDim.util.Point4D;
|
||||||
import StevenDimDoors.mod_pocketDim.items.BaseItemDoor;
|
|
||||||
import StevenDimDoors.mod_pocketDim.items.ItemDimensionalDoor;
|
import StevenDimDoors.mod_pocketDim.items.ItemDimensionalDoor;
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public class PocketBuilder
|
public class PocketBuilder
|
||||||
{
|
{
|
||||||
public static final int MIN_POCKET_SIZE = 5;
|
public static final int MIN_POCKET_SIZE = 5;
|
||||||
@@ -51,6 +49,7 @@ public class PocketBuilder
|
|||||||
* @param properties
|
* @param properties
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public static boolean regenerateDungeonPocket(NewDimData dimension, DimLink linkIn, DDProperties properties)
|
public static boolean regenerateDungeonPocket(NewDimData dimension, DimLink linkIn, DDProperties properties)
|
||||||
{
|
{
|
||||||
if (linkIn == null)
|
if (linkIn == null)
|
||||||
@@ -79,6 +78,7 @@ public class PocketBuilder
|
|||||||
dimension.createLink(oldLinkPos, LinkTypes.SAFE_EXIT, (orientation+2)%4);
|
dimension.createLink(oldLinkPos, LinkTypes.SAFE_EXIT, (orientation+2)%4);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@SuppressWarnings("unused") // ?
|
||||||
NewDimData parent = PocketManager.getDimensionData(incomingLink.source().getDimension());
|
NewDimData parent = PocketManager.getDimensionData(incomingLink.source().getDimension());
|
||||||
|
|
||||||
if (!dimension.isDungeon())
|
if (!dimension.isDungeon())
|
||||||
@@ -241,6 +241,7 @@ public class PocketBuilder
|
|||||||
return buildDungeonPocket(dungeon, dimension, link, schematic, world, properties);
|
return buildDungeonPocket(dungeon, dimension, link, schematic, world, properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static Point3D calculateNoisyDestination(Point4D source, NewDimData dimension, DungeonData dungeon, int orientation)
|
private static Point3D calculateNoisyDestination(Point4D source, NewDimData dimension, DungeonData dungeon, int orientation)
|
||||||
{
|
{
|
||||||
int depth = NewDimData.calculatePackDepth(dimension.parent(), dungeon);
|
int depth = NewDimData.calculatePackDepth(dimension.parent(), dungeon);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
|||||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||||
import StevenDimDoors.mod_pocketDim.ticking.MonolithSpawner;
|
import StevenDimDoors.mod_pocketDim.ticking.MonolithSpawner;
|
||||||
|
|
||||||
public class PocketGenerator extends ChunkProviderGenerate implements IChunkProvider
|
public class PocketGenerator extends ChunkProviderGenerate
|
||||||
{
|
{
|
||||||
private World worldObj;
|
private World worldObj;
|
||||||
|
|
||||||
@@ -32,6 +32,7 @@ public class PocketGenerator extends ChunkProviderGenerate implements IChunkProv
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean unloadQueuedChunks()
|
public boolean unloadQueuedChunks()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ public class PocketProvider extends WorldProvider
|
|||||||
{
|
{
|
||||||
private DDProperties properties;
|
private DDProperties properties;
|
||||||
private MonolithSpawner spawner;
|
private MonolithSpawner spawner;
|
||||||
|
@SuppressWarnings("unused") // ?
|
||||||
private IRenderHandler skyRenderer;
|
private IRenderHandler skyRenderer;
|
||||||
|
|
||||||
public PocketProvider()
|
public PocketProvider()
|
||||||
@@ -47,14 +48,14 @@ public class PocketProvider extends WorldProvider
|
|||||||
public Vec3 getSkyColor(Entity cameraEntity, float partialTicks)
|
public Vec3 getSkyColor(Entity cameraEntity, float partialTicks)
|
||||||
{
|
{
|
||||||
setCloudRenderer( new CloudRenderBlank());
|
setCloudRenderer( new CloudRenderBlank());
|
||||||
return this.worldObj.getWorldVec3Pool().getVecFromPool((double)0, (double)0, (double)0);
|
return this.worldObj.getWorldVec3Pool().getVecFromPool(0d, 0d, 0d);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public Vec3 getFogColor(float par1, float par2)
|
public Vec3 getFogColor(float par1, float par2)
|
||||||
{
|
{
|
||||||
return this.worldObj.getWorldVec3Pool().getVecFromPool((double)0, (double)0, (double)0);
|
return this.worldObj.getWorldVec3Pool().getVecFromPool(0d, 0d, 0d);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,31 +1,18 @@
|
|||||||
package StevenDimDoors.mod_pocketDim.world;
|
package StevenDimDoors.mod_pocketDim.world;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.multiplayer.WorldClient;
|
|
||||||
import net.minecraft.client.renderer.GLAllocation;
|
|
||||||
import net.minecraft.client.renderer.RenderHelper;
|
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
import net.minecraft.util.Vec3;
|
|
||||||
import net.minecraftforge.client.IRenderHandler;
|
|
||||||
|
|
||||||
public class PocketSkyProvider extends CustomSkyProvider
|
public class PocketSkyProvider extends CustomSkyProvider
|
||||||
{
|
{
|
||||||
|
|
||||||
public class LimboSkyProvider extends CustomSkyProvider
|
|
||||||
{
|
|
||||||
@Override
|
@Override
|
||||||
public String getMoonRenderPath()
|
public ResourceLocation getMoonRenderPath()
|
||||||
{
|
{
|
||||||
return "/mods/DimDoors/textures/other/pocketMoon.png";
|
return new ResourceLocation("DimDoors:textures/other/limboMoon.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSunRenderPath()
|
public ResourceLocation getSunRenderPath()
|
||||||
{
|
{
|
||||||
return "/mods/DimDoors/textures/other/pocketSun.png";
|
return new ResourceLocation("DimDoors:textures/other/limboSun.png");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,5 @@
|
|||||||
package StevenDimDoors.mod_pocketDimClient;
|
package StevenDimDoors.mod_pocketDimClient;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
|
||||||
import java.io.DataInputStream;
|
|
||||||
|
|
||||||
import net.minecraft.network.INetworkManager;
|
|
||||||
import net.minecraft.network.packet.Packet250CustomPayload;
|
|
||||||
import net.minecraft.server.integrated.IntegratedServer;
|
|
||||||
import StevenDimDoors.mod_pocketDim.PacketConstants;
|
import StevenDimDoors.mod_pocketDim.PacketConstants;
|
||||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||||
import StevenDimDoors.mod_pocketDim.util.Point4D;
|
import StevenDimDoors.mod_pocketDim.util.Point4D;
|
||||||
@@ -13,10 +7,17 @@ import StevenDimDoors.mod_pocketDim.watcher.ClientDimData;
|
|||||||
import StevenDimDoors.mod_pocketDim.watcher.ClientLinkData;
|
import StevenDimDoors.mod_pocketDim.watcher.ClientLinkData;
|
||||||
import StevenDimDoors.mod_pocketDim.watcher.IUpdateSource;
|
import StevenDimDoors.mod_pocketDim.watcher.IUpdateSource;
|
||||||
import StevenDimDoors.mod_pocketDim.watcher.IUpdateWatcher;
|
import StevenDimDoors.mod_pocketDim.watcher.IUpdateWatcher;
|
||||||
|
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
import cpw.mods.fml.common.network.IPacketHandler;
|
import cpw.mods.fml.common.network.IPacketHandler;
|
||||||
import cpw.mods.fml.common.network.Player;
|
import cpw.mods.fml.common.network.Player;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
|
||||||
|
import net.minecraft.network.INetworkManager;
|
||||||
|
import net.minecraft.network.packet.Packet250CustomPayload;
|
||||||
|
import net.minecraft.server.integrated.IntegratedServer;
|
||||||
|
|
||||||
public class ClientPacketHandler implements IPacketHandler, IUpdateSource
|
public class ClientPacketHandler implements IPacketHandler, IUpdateSource
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -46,24 +46,25 @@ public class ClosingRiftFX extends EntityFX
|
|||||||
|
|
||||||
public void func_92044_a(int par1)
|
public void func_92044_a(int par1)
|
||||||
{
|
{
|
||||||
float var2 = (float)((par1 & 16711680) >> 16) / 255.0F;
|
float var2 = ((par1 & 16711680) >> 16) / 255.0F;
|
||||||
float var3 = (float)((par1 & 65280) >> 8) / 255.0F;
|
float var3 = ((par1 & 65280) >> 8) / 255.0F;
|
||||||
float var4 = (float)((par1 & 255) >> 0) / 255.0F;
|
float var4 = ((par1 & 255) >> 0) / 255.0F;
|
||||||
float var5 = 1.0F;
|
float var5 = 1.0F;
|
||||||
this.setRBGColorF(var2 * var5, var3 * var5, var4 * var5);
|
this.setRBGColorF(var2 * var5, var3 * var5, var4 * var5);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void func_92046_g(int par1)
|
public void func_92046_g(int par1)
|
||||||
{
|
{
|
||||||
this.field_92050_aA = (float)((par1 & 16711680) >> 16) / 255.0F;
|
this.field_92050_aA = ((par1 & 16711680) >> 16) / 255.0F;
|
||||||
this.field_92051_aB = (float)((par1 & 65280) >> 8) / 255.0F;
|
this.field_92051_aB = ((par1 & 65280) >> 8) / 255.0F;
|
||||||
this.field_92052_aC = (float)((par1 & 255) >> 0) / 255.0F;
|
this.field_92052_aC = ((par1 & 255) >> 0) / 255.0F;
|
||||||
this.field_92053_aD = true;
|
this.field_92053_aD = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the bounding box for this entity
|
* returns the bounding box for this entity
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public AxisAlignedBB getBoundingBox()
|
public AxisAlignedBB getBoundingBox()
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
@@ -72,11 +73,13 @@ public class ClosingRiftFX extends EntityFX
|
|||||||
/**
|
/**
|
||||||
* Returns true if this entity should push and be pushed by other entities when colliding.
|
* Returns true if this entity should push and be pushed by other entities when colliding.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean canBePushed()
|
public boolean canBePushed()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
||||||
{
|
{
|
||||||
if (!this.field_92048_ay || this.particleAge < this.particleMaxAge / 3 || (this.particleAge + this.particleMaxAge) / 3 % 2 == 0)
|
if (!this.field_92048_ay || this.particleAge < this.particleMaxAge / 3 || (this.particleAge + this.particleMaxAge) / 3 % 2 == 0)
|
||||||
@@ -87,14 +90,14 @@ public class ClosingRiftFX extends EntityFX
|
|||||||
|
|
||||||
public void doRenderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
public void doRenderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
||||||
{
|
{
|
||||||
float var8 = (float)(super.particleTextureIndexX % 16) / 16.0F;
|
float var8 = super.particleTextureIndexX % 16 / 16.0F;
|
||||||
float var9 = var8 + 0.0624375F;
|
float var9 = var8 + 0.0624375F;
|
||||||
float var10 = (float)(this.particleTextureIndexX / 16) / 16.0F;
|
float var10 = this.particleTextureIndexX / 16 / 16.0F;
|
||||||
float var11 = var10 + 0.0624375F;
|
float var11 = var10 + 0.0624375F;
|
||||||
float var12 = 0.1F * this.particleScale;
|
float var12 = 0.1F * this.particleScale;
|
||||||
float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX);
|
float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
|
||||||
float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY);
|
float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
|
||||||
float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ);
|
float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
|
||||||
float var16 = 0.8F;
|
float var16 = 0.8F;
|
||||||
|
|
||||||
if (PocketManager.getDimensionData(worldObj).isPocketDimension())
|
if (PocketManager.getDimensionData(worldObj).isPocketDimension())
|
||||||
@@ -104,15 +107,16 @@ public class ClosingRiftFX extends EntityFX
|
|||||||
|
|
||||||
par1Tessellator.setColorRGBA_F(this.particleRed * var16, this.particleGreen * var16, this.particleBlue * var16, (float) .7);
|
par1Tessellator.setColorRGBA_F(this.particleRed * var16, this.particleGreen * var16, this.particleBlue * var16, (float) .7);
|
||||||
|
|
||||||
par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 - par5 * var12 - par7 * var12), (double)var9, (double)var11);
|
par1Tessellator.addVertexWithUV(var13 - par3 * var12 - par6 * var12, var14 - par4 * var12, var15 - par5 * var12 - par7 * var12, var9, var11);
|
||||||
par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 - par5 * var12 + par7 * var12), (double)var9, (double)var10);
|
par1Tessellator.addVertexWithUV(var13 - par3 * var12 + par6 * var12, var14 + par4 * var12, var15 - par5 * var12 + par7 * var12, var9, var10);
|
||||||
par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 + par5 * var12 + par7 * var12), (double)var8, (double)var10);
|
par1Tessellator.addVertexWithUV(var13 + par3 * var12 + par6 * var12, var14 + par4 * var12, var15 + par5 * var12 + par7 * var12, var8, var10);
|
||||||
par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 + par5 * var12 - par7 * var12), (double)var8, (double)var11);
|
par1Tessellator.addVertexWithUV(var13 + par3 * var12 - par6 * var12, var14 - par4 * var12, var15 + par5 * var12 - par7 * var12, var8, var11);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called to update the entity's position/logic.
|
* Called to update the entity's position/logic.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void onUpdate()
|
public void onUpdate()
|
||||||
{
|
{
|
||||||
this.prevPosX = this.posX;
|
this.prevPosX = this.posX;
|
||||||
@@ -126,7 +130,7 @@ public class ClosingRiftFX extends EntityFX
|
|||||||
|
|
||||||
if (this.particleAge > this.particleMaxAge / 2)
|
if (this.particleAge > this.particleMaxAge / 2)
|
||||||
{
|
{
|
||||||
this.setAlphaF(1.0F - ((float)this.particleAge - (float)(this.particleMaxAge / 2)) / (float)this.particleMaxAge);
|
this.setAlphaF(1.0F - ((float)this.particleAge - (float)(this.particleMaxAge / 2)) / this.particleMaxAge);
|
||||||
|
|
||||||
if (this.field_92053_aD)
|
if (this.field_92053_aD)
|
||||||
{
|
{
|
||||||
@@ -168,6 +172,7 @@ public class ClosingRiftFX extends EntityFX
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getBrightnessForRender(float par1)
|
public int getBrightnessForRender(float par1)
|
||||||
{
|
{
|
||||||
return 15728880;
|
return 15728880;
|
||||||
@@ -176,6 +181,7 @@ public class ClosingRiftFX extends EntityFX
|
|||||||
/**
|
/**
|
||||||
* Gets how bright this entity is.
|
* Gets how bright this entity is.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public float getBrightness(float par1)
|
public float getBrightness(float par1)
|
||||||
{
|
{
|
||||||
return 1.0F;
|
return 1.0F;
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ public class GoggleRiftFX extends EntityFireworkSparkFX
|
|||||||
this.particleMaxAge = 30 + this.rand.nextInt(16);
|
this.particleMaxAge = 30 + this.rand.nextInt(16);
|
||||||
this.noClip = true;
|
this.noClip = true;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
||||||
{
|
{
|
||||||
if (!this.field_92048_ay || this.particleAge < this.particleMaxAge / 3 || (this.particleAge + this.particleMaxAge) / 3 % 2 == 0)
|
if (!this.field_92048_ay || this.particleAge < this.particleMaxAge / 3 || (this.particleAge + this.particleMaxAge) / 3 % 2 == 0)
|
||||||
@@ -43,14 +44,14 @@ public class GoggleRiftFX extends EntityFireworkSparkFX
|
|||||||
|
|
||||||
public void doRenderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
public void doRenderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
||||||
{
|
{
|
||||||
float var8 = (float)(super.particleTextureIndexX % 16) / 16.0F;
|
float var8 = super.particleTextureIndexX % 16 / 16.0F;
|
||||||
float var9 = var8 + 0.0624375F;
|
float var9 = var8 + 0.0624375F;
|
||||||
float var10 = (float)(this.particleTextureIndexX / 16) / 16.0F;
|
float var10 = this.particleTextureIndexX / 16 / 16.0F;
|
||||||
float var11 = var10 + 0.0624375F;
|
float var11 = var10 + 0.0624375F;
|
||||||
float var12 = 0.1F * this.particleScale;
|
float var12 = 0.1F * this.particleScale;
|
||||||
float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX);
|
float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
|
||||||
float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY);
|
float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
|
||||||
float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ);
|
float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
|
||||||
float var16 = .0F;
|
float var16 = .0F;
|
||||||
|
|
||||||
if (PocketManager.getDimensionData(worldObj).isPocketDimension())
|
if (PocketManager.getDimensionData(worldObj).isPocketDimension())
|
||||||
@@ -60,10 +61,10 @@ public class GoggleRiftFX extends EntityFireworkSparkFX
|
|||||||
|
|
||||||
par1Tessellator.setColorRGBA_F(this.particleRed * var16, this.particleGreen * var16, this.particleBlue * var16, (float) .7);
|
par1Tessellator.setColorRGBA_F(this.particleRed * var16, this.particleGreen * var16, this.particleBlue * var16, (float) .7);
|
||||||
|
|
||||||
par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 - par5 * var12 - par7 * var12), (double)var9, (double)var11);
|
par1Tessellator.addVertexWithUV(var13 - par3 * var12 - par6 * var12, var14 - par4 * var12, var15 - par5 * var12 - par7 * var12, var9, var11);
|
||||||
par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 - par5 * var12 + par7 * var12), (double)var9, (double)var10);
|
par1Tessellator.addVertexWithUV(var13 - par3 * var12 + par6 * var12, var14 + par4 * var12, var15 - par5 * var12 + par7 * var12, var9, var10);
|
||||||
par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 + par5 * var12 + par7 * var12), (double)var8, (double)var10);
|
par1Tessellator.addVertexWithUV(var13 + par3 * var12 + par6 * var12, var14 + par4 * var12, var15 + par5 * var12 + par7 * var12, var8, var10);
|
||||||
par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 + par5 * var12 - par7 * var12), (double)var8, (double)var11);
|
par1Tessellator.addVertexWithUV(var13 + par3 * var12 - par6 * var12, var14 - par4 * var12, var15 + par5 * var12 - par7 * var12, var8, var11);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -79,24 +80,25 @@ public class GoggleRiftFX extends EntityFireworkSparkFX
|
|||||||
|
|
||||||
public void func_92044_a(int par1)
|
public void func_92044_a(int par1)
|
||||||
{
|
{
|
||||||
float var2 = (float)((par1 & 16711680) >> 16) / 255.0F;
|
float var2 = ((par1 & 16711680) >> 16) / 255.0F;
|
||||||
float var3 = (float)((par1 & 65280) >> 8) / 255.0F;
|
float var3 = ((par1 & 65280) >> 8) / 255.0F;
|
||||||
float var4 = (float)((par1 & 255) >> 0) / 255.0F;
|
float var4 = ((par1 & 255) >> 0) / 255.0F;
|
||||||
float var5 = 1.0F;
|
float var5 = 1.0F;
|
||||||
this.setRBGColorF(var2 * var5, var3 * var5, var4 * var5);
|
this.setRBGColorF(var2 * var5, var3 * var5, var4 * var5);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void func_92046_g(int par1)
|
public void func_92046_g(int par1)
|
||||||
{
|
{
|
||||||
this.field_92050_aA = (float)((par1 & 16711680) >> 16) / 255.0F;
|
this.field_92050_aA = ((par1 & 16711680) >> 16) / 255.0F;
|
||||||
this.field_92051_aB = (float)((par1 & 65280) >> 8) / 255.0F;
|
this.field_92051_aB = ((par1 & 65280) >> 8) / 255.0F;
|
||||||
this.field_92052_aC = (float)((par1 & 255) >> 0) / 255.0F;
|
this.field_92052_aC = ((par1 & 255) >> 0) / 255.0F;
|
||||||
this.field_92053_aD = true;
|
this.field_92053_aD = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the bounding box for this entity
|
* returns the bounding box for this entity
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public AxisAlignedBB getBoundingBox()
|
public AxisAlignedBB getBoundingBox()
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
@@ -105,6 +107,7 @@ public class GoggleRiftFX extends EntityFireworkSparkFX
|
|||||||
/**
|
/**
|
||||||
* Returns true if this entity should push and be pushed by other entities when colliding.
|
* Returns true if this entity should push and be pushed by other entities when colliding.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean canBePushed()
|
public boolean canBePushed()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@@ -115,6 +118,7 @@ public class GoggleRiftFX extends EntityFireworkSparkFX
|
|||||||
/**
|
/**
|
||||||
* Called to update the entity's position/logic.
|
* Called to update the entity's position/logic.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void onUpdate()
|
public void onUpdate()
|
||||||
{
|
{
|
||||||
this.prevPosX = this.posX;
|
this.prevPosX = this.posX;
|
||||||
@@ -128,7 +132,7 @@ public class GoggleRiftFX extends EntityFireworkSparkFX
|
|||||||
|
|
||||||
if (this.particleAge > this.particleMaxAge / 2)
|
if (this.particleAge > this.particleMaxAge / 2)
|
||||||
{
|
{
|
||||||
this.setAlphaF(1.0F - ((float)this.particleAge - (float)(this.particleMaxAge / 2)) / (float)this.particleMaxAge);
|
this.setAlphaF(1.0F - ((float)this.particleAge - (float)(this.particleMaxAge / 2)) / this.particleMaxAge);
|
||||||
|
|
||||||
if (this.field_92053_aD)
|
if (this.field_92053_aD)
|
||||||
{
|
{
|
||||||
@@ -170,6 +174,7 @@ public class GoggleRiftFX extends EntityFireworkSparkFX
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getBrightnessForRender(float par1)
|
public int getBrightnessForRender(float par1)
|
||||||
{
|
{
|
||||||
return 15728880;
|
return 15728880;
|
||||||
@@ -178,6 +183,7 @@ public class GoggleRiftFX extends EntityFireworkSparkFX
|
|||||||
/**
|
/**
|
||||||
* Gets how bright this entity is.
|
* Gets how bright this entity is.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public float getBrightness(float par1)
|
public float getBrightness(float par1)
|
||||||
{
|
{
|
||||||
return 1.0F;
|
return 1.0F;
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import net.minecraft.client.renderer.ActiveRenderInfo;
|
|||||||
import net.minecraft.client.renderer.GLAllocation;
|
import net.minecraft.client.renderer.GLAllocation;
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||||
@@ -22,6 +22,8 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||||||
public class RenderDimDoor extends TileEntitySpecialRenderer
|
public class RenderDimDoor extends TileEntitySpecialRenderer
|
||||||
{
|
{
|
||||||
FloatBuffer field_76908_a = GLAllocation.createDirectFloatBuffer(16);
|
FloatBuffer field_76908_a = GLAllocation.createDirectFloatBuffer(16);
|
||||||
|
private ResourceLocation riftPath= new ResourceLocation(mod_pocketDim.modid+":textures/other/RIFT.png");
|
||||||
|
private ResourceLocation warpPath= new ResourceLocation(mod_pocketDim.modid+":textures/other/WARP.png");
|
||||||
|
|
||||||
public RenderDimDoor()
|
public RenderDimDoor()
|
||||||
{
|
{
|
||||||
@@ -60,13 +62,14 @@ public class RenderDimDoor extends TileEntitySpecialRenderer
|
|||||||
for (int count = 0; count < 16; ++count)
|
for (int count = 0; count < 16; ++count)
|
||||||
{
|
{
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
float var15 = (float) (16 - count);
|
float var15 = 16 - count;
|
||||||
float var16 = 0.2625F;
|
float var16 = 0.2625F;
|
||||||
float var17 = 1.0F / (var15 + .80F);
|
float var17 = 1.0F / (var15 + .80F);
|
||||||
|
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
{
|
{
|
||||||
this.bindTexture(new ResourceLocation("/RIFT.png"));
|
this.bindTexture(riftPath);
|
||||||
|
// move files into assets/modid and change to new ResourceLocation(modid:/RIFT.png)
|
||||||
var17 = 0.1F;
|
var17 = 0.1F;
|
||||||
var15 = 25.0F;
|
var15 = 25.0F;
|
||||||
var16 = 0.125F;
|
var16 = 0.125F;
|
||||||
@@ -76,7 +79,8 @@ public class RenderDimDoor extends TileEntitySpecialRenderer
|
|||||||
|
|
||||||
if (count == 1)
|
if (count == 1)
|
||||||
{
|
{
|
||||||
this.bindTexture(new ResourceLocation("/WARP.png"));
|
this.bindTexture(warpPath);
|
||||||
|
// move files into assets/modid and change to new ResourceLocation(modid:/WARP.png)
|
||||||
GL11.glEnable(GL11.GL_BLEND);
|
GL11.glEnable(GL11.GL_BLEND);
|
||||||
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
|
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
|
||||||
var16 = .5F;
|
var16 = .5F;
|
||||||
@@ -99,14 +103,14 @@ public class RenderDimDoor extends TileEntitySpecialRenderer
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
GL11.glTranslatef(
|
GL11.glTranslatef(
|
||||||
(float) (Minecraft.getSystemTime() % 200000L) / 200000.0F,
|
Minecraft.getSystemTime() % 200000L / 200000.0F,
|
||||||
0, 0.0F);
|
0, 0.0F);
|
||||||
GL11.glTranslatef(0,
|
GL11.glTranslatef(0,
|
||||||
(float) (Minecraft.getSystemTime() % 200000L) / 200000.0F,
|
Minecraft.getSystemTime() % 200000L / 200000.0F,
|
||||||
0.0F);
|
0.0F);
|
||||||
|
|
||||||
GL11.glTranslatef(0, 0,
|
GL11.glTranslatef(0, 0,
|
||||||
(float) (Minecraft.getSystemTime() % 200000L) / 200000.0F);
|
Minecraft.getSystemTime() % 200000L / 200000.0F);
|
||||||
|
|
||||||
GL11.glTexGeni(GL11.GL_S, GL11.GL_TEXTURE_GEN_MODE,
|
GL11.glTexGeni(GL11.GL_S, GL11.GL_TEXTURE_GEN_MODE,
|
||||||
GL11.GL_OBJECT_LINEAR);
|
GL11.GL_OBJECT_LINEAR);
|
||||||
@@ -173,11 +177,11 @@ public class RenderDimDoor extends TileEntitySpecialRenderer
|
|||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glLoadIdentity();
|
GL11.glLoadIdentity();
|
||||||
GL11.glTranslatef(0.0F,
|
GL11.glTranslatef(0.0F,
|
||||||
(float) (Minecraft.getSystemTime() % 200000L) / 200000.0F
|
Minecraft.getSystemTime() % 200000L / 200000.0F
|
||||||
* var15, 0.0F);
|
* var15, 0.0F);
|
||||||
GL11.glScalef(var16, var16, var16);
|
GL11.glScalef(var16, var16, var16);
|
||||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||||
GL11.glRotatef((float) (count * count * 4321 + count * 9) * 2.0F,
|
GL11.glRotatef((count * count * 4321 + count * 9) * 2.0F,
|
||||||
0.0F, 0.0F, 1.0F);
|
0.0F, 0.0F, 1.0F);
|
||||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||||
|
|
||||||
|
|||||||
@@ -1,28 +1,30 @@
|
|||||||
package StevenDimDoors.mod_pocketDimClient;
|
package StevenDimDoors.mod_pocketDimClient;
|
||||||
|
|
||||||
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||||
import net.minecraft.client.renderer.entity.RenderLiving;
|
import net.minecraft.client.renderer.entity.RenderLiving;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class RenderMobObelisk extends RenderLiving
|
public class RenderMobObelisk extends RenderLiving
|
||||||
{
|
{
|
||||||
protected ModelMobObelisk obeliskModel;
|
protected ModelMobObelisk obeliskModel;
|
||||||
|
|
||||||
public RenderMobObelisk(float f)
|
public RenderMobObelisk(float f)
|
||||||
{
|
{
|
||||||
super(new ModelMobObelisk(), f);
|
super(new ModelMobObelisk(), f);
|
||||||
this.obeliskModel = (ModelMobObelisk)this.mainModel;
|
this.obeliskModel = (ModelMobObelisk)this.mainModel;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResourceLocation getEntityTexture(Entity entity) {
|
protected ResourceLocation getEntityTexture(Entity entity)
|
||||||
int watchByte = entity.getDataWatcher().getWatchableObjectByte(16);
|
{
|
||||||
|
byte b0 = entity.getDataWatcher().getWatchableObjectByte(16);
|
||||||
|
|
||||||
return new ResourceLocation("/mods/DimDoors/textures/mobs/Monolith"+watchByte+".png");
|
return new ResourceLocation(mod_pocketDim.modid+":textures/mobs/Monolith"+b0+".png");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,8 +7,8 @@ import net.minecraft.client.Minecraft;
|
|||||||
import net.minecraft.client.renderer.GLAllocation;
|
import net.minecraft.client.renderer.GLAllocation;
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||||
@@ -23,6 +23,9 @@ public class RenderTransTrapdoor extends TileEntitySpecialRenderer
|
|||||||
{
|
{
|
||||||
private FloatBuffer field_76908_a = GLAllocation.createDirectFloatBuffer(16);
|
private FloatBuffer field_76908_a = GLAllocation.createDirectFloatBuffer(16);
|
||||||
private static DDProperties properties = null;
|
private static DDProperties properties = null;
|
||||||
|
private ResourceLocation riftPath= new ResourceLocation(mod_pocketDim.modid+":textures/other/RIFT.png");
|
||||||
|
private ResourceLocation warpPath= new ResourceLocation(mod_pocketDim.modid+":textures/other/WARP.png");
|
||||||
|
|
||||||
|
|
||||||
public RenderTransTrapdoor()
|
public RenderTransTrapdoor()
|
||||||
{
|
{
|
||||||
@@ -57,13 +60,13 @@ public class RenderTransTrapdoor extends TileEntitySpecialRenderer
|
|||||||
for (int count = 0; count < 16; ++count)
|
for (int count = 0; count < 16; ++count)
|
||||||
{
|
{
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
float var15 = (float)(16 - count);
|
float var15 = 16 - count;
|
||||||
float var16 = 0.2625F;
|
float var16 = 0.2625F;
|
||||||
float var17 = 1.0F / (var15 + 1.0F);
|
float var17 = 1.0F / (var15 + 1.0F);
|
||||||
|
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
{
|
{
|
||||||
this.bindTexture(new ResourceLocation("/RIFT.png"));
|
this.bindTexture(riftPath);
|
||||||
var17 = 0.1F;
|
var17 = 0.1F;
|
||||||
var15 = 25.0F;
|
var15 = 25.0F;
|
||||||
var16 = 0.125F;
|
var16 = 0.125F;
|
||||||
@@ -73,16 +76,17 @@ public class RenderTransTrapdoor extends TileEntitySpecialRenderer
|
|||||||
|
|
||||||
if (count == 1)
|
if (count == 1)
|
||||||
{
|
{
|
||||||
this.bindTexture(new ResourceLocation("/WARP.png"));
|
this.bindTexture(warpPath);
|
||||||
|
// move files into assets/modid and change to new ResourceLocation(modid:/WARP.png)
|
||||||
GL11.glEnable(GL11.GL_BLEND);
|
GL11.glEnable(GL11.GL_BLEND);
|
||||||
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
|
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
|
||||||
var16 = .5F;
|
var16 = .5F;
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glTranslatef( (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F,0, 0.0F);
|
GL11.glTranslatef( Minecraft.getSystemTime() % 200000L / 200000.0F,0, 0.0F);
|
||||||
GL11.glTranslatef(0, (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F, 0.0F);
|
GL11.glTranslatef(0, Minecraft.getSystemTime() % 200000L / 200000.0F, 0.0F);
|
||||||
|
|
||||||
GL11.glTranslatef(0,0, (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F);
|
GL11.glTranslatef(0,0, Minecraft.getSystemTime() % 200000L / 200000.0F);
|
||||||
|
|
||||||
GL11.glTexGeni(GL11.GL_S, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
|
GL11.glTexGeni(GL11.GL_S, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
|
||||||
GL11.glTexGeni(GL11.GL_T, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
|
GL11.glTexGeni(GL11.GL_T, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
|
||||||
@@ -103,10 +107,10 @@ public class RenderTransTrapdoor extends TileEntitySpecialRenderer
|
|||||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glLoadIdentity();
|
GL11.glLoadIdentity();
|
||||||
GL11.glTranslatef(0.0F, (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F*var15, 0.0F);
|
GL11.glTranslatef(0.0F, Minecraft.getSystemTime() % 200000L / 200000.0F*var15, 0.0F);
|
||||||
GL11.glScalef(var16, var16, var16);
|
GL11.glScalef(var16, var16, var16);
|
||||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||||
GL11.glRotatef((float)(count * count * 4321 + count * 9) * 2.0F, 0.0F, 0.0F, 1.0F);
|
GL11.glRotatef((count * count * 4321 + count * 9) * 2.0F, 0.0F, 0.0F, 1.0F);
|
||||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||||
|
|
||||||
GL11.glBegin(GL11.GL_QUADS);
|
GL11.glBegin(GL11.GL_QUADS);
|
||||||
|
|||||||
@@ -46,24 +46,25 @@ public class RiftFX extends EntityFX
|
|||||||
|
|
||||||
public void func_92044_a(int par1)
|
public void func_92044_a(int par1)
|
||||||
{
|
{
|
||||||
float var2 = (float)((par1 & 16711680) >> 16) / 255.0F;
|
float var2 = ((par1 & 16711680) >> 16) / 255.0F;
|
||||||
float var3 = (float)((par1 & 65280) >> 8) / 255.0F;
|
float var3 = ((par1 & 65280) >> 8) / 255.0F;
|
||||||
float var4 = (float)((par1 & 255) >> 0) / 255.0F;
|
float var4 = ((par1 & 255) >> 0) / 255.0F;
|
||||||
float var5 = 1.0F;
|
float var5 = 1.0F;
|
||||||
this.setRBGColorF(var2 * var5, var3 * var5, var4 * var5);
|
this.setRBGColorF(var2 * var5, var3 * var5, var4 * var5);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void func_92046_g(int par1)
|
public void func_92046_g(int par1)
|
||||||
{
|
{
|
||||||
this.field_92050_aA = (float)((par1 & 16711680) >> 16) / 255.0F;
|
this.field_92050_aA = ((par1 & 16711680) >> 16) / 255.0F;
|
||||||
this.field_92051_aB = (float)((par1 & 65280) >> 8) / 255.0F;
|
this.field_92051_aB = ((par1 & 65280) >> 8) / 255.0F;
|
||||||
this.field_92052_aC = (float)((par1 & 255) >> 0) / 255.0F;
|
this.field_92052_aC = ((par1 & 255) >> 0) / 255.0F;
|
||||||
this.field_92053_aD = true;
|
this.field_92053_aD = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the bounding box for this entity
|
* returns the bounding box for this entity
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public AxisAlignedBB getBoundingBox()
|
public AxisAlignedBB getBoundingBox()
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
@@ -72,11 +73,13 @@ public class RiftFX extends EntityFX
|
|||||||
/**
|
/**
|
||||||
* Returns true if this entity should push and be pushed by other entities when colliding.
|
* Returns true if this entity should push and be pushed by other entities when colliding.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean canBePushed()
|
public boolean canBePushed()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
||||||
{
|
{
|
||||||
if (!this.field_92048_ay || this.particleAge < this.particleMaxAge / 3 || (this.particleAge + this.particleMaxAge) / 3 % 2 == 0)
|
if (!this.field_92048_ay || this.particleAge < this.particleMaxAge / 3 || (this.particleAge + this.particleMaxAge) / 3 % 2 == 0)
|
||||||
@@ -89,9 +92,9 @@ public class RiftFX extends EntityFX
|
|||||||
|
|
||||||
public void doRenderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
public void doRenderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
||||||
{
|
{
|
||||||
float f6 = (float)this.particleTextureIndexX / 16.0F;
|
float f6 = this.particleTextureIndexX / 16.0F;
|
||||||
float f7 = f6 + 0.0624375F;
|
float f7 = f6 + 0.0624375F;
|
||||||
float f8 = (float)this.particleTextureIndexY / 16.0F;
|
float f8 = this.particleTextureIndexY / 16.0F;
|
||||||
float f9 = f8 + 0.0624375F;
|
float f9 = f8 + 0.0624375F;
|
||||||
float f10 = 0.1F * this.particleScale;
|
float f10 = 0.1F * this.particleScale;
|
||||||
|
|
||||||
@@ -103,9 +106,9 @@ public class RiftFX extends EntityFX
|
|||||||
f9 = this.particleIcon.getMaxV();
|
f9 = this.particleIcon.getMaxV();
|
||||||
}
|
}
|
||||||
|
|
||||||
float f11 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX);
|
float f11 = (float)(this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
|
||||||
float f12 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY);
|
float f12 = (float)(this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
|
||||||
float f13 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ);
|
float f13 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
|
||||||
float f14 = 0F;
|
float f14 = 0F;
|
||||||
|
|
||||||
if (PocketManager.getDimensionData(worldObj).isPocketDimension())
|
if (PocketManager.getDimensionData(worldObj).isPocketDimension())
|
||||||
@@ -114,15 +117,16 @@ public class RiftFX extends EntityFX
|
|||||||
}
|
}
|
||||||
|
|
||||||
par1Tessellator.setColorRGBA_F(this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, (float) .7);
|
par1Tessellator.setColorRGBA_F(this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, (float) .7);
|
||||||
par1Tessellator.addVertexWithUV((double)(f11 - par3 * f10 - par6 * f10), (double)(f12 - par4 * f10), (double)(f13 - par5 * f10 - par7 * f10), (double)f7, (double)f9);
|
par1Tessellator.addVertexWithUV(f11 - par3 * f10 - par6 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10, f7, f9);
|
||||||
par1Tessellator.addVertexWithUV((double)(f11 - par3 * f10 + par6 * f10), (double)(f12 + par4 * f10), (double)(f13 - par5 * f10 + par7 * f10), (double)f7, (double)f8);
|
par1Tessellator.addVertexWithUV(f11 - par3 * f10 + par6 * f10, f12 + par4 * f10, f13 - par5 * f10 + par7 * f10, f7, f8);
|
||||||
par1Tessellator.addVertexWithUV((double)(f11 + par3 * f10 + par6 * f10), (double)(f12 + par4 * f10), (double)(f13 + par5 * f10 + par7 * f10), (double)f6, (double)f8);
|
par1Tessellator.addVertexWithUV(f11 + par3 * f10 + par6 * f10, f12 + par4 * f10, f13 + par5 * f10 + par7 * f10, f6, f8);
|
||||||
par1Tessellator.addVertexWithUV((double)(f11 + par3 * f10 - par6 * f10), (double)(f12 - par4 * f10), (double)(f13 + par5 * f10 - par7 * f10), (double)f6, (double)f9);
|
par1Tessellator.addVertexWithUV(f11 + par3 * f10 - par6 * f10, f12 - par4 * f10, f13 + par5 * f10 - par7 * f10, f6, f9);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called to update the entity's position/logic.
|
* Called to update the entity's position/logic.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void onUpdate()
|
public void onUpdate()
|
||||||
{
|
{
|
||||||
this.prevPosX = this.posX;
|
this.prevPosX = this.posX;
|
||||||
@@ -136,7 +140,7 @@ public class RiftFX extends EntityFX
|
|||||||
|
|
||||||
if (this.particleAge > this.particleMaxAge / 2)
|
if (this.particleAge > this.particleMaxAge / 2)
|
||||||
{
|
{
|
||||||
this.setAlphaF(1.0F - ((float)this.particleAge - (float)(this.particleMaxAge / 2)) / (float)this.particleMaxAge);
|
this.setAlphaF(1.0F - ((float)this.particleAge - (float)(this.particleMaxAge / 2)) / this.particleMaxAge);
|
||||||
|
|
||||||
if (this.field_92053_aD)
|
if (this.field_92053_aD)
|
||||||
{
|
{
|
||||||
@@ -178,6 +182,7 @@ public class RiftFX extends EntityFX
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getBrightnessForRender(float par1)
|
public int getBrightnessForRender(float par1)
|
||||||
{
|
{
|
||||||
return 15728880;
|
return 15728880;
|
||||||
@@ -186,6 +191,7 @@ public class RiftFX extends EntityFX
|
|||||||
/**
|
/**
|
||||||
* Gets how bright this entity is.
|
* Gets how bright this entity is.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public float getBrightness(float par1)
|
public float getBrightness(float par1)
|
||||||
{
|
{
|
||||||
return 1.0F;
|
return 1.0F;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<project name="Necromancy" default="install" basedir=".">
|
<project name="DimensionalDoors" default="install" basedir=".">
|
||||||
<property environment="env" />
|
<property environment="env" />
|
||||||
|
|
||||||
<property name="project.name" value="DimDoors" />
|
<property name="project.name" value="DimDoors" />
|
||||||
|
|||||||
199
buildOLD.xml
@@ -1,199 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
<project name="DimensionalDoors" default="install" basedir=".">
|
|
||||||
|
|
||||||
<property environment="env" />
|
|
||||||
|
|
||||||
<property name="build.dir" value="build" />
|
|
||||||
<property name="classes.dir" value="${build.dir}/packaging" />
|
|
||||||
<property name="src.dir" value="src" />
|
|
||||||
<property name="forge.version" value="1.5.2-7.8.0.691" />
|
|
||||||
<property name="forge.url" value="http://files.minecraftforge.net/minecraftforge/minecraftforge-src-${forge.version}.zip" />
|
|
||||||
<property name="mcp.version" value="751" />
|
|
||||||
<property name="forge.dir" value="${build.dir}/forge" />
|
|
||||||
<property name="mcp.dir" value="${forge.dir}/mcp" />
|
|
||||||
<property name="mcpsrc.dir" value="${mcp.dir}/src/minecraft" />
|
|
||||||
<property name="resources.dir" value="resources" />
|
|
||||||
|
|
||||||
<property name="package.meta-inf" value="META-INF" />
|
|
||||||
<property name="build.ver" value="1.5.2" />
|
|
||||||
<property name="dist.dir" value="${build.dir}/dist" />
|
|
||||||
|
|
||||||
<property name="download.dir" value="downloads" />
|
|
||||||
|
|
||||||
<property name="lib.dir" value="${mcp.dir}/lib" />
|
|
||||||
|
|
||||||
<property file="${forge.dir}/forgeversion.properties" />
|
|
||||||
<condition property="forge.already.installed">
|
|
||||||
<equals arg1="${forge.build.number}" arg2="691" />
|
|
||||||
</condition>
|
|
||||||
|
|
||||||
<property name="verclass.dir" value="${mcpsrc.dir}/StevenDimDoors/mod_pocketDim/" />
|
|
||||||
<property name="verclass.name" value="mod_pocketDim.java"/>
|
|
||||||
|
|
||||||
|
|
||||||
<mkdir dir="${download.dir}"/>
|
|
||||||
<mkdir dir="${build.dir}" />
|
|
||||||
|
|
||||||
<target name="get-version" depends="setup-forge">
|
|
||||||
<mkdir dir="${mcpsrc.dir}/StevenDimDoors" />
|
|
||||||
<copy todir="${mcpsrc.dir}/StevenDimDoors" overwrite="true">
|
|
||||||
<fileset dir="StevenDimDoors" />
|
|
||||||
</copy>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<exec dir="${verclass.dir}" executable="sh" osfamily="unix" outputproperty="grep.out">
|
|
||||||
<arg value="-c"/>
|
|
||||||
<arg value="grep -o -P '[0-9.]+R[0-9.]+(RC[0-9]+)?(B[0-9]+)?' ${verclass.name}"/>
|
|
||||||
</exec>
|
|
||||||
<exec executable="python" osfamily="unix">
|
|
||||||
<arg value="versionscript.py" />
|
|
||||||
<arg value="${grep.out}" />
|
|
||||||
</exec>
|
|
||||||
<echo message="Grepped version: ${grep.out}"/>
|
|
||||||
<copy todir="${classes.dir}" file="mcmod.info" overwrite="true"/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<available property="forge-exists" file="${download.dir}/minecraftforge-src-${forge.version}.zip" />
|
|
||||||
<available property="already-compiled" file="${classes.dir}/deathrat" />
|
|
||||||
<condition property="should-download-ant-contrib">
|
|
||||||
<or>
|
|
||||||
<available file="${download.dir}/ant-contrib/ant-contrib-1.0b3.jar"/>
|
|
||||||
<available file="${download.dir}/minecraftforge-src-${forge.version}.zip"/>
|
|
||||||
</or>
|
|
||||||
</condition>
|
|
||||||
|
|
||||||
<target name="install" depends="build">
|
|
||||||
<copy todir="${classes.dir}/schematics" overwrite="true">
|
|
||||||
<fileset dir="schematics" />
|
|
||||||
</copy>
|
|
||||||
<zip destfile="${dist.dir}/DimensionalDoors-${grep.out}-${build.number}.zip" basedir="${classes.dir}"/>
|
|
||||||
<delete dir="${classes.dir}" />
|
|
||||||
<delete dir="${mcp.dir}/reobf"/>
|
|
||||||
<delete dir="${mcpsrc}/StevenDimDoors" />
|
|
||||||
<delete dir="${mcpsrc}/Steven" />
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="build" depends="get-version" unless="already-compiled">
|
|
||||||
<!-- Recompile -->
|
|
||||||
<exec dir="${mcp.dir}" executable="cmd" osfamily="windows" failonerror="true">
|
|
||||||
<arg line="/c recompile.bat"/>
|
|
||||||
</exec>
|
|
||||||
|
|
||||||
<exec dir="${mcp.dir}" executable="sh" osfamily="unix" failonerror="true">
|
|
||||||
<arg value="recompile.sh" />
|
|
||||||
</exec>
|
|
||||||
|
|
||||||
<!-- Reobf -->
|
|
||||||
<exec dir="${mcp.dir}" executable="cmd" osfamily="windows">
|
|
||||||
<arg line="/c reobfuscate_srg.bat"/>
|
|
||||||
</exec>
|
|
||||||
|
|
||||||
<exec dir="${mcp.dir}" executable="sh" osfamily="unix">
|
|
||||||
<arg value="reobfuscate_srg.sh" />
|
|
||||||
</exec>
|
|
||||||
|
|
||||||
<copy todir="${classes.dir}">
|
|
||||||
<fileset dir="${mcp.dir}/reobf/minecraft"/>
|
|
||||||
</copy>
|
|
||||||
<copy todir="${classes.dir}">
|
|
||||||
<fileset dir="${resources.dir}"/>
|
|
||||||
</copy>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="build-number-there" if="env.BUILD_NUMBER" >
|
|
||||||
<echo message="Using build number ${env.BUILD_NUMBER}..." />
|
|
||||||
<property name="build.number" value="${env.BUILD_NUMBER}" />
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="build-number-not-there" unless="env.BUILD_NUMBER" >
|
|
||||||
<echo message="!! No build number set !!" />
|
|
||||||
<property name="build.number" value="CUSTOM_BUILD" />
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="setup-forge" depends="download-forge,build-number-there,build-number-not-there" unless="forge.already.installed">
|
|
||||||
|
|
||||||
<property name="build.full" value="${build.number}" />
|
|
||||||
<unzip dest="${build.dir}">
|
|
||||||
<fileset dir="${download.dir}">
|
|
||||||
<include name="minecraftforge-src-${forge.version}.zip"/>
|
|
||||||
</fileset>
|
|
||||||
</unzip>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Change executables' permitions -->
|
|
||||||
|
|
||||||
<chmod file="${forge.dir}/install.sh" perm="+x"/>
|
|
||||||
|
|
||||||
<!-- if your building on OSX these 2 should be executable -->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Install forge -->
|
|
||||||
<delete dir="${mcp.dir}" failonerror="no"/>
|
|
||||||
<exec dir="${forge.dir}" executable="cmd" osfamily="windows" inputstring="Yes\n">
|
|
||||||
<arg line="/c install.cmd"/>
|
|
||||||
</exec>
|
|
||||||
|
|
||||||
<exec dir="${forge.dir}" executable="sh" osfamily="unix" inputstring="Yes\n">
|
|
||||||
<arg value="install.sh" />
|
|
||||||
|
|
||||||
</exec>
|
|
||||||
|
|
||||||
|
|
||||||
<chmod file="${mcp.dir}/updatemd5.sh" perm="+x"/>
|
|
||||||
<chmod file="${mcp.dir}/recompile.sh" perm="+x"/>
|
|
||||||
<chmod file="${mcp.dir}/reobfuscate_srg.sh" perm="+x"/>
|
|
||||||
<chmod file="${mcp.dir}/runtime/bin/astyle-osx" perm="+x" />
|
|
||||||
<chmod file="${mcp.dir}/runtime/bin/jad-osx" perm="+x" />
|
|
||||||
<!-- Copy libraries -->
|
|
||||||
<!-- <copy todir="${mcp.dir}/lib" >
|
|
||||||
<fileset dir="lib" >
|
|
||||||
<patternset includes="*.jar" />
|
|
||||||
</fileset>
|
|
||||||
</copy> -->
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="download-forge" depends="download-ant-contrib" unless="forge-exists">
|
|
||||||
<taskdef resource="net/sf/antcontrib/antlib.xml">
|
|
||||||
<classpath>
|
|
||||||
<pathelement location="${download.dir}/ant-contrib/ant-contrib-1.0b3.jar"/>
|
|
||||||
<fileset dir="${download.dir}/ant-contrib/lib">
|
|
||||||
<include name="*.jar"/>
|
|
||||||
</fileset>
|
|
||||||
</classpath>
|
|
||||||
</taskdef>
|
|
||||||
<echo message="Downloading forge... " />
|
|
||||||
<get src="${forge.url}" dest="${download.dir}/minecraftforge-src-${forge.version}.zip" />
|
|
||||||
</target>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<target name="download-ant-contrib" unless="should-download-ant-contrib">
|
|
||||||
<echo message="Getting: ant-contrib"/>
|
|
||||||
<mkdir dir="${download.dir}/tmp"/>
|
|
||||||
<mkdir dir="${download.dir}/ant-contrib/lib" />
|
|
||||||
<get src="http://sourceforge.net/projects/ant-contrib/files/ant-contrib/1.0b3/ant-contrib-1.0b3-bin.zip/download" dest="${download.dir}/tmp/ant-contrib-1.0b3-bin.zip"/>
|
|
||||||
<get src="http://archive.apache.org/dist/commons/codec/binaries/commons-codec-1.6-bin.zip" dest="${download.dir}/tmp/commons-codec-1.6-bin.zip"/>
|
|
||||||
|
|
||||||
<unzip src="${download.dir}/tmp/ant-contrib-1.0b3-bin.zip" dest="${download.dir}"/>
|
|
||||||
<unzip src="${download.dir}/tmp/commons-codec-1.6-bin.zip" dest="${download.dir}/tmp"/>
|
|
||||||
|
|
||||||
<move todir="${download.dir}/ant-contrib/lib">
|
|
||||||
<fileset file="${download.dir}/tmp/commons-codec-1.6/commons-codec-1.6.jar"/>
|
|
||||||
</move>
|
|
||||||
|
|
||||||
<!-- Delete useless files -->
|
|
||||||
<delete dir="${download.dir}/ant-contrib/docs"/>
|
|
||||||
<delete dir="${download.dir}/tmp"/>
|
|
||||||
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="clean" >
|
|
||||||
<delete dir="${build.dir}" />
|
|
||||||
</target>
|
|
||||||
|
|
||||||
|
|
||||||
</project>
|
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 345 KiB After Width: | Height: | Size: 345 KiB |
|
Before Width: | Height: | Size: 471 KiB After Width: | Height: | Size: 471 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |