Overhauled Loot #114
@@ -1,64 +0,0 @@
|
||||
package StevenDimDoors.mod_pocketDim.items;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemDoor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemGoldDoor extends ItemDoor
|
||||
{
|
||||
|
||||
public ItemGoldDoor(int par1, Material par2Material)
|
||||
{
|
||||
super(par1, par2Material);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().replace("item.", ""));
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
++par5;
|
||||
Block block = mod_pocketDim.goldDoor;
|
||||
|
||||
|
||||
|
||||
if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack))
|
||||
{
|
||||
if (!block.canPlaceBlockAt(par3World, par4, par5, par6))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
int i1 = MathHelper.floor_double((double)((par2EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
|
||||
placeDoorBlock(par3World, par4, par5, par6, i1, block);
|
||||
--par1ItemStack.stackSize;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
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.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityDimDoor extends TileEntity
|
||||
|
||||
{
|
||||
public boolean openOrClosed;
|
||||
public int orientation;
|
||||
public boolean hasExit;
|
||||
public boolean isDungeonChainLink;
|
||||
public boolean hasGennedPair=false;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public boolean canUpdate()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void updateEntity()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt)
|
||||
{
|
||||
super.readFromNBT(nbt);
|
||||
int i = nbt.getInteger(("Size"));
|
||||
|
||||
try
|
||||
{
|
||||
this.openOrClosed = nbt.getBoolean("openOrClosed");
|
||||
|
||||
this.orientation = nbt.getInteger("orientation");
|
||||
|
||||
this.hasExit = nbt.getBoolean("hasExit");
|
||||
|
||||
this.isDungeonChainLink = nbt.getBoolean("isDungeonChainLink");
|
||||
|
||||
this.hasGennedPair = nbt.getBoolean("hasGennedPair");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt)
|
||||
{
|
||||
int i = 0;
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setBoolean("openOrClosed", this.openOrClosed);
|
||||
|
||||
nbt.setBoolean("hasExit", this.hasExit);
|
||||
|
||||
nbt.setInteger("orientation", this.orientation);
|
||||
|
||||
nbt.setBoolean("isDungeonChainLink", isDungeonChainLink);
|
||||
|
||||
nbt.setBoolean("hasGennedPair", hasGennedPair);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,141 +0,0 @@
|
||||
package StevenDimDoors.mod_pocketDim.tileentities;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.IChunkLoader;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
import StevenDimDoors.mod_pocketDim.util.Point4D;
|
||||
import StevenDimDoors.mod_pocketDim.world.PocketBuilder;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.ChunkCoordIntPair;
|
||||
import net.minecraftforge.common.ForgeChunkManager;
|
||||
import net.minecraftforge.common.ForgeChunkManager.Ticket;
|
||||
import net.minecraftforge.common.ForgeChunkManager.Type;
|
||||
|
||||
public class TileEntityDimDoorGold extends TileEntityDimDoor implements IChunkLoader
|
||||
{
|
||||
|
||||
private Ticket chunkTicket;
|
||||
|
||||
public boolean canUpdate()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity()
|
||||
{ // every tick?
|
||||
if (PocketManager.getDimensionData(this.worldObj) != null &&
|
||||
PocketManager.getDimensionData(this.worldObj).isPocketDimension() &&
|
||||
!this.worldObj.isRemote)
|
||||
{
|
||||
if(PocketManager.getLink(this.xCoord,this.yCoord,this.zCoord,this.worldObj)==null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (this.chunkTicket == null)
|
||||
{
|
||||
if(chunkTicket == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
chunkTicket = ForgeChunkManager.requestTicket(mod_pocketDim.instance, worldObj, Type.NORMAL);
|
||||
chunkTicket.getModData().setInteger("goldDimDoorX", xCoord);
|
||||
chunkTicket.getModData().setInteger("goldDimDoorY", yCoord);
|
||||
chunkTicket.getModData().setInteger("goldDimDoorZ", zCoord);
|
||||
forceChunkLoading(chunkTicket,this.xCoord,this.zCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forceChunkLoading(Ticket chunkTicket,int x,int z)
|
||||
{
|
||||
Point4D origin = PocketManager.getDimensionData(this.worldObj).origin();
|
||||
int orientation = PocketManager.getDimensionData(this.worldObj).orientation();
|
||||
|
||||
int xOffset=0;
|
||||
int zOffset=0;
|
||||
|
||||
switch(orientation)
|
||||
{
|
||||
case 0:
|
||||
xOffset = PocketBuilder.DEFAULT_POCKET_SIZE/2;
|
||||
break;
|
||||
case 1:
|
||||
zOffset = PocketBuilder.DEFAULT_POCKET_SIZE/2;
|
||||
|
||||
break;
|
||||
case 2:
|
||||
xOffset = -PocketBuilder.DEFAULT_POCKET_SIZE/2;
|
||||
|
||||
break;
|
||||
case 3:
|
||||
zOffset = -PocketBuilder.DEFAULT_POCKET_SIZE/2;
|
||||
|
||||
break;
|
||||
}
|
||||
for(int chunkX = -1; chunkX<2;chunkX++)
|
||||
{
|
||||
for(int chunkZ = -1; chunkZ<2;chunkZ++)
|
||||
{
|
||||
ForgeChunkManager.forceChunk(chunkTicket, new ChunkCoordIntPair((origin.getX()+xOffset >> 4)+chunkX, (origin.getZ()+zOffset >> 4)+chunkZ));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void invalidate()
|
||||
{
|
||||
ForgeChunkManager.releaseTicket(chunkTicket);
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt)
|
||||
{
|
||||
super.readFromNBT(nbt);
|
||||
int i = nbt.getInteger(("Size"));
|
||||
|
||||
try
|
||||
{
|
||||
this.openOrClosed = nbt.getBoolean("openOrClosed");
|
||||
|
||||
this.orientation = nbt.getInteger("orientation");
|
||||
|
||||
this.hasExit = nbt.getBoolean("hasExit");
|
||||
|
||||
this.isDungeonChainLink = nbt.getBoolean("isDungeonChainLink");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt)
|
||||
{
|
||||
int i = 0;
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setBoolean("openOrClosed", this.openOrClosed);
|
||||
|
||||
nbt.setBoolean("hasExit", this.hasExit);
|
||||
|
||||
nbt.setInteger("orientation", this.orientation);
|
||||
|
||||
nbt.setBoolean("isDungeonChainLink", isDungeonChainLink);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package StevenDimDoors.mod_pocketDim.watcher;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
||||
import StevenDimDoors.mod_pocketDim.util.Point4D;
|
||||
|
||||
public class ClientLinkData
|
||||
{
|
||||
public Point4D point;
|
||||
public int orientation;
|
||||
|
||||
public ClientLinkData(DimLink link)
|
||||
{
|
||||
this.point= link.source();
|
||||
this.orientation=link.orientation();
|
||||
}
|
||||
|
||||
public ClientLinkData(Point4D point, int orientation)
|
||||
{
|
||||
this.point = point;
|
||||
this.orientation=orientation;
|
||||
}
|
||||
|
||||
public void write(DataOutputStream output) throws IOException
|
||||
{
|
||||
Point4D.write(point, output);
|
||||
output.writeInt(orientation);
|
||||
}
|
||||
|
||||
public static ClientLinkData read(DataInputStream input) throws IOException
|
||||
{
|
||||
return new ClientLinkData(Point4D.read(input), input.readInt());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,232 +0,0 @@
|
||||
package StevenDimDoors.mod_pocketDim.world;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
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 CustomSkyProvider extends IRenderHandler
|
||||
{
|
||||
|
||||
int starGLCallList;
|
||||
int glSkyList;
|
||||
int glSkyList2;
|
||||
|
||||
|
||||
public String getMoonRenderPath()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getSunRenderPath()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void render(float par1, WorldClient world, Minecraft mc)
|
||||
{
|
||||
|
||||
starGLCallList = GLAllocation.generateDisplayLists(3);
|
||||
glSkyList = this.starGLCallList + 1;
|
||||
glSkyList2 = this.starGLCallList + 2;
|
||||
GL11.glDisable(GL11.GL_FOG);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glDepthMask(false);
|
||||
mc.renderEngine.bindTexture("/misc/tunnel.png");
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
if (mc.theWorld.provider.isSurfaceWorld())
|
||||
{
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
Vec3 vec3 = world.getSkyColor(mc.renderViewEntity, par1);
|
||||
float f1 = (float)vec3.xCoord;
|
||||
float f2 = (float)vec3.yCoord;
|
||||
float f3 = (float)vec3.zCoord;
|
||||
float f4;
|
||||
|
||||
if (mc.gameSettings.anaglyph)
|
||||
{
|
||||
float f5 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F;
|
||||
float f6 = (f1 * 30.0F + f2 * 70.0F) / 100.0F;
|
||||
f4 = (f1 * 30.0F + f3 * 70.0F) / 100.0F;
|
||||
f1 = f5;
|
||||
f2 = f6;
|
||||
f3 = f4;
|
||||
}
|
||||
|
||||
GL11.glColor3f(f1, f2, f3);
|
||||
Tessellator tessellator1 = Tessellator.instance;
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glEnable(GL11.GL_FOG);
|
||||
GL11.glColor3f(f1, f2, f3);
|
||||
GL11.glCallList(this.glSkyList);
|
||||
GL11.glDisable(GL11.GL_FOG);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
float[] afloat = world.provider.calcSunriseSunsetColors(world.getCelestialAngle(par1), par1);
|
||||
float f7;
|
||||
float f8;
|
||||
float f9;
|
||||
float f10;
|
||||
|
||||
if (afloat != null)
|
||||
{
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(MathHelper.sin(world.getCelestialAngleRadians(par1)) < 0.0F ? 180.0F : 0.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F);
|
||||
f4 = afloat[0];
|
||||
f7 = afloat[1];
|
||||
f8 = afloat[2];
|
||||
float f11;
|
||||
|
||||
if (mc.gameSettings.anaglyph)
|
||||
{
|
||||
f9 = (f4 * 30.0F + f7 * 59.0F + f8 * 11.0F) / 100.0F;
|
||||
f10 = (f4 * 30.0F + f7 * 70.0F) / 100.0F;
|
||||
f11 = (f4 * 30.0F + f8 * 70.0F) / 100.0F;
|
||||
f4 = f9;
|
||||
f7 = f10;
|
||||
f8 = f11;
|
||||
}
|
||||
|
||||
tessellator1.startDrawing(6);
|
||||
tessellator1.setColorRGBA_F(f4, f7, f8, afloat[3]);
|
||||
tessellator1.addVertex(0.0D, 100.0D, 0.0D);
|
||||
byte b0 = 16;
|
||||
tessellator1.setColorRGBA_F(afloat[0], afloat[1], afloat[2], 0.0F);
|
||||
|
||||
for (int j = 0; j <= b0; ++j)
|
||||
{
|
||||
f11 = (float)j * (float)Math.PI * 2.0F / (float)b0;
|
||||
float f12 = MathHelper.sin(f11);
|
||||
float f13 = MathHelper.cos(f11);
|
||||
tessellator1.addVertex((double)(f12 * 120.0F), (double)(f13 * 120.0F), (double)(-f13 * 40.0F * afloat[3]));
|
||||
}
|
||||
|
||||
tessellator1.draw();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
|
||||
GL11.glPushMatrix();
|
||||
f4 = 1.0F - world.getRainStrength(par1);
|
||||
f7 = 0.0F;
|
||||
f8 = 0.0F;
|
||||
f9 = 0.0F;
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, f4);
|
||||
GL11.glTranslatef(f7, f8, f9);
|
||||
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(world.getCelestialAngle(par1) * 360.0F, 1.0F, 0.0F, 0.0F);
|
||||
f10 = 30.0F;
|
||||
mc.renderEngine.bindTexture(this.getSunRenderPath());
|
||||
tessellator1.startDrawingQuads();
|
||||
tessellator1.addVertexWithUV((double)(-f10), 100.0D, (double)(-f10), 0.0D, 0.0D);
|
||||
tessellator1.addVertexWithUV((double)f10, 100.0D, (double)(-f10), 1.0D, 0.0D);
|
||||
tessellator1.addVertexWithUV((double)f10, 100.0D, (double)f10, 1.0D, 1.0D);
|
||||
tessellator1.addVertexWithUV((double)(-f10), 100.0D, (double)f10, 0.0D, 1.0D);
|
||||
tessellator1.draw();
|
||||
f10 = 20.0F;
|
||||
mc.renderEngine.bindTexture(this.getMoonRenderPath());
|
||||
int k = world.getMoonPhase();
|
||||
int l = k % 4;
|
||||
int i1 = k / 4 % 2;
|
||||
float f14 = (float)(l + 0) ;
|
||||
float f15 = (float)(i1 + 0);
|
||||
float f16 = (float)(l + 1) ;
|
||||
float f17 = (float)(i1 + 1);
|
||||
tessellator1.startDrawingQuads();
|
||||
tessellator1.addVertexWithUV((double)(-f10), -100.0D, (double)f10, (double)f16, (double)f17);
|
||||
tessellator1.addVertexWithUV((double)f10, -100.0D, (double)f10, (double)f14, (double)f17);
|
||||
tessellator1.addVertexWithUV((double)f10, -100.0D, (double)(-f10), (double)f14, (double)f15);
|
||||
tessellator1.addVertexWithUV((double)(-f10), -100.0D, (double)(-f10), (double)f16, (double)f15);
|
||||
tessellator1.draw();
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
float f18 = world.getStarBrightness(par1) * f4;
|
||||
|
||||
if (f18 > 0.0F)
|
||||
{
|
||||
GL11.glColor4f(f18, f18, f18, f18);
|
||||
GL11.glCallList(this.starGLCallList);
|
||||
}
|
||||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_FOG);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glColor3f(0.0F, 0.0F, 0.0F);
|
||||
double d0 = mc.thePlayer.getPosition(par1).yCoord - world.getHorizon();
|
||||
|
||||
if (d0 < 0.0D)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0.0F, 12.0F, 0.0F);
|
||||
GL11.glCallList(this.glSkyList2);
|
||||
GL11.glPopMatrix();
|
||||
f8 = 1.0F;
|
||||
f9 = -((float)(d0 + 65.0D));
|
||||
f10 = -f8;
|
||||
tessellator1.startDrawingQuads();
|
||||
tessellator1.setColorRGBA_I(0, 255);
|
||||
tessellator1.addVertex((double)(-f8), (double)f9, (double)f8);
|
||||
tessellator1.addVertex((double)f8, (double)f9, (double)f8);
|
||||
tessellator1.addVertex((double)f8, (double)f10, (double)f8);
|
||||
tessellator1.addVertex((double)(-f8), (double)f10, (double)f8);
|
||||
tessellator1.addVertex((double)(-f8), (double)f10, (double)(-f8));
|
||||
tessellator1.addVertex((double)f8, (double)f10, (double)(-f8));
|
||||
tessellator1.addVertex((double)f8, (double)f9, (double)(-f8));
|
||||
tessellator1.addVertex((double)(-f8), (double)f9, (double)(-f8));
|
||||
tessellator1.addVertex((double)f8, (double)f10, (double)(-f8));
|
||||
tessellator1.addVertex((double)f8, (double)f10, (double)f8);
|
||||
tessellator1.addVertex((double)f8, (double)f9, (double)f8);
|
||||
tessellator1.addVertex((double)f8, (double)f9, (double)(-f8));
|
||||
tessellator1.addVertex((double)(-f8), (double)f9, (double)(-f8));
|
||||
tessellator1.addVertex((double)(-f8), (double)f9, (double)f8);
|
||||
tessellator1.addVertex((double)(-f8), (double)f10, (double)f8);
|
||||
tessellator1.addVertex((double)(-f8), (double)f10, (double)(-f8));
|
||||
tessellator1.addVertex((double)(-f8), (double)f10, (double)(-f8));
|
||||
tessellator1.addVertex((double)(-f8), (double)f10, (double)f8);
|
||||
tessellator1.addVertex((double)f8, (double)f10, (double)f8);
|
||||
tessellator1.addVertex((double)f8, (double)f10, (double)(-f8));
|
||||
tessellator1.draw();
|
||||
}
|
||||
|
||||
if (world.provider.isSkyColored())
|
||||
{
|
||||
GL11.glColor3f(f1 * 0.2F + 0.04F, f2 * 0.2F + 0.04F, f3 * 0.6F + 0.1F);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glColor3f(f1, f2, f3);
|
||||
}
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0.0F, -((float)(d0 - 16.0D)), 0.0F);
|
||||
GL11.glCallList(this.glSkyList2);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDepthMask(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package StevenDimDoors.mod_pocketDim.world;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
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
|
||||
{
|
||||
@Override
|
||||
public String getMoonRenderPath()
|
||||
{
|
||||
return "/mods/DimDoors/textures/other/limboMoon.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSunRenderPath()
|
||||
{
|
||||
return "/mods/DimDoors/textures/other/limboSun.png";
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package StevenDimDoors.mod_pocketDim.world;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
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 LimboSkyProvider extends CustomSkyProvider
|
||||
{
|
||||
@Override
|
||||
public String getMoonRenderPath()
|
||||
{
|
||||
return "/mods/DimDoors/textures/other/pocketMoon.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSunRenderPath()
|
||||
{
|
||||
return "/mods/DimDoors/textures/other/pocketSun.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package StevenDimDoors.mod_pocketDimClient;
|
||||
|
||||
import net.minecraft.client.renderer.entity.RenderLiving;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderMobObelisk extends RenderLiving
|
||||
{
|
||||
protected ModelMobObelisk obeliskModel;
|
||||
|
||||
public RenderMobObelisk(float f)
|
||||
{
|
||||
super(new ModelMobObelisk(), f);
|
||||
this.obeliskModel = (ModelMobObelisk)this.mainModel;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
49
build.gradle
Normal file
49
build.gradle
Normal file
@@ -0,0 +1,49 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
name = "forge"
|
||||
url = "http://files.minecraftforge.net/maven"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:1.0-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'forge'
|
||||
|
||||
|
||||
|
||||
version = "2.1.1RC1"
|
||||
group= "com.stevenrs11.dimdoors" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = "dimdoors"
|
||||
|
||||
minecraft {
|
||||
version = "1.6.4-9.11.1.964"
|
||||
}
|
||||
|
||||
targetCompatibility = '1.7'
|
||||
sourceCompatibility = '1.7'
|
||||
|
||||
processResources
|
||||
{
|
||||
// replace stuff in mcmod.info, nothing else
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
include 'mcmod/info'
|
||||
|
||||
// replace version and mcversion
|
||||
expand 'version':project.version, 'mcversion':project.minecraft.version
|
||||
}
|
||||
|
||||
// copy everything else, thats not the mcmod.info
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
exclude 'mcmod.info'
|
||||
}
|
||||
}
|
||||
|
||||
jar
|
||||
{
|
||||
destinationDir = new File("build/dist/")
|
||||
archiveName = "DimensionalDoors-${version}-${BUILD_NUMBER}"
|
||||
}
|
||||
@@ -1,64 +1,93 @@
|
||||
|
||||
|
||||
<project name="DimensionalDoors" default="install" basedir=".">
|
||||
|
||||
<property environment="env" />
|
||||
|
||||
<property name="project.name" value="DimDoors" />
|
||||
<property name="src.dir" value="StevenDimDoors" />
|
||||
<property name="resources.dir" value="resources" />
|
||||
<property name="schematics.dir" value="schematics" />
|
||||
<property name="versionclass.dir" value="mod_pocketDim" />
|
||||
<property name="versionclass.file" value="mod_pocketDim.java"/>
|
||||
|
||||
<property name="minecraft.version" value="1.6.4" />
|
||||
<property name="forge.forgeversion" value="9.11.1" />
|
||||
<property name="forge.buildnum" value="953" />
|
||||
|
||||
<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="resourcePack.dir" value="${classes.dir}" />
|
||||
<property name="schematicPack.dir" value="${classes.dir}/schematics/" />
|
||||
<property name="apiclasses.dir" value="${build.dir}/api-packaging" />
|
||||
<property name="forge.version" value="${minecraft.version}-${forge.forgeversion}.${forge.buildnum}" />
|
||||
<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="gson.url" value="https://google-gson.googlecode.com/files/google-gson-2.2.4-release.zip" />
|
||||
<property name="gson.name" value="gson-2.2.4.zip" />
|
||||
<property name="mcpsrc.dir" value="${mcp.dir}/src/minecraft/StevenDimDoors" />
|
||||
|
||||
<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="download.dir" value="${build.dir}/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" />
|
||||
<equals arg1="${forge.build.number}" arg2="${forge.buildnum}" />
|
||||
</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 name="get-version" depends="setup-forge">
|
||||
<!-- Copy source -->
|
||||
<copy todir="${mcpsrc.dir}" overwrite="true">
|
||||
<fileset dir="${src.dir}"/>
|
||||
</copy>
|
||||
|
||||
<!-- Get the version from the mcmod.info -->
|
||||
<script language="javascript">
|
||||
importClass(java.io.File);
|
||||
importClass(java.nio.file.Files)
|
||||
importClass(java.io.FileReader);
|
||||
importClass(java.io.BufferedReader);
|
||||
importClass(java.io.FileWriter);
|
||||
importClass(java.io.BufferedWriter);
|
||||
|
||||
echo = project.createTask("echo");
|
||||
echo.setMessage("Parsing mcmod.info...");
|
||||
echo.perform();
|
||||
|
||||
var file = new File("./mcmod.info");
|
||||
|
||||
fr = new FileReader(file);
|
||||
br = new BufferedReader(fr);
|
||||
|
||||
// Read the file.
|
||||
// This assumes the file has no line
|
||||
var line;
|
||||
var json = "";
|
||||
while ((line = br.readLine()) != null) {
|
||||
json += line;
|
||||
}
|
||||
|
||||
var struct = JSON.parse(json);
|
||||
var version = struct["modlist"][0].version;
|
||||
|
||||
echo = project.createTask("echo");
|
||||
echo.setMessage("Parsed version: " + version);
|
||||
echo.perform();
|
||||
|
||||
project.setProperty("mod.version", version);
|
||||
</script>
|
||||
|
||||
<!-- Replace the version information in the mod class -->
|
||||
<replace file="${mcpsrc.dir}/${versionclass.dir}/${versionclass.file}">
|
||||
<replacefilter token="$VERSION$" value="${mod.version}"/>
|
||||
</replace>
|
||||
</target>
|
||||
|
||||
<available property="forge-exists" file="${download.dir}/minecraftforge-src-${forge.version}.zip" />
|
||||
<available property="gson-exists" file="${mcpsrc.dir}/com/google/gson/Gson.java" />
|
||||
<available property="already-compiled" file="${classes.dir}/deathrat" />
|
||||
<available property="already-compiled" file="${classes.dir}/${src.dir}" />
|
||||
<condition property="should-download-ant-contrib">
|
||||
<or>
|
||||
<available file="${download.dir}/ant-contrib/ant-contrib-1.0b3.jar"/>
|
||||
@@ -67,27 +96,16 @@
|
||||
</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="${mcpsrc.dir}/${src.dir}" />
|
||||
<delete dir="${dist.dir}" />
|
||||
<jar destfile="${dist.dir}/${project.name}-${mod.version}-${build.number}.jar" basedir="${classes.dir}"/>
|
||||
<delete dir="${classes.dir}" />
|
||||
<delete dir="${mcp.dir}/reobf"/>
|
||||
<delete dir="${mcpsrc.dir}/StevenDimDoors" />
|
||||
<delete dir="${mcpsrc.dir}/Steven" />
|
||||
</target>
|
||||
|
||||
<target name="get-gson" unless="gson-exists">
|
||||
<get src="${gson.url}" dest="${download.dir}/${gson.name}" />
|
||||
<unzip src="${download.dir}/${gson.name}" dest="${download.dir}" />
|
||||
<unzip src="${download.dir}/google-gson-2.2.4/gson-2.2.4-sources.jar" dest="${download.dir}/google-gson-2.2.4/"/>
|
||||
<copy todir="${mcpsrc.dir}/com">
|
||||
<fileset dir="${download.dir}/google-gson-2.2.4/com"/>
|
||||
</copy>
|
||||
<delete dir="{$apiclasses.dir}" />
|
||||
<delete dir="${mcpsrc.dir}/${src.dir}" />
|
||||
</target>
|
||||
|
||||
<target name="build" depends="get-version,get-gson" unless="already-compiled">
|
||||
|
||||
<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"/>
|
||||
@@ -99,19 +117,36 @@
|
||||
|
||||
<!-- Reobf -->
|
||||
<exec dir="${mcp.dir}" executable="cmd" osfamily="windows">
|
||||
<arg line="/c reobfuscate_srg.bat"/>
|
||||
<arg line="/c reobfuscate.bat --srgnames"/>
|
||||
</exec>
|
||||
|
||||
<exec dir="${mcp.dir}" executable="sh" osfamily="unix">
|
||||
<arg value="reobfuscate_srg.sh" />
|
||||
<arg value="reobfuscate.sh" />
|
||||
</exec>
|
||||
|
||||
<copy todir="${classes.dir}">
|
||||
<fileset dir="${mcp.dir}/reobf/minecraft"/>
|
||||
</copy>
|
||||
<copy todir="${classes.dir}">
|
||||
<fileset dir="${resources.dir}"/>
|
||||
|
||||
<copy todir="${resourcePack.dir}">
|
||||
<fileset dir="${resources.dir}" />
|
||||
</copy>
|
||||
|
||||
<copy todir="${schematicPack.dir}">
|
||||
<fileset dir="${schematics.dir}" />
|
||||
</copy>
|
||||
|
||||
<copy todir="${classes.dir}">
|
||||
<fileset file="mcmod.info" />
|
||||
</copy>
|
||||
|
||||
<copy todir="${classes.dir}">
|
||||
<fileset file="${resources.dir}/pack.mcmeta" />
|
||||
</copy>
|
||||
|
||||
<delete file="${resourcePack.dir}/mcmod.info" />
|
||||
|
||||
<delete file="${resourcePack.dir}/pack.mcmeta" />
|
||||
</target>
|
||||
|
||||
<target name="build-number-there" if="env.BUILD_NUMBER" >
|
||||
@@ -121,7 +156,7 @@
|
||||
|
||||
<target name="build-number-not-there" unless="env.BUILD_NUMBER" >
|
||||
<echo message="!! No build number set !!" />
|
||||
<property name="build.number" value="CUSTOM_BUILD" />
|
||||
<property name="build.number" value="0" />
|
||||
</target>
|
||||
|
||||
<target name="setup-forge" depends="download-forge,build-number-there,build-number-not-there" unless="forge.already.installed">
|
||||
@@ -132,16 +167,10 @@
|
||||
<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">
|
||||
@@ -151,29 +180,12 @@
|
||||
<exec dir="${forge.dir}" executable="sh" osfamily="unix" inputstring="Yes\n">
|
||||
<arg value="install.sh" />
|
||||
</exec>
|
||||
|
||||
<get src="http://mirror.technicpack.net/Technic/lib/fml/fml_libs15.zip" dest="${download.dir}/fml_libs15.zip" />
|
||||
<unzip src="${download.dir}/fml_libs15.zip" dest="${lib.dir}/" />
|
||||
|
||||
<exec dir="${forge.dir}" executable="cmd" osfamily="windows" inputstring="Yes">
|
||||
<arg line="/c install.cmd"/>
|
||||
</exec>
|
||||
|
||||
<exec dir="${forge.dir}" executable="sh" osfamily="unix" inputstring="Yes">
|
||||
<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}/reobfuscate.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">
|
||||
@@ -186,11 +198,10 @@
|
||||
</classpath>
|
||||
</taskdef>
|
||||
<echo message="Downloading forge... " />
|
||||
<get src="${forge.url}" dest="${download.dir}/minecraftforge-src-${forge.version}.zip" />
|
||||
<get src="http://files.minecraftforge.net/minecraftforge-src-${forge.version}.zip"
|
||||
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"/>
|
||||
@@ -216,5 +227,4 @@
|
||||
</target>
|
||||
|
||||
|
||||
</project>
|
||||
|
||||
</project>
|
||||
199
buildOLD.xml
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>
|
||||
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
6
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
6
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
#Tue Oct 29 18:00:54 CDT 2013
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip
|
||||
164
gradlew
vendored
Executable file
164
gradlew
vendored
Executable file
@@ -0,0 +1,164 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
esac
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched.
|
||||
if $cygwin ; then
|
||||
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
fi
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >&-
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >&-
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||
function splitJvmOpts() {
|
||||
JVM_OPTS=("$@")
|
||||
}
|
||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||
|
||||
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
||||
90
gradlew.bat
vendored
Normal file
90
gradlew.bat
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windowz variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
goto execute
|
||||
|
||||
:4NT_args
|
||||
@rem Get arguments from the 4NT Shell from JP Software
|
||||
set CMD_LINE_ARGS=%$
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.0 KiB |
@@ -1 +0,0 @@
|
||||
0*7,1*7,2*7,3*7,4*7,5*7,6*7,5*7,4*7,3*7,2*7,1*7
|
||||
@@ -29,7 +29,7 @@ public class BlankTeleporter extends Teleporter
|
||||
public void setEntityPosition(Entity entity, double x, double y, double z)
|
||||
{
|
||||
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.setPosition(x, y, z);
|
||||
}
|
||||
@@ -8,7 +8,8 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class CloudRenderBlank extends IRenderHandler
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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.Packet250CustomPayload;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.integrated.IntegratedServer;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
import cpw.mods.fml.common.network.IConnectionHandler;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
@@ -36,7 +37,7 @@ public class ConnectionHandler implements IConnectionHandler
|
||||
{
|
||||
//This shouldn't happen...
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -98,8 +98,8 @@ public class CraftingManager
|
||||
{
|
||||
GameRegistry.addRecipe(new ItemStack(itemStableFabric, 1), new Object[]
|
||||
{
|
||||
"yyy", "yxy", "yyy", 'x', coreCraftingItem, 'y', mod_pocketDim.itemWorldThread
|
||||
});
|
||||
"yyy", "yxy", "yyy", 'x', coreCraftingItem, 'y', mod_pocketDim.itemWorldThread
|
||||
});
|
||||
}
|
||||
|
||||
if (properties.CraftingStabilizedRiftSignatureAllowed)
|
||||
@@ -1,6 +1,8 @@
|
||||
package StevenDimDoors.mod_pocketDim;
|
||||
|
||||
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.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -36,15 +38,15 @@ public class EventHookContainer
|
||||
@ForgeSubscribe
|
||||
public void onSoundLoad(SoundLoadEvent event)
|
||||
{
|
||||
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/monk.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/monk.ogg")));
|
||||
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/crack.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/crack.ogg")));
|
||||
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/tearing.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/tearing.ogg")));
|
||||
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/rift.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/rift.ogg")));
|
||||
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/riftStart.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/riftStart.ogg")));
|
||||
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/riftEnd.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/riftEnd.ogg")));
|
||||
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/riftClose.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/riftClose.ogg")));
|
||||
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/riftDoor.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/riftDoor.ogg")));
|
||||
event.manager.soundPoolMusic.addSound("mods/DimDoors/sfx/creepy.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/creepy.ogg")));
|
||||
event.manager.addSound(mod_pocketDim.modid+":monk.ogg");
|
||||
event.manager.addSound(mod_pocketDim.modid+":crack.ogg");
|
||||
event.manager.addSound(mod_pocketDim.modid+":tearing.ogg");
|
||||
event.manager.addSound(mod_pocketDim.modid+":rift.ogg");
|
||||
event.manager.addSound(mod_pocketDim.modid+":riftStart.ogg");
|
||||
event.manager.addSound(mod_pocketDim.modid+":riftEnd.ogg");
|
||||
event.manager.addSound(mod_pocketDim.modid+":riftClose.ogg");
|
||||
event.manager.addSound(mod_pocketDim.modid+":riftDoor.ogg");
|
||||
event.manager.addMusic(mod_pocketDim.modid+":creepy.ogg");
|
||||
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -93,10 +95,11 @@ public class EventHookContainer
|
||||
{
|
||||
player.inventory.clearInventory(-1, -1);
|
||||
}
|
||||
|
||||
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);
|
||||
DDTeleporter.teleportEntity(player, destination, false);
|
||||
player.setEntityHealth(player.getMaxHealth());
|
||||
player.setHealth(player.getMaxHealth());
|
||||
event.setCanceled(true);
|
||||
return false;
|
||||
}
|
||||
@@ -114,17 +117,24 @@ public class EventHookContainer
|
||||
|
||||
public void playMusicForDim(World world)
|
||||
{
|
||||
if(world.isRemote&&world.provider instanceof LimboProvider)
|
||||
if(world.isRemote)
|
||||
{
|
||||
SoundSystem sndSystem = FMLClientHandler.instance().getClient().sndManager.sndSystem;
|
||||
sndSystem.stop("BgMusic");
|
||||
SoundPoolEntry soundPoolEntry = FMLClientHandler.instance().getClient().sndManager.soundPoolMusic.getRandomSoundFromSoundPool("mods.DimDoors.sfx.creepy");
|
||||
sndSystem.backgroundMusic("LimboMusic", soundPoolEntry.soundUrl, soundPoolEntry.soundName, false);
|
||||
sndSystem.play("LimboMusic");
|
||||
}
|
||||
else if(world.isRemote && !(world.provider instanceof LimboProvider))
|
||||
{
|
||||
FMLClientHandler.instance().getClient().sndManager.sndSystem.stop("LimboMusic");
|
||||
SoundManager sndManager = FMLClientHandler.instance().getClient().sndManager;
|
||||
|
||||
if(world.provider instanceof LimboProvider)
|
||||
{
|
||||
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.provider instanceof LimboProvider))
|
||||
{
|
||||
sndManager.sndSystem.stop("LimboMusic");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
package StevenDimDoors.mod_pocketDim;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InvalidClassException;
|
||||
@@ -6,7 +7,7 @@ import java.io.ObjectInputStream;
|
||||
import java.io.ObjectStreamClass;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class ObjectSaveInputStream extends ObjectInputStream {
|
||||
|
||||
// private static Logger logger = LoggerFactory.getLogger(ObjectSaveInputStream.class);
|
||||
@@ -18,7 +19,7 @@ public class ObjectSaveInputStream extends ObjectInputStream {
|
||||
@Override
|
||||
protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException {
|
||||
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 {
|
||||
localClass = Class.forName(resultClassDescriptor.getName());
|
||||
} catch (ClassNotFoundException e) {
|
||||
@@ -33,7 +34,7 @@ public class ObjectSaveInputStream extends ObjectInputStream {
|
||||
final StringBuffer s = new StringBuffer("Overriding serialized class version mismatch: ");
|
||||
s.append("local serialVersionUID = ").append(localSUID);
|
||||
s.append(" stream serialVersionUID = ").append(streamSUID);
|
||||
Exception e = new InvalidClassException(s.toString());
|
||||
Exception e = new InvalidClassException(s.toString());
|
||||
// logger.error("Potentially Fatal Deserialization Operation.", e);
|
||||
resultClassDescriptor = localClassDescriptor; // Use local class descriptor for deserialization
|
||||
}
|
||||
@@ -11,4 +11,6 @@ public class PacketConstants
|
||||
public static final byte DELETE_DIM_PACKET_ID = 3;
|
||||
public static final byte CREATE_LINK_PACKET_ID = 4;
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Point3D clone()
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other)
|
||||
{
|
||||
return equals((Point3D) other);
|
||||
@@ -4,6 +4,7 @@ import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.watcher.ClientLinkData;
|
||||
import net.minecraft.network.INetworkManager;
|
||||
import net.minecraft.network.packet.Packet250CustomPayload;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
@@ -40,16 +41,16 @@ public class ServerPacketHandler implements IPacketHandler
|
||||
}
|
||||
}
|
||||
|
||||
private static class LinkWatcher implements IUpdateWatcher<Point4D>
|
||||
private static class LinkWatcher implements IUpdateWatcher<ClientLinkData>
|
||||
{
|
||||
@Override
|
||||
public void onCreated(Point4D message)
|
||||
public void onCreated(ClientLinkData message)
|
||||
{
|
||||
sendLinkPacket(PacketConstants.CREATE_LINK_PACKET_ID, message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeleted(Point4D message)
|
||||
public void onDeleted(ClientLinkData message)
|
||||
{
|
||||
sendLinkPacket(PacketConstants.DELETE_LINK_PACKET_ID, message);
|
||||
}
|
||||
@@ -77,7 +78,7 @@ public class ServerPacketHandler implements IPacketHandler
|
||||
}
|
||||
}
|
||||
|
||||
private static void sendLinkPacket(byte id, Point4D data)
|
||||
private static void sendLinkPacket(byte id, ClientLinkData message)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -85,7 +86,7 @@ public class ServerPacketHandler implements IPacketHandler
|
||||
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
|
||||
DataOutputStream writer = new DataOutputStream(buffer);
|
||||
writer.writeByte(id);
|
||||
Point4D.write(data, writer);
|
||||
message.write(writer);
|
||||
writer.close();
|
||||
packet.channel = PacketConstants.CHANNEL_NAME;
|
||||
packet.data = buffer.toByteArray();
|
||||
@@ -6,12 +6,10 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockDoor;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemDoor;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Icon;
|
||||
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.DimLink;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
import StevenDimDoors.mod_pocketDim.items.BaseItemDoor;
|
||||
import StevenDimDoors.mod_pocketDim.schematic.BlockRotator;
|
||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityDimDoor;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEntityProvider
|
||||
{
|
||||
protected final DDProperties properties;
|
||||
@@ -40,13 +38,15 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2()+"_top");
|
||||
this.blockIconBottom = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2()+"_bottom");
|
||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName()+"_top");
|
||||
this.blockIconBottom = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName()+"_bottom");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
/**
|
||||
* From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
||||
@@ -64,6 +64,7 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -77,7 +78,7 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
||||
shouldOpen = false;
|
||||
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)
|
||||
{
|
||||
@@ -87,7 +88,7 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
||||
}
|
||||
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)
|
||||
{
|
||||
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
|
||||
*/
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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
|
||||
* 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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
// Dont check for non-player entites
|
||||
canUse = isEntityFacingDoor(metadata, (EntityLiving) entity);
|
||||
canUse = isEntityFacingDoor(metadata, (EntityLivingBase) entity);
|
||||
}
|
||||
if (canUse)
|
||||
{
|
||||
@@ -418,12 +421,12 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
||||
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,
|
||||
// we should only apply it to living entities since things
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
@@ -57,10 +57,11 @@ public class BlockDimWall extends Block
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.blockIcon[0] = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2());
|
||||
this.blockIcon[1] = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2() + "Perm");
|
||||
this.blockIcon[0] = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName());
|
||||
this.blockIcon[1] = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName() + "Perm");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -77,6 +78,7 @@ public class BlockDimWall extends Block
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(int unknown, CreativeTabs tab, List subItems)
|
||||
@@ -86,14 +88,17 @@ public class BlockDimWall extends Block
|
||||
subItems.add(new ItemStack(this, 1, ix));
|
||||
}
|
||||
}
|
||||
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {}
|
||||
@Override
|
||||
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {}
|
||||
|
||||
protected boolean canSilkHarvest()
|
||||
@Override
|
||||
protected boolean canSilkHarvest()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public int quantityDropped(Random par1Random)
|
||||
@Override
|
||||
public int quantityDropped(Random par1Random)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -101,7 +106,8 @@ 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.
|
||||
*/
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9)
|
||||
@Override
|
||||
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
|
||||
if (entityPlayer.getCurrentEquippedItem() != null && world.getBlockMetadata(x, y, z) == 0)
|
||||
@@ -30,21 +30,25 @@ public class BlockDimWallPerm extends Block
|
||||
properties = DDProperties.instance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2());
|
||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random par1Random)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
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
|
||||
*/
|
||||
@Override
|
||||
public void onEntityWalking(World world, int x, int y, int z, Entity entity)
|
||||
{
|
||||
if (!world.isRemote && world.provider.dimensionId == properties.LimboDimensionID)
|
||||
@@ -17,6 +17,7 @@ public class BlockDoorGold extends BlockDoor
|
||||
{
|
||||
|
||||
private Icon blockIconBottom;
|
||||
@SuppressWarnings("unused") // ??
|
||||
private DDProperties properties;
|
||||
|
||||
public BlockDoorGold(int par1, Material par2Material,DDProperties properties)
|
||||
@@ -26,22 +27,25 @@ public class BlockDoorGold extends BlockDoor
|
||||
|
||||
}
|
||||
|
||||
public int idDropped(int par1, Random par2Random, int par3)
|
||||
{
|
||||
return mod_pocketDim.itemGoldDoor.itemID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2()+"_top");
|
||||
this.blockIconBottom = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2()+"_bottom");
|
||||
}
|
||||
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)
|
||||
{
|
||||
return mod_pocketDim.itemGoldDoor.itemID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int par1, int par2)
|
||||
{
|
||||
return this.blockIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
@@ -1,27 +1,24 @@
|
||||
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.mod_pocketDim;
|
||||
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
||||
import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
||||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityDimDoor;
|
||||
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,
|
||||
DDProperties properties) {
|
||||
super(blockID, material, properties);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -40,9 +37,9 @@ public class BlockGoldDimDoor extends BaseDimDoor implements IDimDoor
|
||||
}
|
||||
@Override
|
||||
public int getDrops()
|
||||
{
|
||||
{
|
||||
return mod_pocketDim.itemGoldDoor.itemID;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world)
|
||||
@@ -40,7 +40,7 @@ public class BlockLimbo extends Block
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
this.blockIcon = iconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2());
|
||||
this.blockIcon = iconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -66,7 +66,7 @@ public class BlockRift extends BlockContainer
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2());
|
||||
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)
|
||||
@@ -313,10 +313,10 @@ public class BlockRift extends BlockContainer
|
||||
yChange=(float) ((yGrowth+yGrowthn)+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))));
|
||||
Zoffset= (float) ((0.25F/(1+Math.abs(zChange))));
|
||||
Yoffset= ((0.25F/(1+Math.abs(yChange))));
|
||||
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.PocketManager;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class DimensionalDoor extends BaseDimDoor
|
||||
{
|
||||
|
||||
@@ -8,7 +8,6 @@ import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemDoor;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
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.NewDimData;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
import StevenDimDoors.mod_pocketDim.items.BaseItemDoor;
|
||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityTransTrapdoor;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class TransTrapdoor extends BlockTrapDoor implements IDimDoor, ITileEntityProvider
|
||||
{
|
||||
|
||||
@@ -32,7 +31,7 @@ public class TransTrapdoor extends BlockTrapDoor implements IDimDoor, ITileEntit
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2());
|
||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName());
|
||||
}
|
||||
|
||||
//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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random random)
|
||||
{
|
||||
TileEntityTransTrapdoor tile = (TileEntityTransTrapdoor) world.getBlockTileEntity(x, y, z);
|
||||
@@ -1,21 +1,21 @@
|
||||
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.mod_pocketDim;
|
||||
import StevenDimDoors.mod_pocketDim.core.DDTeleporter;
|
||||
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
||||
import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
||||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||
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 TransientDoor(int blockID, Material material, DDProperties properties)
|
||||
@@ -37,10 +37,10 @@ public class TransientDoor extends BaseDimDoor
|
||||
{
|
||||
boolean canUse = true;
|
||||
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
|
||||
canUse = BaseDimDoor.isEntityFacingDoor(metadata, (EntityLiving) entity);
|
||||
canUse = BaseDimDoor.isEntityFacingDoor(metadata, (EntityLivingBase) entity);
|
||||
}
|
||||
if (canUse)
|
||||
{
|
||||
@@ -9,6 +9,7 @@ import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
||||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class WarpDoor extends BaseDimDoor
|
||||
{
|
||||
public WarpDoor(int blockID, Material material, DDProperties properties)
|
||||
@@ -1,9 +1,5 @@
|
||||
package StevenDimDoors.mod_pocketDim.commands;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
||||
import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
||||
@@ -13,6 +9,13 @@ import StevenDimDoors.mod_pocketDim.dungeon.DungeonData;
|
||||
import StevenDimDoors.mod_pocketDim.helpers.DungeonHelper;
|
||||
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
|
||||
{
|
||||
private static CommandCreateDungeonRift instance = null;
|
||||
@@ -30,6 +33,13 @@ public class CommandCreateDungeonRift extends DDCommandBase
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender sender) {
|
||||
return "Usage: /dd-rift <dungeon name>\r\n" +
|
||||
" /dd-rift list\r\n" +
|
||||
" /dd-rift random";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DDCommandResult processCommand(EntityPlayer sender, String[] command)
|
||||
{
|
||||
@@ -54,9 +64,9 @@ public class CommandCreateDungeonRift extends DDCommandBase
|
||||
Collection<String> dungeonNames = dungeonHelper.getDungeonNames();
|
||||
for (String name : dungeonNames)
|
||||
{
|
||||
sender.sendChatToPlayer(name);
|
||||
sendChat(sender,(name));
|
||||
}
|
||||
sender.sendChatToPlayer("");
|
||||
sendChat(sender,(""));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -65,7 +75,7 @@ public class CommandCreateDungeonRift extends DDCommandBase
|
||||
int x = MathHelper.floor_double(sender.posX);
|
||||
int y = MathHelper.floor_double(sender.posY);
|
||||
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"))
|
||||
{
|
||||
@@ -74,7 +84,7 @@ public class CommandCreateDungeonRift extends DDCommandBase
|
||||
link = dimension.createLink(x, y + 1, z, LinkTypes.DUNGEON,orientation);
|
||||
sender.worldObj.setBlock(x, y + 1, z,mod_pocketDim.blockRift.blockID,0,3);
|
||||
|
||||
sender.sendChatToPlayer("Created a rift to a random dungeon.");
|
||||
sendChat(sender,("Created a rift to a random dungeon."));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -84,17 +94,17 @@ public class CommandCreateDungeonRift extends DDCommandBase
|
||||
result = findDungeonByPartialName(command[0], dungeonHelper.getUntaggedDungeons());
|
||||
}
|
||||
//Check if we found any matches
|
||||
if (result != null)
|
||||
{
|
||||
//Create a rift to our selected dungeon and notify the player
|
||||
//TODO currently crashes, need to create the dimension first
|
||||
dimension = PocketManager.getDimensionData(sender.worldObj);
|
||||
link = dimension.createLink(x, y + 1, z, LinkTypes.DUNGEON,orientation);
|
||||
PocketBuilder.generateSelectedDungeonPocket(link, mod_pocketDim.properties, result);
|
||||
|
||||
sender.worldObj.setBlock(x, y + 1, z,mod_pocketDim.blockRift.blockID,0,3);
|
||||
sender.sendChatToPlayer("Created a rift to \"" + result.schematicName() + "\" dungeon (Dimension ID = " + link.destination().getDimension() + ").");
|
||||
}
|
||||
if (result != null)
|
||||
{
|
||||
//Create a rift to our selected dungeon and notify the player
|
||||
//TODO currently crashes, need to create the dimension first
|
||||
dimension = PocketManager.getDimensionData(sender.worldObj);
|
||||
link = dimension.createLink(x, y + 1, z, LinkTypes.DUNGEON,orientation);
|
||||
PocketBuilder.generateSelectedDungeonPocket(link, mod_pocketDim.properties, result);
|
||||
|
||||
sender.worldObj.setBlock(x, y + 1, z,mod_pocketDim.blockRift.blockID,0,3);
|
||||
sendChat(sender,("Created a rift to \"" + result.schematicName() + "\" dungeon (Dimension ID = " + link.destination().getDimension() + ")."));
|
||||
}
|
||||
else
|
||||
{
|
||||
//No matches!
|
||||
@@ -1,5 +1,6 @@
|
||||
package StevenDimDoors.mod_pocketDim.commands;
|
||||
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import StevenDimDoors.mod_pocketDim.helpers.DungeonHelper;
|
||||
|
||||
@@ -20,6 +21,11 @@ public class CommandCreatePocket extends DDCommandBase
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender sender) {
|
||||
return "Usage: /dd-create";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DDCommandResult processCommand(EntityPlayer sender, String[] command)
|
||||
{
|
||||
@@ -41,7 +47,7 @@ public class CommandCreatePocket extends DDCommandBase
|
||||
DungeonHelper.instance().createCustomDungeonDoor(sender.worldObj, x, y, z);
|
||||
|
||||
//Notify the player
|
||||
sender.sendChatToPlayer("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;
|
||||
}
|
||||
@@ -1,14 +1,16 @@
|
||||
package StevenDimDoors.mod_pocketDim.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
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;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class CommandDeleteAllLinks extends DDCommandBase
|
||||
{
|
||||
private static CommandDeleteAllLinks instance = null;
|
||||
@@ -26,6 +28,11 @@ public class CommandDeleteAllLinks extends DDCommandBase
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender sender) {
|
||||
return "Usage: /dd-deletelinks <targetDimensionID>";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DDCommandResult processCommand(EntityPlayer sender, String[] command)
|
||||
{
|
||||
@@ -41,7 +48,7 @@ public class CommandDeleteAllLinks extends DDCommandBase
|
||||
{
|
||||
targetDim=0;
|
||||
shouldGo=false;
|
||||
sender.sendChatToPlayer("Error-Invalid argument, delete_all_links <targetDimID>");
|
||||
sendChat(sender, ("Error-Invalid argument, delete_all_links <targetDimID>"));
|
||||
}
|
||||
|
||||
if(shouldGo)
|
||||
@@ -59,7 +66,7 @@ public class CommandDeleteAllLinks extends DDCommandBase
|
||||
|
||||
linksRemoved++;
|
||||
}
|
||||
sender.sendChatToPlayer("Removed " + linksRemoved + " links.");
|
||||
sendChat(sender,("Removed " + linksRemoved + " links."));
|
||||
|
||||
}
|
||||
return DDCommandResult.SUCCESS; //TEMPORARY HACK
|
||||
@@ -2,6 +2,7 @@ package StevenDimDoors.mod_pocketDim.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
@@ -9,6 +10,7 @@ import StevenDimDoors.mod_pocketDim.core.DimLink;
|
||||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class CommandDeleteRifts extends DDCommandBase
|
||||
{
|
||||
private static CommandDeleteRifts instance = null;
|
||||
@@ -26,6 +28,11 @@ public class CommandDeleteRifts extends DDCommandBase
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender sender) {
|
||||
return "Usage: /dd-??? <dimension ID>";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DDCommandResult processCommand(EntityPlayer sender, String[] command)
|
||||
{
|
||||
@@ -41,7 +48,7 @@ public class CommandDeleteRifts extends DDCommandBase
|
||||
{
|
||||
targetDim=0;
|
||||
shouldGo=false;
|
||||
sender.sendChatToPlayer("Error-Invalid argument, delete_all_links <targetDimID>");
|
||||
sendChat(sender,("Error-Invalid argument, delete_all_links <targetDimID>"));
|
||||
}
|
||||
|
||||
if(shouldGo)
|
||||
@@ -61,7 +68,7 @@ public class CommandDeleteRifts extends DDCommandBase
|
||||
dim.deleteLink(link);
|
||||
}
|
||||
}
|
||||
sender.sendChatToPlayer("Removed " + linksRemoved + " rifts.");
|
||||
sendChat(sender,("Removed " + linksRemoved + " rifts."));
|
||||
|
||||
}
|
||||
return DDCommandResult.SUCCESS; //TEMPORARY HACK
|
||||
@@ -2,6 +2,7 @@ package StevenDimDoors.mod_pocketDim.commands;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||
import StevenDimDoors.mod_pocketDim.helpers.DungeonHelper;
|
||||
@@ -25,6 +26,13 @@ public class CommandExportDungeon extends DDCommandBase
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender sender) {
|
||||
return "Usage: /dd-export <dungeon type> <dungeon name> open <weight>\r\n" +
|
||||
" /dd-export <dungeon type> <dungeon name> closed <weight>\r\n" +
|
||||
" /dd-export <schematic name> override";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DDCommandResult processCommand(EntityPlayer sender, String[] command)
|
||||
{
|
||||
@@ -132,7 +140,7 @@ public class CommandExportDungeon extends DDCommandBase
|
||||
String exportPath = properties.CustomSchematicDirectory + File.separator + name + ".schematic";
|
||||
if (dungeonHelper.exportDungeon(player.worldObj, x, y, z, exportPath))
|
||||
{
|
||||
player.sendChatToPlayer("Saved dungeon schematic in " + exportPath);
|
||||
sendChat(player,("Saved dungeon schematic in " + exportPath));
|
||||
dungeonHelper.registerDungeon(exportPath, dungeonHelper.getDungeonPack("ruins"), false, true);
|
||||
return DDCommandResult.SUCCESS;
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package StevenDimDoors.mod_pocketDim.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
||||
@@ -9,6 +10,7 @@ import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
||||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class CommandResetDungeons extends DDCommandBase
|
||||
{
|
||||
private static CommandResetDungeons instance = null;
|
||||
@@ -26,6 +28,11 @@ public class CommandResetDungeons extends DDCommandBase
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender sender) {
|
||||
return "/dd-resetdungeons";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DDCommandResult processCommand(EntityPlayer sender, String[] command)
|
||||
{
|
||||
@@ -84,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 implement blackList
|
||||
//Notify the user of the results
|
||||
sender.sendChatToPlayer("Reset complete. " + resetCount + " out of " + dungeonCount + " dungeons were reset.");
|
||||
sendChat(sender,("Reset complete. " + resetCount + " out of " + dungeonCount + " dungeons were reset."));
|
||||
return DDCommandResult.SUCCESS;
|
||||
}
|
||||
}
|
||||
@@ -1,23 +1,16 @@
|
||||
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.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.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
|
||||
|
||||
public class CommandTeleportPlayer extends DDCommandBase
|
||||
{
|
||||
private static CommandTeleportPlayer instance = null;
|
||||
@@ -36,13 +29,18 @@ public class CommandTeleportPlayer extends DDCommandBase
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender sender) {
|
||||
return "Usage: /dd-tp <player name> <dimension id> <x> <y> <z>";
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO- Change to accept variety of input, like just coords, just dim ID, or two player names.
|
||||
*/
|
||||
@Override
|
||||
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;
|
||||
int dimDestinationID = sender.worldObj.provider.dimensionId;
|
||||
|
||||
@@ -3,6 +3,7 @@ package StevenDimDoors.mod_pocketDim.commands;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
||||
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);
|
||||
|
||||
@Override
|
||||
public final String getCommandName()
|
||||
{
|
||||
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
|
||||
* to provide the sending player directly.
|
||||
*/
|
||||
@Override
|
||||
public final void processCommand(ICommandSender sender, String[] command)
|
||||
{
|
||||
//Forward the command
|
||||
@@ -63,10 +66,24 @@ public abstract class DDCommandBase extends CommandBase
|
||||
//Send the argument formats for this command
|
||||
for (String format : formats)
|
||||
{
|
||||
player.sendChatToPlayer("Usage: " + name + " " + format);
|
||||
sendChat(player,("Usage: " + name + " " + format));
|
||||
}
|
||||
}
|
||||
player.sendChatToPlayer(result.getMessage());
|
||||
sendChat(player,(result.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
public static void sendChat(EntityPlayer player, String message)
|
||||
{
|
||||
ChatMessageComponent cmp = new ChatMessageComponent();
|
||||
cmp.addText(message);
|
||||
player.sendChatToPlayer(cmp);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Object par1Obj)
|
||||
{
|
||||
return this.getCommandName().compareTo(((CommandBase)par1Obj).getCommandName());
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,6 @@ import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.item.EntityMinecart;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemDoor;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.packet.Packet41EntityEffect;
|
||||
import net.minecraft.network.packet.Packet43Experience;
|
||||
@@ -23,8 +22,6 @@ import net.minecraftforge.common.DimensionManager;
|
||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||
import StevenDimDoors.mod_pocketDim.Point3D;
|
||||
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.items.BaseItemDoor;
|
||||
import StevenDimDoors.mod_pocketDim.items.ItemDimensionalDoor;
|
||||
@@ -34,6 +31,7 @@ import StevenDimDoors.mod_pocketDim.util.Point4D;
|
||||
import StevenDimDoors.mod_pocketDim.world.PocketBuilder;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class DDTeleporter
|
||||
{
|
||||
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)
|
||||
{
|
||||
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.setPosition(x, y, z);
|
||||
}
|
||||
@@ -304,7 +302,7 @@ public class DDTeleporter
|
||||
}
|
||||
else
|
||||
{
|
||||
newWorld = (WorldServer) oldWorld;
|
||||
newWorld = oldWorld;
|
||||
}
|
||||
|
||||
|
||||
@@ -327,6 +325,7 @@ public class DDTeleporter
|
||||
// the last non-sleeping player leaves the Overworld
|
||||
// for a pocket dimension, causing all sleeping players
|
||||
// to remain asleep instead of progressing to day.
|
||||
((WorldServer)entity.worldObj).getPlayerManager().removePlayer(player);
|
||||
oldWorld.removePlayerEntityDangerously(player);
|
||||
player.isDead = false;
|
||||
|
||||
@@ -357,13 +356,13 @@ public class DDTeleporter
|
||||
oldWorld.getChunkFromChunkCoords(entX, entZ).isModified = true;
|
||||
}
|
||||
// Memory concerns.
|
||||
oldWorld.releaseEntitySkin(entity);
|
||||
oldWorld.onEntityRemoved(entity);
|
||||
|
||||
if (player == null) // Are we NOT working with a player?
|
||||
{
|
||||
NBTTagCompound entityNBT = new NBTTagCompound();
|
||||
entity.isDead = false;
|
||||
entity.addEntityID(entityNBT);
|
||||
entity.writeMountToNBT(entityNBT);
|
||||
entity.isDead = true;
|
||||
entity = EntityList.createEntityFromNBT(entityNBT, newWorld);
|
||||
|
||||
@@ -399,7 +398,6 @@ public class DDTeleporter
|
||||
if (player != null)
|
||||
{
|
||||
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.
|
||||
// Let's try doing this down here in case this is what's killing NEI.
|
||||
GameRegistry.onPlayerChangedDimension((EntityPlayer)entity);
|
||||
@@ -471,7 +469,7 @@ public class DDTeleporter
|
||||
{
|
||||
if(PocketManager.isBlackListed(link.destination().getDimension()))
|
||||
{
|
||||
link=PocketManager.getDimensionData(link.source().getDimension()).createLink(link.source,LinkTypes.SAFE_EXIT,link.orientation);
|
||||
link=PocketManager.getDimensionData(link.source().getDimension()).createLink(link.link.point,LinkTypes.SAFE_EXIT,link.link.orientation);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -547,7 +545,7 @@ public class DDTeleporter
|
||||
// To avoid loops, don't generate a destination if the player is
|
||||
// already in a non-pocket dimension.
|
||||
|
||||
NewDimData current = PocketManager.getDimensionData(link.source.getDimension());
|
||||
NewDimData current = PocketManager.getDimensionData(link.link.point.getDimension());
|
||||
if (current.isPocketDimension())
|
||||
{
|
||||
Point4D source = link.source();
|
||||
@@ -571,7 +569,7 @@ public class DDTeleporter
|
||||
{
|
||||
World startWorld = PocketManager.loadDimension(link.source().getDimension());
|
||||
World destWorld = PocketManager.loadDimension(link.destination().getDimension());
|
||||
TileEntity doorTE = startWorld.getBlockTileEntity(link.source().getX(), link.source().getY(), link.source.getZ());
|
||||
TileEntity doorTE = startWorld.getBlockTileEntity(link.source().getX(), link.source().getY(), link.link.point.getZ());
|
||||
if(doorTE instanceof TileEntityDimDoor)
|
||||
{
|
||||
if((TileEntityDimDoor.class.cast(doorTE).hasGennedPair))
|
||||
@@ -601,7 +599,7 @@ public class DDTeleporter
|
||||
}
|
||||
private static boolean generateSafeExit(DimLink link, DDProperties properties)
|
||||
{
|
||||
NewDimData current = PocketManager.getDimensionData(link.source.getDimension());
|
||||
NewDimData current = PocketManager.getDimensionData(link.link.point.getDimension());
|
||||
return generateSafeExit(current.root(), link, properties);
|
||||
}
|
||||
|
||||
@@ -610,7 +608,7 @@ public class DDTeleporter
|
||||
// A dungeon exit acts the same as a safe exit, but has the chance of
|
||||
// taking the user to any non-pocket dimension, excluding Limbo and The End.
|
||||
|
||||
NewDimData current = PocketManager.getDimensionData(link.source.getDimension());
|
||||
NewDimData current = PocketManager.getDimensionData(link.link.point.getDimension());
|
||||
ArrayList<NewDimData> roots = PocketManager.getRootDimensions();
|
||||
int shiftChance = START_ROOT_SHIFT_CHANCE + ROOT_SHIFT_CHANCE_PER_LEVEL * (current.packDepth() - 1);
|
||||
|
||||
@@ -4,46 +4,56 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.util.Point4D;
|
||||
import StevenDimDoors.mod_pocketDim.watcher.ClientLinkData;
|
||||
|
||||
public abstract class DimLink
|
||||
{
|
||||
protected Point4D source;
|
||||
protected ClientLinkData link;
|
||||
protected DimLink parent;
|
||||
protected LinkTail tail;
|
||||
protected int orientation;
|
||||
protected List<DimLink> children;
|
||||
|
||||
protected DimLink(Point4D source, DimLink parent, int orientation)
|
||||
protected DimLink(ClientLinkData link, DimLink parent)
|
||||
{
|
||||
|
||||
if (parent.source.getDimension() != source.getDimension())
|
||||
if (parent.link.point.getDimension() != link.point.getDimension())
|
||||
{
|
||||
// Ban having children in other dimensions to avoid serialization issues with cross-dimensional tails
|
||||
throw new IllegalArgumentException("source and parent.source must have the same dimension.");
|
||||
}
|
||||
this.orientation=orientation;
|
||||
this.parent = parent;
|
||||
this.source = source;
|
||||
this.link = link;
|
||||
this.tail = parent.tail;
|
||||
this.children = new LinkedList<DimLink>();
|
||||
parent.children.add(this);
|
||||
}
|
||||
|
||||
protected DimLink(Point4D source, int linkType, int orientation)
|
||||
protected DimLink(ClientLinkData link, int linkType)
|
||||
{
|
||||
if ((linkType < LinkTypes.ENUM_MIN || linkType > LinkTypes.ENUM_MAX) && linkType != LinkTypes.CLIENT_SIDE)
|
||||
{
|
||||
throw new IllegalArgumentException("The specified link type is invalid.");
|
||||
}
|
||||
this.orientation = orientation;
|
||||
|
||||
this.parent = null;
|
||||
this.source = source;
|
||||
this.link = link;
|
||||
this.tail = new LinkTail(linkType, null);
|
||||
this.children = new LinkedList<DimLink>();
|
||||
}
|
||||
|
||||
public Point4D source()
|
||||
{
|
||||
return source;
|
||||
return link.point;
|
||||
}
|
||||
|
||||
public int orientation()
|
||||
{
|
||||
return link.orientation;
|
||||
}
|
||||
|
||||
public ClientLinkData link()
|
||||
{
|
||||
return link;
|
||||
}
|
||||
|
||||
public Point4D destination()
|
||||
@@ -52,7 +62,7 @@ public abstract class DimLink
|
||||
}
|
||||
public int getDestinationOrientation()
|
||||
{
|
||||
return PocketManager.getLink(source.getX(), source.getY(), source.getZ(), source.getDimension()).orientation();
|
||||
return PocketManager.getLink(link.point.getX(), link.point.getY(), link.point.getZ(), link.point.getDimension()).link().orientation;
|
||||
}
|
||||
public boolean hasDestination()
|
||||
{
|
||||
@@ -78,13 +88,9 @@ public abstract class DimLink
|
||||
{
|
||||
return tail.getLinkType();
|
||||
}
|
||||
public int orientation()
|
||||
{
|
||||
return orientation;
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return source + " -> " + (hasDestination() ? destination() : "");
|
||||
return link.point + " -> " + (hasDestination() ? destination() : "");
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.watcher.ClientLinkData;
|
||||
import net.minecraft.world.World;
|
||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||
import StevenDimDoors.mod_pocketDim.Point3D;
|
||||
@@ -14,18 +15,19 @@ import StevenDimDoors.mod_pocketDim.dungeon.pack.DungeonPack;
|
||||
import StevenDimDoors.mod_pocketDim.util.Point4D;
|
||||
import StevenDimDoors.mod_pocketDim.watcher.IUpdateWatcher;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public abstract class NewDimData
|
||||
{
|
||||
private static class InnerDimLink extends DimLink
|
||||
{
|
||||
public InnerDimLink(Point4D source, DimLink parent,int orientation)
|
||||
{
|
||||
super(source, parent,orientation);
|
||||
super(new ClientLinkData(source, orientation), parent);
|
||||
}
|
||||
|
||||
public InnerDimLink(Point4D source, int linkType, int orientation)
|
||||
{
|
||||
super(source, linkType,orientation);
|
||||
super(new ClientLinkData(source, orientation), linkType);
|
||||
}
|
||||
|
||||
public void setDestination(int x, int y, int z, NewDimData dimension)
|
||||
@@ -49,7 +51,7 @@ public abstract class NewDimData
|
||||
}
|
||||
|
||||
parent = null;
|
||||
source = null;
|
||||
link = null;
|
||||
tail = new LinkTail(0, null);
|
||||
}
|
||||
|
||||
@@ -64,7 +66,7 @@ public abstract class NewDimData
|
||||
//Ignore this request silently
|
||||
return false;
|
||||
}
|
||||
if (nextParent.source.getDimension() != source.getDimension())
|
||||
if (nextParent.link.point.getDimension() != link.point.getDimension())
|
||||
{
|
||||
// Ban having children in other dimensions to avoid serialization issues with cross-dimensional tails
|
||||
throw new IllegalArgumentException("source and parent.source must have the same dimension.");
|
||||
@@ -87,7 +89,7 @@ public abstract class NewDimData
|
||||
parent = nextParent;
|
||||
tail = nextParent.tail;
|
||||
nextParent.children.add(this);
|
||||
this.orientation=orientation;
|
||||
this.link.orientation=orientation;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -110,7 +112,7 @@ public abstract class NewDimData
|
||||
parent = null;
|
||||
tail = new LinkTail(linkType, null);
|
||||
//Set new orientation
|
||||
this.orientation=orientation;
|
||||
this.link.orientation=orientation;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,10 +131,10 @@ public abstract class NewDimData
|
||||
protected Point4D origin;
|
||||
protected int orientation;
|
||||
protected DungeonData dungeon;
|
||||
protected IUpdateWatcher<Point4D> linkWatcher;
|
||||
protected IUpdateWatcher<ClientLinkData> linkWatcher;
|
||||
|
||||
protected NewDimData(int id, NewDimData parent, boolean isPocket, boolean isDungeon,
|
||||
IUpdateWatcher<Point4D> linkWatcher)
|
||||
IUpdateWatcher<ClientLinkData> linkWatcher)
|
||||
{
|
||||
// The isPocket flag is redundant. It's meant as an integrity safeguard.
|
||||
if (isPocket && (parent == null))
|
||||
@@ -244,7 +246,6 @@ public abstract class NewDimData
|
||||
{
|
||||
return Math.abs(i) + Math.abs(j) + Math.abs(k);
|
||||
}
|
||||
|
||||
public DimLink createLink(int x, int y, int z, int linkType,int orientation)
|
||||
{
|
||||
return createLink(new Point4D(x, y, z, id), linkType,orientation);
|
||||
@@ -267,7 +268,7 @@ public abstract class NewDimData
|
||||
//Link created!
|
||||
if(linkType!=LinkTypes.CLIENT_SIDE)
|
||||
{
|
||||
linkWatcher.onCreated(link.source);
|
||||
linkWatcher.onCreated(link.link);
|
||||
}
|
||||
return link;
|
||||
}
|
||||
@@ -290,19 +291,19 @@ public abstract class NewDimData
|
||||
InnerDimLink link = linkMapping.get(source);
|
||||
if (link == null)
|
||||
{
|
||||
link = new InnerDimLink(source, parent, parent.orientation);
|
||||
link = new InnerDimLink(source, parent, parent.link.orientation);
|
||||
linkMapping.put(source, link);
|
||||
linkList.add(link);
|
||||
|
||||
//Link created!
|
||||
linkWatcher.onCreated(link.source);
|
||||
linkWatcher.onCreated(link.link);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (link.overwrite(parent, parent.orientation))
|
||||
if (link.overwrite(parent, parent.link.orientation))
|
||||
{
|
||||
//Link created!
|
||||
linkWatcher.onCreated(link.source);
|
||||
linkWatcher.onCreated(link.link);
|
||||
}
|
||||
}
|
||||
return link;
|
||||
@@ -319,7 +320,7 @@ public abstract class NewDimData
|
||||
{
|
||||
linkList.remove(target);
|
||||
//Raise deletion event
|
||||
linkWatcher.onDeleted(target.source);
|
||||
linkWatcher.onDeleted(target.link);
|
||||
target.clear();
|
||||
}
|
||||
return (target != null);
|
||||
@@ -333,7 +334,11 @@ public abstract class NewDimData
|
||||
{
|
||||
linkList.remove(target);
|
||||
//Raise deletion event
|
||||
linkWatcher.onDeleted(target.source);
|
||||
//TODO why is source null here?
|
||||
if(target.link!=null)
|
||||
{
|
||||
linkWatcher.onDeleted(target.link);
|
||||
}
|
||||
target.clear();
|
||||
}
|
||||
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
|
||||
* creating/registering new dimensions as well as loading old dimensions on startup
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class PocketManager
|
||||
{
|
||||
private static class InnerDimData extends NewDimData implements IPackable<PackedDimData>
|
||||
@@ -46,7 +47,7 @@ public class PocketManager
|
||||
// that any link destinations must be real dimensions controlled by PocketManager.
|
||||
|
||||
public InnerDimData(int id, InnerDimData parent, boolean isPocket, boolean isDungeon,
|
||||
IUpdateWatcher<Point4D> linkWatcher)
|
||||
IUpdateWatcher<ClientLinkData> linkWatcher)
|
||||
{
|
||||
super(id, parent, isPocket, isDungeon, linkWatcher);
|
||||
}
|
||||
@@ -118,7 +119,7 @@ public class PocketManager
|
||||
Point3D parentPoint = new Point3D(-1,-1,-1);
|
||||
if(link.parent!=null)
|
||||
{
|
||||
parentPoint=link.parent.source.toPoint3D();
|
||||
parentPoint=link.parent.link.point.toPoint3D();
|
||||
}
|
||||
|
||||
for(DimLink childLink : link.children)
|
||||
@@ -126,7 +127,7 @@ public class PocketManager
|
||||
children.add(childLink.source().toPoint3D());
|
||||
}
|
||||
PackedLinkTail tail = new PackedLinkTail(link.tail.getDestination(),link.tail.getLinkType());
|
||||
Links.add(new PackedLinkData(link.source,parentPoint,tail,link.orientation,children));
|
||||
Links.add(new PackedLinkData(link.link.point,parentPoint,tail,link.link.orientation,children));
|
||||
|
||||
PackedLinkTail tempTail = new PackedLinkTail(link.tail.getDestination(),link.tail.getLinkType());
|
||||
if(Tails.contains(tempTail))
|
||||
@@ -154,24 +155,24 @@ public class PocketManager
|
||||
}
|
||||
}
|
||||
|
||||
private static class ClientLinkWatcher implements IUpdateWatcher<ClientLinkData>
|
||||
{
|
||||
@Override
|
||||
public void onCreated(ClientLinkData link)
|
||||
{
|
||||
Point4D source = link.point;
|
||||
NewDimData dimension = getDimensionData(source.getDimension());
|
||||
dimension.createLink(source.getX(), source.getY(), source.getZ(), LinkTypes.CLIENT_SIDE,link.orientation);
|
||||
}
|
||||
private static class ClientLinkWatcher implements IUpdateWatcher<ClientLinkData>
|
||||
{
|
||||
@Override
|
||||
public void onCreated(ClientLinkData link)
|
||||
{
|
||||
Point4D source = link.point;
|
||||
NewDimData dimension = getDimensionData(source.getDimension());
|
||||
dimension.createLink(source.getX(), source.getY(), source.getZ(), LinkTypes.CLIENT_SIDE,link.orientation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeleted(ClientLinkData link)
|
||||
{
|
||||
Point4D source = link.point;
|
||||
NewDimData dimension = getDimensionData(source.getDimension());
|
||||
dimension.deleteLink(source.getX(), source.getY(), source.getZ());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onDeleted(ClientLinkData link)
|
||||
{
|
||||
Point4D source = link.point;
|
||||
NewDimData dimension = getDimensionData(source.getDimension());
|
||||
dimension.deleteLink(source.getX(), source.getY(), source.getZ());
|
||||
}
|
||||
}
|
||||
|
||||
private static class ClientDimWatcher implements IUpdateWatcher<ClientDimData>
|
||||
{
|
||||
@@ -211,7 +212,7 @@ public class PocketManager
|
||||
* Set as true if we are a client that has connected to a dedicated server
|
||||
*/
|
||||
public static volatile boolean isConnected = false;
|
||||
private static final UpdateWatcherProxy<Point4D> linkWatcher = new UpdateWatcherProxy<Point4D>();
|
||||
private static final UpdateWatcherProxy<ClientLinkData> linkWatcher = new UpdateWatcherProxy<ClientLinkData>();
|
||||
private static final UpdateWatcherProxy<ClientDimData> dimWatcher = new UpdateWatcherProxy<ClientDimData>();
|
||||
private static ArrayList<NewDimData> rootDimensions = null;
|
||||
|
||||
@@ -276,6 +277,7 @@ public class PocketManager
|
||||
dimData.parent=dimData;
|
||||
dimData.isFilled=packedData.IsFilled;
|
||||
dimData.origin = new Point4D(packedData.Origin.getX(),packedData.Origin.getY(),packedData.Origin.getZ(),packedData.ID);
|
||||
|
||||
PocketManager.rootDimensions.add(dimData);
|
||||
}
|
||||
else
|
||||
@@ -284,6 +286,7 @@ public class PocketManager
|
||||
dimData = new InnerDimData(packedData.ID, test,true, packedData.IsDungeon, linkWatcher);
|
||||
dimData.isFilled=packedData.IsFilled;
|
||||
dimData.origin = new Point4D(packedData.Origin.getX(),packedData.Origin.getY(),packedData.Origin.getZ(),packedData.ID);
|
||||
|
||||
dimData.root=PocketManager.getDimensionData(packedData.RootID);
|
||||
|
||||
if(packedData.DungeonData!=null)
|
||||
@@ -596,8 +599,7 @@ public class PocketManager
|
||||
|
||||
public static void unload()
|
||||
{
|
||||
System.out.println("Dimensional Doors unloading...");
|
||||
|
||||
System.out.println("Unloading Pocket Dimensions...");
|
||||
if (!isLoaded)
|
||||
{
|
||||
throw new IllegalStateException("Pocket dimensions have already been unloaded!");
|
||||
@@ -648,12 +650,12 @@ public class PocketManager
|
||||
return dimWatcher.unregisterReceiver(watcher);
|
||||
}
|
||||
|
||||
public static void registerLinkWatcher(IUpdateWatcher<Point4D> watcher)
|
||||
public static void registerLinkWatcher(IUpdateWatcher<ClientLinkData> watcher)
|
||||
{
|
||||
linkWatcher.registerReceiver(watcher);
|
||||
}
|
||||
|
||||
public static boolean unregisterLinkWatcher(IUpdateWatcher<Point4D> watcher)
|
||||
public static boolean unregisterLinkWatcher(IUpdateWatcher<ClientLinkData> watcher)
|
||||
{
|
||||
return linkWatcher.unregisterReceiver(watcher);
|
||||
}
|
||||
@@ -685,9 +687,10 @@ public class PocketManager
|
||||
}
|
||||
public static void readPacket(DataInputStream input) throws IOException
|
||||
{
|
||||
//TODO- figure out why this is getting called so frequently
|
||||
if (isLoaded)
|
||||
{
|
||||
throw new IllegalStateException("Pocket dimensions have already been loaded!");
|
||||
return;
|
||||
}
|
||||
if (isLoading)
|
||||
{
|
||||
@@ -696,8 +699,12 @@ public class PocketManager
|
||||
// Load compacted client-side dimension data
|
||||
load();
|
||||
Compactor.readDimensions(input, new DimRegistrationCallback());
|
||||
isConnected = true;
|
||||
|
||||
// Register pocket dimensions
|
||||
DDProperties properties = DDProperties.instance();
|
||||
|
||||
isLoaded = true;
|
||||
isLoading = false;
|
||||
isConnected = true;
|
||||
}
|
||||
}
|
||||
@@ -81,6 +81,7 @@ public class DungeonSchematic extends Schematic {
|
||||
|
||||
public static DungeonSchematic readFromFile(File schematicFile) throws FileNotFoundException, InvalidSchematicException
|
||||
{
|
||||
// TODO: fix resource leak
|
||||
return readFromStream(new FileInputStream(schematicFile));
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@ public class DungeonPackConfigReader extends BaseConfigurationProcessor<DungeonP
|
||||
|
||||
public DungeonPackConfigReader() { }
|
||||
|
||||
@SuppressWarnings("resource")
|
||||
@Override
|
||||
public DungeonPackConfig readFromStream(InputStream inputStream) throws ConfigurationProcessingException
|
||||
{
|
||||
@@ -206,6 +207,7 @@ public class DungeonPackConfigReader extends BaseConfigurationProcessor<DungeonP
|
||||
|
||||
private class DungeonTypeProcessor implements ILineProcessor
|
||||
{
|
||||
@Override
|
||||
public void process(String line, DungeonPackConfig config) throws ConfigurationProcessingException
|
||||
{
|
||||
List<String> typeNames = config.getTypeNames();
|
||||
@@ -229,6 +231,7 @@ public class DungeonPackConfigReader extends BaseConfigurationProcessor<DungeonP
|
||||
|
||||
private class DungeonSettingsParser implements ILineProcessor
|
||||
{
|
||||
@Override
|
||||
public void process(String line, DungeonPackConfig config) throws ConfigurationProcessingException
|
||||
{
|
||||
//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
|
||||
{
|
||||
@Override
|
||||
public void process(String definition, DungeonPackConfig config) throws ConfigurationProcessingException
|
||||
{
|
||||
String[] ruleParts;
|
||||
@@ -17,7 +17,7 @@ public class BlockRotationHelper
|
||||
{
|
||||
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(1, 3);
|
||||
@@ -1,5 +1,12 @@
|
||||
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.util.List;
|
||||
|
||||
@@ -8,41 +15,29 @@ import net.minecraftforge.common.DimensionManager;
|
||||
import net.minecraftforge.common.ForgeChunkManager;
|
||||
import net.minecraftforge.common.ForgeChunkManager.LoadingCallback;
|
||||
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
|
||||
{
|
||||
|
||||
@Override
|
||||
public void ticketsLoaded(List<Ticket> tickets, World world)
|
||||
{
|
||||
for (Ticket ticket : tickets)
|
||||
{
|
||||
int goldDimDoorX = ticket.getModData().getInteger("goldDimDoorX");
|
||||
int goldDimDoorY = ticket.getModData().getInteger("goldDimDoorY");
|
||||
int goldDimDoorZ = ticket.getModData().getInteger("goldDimDoorZ");
|
||||
if(world.getBlockId(goldDimDoorX, goldDimDoorY, goldDimDoorZ)!=mod_pocketDim.properties.GoldDimDoorID)
|
||||
{
|
||||
ForgeChunkManager.releaseTicket(ticket);
|
||||
}
|
||||
else
|
||||
{
|
||||
IChunkLoader tile = (IChunkLoader) world.getBlockTileEntity(goldDimDoorX, goldDimDoorY, goldDimDoorZ);
|
||||
tile.forceChunkLoading(ticket,goldDimDoorX,goldDimDoorZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void ticketsLoaded(List<Ticket> tickets, World world)
|
||||
{
|
||||
for (Ticket ticket : tickets)
|
||||
{
|
||||
int goldDimDoorX = ticket.getModData().getInteger("goldDimDoorX");
|
||||
int goldDimDoorY = ticket.getModData().getInteger("goldDimDoorY");
|
||||
int goldDimDoorZ = ticket.getModData().getInteger("goldDimDoorZ");
|
||||
if(world.getBlockId(goldDimDoorX, goldDimDoorY, goldDimDoorZ)!=mod_pocketDim.properties.GoldDimDoorID)
|
||||
{
|
||||
ForgeChunkManager.releaseTicket(ticket);
|
||||
}
|
||||
else
|
||||
{
|
||||
IChunkLoader tile = (IChunkLoader) world.getBlockTileEntity(goldDimDoorX, goldDimDoorY, goldDimDoorZ);
|
||||
tile.forceChunkLoading(ticket,goldDimDoorX,goldDimDoorZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void loadChunkForcedWorlds(FMLServerStartingEvent event)
|
||||
{
|
||||
@@ -17,6 +17,7 @@ import StevenDimDoors.mod_pocketDim.watcher.ClientLinkData;
|
||||
public class Compactor
|
||||
{
|
||||
|
||||
@SuppressWarnings("unused") // ?
|
||||
private static class DimComparator implements Comparator<NewDimData>
|
||||
{
|
||||
@Override
|
||||
@@ -38,6 +39,7 @@ public class Compactor
|
||||
for (DimLink link : dimension.links())
|
||||
{
|
||||
Point4D.write(link.source(), output);
|
||||
output.writeInt(link.orientation());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,11 @@ public class DungeonHelper
|
||||
config.setName(name);
|
||||
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());
|
||||
if (e.getCause() != null)
|
||||
@@ -148,10 +152,6 @@ public class DungeonHelper
|
||||
System.err.println(e.getCause());
|
||||
}
|
||||
}
|
||||
catch (FileNotFoundException e)
|
||||
{
|
||||
System.err.println("Could not find a dungeon pack config file: " + configPath);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -442,6 +442,7 @@ public class DungeonHelper
|
||||
System.out.println("Registering bundled dungeon pack: " + name);
|
||||
|
||||
InputStream listStream = this.getClass().getResourceAsStream(listPath);
|
||||
// chance of leak?
|
||||
if (listStream == null)
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
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) &&
|
||||
(!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);
|
||||
|
||||
if (!player.capabilities.isCreativeMode && reduceStack)
|
||||
@@ -15,7 +15,8 @@ public class ItemBlockDimWall extends ItemBlock
|
||||
this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().replace("tile.", ""));
|
||||
}
|
||||
@@ -28,6 +29,6 @@ public class ItemBlockDimWall extends ItemBlock
|
||||
|
||||
public String getUnlocalizedName(ItemStack par1ItemStack)
|
||||
{
|
||||
return subNames[getItemDamageFromStack(par1ItemStack)];
|
||||
return subNames[this.getDamage(par1ItemStack)];
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package StevenDimDoors.mod_pocketDim.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -0,0 +1,58 @@
|
||||
package StevenDimDoors.mod_pocketDim.items;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemDoor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemGoldDoor extends ItemDoor
|
||||
{
|
||||
public ItemGoldDoor(int par1, Material par2Material)
|
||||
{
|
||||
super(par1, par2Material);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
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)
|
||||
{
|
||||
if (par7 != 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
++par5;
|
||||
Block block = mod_pocketDim.goldDoor;
|
||||
|
||||
if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack))
|
||||
{
|
||||
if (!block.canPlaceBlockAt(par3World, par4, par5, par6))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
int i1 = MathHelper.floor_double((par2EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F - 0.5D) & 3;
|
||||
placeDoorBlock(par3World, par4, par5, par6, i1, block);
|
||||
--par1ItemStack.stackSize;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,9 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.EnumToolMaterial;
|
||||
@@ -20,6 +23,7 @@ import net.minecraft.world.World;
|
||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
import com.google.common.collect.Multimap;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -60,10 +64,12 @@ public class ItemRiftBlade extends ItemSword
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDamageVsEntity(Entity par1Entity)
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
public Multimap getItemAttributeModifiers()
|
||||
{
|
||||
Multimap multimap = super.getItemAttributeModifiers();
|
||||
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Weapon modifier", (double)7, 0));
|
||||
return multimap;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -73,7 +79,7 @@ public class ItemRiftBlade extends ItemSword
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
|
||||
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLiving, EntityLivingBase par3EntityLiving)
|
||||
{
|
||||
par1ItemStack.damageItem(1, par3EntityLiving);
|
||||
return true;
|
||||
@@ -85,9 +91,9 @@ public class ItemRiftBlade extends ItemSword
|
||||
float var4 = 1.0F;
|
||||
float var5 = par2EntityPlayer.prevRotationPitch + (par2EntityPlayer.rotationPitch - par2EntityPlayer.prevRotationPitch) * var4;
|
||||
float var6 = par2EntityPlayer.prevRotationYaw + (par2EntityPlayer.rotationYaw - par2EntityPlayer.prevRotationYaw) * var4;
|
||||
double var7 = par2EntityPlayer.prevPosX + (par2EntityPlayer.posX - par2EntityPlayer.prevPosX) * (double)var4;
|
||||
double var9 = par2EntityPlayer.prevPosY + (par2EntityPlayer.posY - par2EntityPlayer.prevPosY) * (double)var4 + 1.62D - (double)par2EntityPlayer.yOffset;
|
||||
double var11 = par2EntityPlayer.prevPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.prevPosZ) * (double)var4;
|
||||
double var7 = par2EntityPlayer.prevPosX + (par2EntityPlayer.posX - par2EntityPlayer.prevPosX) * var4;
|
||||
double var9 = par2EntityPlayer.prevPosY + (par2EntityPlayer.posY - par2EntityPlayer.prevPosY) * var4 + 1.62D - par2EntityPlayer.yOffset;
|
||||
double var11 = par2EntityPlayer.prevPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.prevPosZ) * var4;
|
||||
Vec3 var13 = par1World.getWorldVec3Pool().getVecFromPool(var7, var9, var11);
|
||||
float var14 = MathHelper.cos(-var6 * 0.017453292F - (float)Math.PI);
|
||||
float var15 = MathHelper.sin(-var6 * 0.017453292F - (float)Math.PI);
|
||||
@@ -100,13 +106,13 @@ public class ItemRiftBlade extends ItemSword
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
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();
|
||||
var2.xCoord*=cooef;
|
||||
@@ -141,13 +147,13 @@ public class ItemRiftBlade extends ItemSword
|
||||
if (!world.isRemote)
|
||||
{
|
||||
@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);
|
||||
|
||||
for (EntityLiving ent : list)
|
||||
{
|
||||
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();
|
||||
var4 = var4.normalize();
|
||||
double var7 = var3.dotProduct(var4);
|
||||
@@ -172,13 +178,13 @@ public class ItemRiftBlade extends ItemSword
|
||||
if (player.canPlayerEdit(x, y, 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) &&
|
||||
BaseItemDoor.canPlace(world, x, y - 1, z))
|
||||
{
|
||||
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);
|
||||
return stack;
|
||||
}
|
||||
@@ -212,6 +218,7 @@ public class ItemRiftBlade extends ItemSword
|
||||
/**
|
||||
* allows items to add custom lines of information to the mouseover description
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
@@ -98,15 +98,15 @@ public class ItemRiftSignature extends Item
|
||||
stack.stackSize--;
|
||||
}
|
||||
clearSource(stack);
|
||||
player.sendChatToPlayer("Rift Created");
|
||||
world.playSoundAtEntity(player,"mods.DimDoors.sfx.riftEnd", 0.6f, 1);
|
||||
mod_pocketDim.sendChat(player,("Rift Created"));
|
||||
world.playSoundAtEntity(player,mod_pocketDim.modid+":riftEnd", 0.6f, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
//The link signature has not been used. Store its current target as the first location.
|
||||
setSource(stack, x, adjustedY, z,orientation, PocketManager.getDimensionData(world));
|
||||
player.sendChatToPlayer("Location Stored in Rift Signature");
|
||||
world.playSoundAtEntity(player,"mods.DimDoors.sfx.riftStart", 0.6f, 1);
|
||||
mod_pocketDim.sendChat(player,("Location Stored in Rift Signature"));
|
||||
world.playSoundAtEntity(player,mod_pocketDim.modid+":riftStart", 0.6f, 1);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -25,6 +25,7 @@ public class ItemStabilizedRiftSignature extends ItemRiftSignature
|
||||
super(itemID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
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);
|
||||
|
||||
// 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)
|
||||
{
|
||||
// Yes, it's initialized. Check if the player is in creative
|
||||
// or if the player can pay an Ender Pearl to create a rift.
|
||||
if (!player.capabilities.isCreativeMode && !player.inventory.hasItem(Item.enderPearl.itemID))
|
||||
{
|
||||
player.sendChatToPlayer("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;
|
||||
}
|
||||
|
||||
@@ -86,14 +90,14 @@ public class ItemStabilizedRiftSignature extends ItemRiftSignature
|
||||
{
|
||||
player.inventory.consumeInventoryItem(Item.enderPearl.itemID);
|
||||
}
|
||||
player.sendChatToPlayer("Rift Created");
|
||||
mod_pocketDim.sendChat(player,"Rift Created");
|
||||
world.playSoundAtEntity(player,"mods.DimDoors.sfx.riftEnd", 0.6f, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
//The link signature has not been used. Store its current target as the first location.
|
||||
setSource(stack, x, adjustedY, z, orientation, PocketManager.getDimensionData(world));
|
||||
player.sendChatToPlayer("Location Stored in Rift Signature");
|
||||
mod_pocketDim.sendChat(player,"Location Stored in Rift Signature");
|
||||
world.playSoundAtEntity(player,"mods.DimDoors.sfx.riftStart", 0.6f, 1);
|
||||
}
|
||||
return true;
|
||||
@@ -12,6 +12,7 @@ public class ItemStableFabric extends Item
|
||||
this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().replace("item.", ""));
|
||||
@@ -29,6 +29,7 @@ public class itemRiftRemover extends Item
|
||||
this.setMaxDamage(4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName());
|
||||
@@ -114,7 +115,7 @@ public class itemRiftRemover extends Item
|
||||
{
|
||||
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;
|
||||
|
||||
|
||||
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.BlockDimWallPerm;
|
||||
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_pocketDimClient.ClientPacketHandler;
|
||||
import StevenDimDoors.mod_pocketDimClient.ClientTickHandler;
|
||||
|
||||
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.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.event.FMLInitializationEvent;
|
||||
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.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)
|
||||
|
||||
@@ -91,11 +91,10 @@ clientPacketHandlerSpec =
|
||||
@SidedPacketHandler(channels = {PacketConstants.CHANNEL_NAME}, packetHandler = ClientPacketHandler.class),
|
||||
serverPacketHandlerSpec =
|
||||
@SidedPacketHandler(channels = {PacketConstants.CHANNEL_NAME}, packetHandler = ServerPacketHandler.class))
|
||||
|
||||
public class mod_pocketDim
|
||||
{
|
||||
public static final String version = "1.5.2R2.0.1RC1";
|
||||
public static final String modid = "DimDoors";
|
||||
public static final String version = "$VERSION$";
|
||||
public static final String modid = "dimdoors";
|
||||
|
||||
//need to clean up
|
||||
@SidedProxy(clientSide = "StevenDimDoors.mod_pocketDimClient.ClientProxy", serverSide = "StevenDimDoors.mod_pocketDim.CommonProxy")
|
||||
@@ -103,7 +102,7 @@ public class mod_pocketDim
|
||||
|
||||
@Instance("PocketDimensions")
|
||||
public static mod_pocketDim instance = new mod_pocketDim();
|
||||
|
||||
|
||||
public static Block transientDoor;
|
||||
public static Block warpDoor;
|
||||
public static Block goldDoor;
|
||||
@@ -128,53 +127,56 @@ public class mod_pocketDim
|
||||
public static Item itemStableFabric;
|
||||
public static Item itemChaosDoor;
|
||||
public static Item itemStabilizedLinkSignature;
|
||||
|
||||
|
||||
public static BiomeGenBase limboBiome;
|
||||
public static BiomeGenBase pocketBiome;
|
||||
|
||||
|
||||
public static boolean isPlayerWearingGoogles = false;
|
||||
|
||||
public static DDProperties properties;
|
||||
public static MonolithSpawner spawner; //Added this field temporarily. Will be refactored out later.
|
||||
public static GatewayGenerator riftGen;
|
||||
|
||||
public static CreativeTabs dimDoorsCreativeTab = new CreativeTabs("dimDoorsCreativeTab")
|
||||
{
|
||||
@Override
|
||||
public ItemStack getIconItemStack()
|
||||
{
|
||||
return new ItemStack(mod_pocketDim.itemDimDoor, 1, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTranslatedTabLabel()
|
||||
{
|
||||
return "Dimensional Doors";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@PreInit
|
||||
public static CreativeTabs dimDoorsCreativeTab = new CreativeTabs("dimDoorsCreativeTab")
|
||||
{
|
||||
@Override
|
||||
public ItemStack getIconItemStack()
|
||||
{
|
||||
return new ItemStack(mod_pocketDim.itemDimDoor, 1, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTranslatedTabLabel()
|
||||
{
|
||||
return "Dimensional Doors";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void onPreInitialization(FMLPreInitializationEvent event)
|
||||
{
|
||||
this.instance = this;
|
||||
instance = this;
|
||||
//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
|
||||
MinecraftForge.EVENT_BUS.register(new EventHookContainer(properties));
|
||||
|
||||
|
||||
riftGen = new GatewayGenerator(properties);
|
||||
}
|
||||
|
||||
@Init
|
||||
@SuppressWarnings("unused")
|
||||
@EventHandler
|
||||
public void onInitialization(FMLInitializationEvent event)
|
||||
{
|
||||
CommonTickHandler commonTickHandler = new CommonTickHandler();
|
||||
TickRegistry.registerTickHandler(new ClientTickHandler(), Side.CLIENT);
|
||||
TickRegistry.registerTickHandler(commonTickHandler, Side.SERVER);
|
||||
|
||||
|
||||
//MonolithSpawner should be initialized before any provider instances are created
|
||||
//Register the other regular tick receivers as well
|
||||
spawner = new MonolithSpawner(commonTickHandler, properties);
|
||||
@@ -193,7 +195,7 @@ public class mod_pocketDim
|
||||
unstableDoor = (new UnstableDoor(properties.UnstableDoorID, Material.iron, properties).setHardness(.2F).setUnlocalizedName("chaosDoor").setLightValue(.0F) );
|
||||
dimensionalDoor = (DimensionalDoor) (new DimensionalDoor(properties.DimensionalDoorID, Material.iron, properties).setHardness(1.0F).setResistance(2000.0F) .setUnlocalizedName("dimDoor"));
|
||||
transTrapdoor = (TransTrapdoor) (new TransTrapdoor(properties.TransTrapdoorID, Material.wood).setHardness(1.0F) .setUnlocalizedName("dimHatch"));
|
||||
|
||||
|
||||
itemGoldDimDoor = (new ItemGoldDimDoor(properties.GoldDimDoorItemID, Material.iron)).setUnlocalizedName("itemGoldDimDoor");
|
||||
itemGoldDoor = (new ItemGoldDoor(properties.GoldDoorID, Material.wood)).setUnlocalizedName("itemGoldDoor");
|
||||
itemDimDoor = (new ItemDimensionalDoor(properties.DimensionalDoorItemID, Material.iron)).setUnlocalizedName("itemDimDoor");
|
||||
@@ -206,7 +208,7 @@ public class mod_pocketDim
|
||||
itemStabilizedLinkSignature = (new ItemStabilizedRiftSignature(properties.StabilizedRiftSignatureItemID)).setUnlocalizedName("itemStabilizedRiftSig");
|
||||
itemWorldThread = (new ItemWorldThread(properties.ItemWorldThreadID)).setUnlocalizedName("itemWorldThread");
|
||||
|
||||
|
||||
|
||||
mod_pocketDim.limboBiome= (new BiomeGenLimbo(properties.LimboBiomeID));
|
||||
mod_pocketDim.pocketBiome= (new BiomeGenPocket(properties.PocketBiomeID));
|
||||
|
||||
@@ -222,7 +224,7 @@ public class mod_pocketDim
|
||||
GameRegistry.registerBlock(transTrapdoor,"Transdimensional Trapdoor");
|
||||
GameRegistry.registerBlock(blockDimWallPerm, "Fabric of RealityPerm");
|
||||
GameRegistry.registerBlock(transientDoor, "transientDoor");
|
||||
|
||||
|
||||
GameRegistry.registerBlock(blockDimWall, ItemBlockDimWall.class, "Fabric of Reality");
|
||||
|
||||
DimensionManager.registerProviderType(properties.PocketProviderID, PocketProvider.class, false);
|
||||
@@ -240,7 +242,7 @@ public class mod_pocketDim
|
||||
LanguageRegistry.addName(blockDimWallPerm , "Eternal Fabric");
|
||||
LanguageRegistry.addName(dimensionalDoor, "Dimensional Door");
|
||||
LanguageRegistry.addName(transTrapdoor, "Transdimensional Trapdoor");
|
||||
|
||||
|
||||
LanguageRegistry.addName(itemExitDoor, "Warp Door");
|
||||
LanguageRegistry.addName(itemLinkSignature , "Rift Signature");
|
||||
LanguageRegistry.addName(itemGoldDoor, "Golden Door");
|
||||
@@ -253,16 +255,16 @@ public class mod_pocketDim
|
||||
LanguageRegistry.addName(itemRiftBlade , "Rift Blade");
|
||||
LanguageRegistry.addName(itemWorldThread, "World Thread");
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Add names for multiblock inventory item
|
||||
*/
|
||||
LanguageRegistry.addName(new ItemStack(blockDimWall, 1, 0), "Fabric of Reality");
|
||||
LanguageRegistry.addName(new ItemStack(blockDimWall, 1, 1), "Ancient Fabric");
|
||||
|
||||
|
||||
|
||||
LanguageRegistry.instance().addStringLocalization("itemGroup.dimDoorsCustomTab", "en_US", "Dimensional Doors Items");
|
||||
|
||||
|
||||
GameRegistry.registerTileEntity(TileEntityDimDoor.class, "TileEntityDimDoor");
|
||||
GameRegistry.registerTileEntity(TileEntityRift.class, "TileEntityRift");
|
||||
GameRegistry.registerTileEntity(TileEntityTransTrapdoor.class, "TileEntityDimHatch");
|
||||
@@ -276,20 +278,20 @@ public class mod_pocketDim
|
||||
|
||||
CraftingManager.registerRecipies();
|
||||
DungeonHelper.initialize();
|
||||
|
||||
|
||||
proxy.loadTextures();
|
||||
proxy.registerRenderers();
|
||||
}
|
||||
|
||||
|
||||
@PostInit
|
||||
@EventHandler
|
||||
public void onPostInitialization(FMLPostInitializationEvent event)
|
||||
{
|
||||
ForgeChunkManager.setForcedChunkLoadingCallback(instance, new ChunkLoaderHelper());
|
||||
//Register loot chests
|
||||
DDLoot.registerInfo();
|
||||
}
|
||||
@ServerStopping
|
||||
@EventHandler
|
||||
public void onServerStopping(FMLServerStoppingEvent event)
|
||||
{
|
||||
try
|
||||
@@ -302,12 +304,12 @@ public class mod_pocketDim
|
||||
}
|
||||
}
|
||||
|
||||
@ServerStarting
|
||||
@EventHandler
|
||||
public void onServerStarting(FMLServerStartingEvent event)
|
||||
{
|
||||
|
||||
|
||||
//TODO- load dims with forced chunks on server startup here
|
||||
|
||||
|
||||
CommandResetDungeons.instance().register(event);
|
||||
CommandCreateDungeonRift.instance().register(event);
|
||||
CommandDeleteAllLinks.instance().register(event);
|
||||
@@ -318,7 +320,7 @@ public class mod_pocketDim
|
||||
//CommandPruneDimensions.instance().register(event);
|
||||
CommandCreatePocket.instance().register(event);
|
||||
CommandTeleportPlayer.instance().register(event);
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
ChunkLoaderHelper.loadChunkForcedWorlds(event);
|
||||
@@ -328,4 +330,12 @@ public class mod_pocketDim
|
||||
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"));
|
||||
List<Integer> data = this.createBlacklistFromJson(reader);
|
||||
reader.close();
|
||||
return data;
|
||||
}
|
||||
catch (IOException e)
|
||||
@@ -144,6 +144,7 @@ public class DDSaveHandler
|
||||
linkType = LinkTypes.NORMAL;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
DimLink link = data.createLink(packedLink.source, linkType, packedLink.orientation);
|
||||
Point4D destination = packedLink.tail.destination;
|
||||
if(destination!=null)
|
||||
@@ -1,24 +1,16 @@
|
||||
package StevenDimDoors.mod_pocketDim.saving;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import scala.Char;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonToken;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.Point3D;
|
||||
import StevenDimDoors.mod_pocketDim.util.BaseConfigurationProcessor;
|
||||
@@ -35,6 +27,7 @@ public class DimDataProcessor extends BaseConfigurationProcessor<PackedDimData>
|
||||
{
|
||||
JsonReader reader = new JsonReader(new InputStreamReader(inputStream, "UTF-8"));
|
||||
PackedDimData data = this.createDImDataFromJson(reader);
|
||||
reader.close();
|
||||
return data;
|
||||
}
|
||||
catch (IOException e)
|
||||
@@ -94,7 +87,7 @@ public class DimDataProcessor extends BaseConfigurationProcessor<PackedDimData>
|
||||
reader.beginObject();
|
||||
|
||||
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");
|
||||
}
|
||||
@@ -184,7 +177,7 @@ public class DimDataProcessor extends BaseConfigurationProcessor<PackedDimData>
|
||||
List<Integer> list = new ArrayList<Integer>();
|
||||
reader.beginArray();
|
||||
|
||||
while(reader.peek()!= JsonToken.END_ARRAY)
|
||||
while (reader.peek() != JsonToken.END_ARRAY)
|
||||
{
|
||||
list.add(reader.nextInt());
|
||||
|
||||
@@ -199,7 +192,7 @@ public class DimDataProcessor extends BaseConfigurationProcessor<PackedDimData>
|
||||
|
||||
reader.beginArray();
|
||||
|
||||
while(reader.peek()!= JsonToken.END_ARRAY)
|
||||
while (reader.peek() != JsonToken.END_ARRAY)
|
||||
{
|
||||
list.add(createLinkDataFromJson(reader));
|
||||
}
|
||||
@@ -232,7 +225,7 @@ public class DimDataProcessor extends BaseConfigurationProcessor<PackedDimData>
|
||||
reader.nextName();
|
||||
reader.beginArray();
|
||||
|
||||
while(reader.peek() != JsonToken.END_ARRAY)
|
||||
while (reader.peek() != JsonToken.END_ARRAY)
|
||||
{
|
||||
children.add(this.createPointFromJson(reader));
|
||||
}
|
||||
@@ -252,6 +245,7 @@ public class DimDataProcessor extends BaseConfigurationProcessor<PackedDimData>
|
||||
String DungeonPackName;
|
||||
|
||||
reader.beginObject();
|
||||
@SuppressWarnings("unused")
|
||||
JsonToken test = reader.peek();
|
||||
|
||||
if(reader.peek() == JsonToken.END_OBJECT)
|
||||
@@ -285,13 +279,14 @@ public class DimDataProcessor extends BaseConfigurationProcessor<PackedDimData>
|
||||
}
|
||||
private PackedLinkTail createLinkTailFromJson(JsonReader reader) throws IOException
|
||||
{
|
||||
Point4D destination=null;
|
||||
Point4D destination = null;
|
||||
int linkType;
|
||||
reader.beginObject();
|
||||
reader.nextName();
|
||||
|
||||
JsonToken test =reader.peek();
|
||||
if(reader.peek()==JsonToken.BEGIN_OBJECT)
|
||||
@SuppressWarnings("unused")
|
||||
JsonToken test = reader.peek();
|
||||
if (reader.peek() == JsonToken.BEGIN_OBJECT)
|
||||
{
|
||||
destination = this.createPoint4DFromJson(reader);
|
||||
reader.nextName();
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user