Merge pull request #141 from SenseiKiwi/master

Minor Change
This commit is contained in:
StevenRS11
2014-03-07 00:26:04 -05:00
14 changed files with 74 additions and 73 deletions

View File

@@ -96,6 +96,7 @@ public class DDProperties
public final boolean LimboReturnsInventoryEnabled; public final boolean LimboReturnsInventoryEnabled;
public final boolean DoorRenderingEnabled; public final boolean DoorRenderingEnabled;
public final boolean TNFREAKINGT_Enabled; public final boolean TNFREAKINGT_Enabled;
public final boolean MonolithTeleportationEnabled;
/** /**
@@ -118,6 +119,7 @@ public class DDProperties
//Names of categories //Names of categories
private final String CATEGORY_CRAFTING = "crafting"; private final String CATEGORY_CRAFTING = "crafting";
private final String CATEGORY_ENTITY = "entity"; private final String CATEGORY_ENTITY = "entity";
private final String CATEGORY_SPECIAL = "special";
private final String CATEGORY_DIMENSION = "dimension"; private final String CATEGORY_DIMENSION = "dimension";
private final String CATEGORY_PROVIDER = "provider"; private final String CATEGORY_PROVIDER = "provider";
private final String CATEGORY_BIOME = "biome"; private final String CATEGORY_BIOME = "biome";
@@ -228,13 +230,20 @@ public class DDProperties
config.save(); config.save();
//Unfortunately, there are users out there who have been misconfiguring the worldgen blocks to have IDs above 255. // Unfortunately, there are users out there who have been misconfiguring the worldgen blocks to have IDs above 255.
//This leads to disastrous and cryptic errors in other areas of Minecraft. To prevent headaches, we'll throw // This leads to disastrous and cryptic errors in other areas of Minecraft. To prevent headaches, we'll throw
//an exception here if the blocks have invalid IDs. // an exception here if the blocks have invalid IDs.
if (LimboBlockID > 255 || PermaFabricBlockID > 255) if (LimboBlockID > 255 || PermaFabricBlockID > 255)
{ {
throw new IllegalStateException("World generation blocks MUST have block IDs less than 256. Fix your configuration!"); throw new IllegalStateException("World generation blocks MUST have block IDs less than 256. Fix your configuration!");
} }
// SPECIAL CONFIG SETTINGS
// I'm adding this category because one of our users convinced me, personally, to please allow this.
// These settings are checked _after_ we save the config file, so Forge won't generate them automatically.
// Whoever wants to use them must intentionally write them into the config file.
MonolithTeleportationEnabled = config.get(CATEGORY_SPECIAL, "Enable Monolith Teleportation", true).getBoolean(true);
} }
public static DDProperties initialize(File configFile) public static DDProperties initialize(File configFile)

View File

@@ -32,14 +32,6 @@ public class CommandCreateDungeonRift extends DDCommandBase
return instance; return instance;
} }
@Override
public String getCommandUsage(ICommandSender sender)
{
return "Usage: /dd-rift <dungeon name>\r\n" +
" /dd-rift list\r\n" +
" /dd-rift random";
}
@Override @Override
protected DDCommandResult processCommand(EntityPlayer sender, String[] command) protected DDCommandResult processCommand(EntityPlayer sender, String[] command)
{ {

View File

@@ -21,11 +21,6 @@ public class CommandCreatePocket extends DDCommandBase
return instance; return instance;
} }
@Override
public String getCommandUsage(ICommandSender sender) {
return "Usage: /dd-create";
}
@Override @Override
protected DDCommandResult processCommand(EntityPlayer sender, String[] command) protected DDCommandResult processCommand(EntityPlayer sender, String[] command)
{ {

View File

@@ -28,11 +28,6 @@ public class CommandDeleteAllLinks extends DDCommandBase
return instance; return instance;
} }
@Override
public String getCommandUsage(ICommandSender sender) {
return "Usage: /dd-deletelinks <targetDimensionID>";
}
@Override @Override
protected DDCommandResult processCommand(EntityPlayer sender, String[] command) protected DDCommandResult processCommand(EntityPlayer sender, String[] command)
{ {

View File

@@ -28,11 +28,6 @@ public class CommandDeleteRifts extends DDCommandBase
return instance; return instance;
} }
@Override
public String getCommandUsage(ICommandSender sender) {
return "Usage: /dd-??? <dimension ID>";
}
@Override @Override
protected DDCommandResult processCommand(EntityPlayer sender, String[] command) protected DDCommandResult processCommand(EntityPlayer sender, String[] command)
{ {

View File

@@ -26,13 +26,6 @@ public class CommandExportDungeon extends DDCommandBase
return instance; return instance;
} }
@Override
public String getCommandUsage(ICommandSender sender) {
return "Usage: /dd-export <dungeon type> <dungeon name> open <weight>\r\n" +
" /dd-export <dungeon type> <dungeon name> closed <weight>\r\n" +
" /dd-export <schematic name> override";
}
@Override @Override
protected DDCommandResult processCommand(EntityPlayer sender, String[] command) protected DDCommandResult processCommand(EntityPlayer sender, String[] command)
{ {

View File

@@ -28,11 +28,6 @@ public class CommandResetDungeons extends DDCommandBase
return instance; return instance;
} }
@Override
public String getCommandUsage(ICommandSender sender) {
return "/dd-resetdungeons";
}
@Override @Override
protected DDCommandResult processCommand(EntityPlayer sender, String[] command) protected DDCommandResult processCommand(EntityPlayer sender, String[] command)
{ {

View File

@@ -23,15 +23,9 @@ public class CommandTeleportPlayer extends DDCommandBase
public static CommandTeleportPlayer instance() public static CommandTeleportPlayer instance()
{ {
if (instance == null) if (instance == null)
{
instance = new CommandTeleportPlayer(); instance = new CommandTeleportPlayer();
}
return instance;
}
@Override return instance;
public String getCommandUsage(ICommandSender sender) {
return "Usage: /dd-tp <player name> <dimension id> <x> <y> <z>";
} }
/** /**

View File

@@ -39,12 +39,22 @@ public abstract class DDCommandBase extends CommandBase
return name; return name;
} }
/* @Override
* Registers the command at server startup. public final String getCommandUsage(ICommandSender sender)
*/
public void register(FMLServerStartingEvent event)
{ {
event.registerServerCommand(this); StringBuilder builder = new StringBuilder();
builder.append('/');
builder.append(name);
builder.append(' ');
builder.append(formats[0]);
for (int index = 1; index < formats.length; index++)
{
builder.append(" OR /");
builder.append(name);
builder.append(' ');
builder.append(formats[index]);
}
return builder.toString();
} }
/* /*
@@ -66,10 +76,10 @@ 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)
{ {
sendChat(player,("Usage: " + name + " " + format)); sendChat(player, "Usage: " + name + " " + format);
} }
} }
sendChat(player,(result.getMessage())); sendChat(player, result.getMessage());
} }
} }
@@ -78,12 +88,5 @@ public abstract class DDCommandBase extends CommandBase
ChatMessageComponent cmp = new ChatMessageComponent(); ChatMessageComponent cmp = new ChatMessageComponent();
cmp.addText(message); cmp.addText(message);
player.sendChatToPlayer(cmp); player.sendChatToPlayer(cmp);
}
@Override
public int compareTo(Object par1Obj)
{
return this.getCommandName().compareTo(((CommandBase)par1Obj).getCommandName());
} }
} }

View File

@@ -307,16 +307,16 @@ public class mod_pocketDim
//TODO- load dims with forced chunks on server startup here //TODO- load dims with forced chunks on server startup here
// Register commands with the server // Register commands with the server
CommandResetDungeons.instance().register(event); event.registerServerCommand( CommandResetDungeons.instance() );
CommandCreateDungeonRift.instance().register(event); event.registerServerCommand( CommandCreateDungeonRift.instance() );
CommandDeleteAllLinks.instance().register(event); event.registerServerCommand( CommandDeleteAllLinks.instance() );
//CommandDeleteDimensionData.instance().register(event); //CommandDeleteDimensionData.instance().register(event);
CommandDeleteRifts.instance().register(event); event.registerServerCommand( CommandDeleteRifts.instance() );
CommandExportDungeon.instance().register(event); event.registerServerCommand( CommandExportDungeon.instance() );
//CommandPrintDimensionData.instance().register(event); //CommandPrintDimensionData.instance().register(event);
//CommandPruneDimensions.instance().register(event); //CommandPruneDimensions.instance().register(event);
CommandCreatePocket.instance().register(event); event.registerServerCommand( CommandCreatePocket.instance() );
CommandTeleportPlayer.instance().register(event); event.registerServerCommand( CommandTeleportPlayer.instance() );
// Initialize a new DeathTracker // Initialize a new DeathTracker
String deathTrackerFile = DimensionManager.getCurrentSaveRootDirectory() + "/DimensionalDoors/data/deaths.txt"; String deathTrackerFile = DimensionManager.getCurrentSaveRootDirectory() + "/DimensionalDoors/data/deaths.txt";

View File

@@ -22,6 +22,7 @@ public class BlockRotator
static static
{ {
hasOrientations[Block.dispenser.blockID] = true; hasOrientations[Block.dispenser.blockID] = true;
hasOrientations[Block.dropper.blockID] = true;
hasOrientations[Block.stairsStoneBrick.blockID] = true; hasOrientations[Block.stairsStoneBrick.blockID] = true;
hasOrientations[Block.lever.blockID] = true; hasOrientations[Block.lever.blockID] = true;
hasOrientations[Block.stoneButton.blockID] = true; hasOrientations[Block.stoneButton.blockID] = true;
@@ -241,7 +242,7 @@ public class BlockRotator
break; break;
} }
} }
else if (blockID == Block.chest.blockID || blockID == Block.chestTrapped.blockID || blockID == Block.ladder.blockID || blockID == Block.hopperBlock.blockID|| blockID == Block.furnaceBurning.blockID|| blockID == Block.furnaceIdle.blockID) else if (blockID == Block.chest.blockID || blockID == Block.chestTrapped.blockID || blockID == Block.ladder.blockID || blockID == Block.furnaceBurning.blockID|| blockID == Block.furnaceIdle.blockID)
{ {
switch (metadata) switch (metadata)
{ {
@@ -258,7 +259,36 @@ public class BlockRotator
metadata = 3; metadata = 3;
break; break;
} }
}
else if (blockID == Block.hopperBlock.blockID)
{
switch (metadata)
{
case 2:
metadata = 5;
break;
case 3:
metadata = 4;
break;
case 4:
metadata = 2;
break;
case 5:
metadata = 3;
break;
case 10:
metadata = 13;
break;
case 11:
metadata = 12;
break;
case 12:
metadata = 10;
break;
case 13:
metadata = 11;
break;
}
} }
else if (blockID==Block.vine.blockID) else if (blockID==Block.vine.blockID)
{ {
@@ -352,7 +382,7 @@ public class BlockRotator
break; break;
} }
} }
else if(blockID== Block.lever.blockID||blockID== Block.stoneButton.blockID||blockID== Block.stoneButton.blockID||blockID== Block.woodenButton.blockID||blockID== Block.torchWood.blockID||blockID== Block.torchRedstoneIdle.blockID||blockID== Block.torchRedstoneActive.blockID) else if(blockID== Block.lever.blockID || blockID == Block.stoneButton.blockID || blockID == Block.woodenButton.blockID || blockID== Block.torchWood.blockID||blockID== Block.torchRedstoneIdle.blockID||blockID== Block.torchRedstoneActive.blockID)
{ {
switch (metadata) switch (metadata)
{ {
@@ -382,7 +412,7 @@ public class BlockRotator
break; break;
} }
} }
else if(blockID== Block.pistonBase.blockID||blockID==Block.pistonExtension.blockID||blockID==Block.pistonStickyBase.blockID||blockID==Block.dispenser.blockID||blockID==Block.dropper.blockID) else if(blockID== Block.pistonBase.blockID||blockID==Block.pistonExtension.blockID||blockID==Block.pistonStickyBase.blockID || blockID == Block.dispenser.blockID || blockID == Block.dropper.blockID)
{ {
switch (metadata) switch (metadata)
{ {

View File

@@ -193,7 +193,7 @@ public class MobMonolith extends EntityFlying implements IMob
this.soundTime=200; this.soundTime=200;
} }
} }
else if (!this.worldObj.isRemote && !entityPlayer.capabilities.isCreativeMode) else if (!this.worldObj.isRemote && properties.MonolithTeleportationEnabled && !entityPlayer.capabilities.isCreativeMode)
{ {
ChunkCoordinates coords = LimboProvider.getLimboSkySpawn(entityPlayer.worldObj.rand); ChunkCoordinates coords = LimboProvider.getLimboSkySpawn(entityPlayer.worldObj.rand);
Point4D destination = new Point4D((int) (coords.posX+entityPlayer.posX), coords.posY, (int) (coords.posZ+entityPlayer.posZ ), mod_pocketDim.properties.LimboDimensionID); Point4D destination = new Point4D((int) (coords.posX+entityPlayer.posX), coords.posY, (int) (coords.posZ+entityPlayer.posZ ), mod_pocketDim.properties.LimboDimensionID);