diff --git a/StevenDimDoors/mod_pocketDim/DDProperties.java b/StevenDimDoors/mod_pocketDim/DDProperties.java index cb0ea3b..18e3218 100644 --- a/StevenDimDoors/mod_pocketDim/DDProperties.java +++ b/StevenDimDoors/mod_pocketDim/DDProperties.java @@ -13,7 +13,9 @@ public class DDProperties */ public final int UnstableDoorID; - public final int DimensionalDoorID; + public final int DimensionalDoorID; + public final int GoldDoorID; + public final int GoldDimDoorID; public final int WarpDoorID; public final int TransTrapdoorID; public final int TransientDoorID; @@ -32,7 +34,9 @@ public class DDProperties */ public final int RiftBladeItemID; - public final int RiftSignatureItemID; + 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,7 +188,9 @@ 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(); StableFabricItemID = config.getItem("Stable Fabric Item ID", 5672).getInt(); @@ -189,7 +199,9 @@ 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(); PermaFabricBlockID = config.getTerrainBlock("World Generation Block IDs - must be less than 256", diff --git a/StevenDimDoors/mod_pocketDim/blocks/BlockDoorGold.java b/StevenDimDoors/mod_pocketDim/blocks/BlockDoorGold.java new file mode 100644 index 0000000..fdc26c3 --- /dev/null +++ b/StevenDimDoors/mod_pocketDim/blocks/BlockDoorGold.java @@ -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; + } + } +} diff --git a/StevenDimDoors/mod_pocketDim/blocks/BlockGoldDimDoor.java b/StevenDimDoors/mod_pocketDim/blocks/BlockGoldDimDoor.java new file mode 100644 index 0000000..22c1853 --- /dev/null +++ b/StevenDimDoors/mod_pocketDim/blocks/BlockGoldDimDoor.java @@ -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; + } + +} diff --git a/StevenDimDoors/mod_pocketDim/blocks/BlockRift.java b/StevenDimDoors/mod_pocketDim/blocks/BlockRift.java index bca54b5..11fe960 100644 --- a/StevenDimDoors/mod_pocketDim/blocks/BlockRift.java +++ b/StevenDimDoors/mod_pocketDim/blocks/BlockRift.java @@ -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); diff --git a/StevenDimDoors/mod_pocketDim/core/DDTeleporter.java b/StevenDimDoors/mod_pocketDim/core/DDTeleporter.java index ccfa585..312f9ee 100644 --- a/StevenDimDoors/mod_pocketDim/core/DDTeleporter.java +++ b/StevenDimDoors/mod_pocketDim/core/DDTeleporter.java @@ -154,7 +154,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(); diff --git a/StevenDimDoors/mod_pocketDim/dungeon/ItemGoldDimDoor.java b/StevenDimDoors/mod_pocketDim/dungeon/ItemGoldDimDoor.java new file mode 100644 index 0000000..dde4efa --- /dev/null +++ b/StevenDimDoors/mod_pocketDim/dungeon/ItemGoldDimDoor.java @@ -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; + } + + + +} diff --git a/StevenDimDoors/mod_pocketDim/dungeon/ItemGoldDoor.java b/StevenDimDoors/mod_pocketDim/dungeon/ItemGoldDoor.java new file mode 100644 index 0000000..0a8a5ce --- /dev/null +++ b/StevenDimDoors/mod_pocketDim/dungeon/ItemGoldDoor.java @@ -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; + } + } + } + + + + +} diff --git a/StevenDimDoors/mod_pocketDim/helpers/ChunkLoaderHelper.java b/StevenDimDoors/mod_pocketDim/helpers/ChunkLoaderHelper.java new file mode 100644 index 0000000..bd2a234 --- /dev/null +++ b/StevenDimDoors/mod_pocketDim/helpers/ChunkLoaderHelper.java @@ -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 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 ticketsLoaded(List tickets, World world, int maxTicketCount) + { + List 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; + } +} \ No newline at end of file diff --git a/StevenDimDoors/mod_pocketDim/items/BaseItemDoor.java b/StevenDimDoors/mod_pocketDim/items/BaseItemDoor.java index e084b1f..ea5bbec 100644 --- a/StevenDimDoors/mod_pocketDim/items/BaseItemDoor.java +++ b/StevenDimDoors/mod_pocketDim/items/BaseItemDoor.java @@ -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); diff --git a/StevenDimDoors/mod_pocketDim/mod_pocketDim.java b/StevenDimDoors/mod_pocketDim/mod_pocketDim.java index c1335a6..1523c19 100644 --- a/StevenDimDoors/mod_pocketDim/mod_pocketDim.java +++ b/StevenDimDoors/mod_pocketDim/mod_pocketDim.java @@ -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(); } diff --git a/StevenDimDoors/mod_pocketDim/tileentities/TileEntityDimDoorGold.java b/StevenDimDoors/mod_pocketDim/tileentities/TileEntityDimDoorGold.java new file mode 100644 index 0000000..d57aa37 --- /dev/null +++ b/StevenDimDoors/mod_pocketDim/tileentities/TileEntityDimDoorGold.java @@ -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); + + + } +} diff --git a/StevenDimDoors/mod_pocketDim/world/CustomSkyProvider.java b/StevenDimDoors/mod_pocketDim/world/CustomSkyProvider.java new file mode 100644 index 0000000..c88377c --- /dev/null +++ b/StevenDimDoors/mod_pocketDim/world/CustomSkyProvider.java @@ -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); + } + + } + +} \ No newline at end of file diff --git a/StevenDimDoors/mod_pocketDim/world/LimboSkyProvider.java b/StevenDimDoors/mod_pocketDim/world/LimboSkyProvider.java index 21b1d73..4252564 100644 --- a/StevenDimDoors/mod_pocketDim/world/LimboSkyProvider.java +++ b/StevenDimDoors/mod_pocketDim/world/LimboSkyProvider.java @@ -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 void render(float par1, WorldClient world, Minecraft mc) + public String getMoonRenderPath() { - - 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/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); - } - + return "/mods/DimDoors/textures/other/limboMoon.png"; } + @Override + public String getSunRenderPath() + { + return "/mods/DimDoors/textures/other/limboSun.png"; + } } \ No newline at end of file diff --git a/StevenDimDoors/mod_pocketDim/world/PocketBuilder.java b/StevenDimDoors/mod_pocketDim/world/PocketBuilder.java index 0b55e71..c3b1706 100644 --- a/StevenDimDoors/mod_pocketDim/world/PocketBuilder.java +++ b/StevenDimDoors/mod_pocketDim/world/PocketBuilder.java @@ -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!"); } diff --git a/StevenDimDoors/mod_pocketDim/world/PocketProvider.java b/StevenDimDoors/mod_pocketDim/world/PocketProvider.java index 8348e08..ca51580 100644 --- a/StevenDimDoors/mod_pocketDim/world/PocketProvider.java +++ b/StevenDimDoors/mod_pocketDim/world/PocketProvider.java @@ -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; } diff --git a/StevenDimDoors/mod_pocketDim/world/PocketSkyProvider.java b/StevenDimDoors/mod_pocketDim/world/PocketSkyProvider.java new file mode 100644 index 0000000..a3503fe --- /dev/null +++ b/StevenDimDoors/mod_pocketDim/world/PocketSkyProvider.java @@ -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"; + } + } +} \ No newline at end of file diff --git a/resources/mods/DimDoors/textures/blocks/dimDoorGold_bottom.png b/resources/mods/DimDoors/textures/blocks/dimDoorGold_bottom.png new file mode 100644 index 0000000..85221b9 Binary files /dev/null and b/resources/mods/DimDoors/textures/blocks/dimDoorGold_bottom.png differ diff --git a/resources/mods/DimDoors/textures/blocks/dimDoorGold_top.png b/resources/mods/DimDoors/textures/blocks/dimDoorGold_top.png new file mode 100644 index 0000000..1b4339a Binary files /dev/null and b/resources/mods/DimDoors/textures/blocks/dimDoorGold_top.png differ diff --git a/resources/mods/DimDoors/textures/blocks/doorGold_bottom.png b/resources/mods/DimDoors/textures/blocks/doorGold_bottom.png new file mode 100644 index 0000000..85221b9 Binary files /dev/null and b/resources/mods/DimDoors/textures/blocks/doorGold_bottom.png differ diff --git a/resources/mods/DimDoors/textures/blocks/doorGold_top.png b/resources/mods/DimDoors/textures/blocks/doorGold_top.png new file mode 100644 index 0000000..1b4339a Binary files /dev/null and b/resources/mods/DimDoors/textures/blocks/doorGold_top.png differ diff --git a/resources/mods/DimDoors/textures/items/itemGoldDimDoor.png b/resources/mods/DimDoors/textures/items/itemGoldDimDoor.png new file mode 100644 index 0000000..4ff74c9 Binary files /dev/null and b/resources/mods/DimDoors/textures/items/itemGoldDimDoor.png differ diff --git a/resources/mods/DimDoors/textures/items/itemGoldDoor.png b/resources/mods/DimDoors/textures/items/itemGoldDoor.png new file mode 100644 index 0000000..681f561 Binary files /dev/null and b/resources/mods/DimDoors/textures/items/itemGoldDoor.png differ diff --git a/resources/mods/DimDoors/textures/other/pocketMoon.png b/resources/mods/DimDoors/textures/other/pocketMoon.png new file mode 100644 index 0000000..4d7a88f Binary files /dev/null and b/resources/mods/DimDoors/textures/other/pocketMoon.png differ diff --git a/resources/mods/DimDoors/textures/other/pocketSun.png b/resources/mods/DimDoors/textures/other/pocketSun.png new file mode 100644 index 0000000..4d7a88f Binary files /dev/null and b/resources/mods/DimDoors/textures/other/pocketSun.png differ