1.6.2 code #121

Merged
StevenRS11 merged 78 commits from 1.6.2-code into master 2014-01-03 07:15:09 +00:00
10 changed files with 81 additions and 18 deletions
Showing only changes of commit d849071e8e - Show all commits

View File

@@ -2,6 +2,7 @@ package StevenDimDoors.mod_pocketDim.commands;
import java.util.Collection; import java.util.Collection;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import StevenDimDoors.mod_pocketDim.mod_pocketDim; import StevenDimDoors.mod_pocketDim.mod_pocketDim;
@@ -53,9 +54,9 @@ public class CommandCreateDungeonRift extends DDCommandBase
Collection<String> dungeonNames = dungeonHelper.getDungeonNames(); Collection<String> dungeonNames = dungeonHelper.getDungeonNames();
for (String name : dungeonNames) for (String name : dungeonNames)
{ {
sender.sendChatToPlayer(name); sendChat(sender,(name));
} }
sender.sendChatToPlayer(""); sendChat(sender,(""));
} }
else else
{ {
@@ -73,7 +74,7 @@ public class CommandCreateDungeonRift extends DDCommandBase
link = dimension.createLink(x, y + 1, z, LinkTypes.DUNGEON); link = dimension.createLink(x, y + 1, z, LinkTypes.DUNGEON);
sender.worldObj.setBlock(x, y + 1, z,mod_pocketDim.blockRift.blockID,0,3); sender.worldObj.setBlock(x, y + 1, z,mod_pocketDim.blockRift.blockID,0,3);
sender.sendChatToPlayer("Created a rift to a random dungeon."); sendChat(sender,("Created a rift to a random dungeon."));
} }
else else
{ {
@@ -91,7 +92,7 @@ public class CommandCreateDungeonRift extends DDCommandBase
link = dimension.createLink(x, y + 1, z, LinkTypes.DUNGEON); link = dimension.createLink(x, y + 1, z, LinkTypes.DUNGEON);
PocketManager.getDimensionData(link.destination().getDimension()).initializeDungeon(x, y + 1, z, orientation,link, result); PocketManager.getDimensionData(link.destination().getDimension()).initializeDungeon(x, y + 1, z, orientation,link, result);
sender.worldObj.setBlock(x, y + 1, z,mod_pocketDim.blockRift.blockID,0,3); 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() + ")."); sendChat(sender,("Created a rift to \"" + result.schematicName() + "\" dungeon (Dimension ID = " + link.destination().getDimension() + ")."));
} }
else else
{ {
@@ -125,4 +126,10 @@ public class CommandCreateDungeonRift extends DDCommandBase
} }
return bestMatch; return bestMatch;
} }
@Override
public String getCommandUsage(ICommandSender icommandsender) {
// TODO Auto-generated method stub
return null;
}
} }

View File

@@ -1,5 +1,6 @@
package StevenDimDoors.mod_pocketDim.commands; package StevenDimDoors.mod_pocketDim.commands;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import StevenDimDoors.mod_pocketDim.helpers.DungeonHelper; import StevenDimDoors.mod_pocketDim.helpers.DungeonHelper;
@@ -41,8 +42,14 @@ public class CommandCreatePocket extends DDCommandBase
DungeonHelper.instance().createCustomDungeonDoor(sender.worldObj, x, y, z); DungeonHelper.instance().createCustomDungeonDoor(sender.worldObj, x, y, z);
//Notify the player //Notify the player
sender.sendChatToPlayer("Created a door to a pocket dimension. Please build your dungeon there."); sendChat(sender,("Created a door to a pocket dimension. Please build your dungeon there."));
} }
return DDCommandResult.SUCCESS; return DDCommandResult.SUCCESS;
} }
@Override
public String getCommandUsage(ICommandSender icommandsender) {
// TODO Auto-generated method stub
return null;
}
} }

View File

