diff --git a/StevenDimDoors/mod_pocketDim/EventHookContainer.java b/StevenDimDoors/mod_pocketDim/EventHookContainer.java index 26fe6871..d68ecd43 100644 --- a/StevenDimDoors/mod_pocketDim/EventHookContainer.java +++ b/StevenDimDoors/mod_pocketDim/EventHookContainer.java @@ -36,15 +36,15 @@ public class EventHookContainer @ForgeSubscribe public void onSoundLoad(SoundLoadEvent event) { - event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/monk.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/monk.ogg"))); - event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/crack.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/crack.ogg"))); - event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/tearing.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/tearing.ogg"))); - event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/rift.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/rift.ogg"))); - event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/riftStart.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/riftStart.ogg"))); - event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/riftEnd.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/riftEnd.ogg"))); - event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/riftClose.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/riftClose.ogg"))); - event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/riftDoor.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/riftDoor.ogg"))); - event.manager.soundPoolMusic.addSound("mods/DimDoors/sfx/creepy.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/creepy.ogg"))); + event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/monk.ogg"); + event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/crack.ogg"); + event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/tearing.ogg"); + event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/rift.ogg"); + event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/riftStart.ogg"); + event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/riftEnd.ogg"); + event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/riftClose.ogg"); + event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/riftDoor.ogg"); + event.manager.soundPoolMusic.addSound("mods/DimDoors/sfx/creepy.ogg"); } @SideOnly(Side.CLIENT) @@ -96,7 +96,7 @@ public class EventHookContainer ChunkCoordinates coords = LimboProvider.getLimboSkySpawn(player.worldObj.rand); Point4D destination = new Point4D((int) (coords.posX+entity.posX), coords.posY, (int) (coords.posZ+entity.posZ ), mod_pocketDim.properties.LimboDimensionID); DDTeleporter.teleportEntity(player, destination, false); - player.setEntityHealth(player.getMaxHealth()); + player.setHealth(player.getMaxHealth()); event.setCanceled(true); return false; } @@ -119,7 +119,7 @@ public class EventHookContainer SoundSystem sndSystem = FMLClientHandler.instance().getClient().sndManager.sndSystem; sndSystem.stop("BgMusic"); SoundPoolEntry soundPoolEntry = FMLClientHandler.instance().getClient().sndManager.soundPoolMusic.getRandomSoundFromSoundPool("mods.DimDoors.sfx.creepy"); - sndSystem.backgroundMusic("LimboMusic", soundPoolEntry.soundUrl, soundPoolEntry.soundName, false); + sndSystem.backgroundMusic("LimboMusic", soundPoolEntry.getSoundUrl(), soundPoolEntry.getSoundName(), false); sndSystem.play("LimboMusic"); } else if(world.isRemote && !(world.provider instanceof LimboProvider)) diff --git a/StevenDimDoors/mod_pocketDim/blocks/BaseDimDoor.java b/StevenDimDoors/mod_pocketDim/blocks/BaseDimDoor.java index 6537d859..c2f43c4d 100644 --- a/StevenDimDoors/mod_pocketDim/blocks/BaseDimDoor.java +++ b/StevenDimDoors/mod_pocketDim/blocks/BaseDimDoor.java @@ -42,8 +42,8 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn public void registerIcons(IconRegister par1IconRegister) { - this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2()+"_top"); - this.blockIconBottom = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2()+"_bottom"); + this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5)+"_top"); + this.blockIconBottom = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5)+"_bottom"); } @SideOnly(Side.CLIENT) diff --git a/StevenDimDoors/mod_pocketDim/blocks/BlockDimWall.java b/StevenDimDoors/mod_pocketDim/blocks/BlockDimWall.java index 6144d4d1..5a39bbb4 100644 --- a/StevenDimDoors/mod_pocketDim/blocks/BlockDimWall.java +++ b/StevenDimDoors/mod_pocketDim/blocks/BlockDimWall.java @@ -59,8 +59,8 @@ public class BlockDimWall extends Block public void registerIcons(IconRegister par1IconRegister) { - this.blockIcon[0] = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2()); - this.blockIcon[1] = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2() + "Perm"); + this.blockIcon[0] = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5)); + this.blockIcon[1] = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5) + "Perm"); } @SideOnly(Side.CLIENT) diff --git a/StevenDimDoors/mod_pocketDim/blocks/BlockDimWallPerm.java b/StevenDimDoors/mod_pocketDim/blocks/BlockDimWallPerm.java index c635b7f6..5b3c3d0e 100644 --- a/StevenDimDoors/mod_pocketDim/blocks/BlockDimWallPerm.java +++ b/StevenDimDoors/mod_pocketDim/blocks/BlockDimWallPerm.java @@ -32,7 +32,7 @@ public class BlockDimWallPerm extends Block public void registerIcons(IconRegister par1IconRegister) { - this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2()); + this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5)); } public int quantityDropped(Random par1Random) diff --git a/StevenDimDoors/mod_pocketDim/blocks/BlockDoorGold.java b/StevenDimDoors/mod_pocketDim/blocks/BlockDoorGold.java index 5dead11f..f2e4cbe1 100644 --- a/StevenDimDoors/mod_pocketDim/blocks/BlockDoorGold.java +++ b/StevenDimDoors/mod_pocketDim/blocks/BlockDoorGold.java @@ -33,8 +33,8 @@ public class BlockDoorGold extends BlockDoor public void registerIcons(IconRegister par1IconRegister) { - this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2()+"_top"); - this.blockIconBottom = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2()+"_bottom"); + this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5)+"_top"); + this.blockIconBottom = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5)+"_bottom"); } public Icon getIcon(int par1, int par2) diff --git a/StevenDimDoors/mod_pocketDim/blocks/BlockLimbo.java b/StevenDimDoors/mod_pocketDim/blocks/BlockLimbo.java index 0ec6bbe3..0593356e 100644 --- a/StevenDimDoors/mod_pocketDim/blocks/BlockLimbo.java +++ b/StevenDimDoors/mod_pocketDim/blocks/BlockLimbo.java @@ -40,7 +40,7 @@ public class BlockLimbo extends Block @Override public void registerIcons(IconRegister iconRegister) { - this.blockIcon = iconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2()); + this.blockIcon = iconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5)); } @Override diff --git a/StevenDimDoors/mod_pocketDim/blocks/BlockRift.java b/StevenDimDoors/mod_pocketDim/blocks/BlockRift.java index 11fe9604..3345c6e9 100644 --- a/StevenDimDoors/mod_pocketDim/blocks/BlockRift.java +++ b/StevenDimDoors/mod_pocketDim/blocks/BlockRift.java @@ -66,7 +66,7 @@ public class BlockRift extends BlockContainer @Override public void registerIcons(IconRegister par1IconRegister) { - this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2()); + this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5)); } //sends a packet informing the client that there is a link present so it renders properly. (when placed) diff --git a/StevenDimDoors/mod_pocketDim/blocks/TransTrapdoor.java b/StevenDimDoors/mod_pocketDim/blocks/TransTrapdoor.java index 7c629238..1884d305 100644 --- a/StevenDimDoors/mod_pocketDim/blocks/TransTrapdoor.java +++ b/StevenDimDoors/mod_pocketDim/blocks/TransTrapdoor.java @@ -32,7 +32,7 @@ public class TransTrapdoor extends BlockTrapDoor implements IDimDoor, ITileEntit @Override public void registerIcons(IconRegister par1IconRegister) { - this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2()); + this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5)); } //Teleports the player to the exit link of that dimension, assuming it is a pocket diff --git a/StevenDimDoors/mod_pocketDim/commands/CommandCreateDungeonRift.java b/StevenDimDoors/mod_pocketDim/commands/CommandCreateDungeonRift.java index 7b24c72a..23f40135 100644 --- a/StevenDimDoors/mod_pocketDim/commands/CommandCreateDungeonRift.java +++ b/StevenDimDoors/mod_pocketDim/commands/CommandCreateDungeonRift.java @@ -2,6 +2,7 @@ package StevenDimDoors.mod_pocketDim.commands; import java.util.Collection; +import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.MathHelper; import StevenDimDoors.mod_pocketDim.mod_pocketDim; @@ -30,6 +31,13 @@ public class CommandCreateDungeonRift extends DDCommandBase return instance; } + @Override + public String getCommandUsage(ICommandSender sender) { + return "Usage: /dd-rift \r\n" + + " /dd-rift list\r\n" + + " /dd-rift random"; + } + @Override protected DDCommandResult processCommand(EntityPlayer sender, String[] command) { @@ -54,9 +62,9 @@ public class CommandCreateDungeonRift extends DDCommandBase Collection dungeonNames = dungeonHelper.getDungeonNames(); for (String name : dungeonNames) { - sender.sendChatToPlayer(name); + sender.addChatMessage(name); } - sender.sendChatToPlayer(""); + sender.addChatMessage(""); } else { @@ -74,7 +82,7 @@ public class CommandCreateDungeonRift extends DDCommandBase link = dimension.createLink(x, y + 1, z, LinkTypes.DUNGEON,orientation); sender.worldObj.setBlock(x, y + 1, z,mod_pocketDim.blockRift.blockID,0,3); - sender.sendChatToPlayer("Created a rift to a random dungeon."); + sender.addChatMessage("Created a rift to a random dungeon."); } else { @@ -93,7 +101,7 @@ public class CommandCreateDungeonRift extends DDCommandBase PocketBuilder.generateSelectedDungeonPocket(link, mod_pocketDim.properties, result); sender.worldObj.setBlock(x, y + 1, z,mod_pocketDim.blockRift.blockID,0,3); - sender.sendChatToPlayer("Created a rift to \"" + result.schematicName() + "\" dungeon (Dimension ID = " + link.destination().getDimension() + ")."); + sender.addChatMessage("Created a rift to \"" + result.schematicName() + "\" dungeon (Dimension ID = " + link.destination().getDimension() + ")."); } else { diff --git a/StevenDimDoors/mod_pocketDim/commands/CommandCreatePocket.java b/StevenDimDoors/mod_pocketDim/commands/CommandCreatePocket.java index 5360cff7..b94e46c0 100644 --- a/StevenDimDoors/mod_pocketDim/commands/CommandCreatePocket.java +++ b/StevenDimDoors/mod_pocketDim/commands/CommandCreatePocket.java @@ -1,5 +1,6 @@ package StevenDimDoors.mod_pocketDim.commands; +import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; import StevenDimDoors.mod_pocketDim.helpers.DungeonHelper; @@ -20,6 +21,11 @@ public class CommandCreatePocket extends DDCommandBase return instance; } + @Override + public String getCommandUsage(ICommandSender sender) { + return "Usage: /dd-create"; + } + @Override protected DDCommandResult processCommand(EntityPlayer sender, String[] command) { @@ -41,7 +47,7 @@ public class CommandCreatePocket extends DDCommandBase DungeonHelper.instance().createCustomDungeonDoor(sender.worldObj, x, y, z); //Notify the player - sender.sendChatToPlayer("Created a door to a pocket dimension. Please build your dungeon there."); + sender.addChatMessage("Created a door to a pocket dimension. Please build your dungeon there."); } return DDCommandResult.SUCCESS; } diff --git a/StevenDimDoors/mod_pocketDim/commands/CommandDeleteAllLinks.java b/StevenDimDoors/mod_pocketDim/commands/CommandDeleteAllLinks.java index 4b2cf423..2f674a66 100644 --- a/StevenDimDoors/mod_pocketDim/commands/CommandDeleteAllLinks.java +++ b/StevenDimDoors/mod_pocketDim/commands/CommandDeleteAllLinks.java @@ -2,6 +2,7 @@ package StevenDimDoors.mod_pocketDim.commands; import java.util.ArrayList; +import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; @@ -26,6 +27,11 @@ public class CommandDeleteAllLinks extends DDCommandBase return instance; } + @Override + public String getCommandUsage(ICommandSender sender) { + return "Usage: /dd-deletelinks "; + } + @Override protected DDCommandResult processCommand(EntityPlayer sender, String[] command) { @@ -41,7 +47,7 @@ public class CommandDeleteAllLinks extends DDCommandBase { targetDim=0; shouldGo=false; - sender.sendChatToPlayer("Error-Invalid argument, delete_all_links "); + sender.addChatMessage("Error-Invalid argument, delete_all_links "); } if(shouldGo) @@ -59,7 +65,7 @@ public class CommandDeleteAllLinks extends DDCommandBase linksRemoved++; } - sender.sendChatToPlayer("Removed " + linksRemoved + " links."); + sender.addChatMessage("Removed " + linksRemoved + " links."); } return DDCommandResult.SUCCESS; //TEMPORARY HACK diff --git a/StevenDimDoors/mod_pocketDim/commands/CommandDeleteRifts.java b/StevenDimDoors/mod_pocketDim/commands/CommandDeleteRifts.java index 61668d70..88905b54 100644 --- a/StevenDimDoors/mod_pocketDim/commands/CommandDeleteRifts.java +++ b/StevenDimDoors/mod_pocketDim/commands/CommandDeleteRifts.java @@ -2,6 +2,7 @@ package StevenDimDoors.mod_pocketDim.commands; import java.util.ArrayList; +import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; import StevenDimDoors.mod_pocketDim.mod_pocketDim; @@ -26,6 +27,11 @@ public class CommandDeleteRifts extends DDCommandBase return instance; } + @Override + public String getCommandUsage(ICommandSender sender) { + return "Usage: /dd-??? "; + } + @Override protected DDCommandResult processCommand(EntityPlayer sender, String[] command) { @@ -41,7 +47,7 @@ public class CommandDeleteRifts extends DDCommandBase { targetDim=0; shouldGo=false; - sender.sendChatToPlayer("Error-Invalid argument, delete_all_links "); + sender.addChatMessage("Error-Invalid argument, delete_all_links "); } if(shouldGo) @@ -61,7 +67,7 @@ public class CommandDeleteRifts extends DDCommandBase dim.deleteLink(link); } } - sender.sendChatToPlayer("Removed " + linksRemoved + " rifts."); + sender.addChatMessage("Removed " + linksRemoved + " rifts."); } return DDCommandResult.SUCCESS; //TEMPORARY HACK diff --git a/StevenDimDoors/mod_pocketDim/commands/CommandExportDungeon.java b/StevenDimDoors/mod_pocketDim/commands/CommandExportDungeon.java index 8968d11c..14ba9985 100644 --- a/StevenDimDoors/mod_pocketDim/commands/CommandExportDungeon.java +++ b/StevenDimDoors/mod_pocketDim/commands/CommandExportDungeon.java @@ -2,6 +2,7 @@ package StevenDimDoors.mod_pocketDim.commands; import java.io.File; +import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; import StevenDimDoors.mod_pocketDim.DDProperties; import StevenDimDoors.mod_pocketDim.helpers.DungeonHelper; @@ -25,6 +26,13 @@ public class CommandExportDungeon extends DDCommandBase return instance; } + @Override + public String getCommandUsage(ICommandSender sender) { + return "Usage: /dd-export open \r\n" + + " /dd-export closed \r\n" + + " /dd-export override"; + } + @Override protected DDCommandResult processCommand(EntityPlayer sender, String[] command) { @@ -132,7 +140,7 @@ public class CommandExportDungeon extends DDCommandBase String exportPath = properties.CustomSchematicDirectory + File.separator + name + ".schematic"; if (dungeonHelper.exportDungeon(player.worldObj, x, y, z, exportPath)) { - player.sendChatToPlayer("Saved dungeon schematic in " + exportPath); + player.addChatMessage("Saved dungeon schematic in " + exportPath); dungeonHelper.registerDungeon(exportPath, dungeonHelper.getDungeonPack("ruins"), false, true); return DDCommandResult.SUCCESS; } diff --git a/StevenDimDoors/mod_pocketDim/commands/CommandResetDungeons.java b/StevenDimDoors/mod_pocketDim/commands/CommandResetDungeons.java index d4353fe1..f9084695 100644 --- a/StevenDimDoors/mod_pocketDim/commands/CommandResetDungeons.java +++ b/StevenDimDoors/mod_pocketDim/commands/CommandResetDungeons.java @@ -2,6 +2,7 @@ package StevenDimDoors.mod_pocketDim.commands; import java.util.ArrayList; +import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.common.DimensionManager; import StevenDimDoors.mod_pocketDim.core.DimLink; @@ -26,6 +27,11 @@ public class CommandResetDungeons extends DDCommandBase return instance; } + @Override + public String getCommandUsage(ICommandSender sender) { + return "/dd-resetdungeons"; + } + @Override protected DDCommandResult processCommand(EntityPlayer sender, String[] command) { @@ -84,7 +90,7 @@ public class CommandResetDungeons extends DDCommandBase //TODO- for some reason the parent field of loaded dimenions get reset to null if I call .setParentToRoot() before I delete the pockets. //TODO implement blackList //Notify the user of the results - sender.sendChatToPlayer("Reset complete. " + resetCount + " out of " + dungeonCount + " dungeons were reset."); + sender.addChatMessage("Reset complete. " + resetCount + " out of " + dungeonCount + " dungeons were reset."); return DDCommandResult.SUCCESS; } } \ No newline at end of file diff --git a/StevenDimDoors/mod_pocketDim/commands/CommandTeleportPlayer.java b/StevenDimDoors/mod_pocketDim/commands/CommandTeleportPlayer.java index c91286ca..8d0780e6 100644 --- a/StevenDimDoors/mod_pocketDim/commands/CommandTeleportPlayer.java +++ b/StevenDimDoors/mod_pocketDim/commands/CommandTeleportPlayer.java @@ -11,6 +11,7 @@ import StevenDimDoors.mod_pocketDim.core.PocketManager; import StevenDimDoors.mod_pocketDim.helpers.yCoordHelper; import StevenDimDoors.mod_pocketDim.util.Point4D; +import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.world.World; @@ -36,6 +37,11 @@ public class CommandTeleportPlayer extends DDCommandBase return instance; } + @Override + public String getCommandUsage(ICommandSender sender) { + return "Usage: /dd-tp "; + } + /** * TODO- Change to accept variety of input, like just coords, just dim ID, or two player names. */ diff --git a/StevenDimDoors/mod_pocketDim/commands/DDCommandBase.java b/StevenDimDoors/mod_pocketDim/commands/DDCommandBase.java index 9a7c5343..d7b9c697 100644 --- a/StevenDimDoors/mod_pocketDim/commands/DDCommandBase.java +++ b/StevenDimDoors/mod_pocketDim/commands/DDCommandBase.java @@ -63,10 +63,10 @@ public abstract class DDCommandBase extends CommandBase //Send the argument formats for this command for (String format : formats) { - player.sendChatToPlayer("Usage: " + name + " " + format); + player.addChatMessage("Usage: " + name + " " + format); } } - player.sendChatToPlayer(result.getMessage()); + player.addChatMessage(result.getMessage()); } } } diff --git a/StevenDimDoors/mod_pocketDim/core/DDTeleporter.java b/StevenDimDoors/mod_pocketDim/core/DDTeleporter.java index c9e9c66a..2dd76516 100644 --- a/StevenDimDoors/mod_pocketDim/core/DDTeleporter.java +++ b/StevenDimDoors/mod_pocketDim/core/DDTeleporter.java @@ -357,13 +357,13 @@ public class DDTeleporter oldWorld.getChunkFromChunkCoords(entX, entZ).isModified = true; } // Memory concerns. - oldWorld.releaseEntitySkin(entity); + oldWorld.onEntityRemoved(entity); if (player == null) // Are we NOT working with a player? { NBTTagCompound entityNBT = new NBTTagCompound(); entity.isDead = false; - entity.addEntityID(entityNBT); + entity.writeMountToNBT(entityNBT); entity.isDead = true; entity = EntityList.createEntityFromNBT(entityNBT, newWorld); diff --git a/StevenDimDoors/mod_pocketDim/items/ItemBlockDimWall.java b/StevenDimDoors/mod_pocketDim/items/ItemBlockDimWall.java index 572f506b..9fd7b23f 100644 --- a/StevenDimDoors/mod_pocketDim/items/ItemBlockDimWall.java +++ b/StevenDimDoors/mod_pocketDim/items/ItemBlockDimWall.java @@ -28,6 +28,6 @@ public class ItemBlockDimWall extends ItemBlock public String getUnlocalizedName(ItemStack par1ItemStack) { - return subNames[getItemDamageFromStack(par1ItemStack)]; + return subNames[this.getDamage(par1ItemStack)]; } } \ No newline at end of file diff --git a/StevenDimDoors/mod_pocketDim/items/ItemRiftBlade.java b/StevenDimDoors/mod_pocketDim/items/ItemRiftBlade.java index b51950c7..fa1521a4 100644 --- a/StevenDimDoors/mod_pocketDim/items/ItemRiftBlade.java +++ b/StevenDimDoors/mod_pocketDim/items/ItemRiftBlade.java @@ -2,11 +2,15 @@ package StevenDimDoors.mod_pocketDim.items; import java.util.List; +import com.google.common.collect.Multimap; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.EnumToolMaterial; @@ -60,10 +64,12 @@ public class ItemRiftBlade extends ItemSword } @Override - public int getDamageVsEntity(Entity par1Entity) - { - return 7; - } + public Multimap getItemAttributeModifiers() + { + Multimap multimap = super.getItemAttributeModifiers(); + multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Weapon modifier", (double)7, 0)); + return multimap; + } @Override @SideOnly(Side.CLIENT) @@ -73,7 +79,7 @@ public class ItemRiftBlade extends ItemSword } @Override - public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving) + public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLiving, EntityLivingBase par3EntityLiving) { par1ItemStack.damageItem(1, par3EntityLiving); return true; diff --git a/StevenDimDoors/mod_pocketDim/items/ItemRiftSignature.java b/StevenDimDoors/mod_pocketDim/items/ItemRiftSignature.java index 578a71f1..5e26c52e 100644 --- a/StevenDimDoors/mod_pocketDim/items/ItemRiftSignature.java +++ b/StevenDimDoors/mod_pocketDim/items/ItemRiftSignature.java @@ -98,14 +98,14 @@ public class ItemRiftSignature extends Item stack.stackSize--; } clearSource(stack); - player.sendChatToPlayer("Rift Created"); + player.addChatMessage("Rift Created"); world.playSoundAtEntity(player,"mods.DimDoors.sfx.riftEnd", 0.6f, 1); } else { //The link signature has not been used. Store its current target as the first location. setSource(stack, x, adjustedY, z,orientation, PocketManager.getDimensionData(world)); - player.sendChatToPlayer("Location Stored in Rift Signature"); + player.addChatMessage("Location Stored in Rift Signature"); world.playSoundAtEntity(player,"mods.DimDoors.sfx.riftStart", 0.6f, 1); } return true; diff --git a/StevenDimDoors/mod_pocketDim/items/ItemStabilizedRiftSignature.java b/StevenDimDoors/mod_pocketDim/items/ItemStabilizedRiftSignature.java index fca2c24e..a676a4fa 100644 --- a/StevenDimDoors/mod_pocketDim/items/ItemStabilizedRiftSignature.java +++ b/StevenDimDoors/mod_pocketDim/items/ItemStabilizedRiftSignature.java @@ -56,7 +56,7 @@ public class ItemStabilizedRiftSignature extends ItemRiftSignature // or if the player can pay an Ender Pearl to create a rift. if (!player.capabilities.isCreativeMode && !player.inventory.hasItem(Item.enderPearl.itemID)) { - player.sendChatToPlayer("You don't have any Ender Pearls!"); + player.addChatMessage("You don't have any Ender Pearls!"); return true; } @@ -86,14 +86,14 @@ public class ItemStabilizedRiftSignature extends ItemRiftSignature { player.inventory.consumeInventoryItem(Item.enderPearl.itemID); } - player.sendChatToPlayer("Rift Created"); + player.addChatMessage("Rift Created"); world.playSoundAtEntity(player,"mods.DimDoors.sfx.riftEnd", 0.6f, 1); } else { //The link signature has not been used. Store its current target as the first location. setSource(stack, x, adjustedY, z, orientation, PocketManager.getDimensionData(world)); - player.sendChatToPlayer("Location Stored in Rift Signature"); + player.addChatMessage("Location Stored in Rift Signature"); world.playSoundAtEntity(player,"mods.DimDoors.sfx.riftStart", 0.6f, 1); } return true; diff --git a/StevenDimDoors/mod_pocketDim/mod_pocketDim.java b/StevenDimDoors/mod_pocketDim/mod_pocketDim.java index 77828bae..2a66f509 100644 --- a/StevenDimDoors/mod_pocketDim/mod_pocketDim.java +++ b/StevenDimDoors/mod_pocketDim/mod_pocketDim.java @@ -94,7 +94,7 @@ serverPacketHandlerSpec = public class mod_pocketDim { - public static final String version = "1.5.2R2.0.1RC1"; + public static final String version = "$VERSION$"; public static final String modid = "DimDoors"; //need to clean up diff --git a/StevenDimDoors/mod_pocketDim/saving/DimDataProcessor.java b/StevenDimDoors/mod_pocketDim/saving/DimDataProcessor.java index 55a01d9a..c539396c 100644 --- a/StevenDimDoors/mod_pocketDim/saving/DimDataProcessor.java +++ b/StevenDimDoors/mod_pocketDim/saving/DimDataProcessor.java @@ -11,8 +11,6 @@ import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.List; -import scala.Char; - import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; diff --git a/StevenDimDoors/mod_pocketDim/ticking/MobMonolith.java b/StevenDimDoors/mod_pocketDim/ticking/MobMonolith.java index 928877f8..6a185346 100644 --- a/StevenDimDoors/mod_pocketDim/ticking/MobMonolith.java +++ b/StevenDimDoors/mod_pocketDim/ticking/MobMonolith.java @@ -5,6 +5,7 @@ import java.util.List; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityFlying; import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.monster.IMob; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; @@ -36,7 +37,7 @@ public class MobMonolith extends EntityFlying implements IMob public MobMonolith(World par1World) { super(par1World); - this.texture="/mods/DimDoors/textures/mobs/Monolith0.png"; + this.getDataWatcher().addObject(16,0); this.setSize(3F, 9.0F); this.noClip=true; this.scaleFactor= (float) ((rand.nextDouble()/2)+1); @@ -55,10 +56,10 @@ public class MobMonolith extends EntityFlying implements IMob } @Override - public int getMaxHealth() + protected void applyEntityAttributes() { - // TODO Auto-generated method stub - return 20; + super.applyEntityAttributes(); + this.getAttributeMap().func_111150_b(SharedMonsterAttributes.maxHealth).setAttribute(20); } public boolean canBePushed() @@ -93,9 +94,6 @@ public class MobMonolith extends EntityFlying implements IMob this.setDead(); } - byte b0 = this.dataWatcher.getWatchableObjectByte(16); - - this.texture="/mods/DimDoors/textures/mobs/Monolith"+b0+".png"; super.onEntityUpdate(); if (this.isEntityAlive() && this.isEntityInsideOpaqueBlock()) diff --git a/StevenDimDoors/mod_pocketDim/tileentities/TileEntityRift.java b/StevenDimDoors/mod_pocketDim/tileentities/TileEntityRift.java index ce3e0c6b..5ae69c6d 100644 --- a/StevenDimDoors/mod_pocketDim/tileentities/TileEntityRift.java +++ b/StevenDimDoors/mod_pocketDim/tileentities/TileEntityRift.java @@ -350,13 +350,13 @@ public class TileEntityRift extends TileEntity NBTTagCompound nbt = new NBTTagCompound(); writeToNBT(nbt); - packet.customParam1 = nbt; + packet.data = nbt; return packet; } @Override public void onDataPacket(INetworkManager net, Packet132TileEntityData pkt) { - readFromNBT(pkt.customParam1); + readFromNBT(pkt.data); } } diff --git a/StevenDimDoors/mod_pocketDim/world/CustomSkyProvider.java b/StevenDimDoors/mod_pocketDim/world/CustomSkyProvider.java index c88377c1..3a6b24dd 100644 --- a/StevenDimDoors/mod_pocketDim/world/CustomSkyProvider.java +++ b/StevenDimDoors/mod_pocketDim/world/CustomSkyProvider.java @@ -1,5 +1,6 @@ package StevenDimDoors.mod_pocketDim.world; +import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import net.minecraft.client.Minecraft; @@ -43,7 +44,7 @@ public class CustomSkyProvider extends IRenderHandler GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); RenderHelper.disableStandardItemLighting(); GL11.glDepthMask(false); - mc.renderEngine.bindTexture("/misc/tunnel.png"); + mc.renderEngine.bindTexture(new ResourceLocation("/misc/tunnel.png")); Tessellator tessellator = Tessellator.instance; if (mc.theWorld.provider.isSurfaceWorld()) @@ -136,7 +137,7 @@ public class CustomSkyProvider extends IRenderHandler 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()); + mc.renderEngine.bindTexture(new ResourceLocation(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); @@ -144,7 +145,7 @@ public class CustomSkyProvider extends IRenderHandler tessellator1.addVertexWithUV((double)(-f10), 100.0D, (double)f10, 0.0D, 1.0D); tessellator1.draw(); f10 = 20.0F; - mc.renderEngine.bindTexture(this.getMoonRenderPath()); + mc.renderEngine.bindTexture(new ResourceLocation(this.getMoonRenderPath())); int k = world.getMoonPhase(); int l = k % 4; int i1 = k / 4 % 2; diff --git a/StevenDimDoors/mod_pocketDimClient/RenderDimDoor.java b/StevenDimDoors/mod_pocketDimClient/RenderDimDoor.java index 1374baf9..c46bf013 100644 --- a/StevenDimDoors/mod_pocketDimClient/RenderDimDoor.java +++ b/StevenDimDoors/mod_pocketDimClient/RenderDimDoor.java @@ -9,6 +9,7 @@ import net.minecraft.client.renderer.GLAllocation; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import StevenDimDoors.mod_pocketDim.DDProperties; @@ -65,7 +66,7 @@ public class RenderDimDoor extends TileEntitySpecialRenderer if (count == 0) { - this.bindTextureByName("/RIFT.png"); + this.bindTexture(new ResourceLocation("/RIFT.png")); var17 = 0.1F; var15 = 25.0F; var16 = 0.125F; @@ -75,7 +76,7 @@ public class RenderDimDoor extends TileEntitySpecialRenderer if (count == 1) { - this.bindTextureByName("/WARP.png"); + this.bindTexture(new ResourceLocation("/WARP.png")); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); var16 = .5F; diff --git a/StevenDimDoors/mod_pocketDimClient/RenderMobObelisk.java b/StevenDimDoors/mod_pocketDimClient/RenderMobObelisk.java index 2bbdbad2..6795c1d2 100644 --- a/StevenDimDoors/mod_pocketDimClient/RenderMobObelisk.java +++ b/StevenDimDoors/mod_pocketDimClient/RenderMobObelisk.java @@ -3,6 +3,8 @@ package StevenDimDoors.mod_pocketDimClient; import net.minecraft.client.renderer.entity.RenderLiving; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; @SideOnly(Side.CLIENT) public class RenderMobObelisk extends RenderLiving @@ -16,6 +18,11 @@ protected ModelMobObelisk obeliskModel; } - - + + @Override + public ResourceLocation getEntityTexture(Entity entity) { + int watchByte = entity.getDataWatcher().getWatchableObjectByte(16); + + return new ResourceLocation("/mods/DimDoors/textures/mobs/Monolith"+watchByte+".png"); + } } \ No newline at end of file diff --git a/StevenDimDoors/mod_pocketDimClient/RenderTransTrapdoor.java b/StevenDimDoors/mod_pocketDimClient/RenderTransTrapdoor.java index 68fe35c4..93fd8c65 100644 --- a/StevenDimDoors/mod_pocketDimClient/RenderTransTrapdoor.java +++ b/StevenDimDoors/mod_pocketDimClient/RenderTransTrapdoor.java @@ -8,6 +8,7 @@ import net.minecraft.client.renderer.GLAllocation; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import StevenDimDoors.mod_pocketDim.DDProperties; @@ -62,7 +63,7 @@ public class RenderTransTrapdoor extends TileEntitySpecialRenderer if (count == 0) { - this.bindTextureByName("/RIFT.png"); + this.bindTexture(new ResourceLocation("/RIFT.png")); var17 = 0.1F; var15 = 25.0F; var16 = 0.125F; @@ -72,7 +73,7 @@ public class RenderTransTrapdoor extends TileEntitySpecialRenderer if (count == 1) { - this.bindTextureByName("/WARP.png"); + this.bindTexture(new ResourceLocation("/WARP.png")); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); var16 = .5F; diff --git a/build.xml b/build.xml index 13e1c3c8..c66dd2e7 100644 --- a/build.xml +++ b/build.xml @@ -1,64 +1,93 @@ - - - - + + + + + + + + + + + + - - + + + + - - - - - - + - - + - + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - + @@ -67,27 +96,16 @@ - - - - + + + - - - - - - - - - - - + + - - + @@ -99,19 +117,40 @@ - + - + - - + + + + + + + + + + + + + + + + + + + + + + + @@ -121,7 +160,7 @@ - + @@ -132,16 +171,10 @@ - - + - - - - - @@ -151,29 +184,12 @@ - - - - - - - - - - - - + - - @@ -186,11 +202,10 @@ - + - - @@ -216,5 +231,4 @@ - - + \ No newline at end of file diff --git a/mcmod.info b/mcmod.info index 89eaa2b0..15572905 100644 --- a/mcmod.info +++ b/mcmod.info @@ -1,9 +1,12 @@ +{ +"modinfoversion":2, +"modlist": [ { "modid": "DimDoors", "name": "Dimensional Doors", "description": "Bend and twist reality itself, creating pocket dimensions, rifts, and much more", -"version": "1.5.2R1.4.1RC1", +"version": "1.6.4R2.1.2RC1", "credits": "Created by StevenRS11, Coded by StevenRS11 and SenseiKiwi, Logo and Testing by Jaitsu", "logoFile": "/dimdoors_logo.png", "mcversion": "", @@ -15,3 +18,4 @@ "dependencies": [ "Forge"] } ] +} \ No newline at end of file