diff --git a/StevenDimDoors/mod_pocketDim/LimboGenerator.java b/StevenDimDoors/mod_pocketDim/LimboGenerator.java index a8e43af5..b6cb8f6c 100644 --- a/StevenDimDoors/mod_pocketDim/LimboGenerator.java +++ b/StevenDimDoors/mod_pocketDim/LimboGenerator.java @@ -3,6 +3,7 @@ package StevenDimDoors.mod_pocketDim; import java.util.List; import java.util.Random; +import net.minecraft.block.Block; import net.minecraft.entity.EnumCreatureType; import net.minecraft.util.IProgressUpdate; import net.minecraft.util.MathHelper; @@ -137,6 +138,11 @@ public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvi // TODO Auto-generated method stub return super.chunkExists(var1, var2); } + @Override + public void replaceBlocksForBiome(int par1, int par2, byte[] par3ArrayOfByte, BiomeGenBase[] par4ArrayOfBiomeGenBase) + { + + } @Override public Chunk provideChunk(int par1, int par2) @@ -162,7 +168,8 @@ public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvi } @Override - public void populate(IChunkProvider var1, int var2, int var3) { + public void populate(IChunkProvider var1, int var2, int var3) + { // TODO Auto-generated method stub } @@ -373,7 +380,7 @@ public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvi { par3ArrayOfByte[var43 += var44] = (byte)mod_pocketDim.blockDimWallPermID; } - + else { par3ArrayOfByte[var43 += var44] = 0; diff --git a/StevenDimDoors/mod_pocketDim/LimboProvider.java b/StevenDimDoors/mod_pocketDim/LimboProvider.java index f90a5bdc..a3c6f0d3 100644 --- a/StevenDimDoors/mod_pocketDim/LimboProvider.java +++ b/StevenDimDoors/mod_pocketDim/LimboProvider.java @@ -8,6 +8,7 @@ import net.minecraft.world.WorldProvider; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.WorldChunkManagerHell; import net.minecraft.world.chunk.IChunkProvider; +import net.minecraftforge.client.IRenderHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -21,16 +22,25 @@ public class LimboProvider extends WorldProvider return "Limbo"; } + private IRenderHandler skyRenderer; public LimboProvider() { - this.hasNoSky=true; - - + this.hasNoSky=false; + + + this.skyRenderer =new limboSkyProvider(); } + @SideOnly(Side.CLIENT) + public IRenderHandler getSkyRenderer() + { + return this.skyRenderer; + } + + @Override protected void registerWorldChunkManager() { diff --git a/StevenDimDoors/mod_pocketDim/items/itemDimDoor.java b/StevenDimDoors/mod_pocketDim/items/itemDimDoor.java index a378c626..6a7b2d19 100644 --- a/StevenDimDoors/mod_pocketDim/items/itemDimDoor.java +++ b/StevenDimDoors/mod_pocketDim/items/itemDimDoor.java @@ -1,6 +1,7 @@ package StevenDimDoors.mod_pocketDim.items; import java.util.List; +import java.util.Random; import StevenDimDoors.mod_pocketDim.LinkData; import StevenDimDoors.mod_pocketDim.dimHelper; @@ -132,6 +133,8 @@ public class itemDimDoor extends ItemDoor public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { + + Boolean didFindThing=false; MovingObjectPosition hit = this.getMovingObjectPositionFromPlayer(par3EntityPlayer.worldObj, par3EntityPlayer, false ); if(hit!=null&&!par2World.isRemote) diff --git a/StevenDimDoors/mod_pocketDim/limboSkyProvider.java b/StevenDimDoors/mod_pocketDim/limboSkyProvider.java new file mode 100644 index 00000000..e4f92a0e --- /dev/null +++ b/StevenDimDoors/mod_pocketDim/limboSkyProvider.java @@ -0,0 +1,221 @@ +package StevenDimDoors.mod_pocketDim; + +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 IRenderHandler +{ + + int starGLCallList; + int glSkyList; + int glSkyList2; + + + @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("/mods/DimensionalDoors/textures/other/limboSun.png"); + 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("/environment/moon_phases.png"); + int k = world.getMoonPhase(); + int l = k % 4; + int i1 = k / 4 % 2; + float f14 = (float)(l + 0) / 4.0F; + float f15 = (float)(i1 + 0) / 2.0F; + float f16 = (float)(l + 1) / 4.0F; + float f17 = (float)(i1 + 1) / 2.0F; + 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); + } + + } + +} \ No newline at end of file diff --git a/StevenDimDoors/mod_pocketDim/ticking/MobObelisk.java b/StevenDimDoors/mod_pocketDim/ticking/MobObelisk.java index 870586c4..2c0537f3 100644 --- a/StevenDimDoors/mod_pocketDim/ticking/MobObelisk.java +++ b/StevenDimDoors/mod_pocketDim/ticking/MobObelisk.java @@ -87,16 +87,20 @@ public class MobObelisk extends EntityFlying implements IMob public void onEntityUpdate() { byte b0 = this.dataWatcher.getWatchableObjectByte(16); - this.texture="/mods/DimensionalDoors/textures/mobs/Monolith"+b0+".png"; if(!this.hasJumped&&!this.worldObj.isRemote) { + int sanity=0; double jumpHeight=0; do { jumpHeight = this.posY+rand.nextInt(25); + if(this.worldObj.provider instanceof pocketProvider) + { + jumpHeight = jumpHeight- rand.nextInt(10); + } sanity++; } while(!this.worldObj.isAirBlock((int)this.posX,(int)jumpHeight+6 , (int)this.posZ)&&sanity<20); diff --git a/resources/mods/DimensionalDoors/textures/mobs/Untitled-2.psd b/resources/mods/DimensionalDoors/textures/mobs/Untitled-2.psd new file mode 100644 index 00000000..54fabf73 Binary files /dev/null and b/resources/mods/DimensionalDoors/textures/mobs/Untitled-2.psd differ diff --git a/resources/mods/DimensionalDoors/textures/other/limboSun.png b/resources/mods/DimensionalDoors/textures/other/limboSun.png new file mode 100644 index 00000000..c2652e16 Binary files /dev/null and b/resources/mods/DimensionalDoors/textures/other/limboSun.png differ diff --git a/resources/mods/DimensionalDoors/textures/other/limboSun2.png b/resources/mods/DimensionalDoors/textures/other/limboSun2.png new file mode 100644 index 00000000..40fd7eb9 Binary files /dev/null and b/resources/mods/DimensionalDoors/textures/other/limboSun2.png differ