@@ -2,6 +2,7 @@ package StevenDimDoors.mod_pocketDim.commands;
import java.util.ArrayList; import java.util.ArrayList;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.DimensionManager;
@@ -41,7 +42,7 @@ public class CommandDeleteAllLinks extends DDCommandBase
{ {
targetDim=0; targetDim=0;
shouldGo=false; shouldGo=false;
sender.sendChatToPlayer("Error-Invalid argument, delete_all_links <targetDimID>"); sendChat(sender, ("Error-Invalid argument, delete_all_links <targetDimID>"));
} }
if(shouldGo) if(shouldGo)
@@ -59,9 +60,15 @@ public class CommandDeleteAllLinks extends DDCommandBase
linksRemoved++; linksRemoved++;
} }
sender.sendChatToPlayer("Removed " + linksRemoved + " links."); sendChat(sender,("Removed " + linksRemoved + " links."));
} }
return DDCommandResult.SUCCESS; //TEMPORARY HACK return DDCommandResult.SUCCESS; //TEMPORARY HACK
} }
@Override
public String getCommandUsage(ICommandSender icommandsender) {
// TODO Auto-generated method stub
return null;
}
} }

View File

@@ -2,6 +2,7 @@ package StevenDimDoors.mod_pocketDim.commands;
import java.util.ArrayList; import java.util.ArrayList;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World; import net.minecraft.world.World;
import StevenDimDoors.mod_pocketDim.mod_pocketDim; import StevenDimDoors.mod_pocketDim.mod_pocketDim;
@@ -41,7 +42,7 @@ public class CommandDeleteRifts extends DDCommandBase
{ {
targetDim=0; targetDim=0;
shouldGo=false; shouldGo=false;
sender.sendChatToPlayer("Error-Invalid argument, delete_all_links <targetDimID>"); sendChat(sender,("Error-Invalid argument, delete_all_links <targetDimID>"));
} }
if(shouldGo) if(shouldGo)
@@ -61,9 +62,15 @@ public class CommandDeleteRifts extends DDCommandBase
dim.deleteLink(link); dim.deleteLink(link);
} }
} }
sender.sendChatToPlayer("Removed " + linksRemoved + " rifts."); sendChat(sender,("Removed " + linksRemoved + " rifts."));
} }
return DDCommandResult.SUCCESS; //TEMPORARY HACK return DDCommandResult.SUCCESS; //TEMPORARY HACK
} }
@Override
public String getCommandUsage(ICommandSender icommandsender) {
// TODO Auto-generated method stub
return null;
}
} }

View File

@@ -2,6 +2,7 @@ package StevenDimDoors.mod_pocketDim.commands;
import java.io.File; import java.io.File;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import StevenDimDoors.mod_pocketDim.DDProperties; import StevenDimDoors.mod_pocketDim.DDProperties;
import StevenDimDoors.mod_pocketDim.helpers.DungeonHelper; import StevenDimDoors.mod_pocketDim.helpers.DungeonHelper;
@@ -132,7 +133,7 @@ public class CommandExportDungeon extends DDCommandBase
String exportPath = properties.CustomSchematicDirectory + File.separator + name + ".schematic"; String exportPath = properties.CustomSchematicDirectory + File.separator + name + ".schematic";
if (dungeonHelper.exportDungeon(player.worldObj, x, y, z, exportPath)) if (dungeonHelper.exportDungeon(player.worldObj, x, y, z, exportPath))
{ {
player.sendChatToPlayer("Saved dungeon schematic in " + exportPath); sendChat(player,("Saved dungeon schematic in " + exportPath));
dungeonHelper.registerDungeon(exportPath, dungeonHelper.getDungeonPack("ruins"), false, true); dungeonHelper.registerDungeon(exportPath, dungeonHelper.getDungeonPack("ruins"), false, true);
return DDCommandResult.SUCCESS; return DDCommandResult.SUCCESS;
} }
@@ -165,4 +166,10 @@ public class CommandExportDungeon extends DDCommandBase
} }
return buffer.toString(); return buffer.toString();
} }
@Override
public String getCommandUsage(ICommandSender icommandsender) {
// TODO Auto-generated method stub
return null;
}
} }

View File

@@ -2,6 +2,7 @@ package StevenDimDoors.mod_pocketDim.commands;
import java.util.ArrayList; import java.util.ArrayList;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.DimensionManager;
import StevenDimDoors.mod_pocketDim.core.DimLink; import StevenDimDoors.mod_pocketDim.core.DimLink;
@@ -84,7 +85,13 @@ 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- 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 //TODO implement blackList
//Notify the user of the results //Notify the user of the results
sender.sendChatToPlayer("Reset complete. " + resetCount + " out of " + dungeonCount + " dungeons were reset."); sendChat(sender,("Reset complete. " + resetCount + " out of " + dungeonCount + " dungeons were reset."));
return DDCommandResult.SUCCESS; return DDCommandResult.SUCCESS;
} }
@Override
public String getCommandUsage(ICommandSender icommandsender) {
// TODO Auto-generated method stub
return null;
}
} }

