Progress on the New Save Format and Minor Fixes #88
@@ -14,6 +14,8 @@ public class DDProperties
|
||||
|
||||
public final int UnstableDoorID;
|
||||
public final int DimensionalDoorID;
|
||||
public final int GoldDoorID;
|
||||
public final int GoldDimDoorID;
|
||||
public final int WarpDoorID;
|
||||
public final int TransTrapdoorID;
|
||||
public final int TransientDoorID;
|
||||
@@ -33,6 +35,8 @@ public class DDProperties
|
||||
|
||||
public final int RiftBladeItemID;
|
||||
public final int RiftSignatureItemID;
|
||||
public final int GoldDimDoorItemID;
|
||||
public final int GoldDoorItemID;
|
||||
public final int RiftRemoverItemID;
|
||||
public final int StableFabricItemID;
|
||||
public final int StabilizedRiftSignatureItemID;
|
||||
@@ -65,6 +69,8 @@ public class DDProperties
|
||||
public final boolean CraftingTransTrapdoorAllowed;
|
||||
public final boolean CraftingStabilizedRiftSignatureAllowed;
|
||||
public final boolean CraftingStableFabricAllowed;
|
||||
public final boolean CraftingGoldDimDoorAllowed;
|
||||
public final boolean CraftingGoldDoorAllowed;
|
||||
|
||||
/**
|
||||
* Loot Flags
|
||||
@@ -136,6 +142,8 @@ public class DDProperties
|
||||
CraftingStabilizedRiftSignatureAllowed = config.get(CATEGORY_CRAFTING, "Allow Crafting Stabilized Rift Signature", true).getBoolean(true);
|
||||
CraftingRiftBladeAllowed = config.get(CATEGORY_CRAFTING, "Allow Crafting Rift Blade", true).getBoolean(true);
|
||||
CraftingStableFabricAllowed = config.get(CATEGORY_CRAFTING, "Allow Crafting Stable Fabric", true).getBoolean(true);
|
||||
CraftingGoldDimDoorAllowed = config.get(CATEGORY_CRAFTING, "Allow Crafting Golden Dimensional Door", true).getBoolean(true);
|
||||
CraftingGoldDoorAllowed = config.get(CATEGORY_CRAFTING, "Allow Golden Door", true).getBoolean(true);
|
||||
|
||||
DimensionalDoorLootEnabled = config.get(CATEGORY_LOOT, "Enable Dimensional Door Loot", true).getBoolean(true);
|
||||
WarpDoorLootEnabled = config.get(CATEGORY_LOOT, "Enable Warp Door Loot", false).getBoolean(false);
|
||||
@@ -180,6 +188,8 @@ public class DDProperties
|
||||
RiftBlockID = config.getBlock("Rift Block ID", 1977).getInt();
|
||||
UnstableDoorID = config.getBlock("Unstable Door Block ID", 1978).getInt();
|
||||
TransientDoorID = config.getBlock("Transient Door Block ID", 1979).getInt();
|
||||
GoldDoorID = config.getBlock("Gold Door Block ID", 1980).getInt();
|
||||
GoldDimDoorID = config.getBlock("Gold Dim Door Block ID", 1981).getInt();
|
||||
|
||||
WarpDoorItemID = config.getItem("Warp Door Item ID", 5670).getInt();
|
||||
RiftRemoverItemID = config.getItem("Rift Remover Item ID", 5671).getInt();
|
||||
@@ -189,6 +199,8 @@ public class DDProperties
|
||||
RiftSignatureItemID = config.getItem("Rift Signature Item ID", 5675).getInt();
|
||||
RiftBladeItemID = config.getItem("Rift Blade Item ID", 5676).getInt();
|
||||
StabilizedRiftSignatureItemID = config.getItem("Stabilized Rift Signature Item ID", 5677).getInt();
|
||||
GoldDoorItemID = config.getItem("Gold Door Item ID", 5678).getInt();
|
||||
GoldDimDoorItemID = config.getItem("Gold Dim Door Item ID", 5679).getInt();
|
||||
|
||||
LimboBlockID = config.getTerrainBlock("World Generation Block IDs - must be less than 256", "Limbo Block ID", 217,
|
||||
"Blocks used for the terrain in Limbo").getInt();
|
||||
|
||||
@@ -180,7 +180,14 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
||||
tile.orientation = this.getFullMetadata(par1World, par2, par3, par4) & 7;
|
||||
}
|
||||
|
||||
private void setDoorRotation(int par1)
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
||||
{
|
||||
this.setDoorRotation(this.getFullMetadata(par1IBlockAccess, par2, par3, par4));
|
||||
}
|
||||
|
||||
|
||||
public void setDoorRotation(int par1)
|
||||
{
|
||||
float var2 = 0.1875F;
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F);
|
||||
|
||||
49
StevenDimDoors/mod_pocketDim/blocks/BlockDoorGold.java
Normal file
@@ -0,0 +1,49 @@
|
||||
package StevenDimDoors.mod_pocketDim.blocks;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import net.minecraft.block.BlockDoor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class BlockDoorGold extends BlockDoor
|
||||
{
|
||||
|
||||
private Icon blockIconBottom;
|
||||
private DDProperties properties;
|
||||
|
||||
public BlockDoorGold(int par1, Material par2Material,DDProperties properties)
|
||||
{
|
||||
super(par1, par2Material);
|
||||
this.properties=properties;
|
||||
|
||||
}
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
public Icon getIcon(int par1, int par2)
|
||||
{
|
||||
return this.blockIcon;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
if(par1IBlockAccess.getBlockId(par2, par3-1, par4) == this.blockID)
|
||||
{
|
||||
return this.blockIcon;
|
||||
}
|
||||
else
|
||||
{
|
||||
return blockIconBottom;
|
||||
}
|
||||
}
|
||||
}
|
||||
41
StevenDimDoors/mod_pocketDim/blocks/BlockGoldDimDoor.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package StevenDimDoors.mod_pocketDim.blocks;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.world.World;
|
||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
||||
import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
||||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
|
||||
public class BlockGoldDimDoor extends BaseDimDoor implements IDimDoor
|
||||
{
|
||||
|
||||
public BlockGoldDimDoor(int blockID, Material material,
|
||||
DDProperties properties) {
|
||||
super(blockID, material, properties);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public void placeLink(World world, int x, int y, int z)
|
||||
{
|
||||
if (!world.isRemote && world.getBlockId(x, y - 1, z) == this.blockID)
|
||||
{
|
||||
NewDimData dimension = PocketManager.getDimensionData(world);
|
||||
DimLink link = dimension.getLink(x, y, z);
|
||||
if (link == null)
|
||||
{
|
||||
dimension.createLink(x, y, z, LinkTypes.POCKET);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public int getDrops()
|
||||
{
|
||||
return this.properties.GoldDoorItemID;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -53,6 +53,9 @@ public class BlockRift extends BlockContainer
|
||||
this.blocksImmuneToRift.add(properties.UnstableDoorID);
|
||||
this.blocksImmuneToRift.add(properties.RiftBlockID);
|
||||
this.blocksImmuneToRift.add(properties.TransientDoorID);
|
||||
this.blocksImmuneToRift.add(properties.GoldDimDoorID);
|
||||
this.blocksImmuneToRift.add(properties.GoldDoorID);
|
||||
|
||||
this.blocksImmuneToRift.add(Block.blockIron.blockID);
|
||||
this.blocksImmuneToRift.add(Block.blockDiamond.blockID);
|
||||
this.blocksImmuneToRift.add(Block.blockEmerald.blockID);
|
||||
|
||||
@@ -155,7 +155,8 @@ public class DDTeleporter
|
||||
//Check if the block below that point is actually a door
|
||||
int blockID = world.getBlockId(door.getX(), door.getY() - 1, door.getZ());
|
||||
if (blockID != properties.DimensionalDoorID && blockID != properties.WarpDoorID &&
|
||||
blockID != properties.TransientDoorID && blockID != properties.UnstableDoorID)
|
||||
blockID != properties.TransientDoorID && blockID != properties.UnstableDoorID
|
||||
&& blockID != properties.GoldDimDoorID)
|
||||
{
|
||||
//Return the pocket's orientation instead
|
||||
return PocketManager.getDimensionData(door.getDimension()).orientation();
|
||||
|
||||
52
StevenDimDoors/mod_pocketDim/dungeon/ItemGoldDimDoor.java
Normal file
@@ -0,0 +1,52 @@
|
||||
package StevenDimDoors.mod_pocketDim.dungeon;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import StevenDimDoors.mod_pocketDim.items.BaseItemDoor;
|
||||
|
||||
public class ItemGoldDimDoor extends BaseItemDoor
|
||||
{
|
||||
|
||||
public ItemGoldDimDoor(int itemID, Material material) {
|
||||
super(itemID, material);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Similar to a Iron Dim Door");
|
||||
par3List.add("But if present in a pocket dim");
|
||||
par3List.add("it will keep it loaded.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y,
|
||||
int z, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
return tryItemUse(mod_pocketDim.goldDimDoor, stack, player, world, x, y, z, par7, false, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
if (tryPlacingDoor(mod_pocketDim.goldDimDoor, world, player, stack) &&
|
||||
!player.capabilities.isCreativeMode)
|
||||
{
|
||||
stack.stackSize--;
|
||||
}
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
64
StevenDimDoors/mod_pocketDim/dungeon/ItemGoldDoor.java
Normal file
@@ -0,0 +1,64 @@
|
||||
package StevenDimDoors.mod_pocketDim.dungeon;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
51
StevenDimDoors/mod_pocketDim/helpers/ChunkLoaderHelper.java
Normal file
@@ -0,0 +1,51 @@
|
||||
package StevenDimDoors.mod_pocketDim.helpers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeChunkManager.Ticket;
|
||||
import net.minecraftforge.common.ForgeChunkManager;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityDimDoor;
|
||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityDimDoorGold;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
|
||||
public class ChunkLoaderHelper implements ForgeChunkManager.OrderedLoadingCallback
|
||||
{
|
||||
|
||||
@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");
|
||||
TileEntityDimDoorGold tile = (TileEntityDimDoorGold) world.getBlockTileEntity(goldDimDoorX, goldDimDoorY, goldDimDoorZ);
|
||||
tile.forceChunkLoading(ticket);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Ticket> ticketsLoaded(List<Ticket> tickets, World world, int maxTicketCount)
|
||||
{
|
||||
List<Ticket> validTickets = Lists.newArrayList();
|
||||
for (Ticket ticket : tickets)
|
||||
{
|
||||
int goldDimDoorX = ticket.getModData().getInteger("goldDimDoorX");
|
||||
int goldDimDoorY = ticket.getModData().getInteger("goldDimDoorY");
|
||||
int goldDimDoorZ = ticket.getModData().getInteger("goldDimDoorZ");
|
||||
|
||||
int blId = world.getBlockId(goldDimDoorX, goldDimDoorY, goldDimDoorZ);
|
||||
if (blId == mod_pocketDim.properties.GoldDimDoorID)
|
||||
{
|
||||
validTickets.add(ticket);
|
||||
}
|
||||
}
|
||||
return validTickets;
|
||||
}
|
||||
}
|
||||
@@ -57,7 +57,7 @@ public abstract class BaseItemDoor extends ItemDoor
|
||||
|
||||
if (canPlace(world, x, y, z) && canPlace(world, x, y + 1, z) &&
|
||||
player.canPlayerEdit(x, y, z, side, stack) && player.canPlayerEdit(x, y + 1, z, side, stack) &&
|
||||
(!requireLink || PocketManager.getLink(x, y + 1, z, world) != null))
|
||||
(!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;
|
||||
placeDoorBlock(world, x, y, z, orientation, doorBlock);
|
||||
|
||||
@@ -11,9 +11,12 @@ 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;
|
||||
import StevenDimDoors.mod_pocketDim.blocks.BlockGoldDimDoor;
|
||||
import StevenDimDoors.mod_pocketDim.blocks.BlockLimbo;
|
||||
import StevenDimDoors.mod_pocketDim.blocks.BlockRift;
|
||||
import StevenDimDoors.mod_pocketDim.blocks.DimensionalDoor;
|
||||
@@ -22,6 +25,9 @@ import StevenDimDoors.mod_pocketDim.blocks.TransientDoor;
|
||||
import StevenDimDoors.mod_pocketDim.blocks.UnstableDoor;
|
||||
import StevenDimDoors.mod_pocketDim.blocks.WarpDoor;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
import StevenDimDoors.mod_pocketDim.dungeon.ItemGoldDimDoor;
|
||||
import StevenDimDoors.mod_pocketDim.dungeon.ItemGoldDoor;
|
||||
import StevenDimDoors.mod_pocketDim.helpers.ChunkLoaderHelper;
|
||||
import StevenDimDoors.mod_pocketDim.helpers.DungeonHelper;
|
||||
import StevenDimDoors.mod_pocketDim.items.ItemBlockDimWall;
|
||||
import StevenDimDoors.mod_pocketDim.items.ItemDimensionalDoor;
|
||||
@@ -38,6 +44,7 @@ import StevenDimDoors.mod_pocketDim.ticking.MobMonolith;
|
||||
import StevenDimDoors.mod_pocketDim.ticking.MonolithSpawner;
|
||||
import StevenDimDoors.mod_pocketDim.ticking.RiftRegenerator;
|
||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityDimDoor;
|
||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityDimDoorGold;
|
||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityRift;
|
||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityTransTrapdoor;
|
||||
import StevenDimDoors.mod_pocketDim.world.BiomeGenLimbo;
|
||||
@@ -91,6 +98,8 @@ public class mod_pocketDim
|
||||
|
||||
public static Block transientDoor;
|
||||
public static Block warpDoor;
|
||||
public static Block goldDoor;
|
||||
public static Block goldDimDoor;
|
||||
public static Block unstableDoor;
|
||||
public static Block blockLimbo;
|
||||
public static DimensionalDoor dimensionalDoor;
|
||||
@@ -99,6 +108,8 @@ public class mod_pocketDim
|
||||
public static Block blockDimWallPerm;
|
||||
public static BlockRift blockRift;
|
||||
|
||||
public static Item itemGoldDimDoor;
|
||||
public static Item itemGoldDoor;
|
||||
public static Item itemRiftBlade;
|
||||
public static Item itemDimDoor;
|
||||
public static Item itemExitDoor;
|
||||
@@ -160,7 +171,9 @@ public class mod_pocketDim
|
||||
LimboDecay decay = new LimboDecay(commonTickHandler, properties);
|
||||
|
||||
transientDoor = new TransientDoor(properties.TransientDoorID, Material.iron, properties).setHardness(1.0F) .setUnlocalizedName("transientDoor");
|
||||
goldDimDoor = new BlockGoldDimDoor(properties.GoldDimDoorID, Material.iron, properties).setHardness(1.0F) .setUnlocalizedName("dimDoorGold");
|
||||
|
||||
goldDoor = new BlockDoorGold(properties.GoldDoorID, Material.iron, properties).setLightValue(1.0F).setHardness(0.1F).setUnlocalizedName("doorGold");
|
||||
blockDimWall = new BlockDimWall(properties.FabricBlockID, 0, Material.iron).setLightValue(1.0F).setHardness(0.1F).setUnlocalizedName("blockDimWall");
|
||||
blockDimWallPerm = (new BlockDimWallPerm(properties.PermaFabricBlockID, 0, Material.iron)).setLightValue(1.0F).setBlockUnbreakable().setResistance(6000000.0F).setUnlocalizedName("blockDimWallPerm");
|
||||
warpDoor = new WarpDoor(properties.WarpDoorID, Material.wood, properties).setHardness(1.0F) .setUnlocalizedName("dimDoorWarp");
|
||||
@@ -170,6 +183,8 @@ public class mod_pocketDim
|
||||
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");
|
||||
itemExitDoor = (new ItemWarpDoor(properties.WarpDoorItemID, Material.wood)).setUnlocalizedName("itemDimDoorWarp");
|
||||
itemLinkSignature = (new ItemRiftSignature(properties.RiftSignatureItemID)).setUnlocalizedName("itemLinkSignature");
|
||||
@@ -184,6 +199,8 @@ public class mod_pocketDim
|
||||
|
||||
GameRegistry.registerWorldGenerator(mod_pocketDim.riftGen);
|
||||
|
||||
GameRegistry.registerBlock(goldDoor, "Golden Door");
|
||||
GameRegistry.registerBlock(goldDimDoor, "Golden Dimensional Door");
|
||||
GameRegistry.registerBlock(unstableDoor, "Unstable Door");
|
||||
GameRegistry.registerBlock(warpDoor, "Warp Door");
|
||||
GameRegistry.registerBlock(blockRift, "Rift");
|
||||
@@ -199,6 +216,8 @@ public class mod_pocketDim
|
||||
DimensionManager.registerProviderType(properties.LimboProviderID, LimboProvider.class, false);
|
||||
DimensionManager.registerDimension(properties.LimboDimensionID, properties.LimboProviderID);
|
||||
|
||||
LanguageRegistry.addName(goldDoor, "Golden Door");
|
||||
LanguageRegistry.addName(goldDimDoor, "Golden Dimensional Door");
|
||||
LanguageRegistry.addName(transientDoor , "transientDoor");
|
||||
LanguageRegistry.addName(blockRift , "Rift");
|
||||
LanguageRegistry.addName(blockLimbo , "Unraveled Fabric");
|
||||
@@ -211,6 +230,8 @@ public class mod_pocketDim
|
||||
|
||||
LanguageRegistry.addName(itemExitDoor, "Warp Door");
|
||||
LanguageRegistry.addName(itemLinkSignature , "Rift Signature");
|
||||
LanguageRegistry.addName(itemGoldDoor, "Golden Door");
|
||||
LanguageRegistry.addName(itemGoldDimDoor , "Golden Dimensional Door");
|
||||
LanguageRegistry.addName(itemStabilizedLinkSignature, "Stabilized Rift Signature");
|
||||
LanguageRegistry.addName(itemRiftRemover , "Rift Remover");
|
||||
LanguageRegistry.addName(itemStableFabric , "Stable Fabric");
|
||||
@@ -230,6 +251,7 @@ public class mod_pocketDim
|
||||
GameRegistry.registerTileEntity(TileEntityDimDoor.class, "TileEntityDimDoor");
|
||||
GameRegistry.registerTileEntity(TileEntityRift.class, "TileEntityRift");
|
||||
GameRegistry.registerTileEntity(TileEntityTransTrapdoor.class, "TileEntityDimHatch");
|
||||
GameRegistry.registerTileEntity(TileEntityDimDoorGold.class, "TileEntityDimDoorGold");
|
||||
|
||||
EntityRegistry.registerModEntity(MobMonolith.class, "Monolith", properties.MonolithEntityID, this, 70, 1, true);
|
||||
EntityList.IDtoClassMapping.put(properties.MonolithEntityID, MobMonolith.class);
|
||||
@@ -331,7 +353,25 @@ public class mod_pocketDim
|
||||
" y ", "yxy", " y ", 'x', mod_pocketDim.itemLinkSignature, 'y', mod_pocketDim.itemStableFabric
|
||||
});
|
||||
}
|
||||
if (properties.CraftingGoldDimDoorAllowed)
|
||||
{
|
||||
GameRegistry.addRecipe(new ItemStack(mod_pocketDim.itemGoldDimDoor,1), new Object[]
|
||||
{
|
||||
" x ", " y ", " x ", 'x', mod_pocketDim.itemGoldDoor, 'y', Item.eyeOfEnder
|
||||
});
|
||||
}
|
||||
if (properties.CraftingGoldDoorAllowed)
|
||||
{
|
||||
GameRegistry.addRecipe(new ItemStack(mod_pocketDim.itemGoldDoor,1), new Object[]
|
||||
{
|
||||
"yy ", "yy ", "yy ", 'y', Item.ingotGold
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(mod_pocketDim.itemGoldDoor,1), new Object[]
|
||||
{
|
||||
" yy", " yy", " yy", 'y', Item.ingotGold
|
||||
});
|
||||
}
|
||||
DungeonHelper.initialize();
|
||||
|
||||
proxy.loadTextures();
|
||||
@@ -342,6 +382,7 @@ public class mod_pocketDim
|
||||
@PostInit
|
||||
public void onPostInitialization(FMLPostInitializationEvent event)
|
||||
{
|
||||
ForgeChunkManager.setForcedChunkLoadingCallback(instance, new ChunkLoaderHelper());
|
||||
//Register loot chests
|
||||
DDLoot.registerInfo();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
package StevenDimDoors.mod_pocketDim.tileentities;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
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
|
||||
{
|
||||
|
||||
private Ticket chunkTicket;
|
||||
|
||||
public boolean canUpdate()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void updateEntity()
|
||||
{
|
||||
if(this.chunkTicket==null)
|
||||
{
|
||||
chunkTicket = ForgeChunkManager.requestTicket(mod_pocketDim.instance, worldObj, Type.NORMAL);
|
||||
}
|
||||
|
||||
chunkTicket.getModData().setInteger("goldDimDoorX", xCoord);
|
||||
chunkTicket.getModData().setInteger("goldDimDoorY", yCoord);
|
||||
chunkTicket.getModData().setInteger("goldDimDoorZ", zCoord);
|
||||
|
||||
this.forceChunkLoading(chunkTicket);
|
||||
}
|
||||
|
||||
public void forceChunkLoading(Ticket chunkTicket)
|
||||
{
|
||||
if(PocketManager.getDimensionData(this.worldObj)==null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(!PocketManager.getDimensionData(this.worldObj).isPocketDimension())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for(int chunks = (PocketBuilder.DEFAULT_POCKET_SIZE%16)+1;chunks>0;chunks--)
|
||||
{
|
||||
ForgeChunkManager.forceChunk(chunkTicket, new ChunkCoordIntPair((xCoord >> 4)+chunks, (zCoord >> 4)+chunks));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@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);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
232
StevenDimDoors/mod_pocketDim/world/CustomSkyProvider.java
Normal file
@@ -0,0 +1,232 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,211 +11,17 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.client.IRenderHandler;
|
||||
|
||||
public class LimboSkyProvider extends IRenderHandler
|
||||
public class LimboSkyProvider extends CustomSkyProvider
|
||||
{
|
||||
|
||||
int starGLCallList;
|
||||
int glSkyList;
|
||||
int glSkyList2;
|
||||
|
||||
@Override
|
||||
public String getMoonRenderPath()
|
||||
{
|
||||
return "/mods/DimDoors/textures/other/limboMoon.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(float par1, WorldClient world, Minecraft mc)
|
||||
public String getSunRenderPath()
|
||||
{
|
||||
|
||||
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;
|
||||
return "/mods/DimDoors/textures/other/limboSun.png";
|
||||
}
|
||||
|
||||
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/DimDoors/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("/mods/DimDoors/textures/other/limboMoon.png");
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -224,7 +224,8 @@ public class PocketBuilder
|
||||
//Check if the block below that point is actually a door
|
||||
int blockID = world.getBlockId(source.getX(), source.getY() - 1, source.getZ());
|
||||
if (blockID != properties.DimensionalDoorID && blockID != properties.WarpDoorID &&
|
||||
blockID != properties.TransientDoorID)
|
||||
blockID != properties.TransientDoorID &&
|
||||
blockID != properties.GoldDimDoorID)
|
||||
{
|
||||
throw new IllegalStateException("The link's source is not a door block. It should be impossible to traverse a rift without a door!");
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.WorldProvider;
|
||||
import net.minecraft.world.biome.WorldChunkManagerHell;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraftforge.client.IRenderHandler;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import StevenDimDoors.mod_pocketDim.CloudRenderBlank;
|
||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||
@@ -19,10 +20,13 @@ public class PocketProvider extends WorldProvider
|
||||
{
|
||||
private DDProperties properties;
|
||||
private MonolithSpawner spawner;
|
||||
private IRenderHandler skyRenderer;
|
||||
|
||||
public PocketProvider()
|
||||
{
|
||||
this.hasNoSky = true;
|
||||
this.skyRenderer = new PocketSkyProvider();
|
||||
|
||||
this.spawner = mod_pocketDim.spawner;
|
||||
this.properties = mod_pocketDim.properties;
|
||||
}
|
||||
|
||||
31
StevenDimDoors/mod_pocketDim/world/PocketSkyProvider.java
Normal file
@@ -0,0 +1,31 @@
|
||||
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";
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
resources/mods/DimDoors/textures/blocks/dimDoorGold_bottom.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
resources/mods/DimDoors/textures/blocks/dimDoorGold_top.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
resources/mods/DimDoors/textures/blocks/doorGold_bottom.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
resources/mods/DimDoors/textures/blocks/doorGold_top.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
resources/mods/DimDoors/textures/items/itemGoldDimDoor.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
resources/mods/DimDoors/textures/items/itemGoldDoor.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
resources/mods/DimDoors/textures/other/pocketMoon.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
resources/mods/DimDoors/textures/other/pocketSun.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |