diff --git a/StevenDimDoors/mod_pocketDim/EventHookContainer.java b/StevenDimDoors/mod_pocketDim/EventHookContainer.java index 0bd8d1bb..1a283759 100644 --- a/StevenDimDoors/mod_pocketDim/EventHookContainer.java +++ b/StevenDimDoors/mod_pocketDim/EventHookContainer.java @@ -62,6 +62,12 @@ public class EventHookContainer event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/monk.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/monk.ogg"))); event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/crack.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/crack.ogg"))); event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/tearing.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/tearing.ogg"))); + event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/rift.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/rift.ogg"))); + event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/riftStart.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/riftStart.ogg"))); + event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/riftEnd.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/riftEnd.ogg"))); + event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/riftClose.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/riftClose.ogg"))); + event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/riftDoor.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/riftDoor.ogg"))); + } @ForgeSubscribe diff --git a/StevenDimDoors/mod_pocketDim/RiftGenerator.java b/StevenDimDoors/mod_pocketDim/RiftGenerator.java index 424cc58b..76888069 100644 --- a/StevenDimDoors/mod_pocketDim/RiftGenerator.java +++ b/StevenDimDoors/mod_pocketDim/RiftGenerator.java @@ -8,6 +8,7 @@ import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import StevenDimDoors.mod_pocketDim.helpers.dimHelper; import StevenDimDoors.mod_pocketDim.items.ItemRiftBlade; +import StevenDimDoors.mod_pocketDim.items.itemDimDoor; import StevenDimDoors.mod_pocketDim.world.LimboProvider; import StevenDimDoors.mod_pocketDim.world.pocketProvider; import cpw.mods.fml.common.IWorldGenerator; @@ -158,7 +159,7 @@ public class RiftGenerator implements IWorldGenerator } //Place the shiny transient door into a dungeon - ItemRiftBlade.placeDoorBlock(world, x, y + 1, z, 0, mod_pocketDim.transientDoor); + itemDimDoor.placeDoorBlock(world, x, y + 1, z, 0, mod_pocketDim.transientDoor); //Build the columns around the door world.setBlock(x, y + 1, z - 1, blockID, 0, 3); diff --git a/StevenDimDoors/mod_pocketDim/TileEntityRift.java b/StevenDimDoors/mod_pocketDim/TileEntityRift.java index 390fa0a2..273a61a1 100644 --- a/StevenDimDoors/mod_pocketDim/TileEntityRift.java +++ b/StevenDimDoors/mod_pocketDim/TileEntityRift.java @@ -31,6 +31,7 @@ public class TileEntityRift extends TileEntity public boolean isNearRift=false; private int count=200; private int count2 = 0; + private int soundCount = 0; public LinkData nearestRiftData; Random rand = new Random(); @@ -46,6 +47,10 @@ public class TileEntityRift extends TileEntity if(count>200&&dimHelper.dimList.get(this.worldObj.provider.dimensionId)!=null) { + if(rand.nextBoolean()) + { + this.worldObj.playSound(xCoord, yCoord, zCoord, "mods.DimDoors.sfx.rift", (float) .7, 1,true); + } nearestRiftData = dimHelper.dimList.get(this.worldObj.provider.dimensionId).findNearestRift(worldObj, 5, xCoord, yCoord, zCoord); if(nearestRiftData!=null) { diff --git a/StevenDimDoors/mod_pocketDim/items/ItemRiftBlade.java b/StevenDimDoors/mod_pocketDim/items/ItemRiftBlade.java index 59031e94..5f1b402c 100644 --- a/StevenDimDoors/mod_pocketDim/items/ItemRiftBlade.java +++ b/StevenDimDoors/mod_pocketDim/items/ItemRiftBlade.java @@ -12,7 +12,9 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.EnumAction; import net.minecraft.item.EnumToolMaterial; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; @@ -25,11 +27,11 @@ import StevenDimDoors.mod_pocketDim.helpers.dimHelper; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class ItemRiftBlade extends itemDimDoor +public class ItemRiftBlade extends ItemSword { - public ItemRiftBlade(int par1, Material par2Material) + public ItemRiftBlade(int par1) { - super(par1, par2Material); + super(par1, EnumToolMaterial.GOLD); // this.setTextureFile("/PocketBlockTextures.png"); this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab); @@ -80,7 +82,7 @@ public class ItemRiftBlade extends itemDimDoor public int getDamageVsEntity(Entity par1Entity) { - return 8; + return 7; } public MovingObjectPosition getMovingObjectPositionFromPlayer(World par1World, EntityPlayer par2EntityPlayer, boolean par3) @@ -183,7 +185,7 @@ public class ItemRiftBlade extends itemDimDoor int rotation = (int) (MathHelper.floor_double((double)((par3EntityPlayer.rotationYaw+90) * 4.0F / 360.0F) + 0.5D) & 3); LinkData link = new LinkData(par2World.provider.dimensionId, 0, x, y, z, x, y, z, true,rotation); - if(this.getMaxItemUseDuration(par1ItemStack)-par4>12&&!par2World.isRemote&&this.canPlace(par2World, x, y, z, rotation)) + if(this.getMaxItemUseDuration(par1ItemStack)-par4>12&&!par2World.isRemote&&itemDimDoor.canPlace(par2World, x, y, z, rotation)) { if(dimHelper.dimList.get(par2World.provider.dimensionId)!=null) @@ -197,7 +199,8 @@ public class ItemRiftBlade extends itemDimDoor { dimHelper.instance.createPocket(link,true, false); } - placeDoorBlock(par2World, x, y-1, z, rotation, mod_pocketDim.transientDoor); + par3EntityPlayer.worldObj.playSoundAtEntity(par3EntityPlayer,"mods.DimDoors.sfx.riftDoor", (float) .6, 1); + itemDimDoor.placeDoorBlock(par2World, x, y-1, z, rotation, mod_pocketDim.transientDoor); } } @@ -226,14 +229,16 @@ public class ItemRiftBlade extends itemDimDoor { int var12 = MathHelper.floor_double((double)((par3EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3; - if (!this.canPlace(par2World, par4, par5, par6, var12)||!this.canPlace(par2World, par4, par5-1, par6, var12)||dimHelper.instance.getLinkDataFromCoords(par4, par5, par6, par2World)==null) + if (!itemDimDoor.canPlace(par2World, par4, par5, par6, var12)||!itemDimDoor.canPlace(par2World, par4, par5-1, par6, var12)||dimHelper.instance.getLinkDataFromCoords(par4, par5, par6, par2World)==null) { return par1ItemStack; } else { - placeDoorBlock(par2World, par4, par5-1, par6, var12, var11); + itemDimDoor.placeDoorBlock(par2World, par4, par5-1, par6, var12, var11); + par3EntityPlayer.worldObj.playSoundAtEntity(par3EntityPlayer,"mods.DimDoors.sfx.riftDoor", (float) .6, 1); + didFindThing=true; @@ -299,17 +304,25 @@ public class ItemRiftBlade extends itemDimDoor } public int getItemEnchantability() - { - return EnumToolMaterial.GOLD.getEnchantability(); - } - public String func_77825_f() - { - return EnumToolMaterial.GOLD.toString(); - } - public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) - { - return true; - } + { + return EnumToolMaterial.GOLD.getEnchantability(); + } + + /** + * Return the name for this tool's material. + */ + public String getToolMaterialName() + { + return EnumToolMaterial.GOLD.toString(); + } + + /** + * Return whether this item is repairable in an anvil. + */ + public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) + { + return mod_pocketDim.itemStableFabric.itemID == par2ItemStack.itemID ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); + } public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { @@ -325,25 +338,19 @@ public class ItemRiftBlade extends itemDimDoor var11 = mod_pocketDim.transientDoor; - - - - - - - if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack)&&!par3World.isRemote) { int var12 = MathHelper.floor_double((double)((par2EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3; - if (!this.canPlace(par3World, par4, par5, par6, var12)||dimHelper.instance.getLinkDataFromCoords(par4, par5+1, par6, par3World)==null) + if (!itemDimDoor.canPlace(par3World, par4, par5, par6, var12)||dimHelper.instance.getLinkDataFromCoords(par4, par5+1, par6, par3World)==null) { return false; } else { - placeDoorBlock(par3World, par4, par5, par6, var12, var11); + itemDimDoor.placeDoorBlock(par3World, par4, par5, par6, var12, var11); + par2EntityPlayer.worldObj.playSoundAtEntity(par2EntityPlayer,"mods.DimDoors.sfx.rift", (float) .6, 1); par1ItemStack.damageItem(10, par2EntityPlayer); diff --git a/StevenDimDoors/mod_pocketDim/items/ItemStabilizedRiftSignature.java b/StevenDimDoors/mod_pocketDim/items/ItemStabilizedRiftSignature.java index e3e43fd6..3da5016a 100644 --- a/StevenDimDoors/mod_pocketDim/items/ItemStabilizedRiftSignature.java +++ b/StevenDimDoors/mod_pocketDim/items/ItemStabilizedRiftSignature.java @@ -87,7 +87,9 @@ public class ItemStabilizedRiftSignature extends itemLinkSignature { dimHelper.instance.createLink(linkCoords[3], par3World.provider.dimensionId, linkCoords[0], linkCoords[1], linkCoords[2],par4, par5+offset, par6); } - dimHelper.instance.createLink(par3World.provider.dimensionId, linkCoords[3], par4, par5+offset, par6, linkCoords[0], linkCoords[1], linkCoords[2]); + dimHelper.instance.createLink(par3World.provider.dimensionId, linkCoords[3], par4, par5+offset, par6, linkCoords[0], linkCoords[1], linkCoords[2]); + par2EntityPlayer.worldObj.playSoundAtEntity(par2EntityPlayer,"mods.DimDoors.sfx.riftEnd", (float) .6, 1); + par2EntityPlayer.sendChatToPlayer("Rift Created"); } else if(!par3World.isRemote) @@ -105,6 +107,8 @@ public class ItemStabilizedRiftSignature extends itemLinkSignature //otherwise, it creates the first half of the link. Next click will complete it. key= dimHelper.instance.createUniqueInterDimLinkKey(); this.writeToNBT(par1ItemStack, par4, par5+offset, par6,par3World.provider.dimensionId); + par2EntityPlayer.worldObj.playSoundAtEntity(par2EntityPlayer,"mods.DimDoors.sfx.riftStart", (float) .6, 1); + par2EntityPlayer.sendChatToPlayer("Rift Signature Stored"); } return true; diff --git a/StevenDimDoors/mod_pocketDim/items/itemDimDoor.java b/StevenDimDoors/mod_pocketDim/items/itemDimDoor.java index 15ed3611..13eb0b08 100644 --- a/StevenDimDoors/mod_pocketDim/items/itemDimDoor.java +++ b/StevenDimDoors/mod_pocketDim/items/itemDimDoor.java @@ -198,7 +198,7 @@ public class itemDimDoor extends ItemDoor } - public boolean canPlace(World world,int i, int j, int k, int p) + public static boolean canPlace(World world,int i, int j, int k, int p) { int id = world.getBlockId(i, j, k); diff --git a/StevenDimDoors/mod_pocketDim/items/itemLinkSignature.java b/StevenDimDoors/mod_pocketDim/items/itemLinkSignature.java index 6f2c75e5..9de5a380 100644 --- a/StevenDimDoors/mod_pocketDim/items/itemLinkSignature.java +++ b/StevenDimDoors/mod_pocketDim/items/itemLinkSignature.java @@ -147,13 +147,7 @@ public class itemLinkSignature extends Item --par1ItemStack.stackSize; par2EntityPlayer.sendChatToPlayer("Rift Created"); par1ItemStack.stackTagCompound=null; - /** - else - { - par2EntityPlayer.sendChatToPlayer("Both ends of a single rift cannot exist in the same dimension."); - - } - **/ + par2EntityPlayer.worldObj.playSoundAtEntity(par2EntityPlayer,"mods.DimDoors.sfx.riftEnd", (float) .6, 1); } } else @@ -163,14 +157,9 @@ public class itemLinkSignature extends Item //otherwise, it creates the first half of the link. Next click will complete it. key= dimHelper.instance.createUniqueInterDimLinkKey(); this.writeToNBT(par1ItemStack, par4, par5+offset, par6,par3World.provider.dimensionId,orientation); - - - par2EntityPlayer.sendChatToPlayer("Rift Signature Stored"); - - - } - + par2EntityPlayer.worldObj.playSoundAtEntity(par2EntityPlayer,"mods.DimDoors.sfx.riftStart", (float) .6, 1); + } //dimHelper.instance.save(); } diff --git a/StevenDimDoors/mod_pocketDim/items/itemRiftRemover.java b/StevenDimDoors/mod_pocketDim/items/itemRiftRemover.java index 3ba055e5..1d5452ad 100644 --- a/StevenDimDoors/mod_pocketDim/items/itemRiftRemover.java +++ b/StevenDimDoors/mod_pocketDim/items/itemRiftRemover.java @@ -85,7 +85,8 @@ public class itemRiftRemover extends Item //System.out.println(hit.hitVec); if(dimHelper.instance.removeRift(par2World, hit.blockX, hit.blockY, hit.blockZ, 1, par3EntityPlayer, par1ItemStack)) { - + par3EntityPlayer.worldObj.playSoundAtEntity(par3EntityPlayer,"mods.DimDoors.sfx.riftClose", (float) .7, 1); + } } diff --git a/StevenDimDoors/mod_pocketDim/mod_pocketDim.java b/StevenDimDoors/mod_pocketDim/mod_pocketDim.java index 7a03bf1a..46827967 100644 --- a/StevenDimDoors/mod_pocketDim/mod_pocketDim.java +++ b/StevenDimDoors/mod_pocketDim/mod_pocketDim.java @@ -193,7 +193,7 @@ public class mod_pocketDim itemRiftRemover = (new itemRiftRemover(properties.RiftRemoverItemID, Material.wood)).setUnlocalizedName("itemRiftRemover"); itemStableFabric = (new ItemStableFabric(properties.StableFabricItemID, 0)).setUnlocalizedName("itemStableFabric"); itemChaosDoor = (new ItemChaosDoor(properties.UnstableDoorItemID, Material.iron)).setUnlocalizedName("itemChaosDoor"); - itemRiftBlade = (new ItemRiftBlade(properties.RiftBladeItemID, Material.iron)).setUnlocalizedName("ItemRiftBlade"); + itemRiftBlade = (new ItemRiftBlade(properties.RiftBladeItemID)).setUnlocalizedName("ItemRiftBlade"); itemStabilizedLinkSignature = (new ItemStabilizedRiftSignature(properties.StabilizedRiftSignatureItemID)).setUnlocalizedName("itemStabilizedRiftSig"); mod_pocketDim.limboBiome= (new BiomeGenLimbo(properties.LimboBiomeID)); diff --git a/resources/mods/DimDoors/sfx/creeepysound.aup b/resources/mods/DimDoors/sfx/creeepysound.aup new file mode 100644 index 00000000..ed4281f6 --- /dev/null +++ b/resources/mods/DimDoors/sfx/creeepysound.aup @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/mods/DimDoors/sfx/creeepysound_data/e00/d00/e000014d.au b/resources/mods/DimDoors/sfx/creeepysound_data/e00/d00/e000014d.au new file mode 100644 index 00000000..fee6c050 Binary files /dev/null and b/resources/mods/DimDoors/sfx/creeepysound_data/e00/d00/e000014d.au differ diff --git a/resources/mods/DimDoors/sfx/creeepysound_data/e00/d00/e000041b.au b/resources/mods/DimDoors/sfx/creeepysound_data/e00/d00/e000041b.au new file mode 100644 index 00000000..5f58ad4b Binary files /dev/null and b/resources/mods/DimDoors/sfx/creeepysound_data/e00/d00/e000041b.au differ diff --git a/resources/mods/DimDoors/sfx/creeepysound_data/e00/d00/e00006cb.au b/resources/mods/DimDoors/sfx/creeepysound_data/e00/d00/e00006cb.au new file mode 100644 index 00000000..07fc1448 Binary files /dev/null and b/resources/mods/DimDoors/sfx/creeepysound_data/e00/d00/e00006cb.au differ diff --git a/resources/mods/DimDoors/sfx/creeepysound_data/e00/d00/e0000805.au b/resources/mods/DimDoors/sfx/creeepysound_data/e00/d00/e0000805.au new file mode 100644 index 00000000..f23c3f63 Binary files /dev/null and b/resources/mods/DimDoors/sfx/creeepysound_data/e00/d00/e0000805.au differ diff --git a/resources/mods/DimDoors/sfx/creeepysound_data/e00/d00/e0000a54.au b/resources/mods/DimDoors/sfx/creeepysound_data/e00/d00/e0000a54.au new file mode 100644 index 00000000..075f9a64 Binary files /dev/null and b/resources/mods/DimDoors/sfx/creeepysound_data/e00/d00/e0000a54.au differ diff --git a/resources/mods/DimDoors/sfx/creeepysound_data/e00/d00/e0000d4e.au b/resources/mods/DimDoors/sfx/creeepysound_data/e00/d00/e0000d4e.au new file mode 100644 index 00000000..3e5f3c7c Binary files /dev/null and b/resources/mods/DimDoors/sfx/creeepysound_data/e00/d00/e0000d4e.au differ diff --git a/resources/mods/DimDoors/sfx/creeepysound_data/e00/d00/e0000f7b.au b/resources/mods/DimDoors/sfx/creeepysound_data/e00/d00/e0000f7b.au new file mode 100644 index 00000000..f04da051 Binary files /dev/null and b/resources/mods/DimDoors/sfx/creeepysound_data/e00/d00/e0000f7b.au differ diff --git a/resources/mods/DimDoors/sfx/creeepysound_data/e00/d00/e0000fde.au b/resources/mods/DimDoors/sfx/creeepysound_data/e00/d00/e0000fde.au new file mode 100644 index 00000000..7341d57d Binary files /dev/null and b/resources/mods/DimDoors/sfx/creeepysound_data/e00/d00/e0000fde.au differ diff --git a/resources/mods/DimDoors/sfx/rift.ogg b/resources/mods/DimDoors/sfx/rift.ogg new file mode 100644 index 00000000..b200fb15 Binary files /dev/null and b/resources/mods/DimDoors/sfx/rift.ogg differ diff --git a/resources/mods/DimDoors/sfx/riftClose.ogg b/resources/mods/DimDoors/sfx/riftClose.ogg new file mode 100644 index 00000000..d73df503 Binary files /dev/null and b/resources/mods/DimDoors/sfx/riftClose.ogg differ diff --git a/resources/mods/DimDoors/sfx/riftDoor.ogg b/resources/mods/DimDoors/sfx/riftDoor.ogg new file mode 100644 index 00000000..dcbe5c21 Binary files /dev/null and b/resources/mods/DimDoors/sfx/riftDoor.ogg differ diff --git a/resources/mods/DimDoors/sfx/riftEnd.ogg b/resources/mods/DimDoors/sfx/riftEnd.ogg new file mode 100644 index 00000000..08c486e8 Binary files /dev/null and b/resources/mods/DimDoors/sfx/riftEnd.ogg differ diff --git a/resources/mods/DimDoors/sfx/riftStart.ogg b/resources/mods/DimDoors/sfx/riftStart.ogg new file mode 100644 index 00000000..b85ffb4d Binary files /dev/null and b/resources/mods/DimDoors/sfx/riftStart.ogg differ