View File

@@ -11,6 +11,7 @@ import StevenDimDoors.mod_pocketDim.core.PocketManager;
import StevenDimDoors.mod_pocketDim.helpers.yCoordHelper; import StevenDimDoors.mod_pocketDim.helpers.yCoordHelper;
import StevenDimDoors.mod_pocketDim.util.Point4D; import StevenDimDoors.mod_pocketDim.util.Point4D;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.world.World; import net.minecraft.world.World;
@@ -94,4 +95,10 @@ public class CommandTeleportPlayer extends DDCommandBase
} }
} }
@Override
public String getCommandUsage(ICommandSender icommandsender) {
// TODO Auto-generated method stub
return null;
}
} }

View File

@@ -3,6 +3,7 @@ package StevenDimDoors.mod_pocketDim.commands;
import net.minecraft.command.CommandBase; import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender; import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ChatMessageComponent;
import cpw.mods.fml.common.event.FMLServerStartingEvent; import cpw.mods.fml.common.event.FMLServerStartingEvent;
/* /*
@@ -63,10 +64,18 @@ public abstract class DDCommandBase extends CommandBase
//Send the argument formats for this command //Send the argument formats for this command
for (String format : formats) for (String format : formats)
{ {
player.sendChatToPlayer("Usage: " + name + " " + format); sendChat(player,("Usage: " + name + " " + format));
} }
} }
player.sendChatToPlayer(result.getMessage()); sendChat(player,(result.getMessage()));
} }
} }
public static void sendChat(EntityPlayer player, String message)
{
ChatMessageComponent cmp = new ChatMessageComponent();
cmp.addText(message);
player.sendChatToPlayer(cmp);
}
} }

View File

@@ -327,6 +327,7 @@ public class DDTeleporter
// the last non-sleeping player leaves the Overworld // the last non-sleeping player leaves the Overworld
// for a pocket dimension, causing all sleeping players // for a pocket dimension, causing all sleeping players
// to remain asleep instead of progressing to day. // to remain asleep instead of progressing to day.
((WorldServer)entity.worldObj).getPlayerManager().removePlayer(player);
oldWorld.removePlayerEntityDangerously(player); oldWorld.removePlayerEntityDangerously(player);
player.isDead = false; player.isDead = false;
@@ -357,13 +358,13 @@ public class DDTeleporter
oldWorld.getChunkFromChunkCoords(entX, entZ).isModified = true; oldWorld.getChunkFromChunkCoords(entX, entZ).isModified = true;
} }
// Memory concerns. // Memory concerns.
oldWorld.releaseEntitySkin(entity); // oldWorld.releaseEntitySkin(entity);
if (player == null) // Are we NOT working with a player? if (player == null) // Are we NOT working with a player?
{ {
NBTTagCompound entityNBT = new NBTTagCompound(); NBTTagCompound entityNBT = new NBTTagCompound();
entity.isDead = false; entity.isDead = false;
entity.addEntityID(entityNBT); entity.writeToNBTOptional(entityNBT);
entity.isDead = true; entity.isDead = true;
entity = EntityList.createEntityFromNBT(entityNBT, newWorld); entity = EntityList.createEntityFromNBT(entityNBT, newWorld);
@@ -399,6 +400,10 @@ public class DDTeleporter
if (player != null) if (player != null)
{ {
newWorld.getChunkProvider().loadChunk(MathHelper.floor_double(entity.posX) >> 4, MathHelper.floor_double(entity.posZ) >> 4); newWorld.getChunkProvider().loadChunk(MathHelper.floor_double(entity.posX) >> 4, MathHelper.floor_double(entity.posZ) >> 4);
if(difDest)
{
newWorld.getPlayerManager().addPlayer(player);
}
// Tell Forge we're moving its players so everyone else knows. // Tell Forge we're moving its players so everyone else knows.
// Let's try doing this down here in case this is what's killing NEI. // Let's try doing this down here in case this is what's killing NEI.

View File

@@ -1,6 +1,8 @@
package StevenDimDoors.mod_pocketDimClient; package StevenDimDoors.mod_pocketDimClient;
import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@@ -16,6 +18,4 @@ protected ModelMobObelisk obeliskModel;
} }
} }