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 DoorRenderingEnabled;
public final boolean TNFREAKINGT_Enabled;
public final boolean MonolithTeleportationEnabled;
/**
@@ -118,10 +119,11 @@ public class DDProperties
//Names of categories
private final String CATEGORY_CRAFTING = "crafting";
private final String CATEGORY_ENTITY = "entity";
private final String CATEGORY_SPECIAL = "special";
private final String CATEGORY_DIMENSION = "dimension";
private final String CATEGORY_PROVIDER = "provider";
private final String CATEGORY_BIOME = "biome";
private final String CATEGORY_LOOT = "loot";
private final String CATEGORY_LOOT = "loot";
private DDProperties(File configFile)
{
@@ -228,13 +230,20 @@ public class DDProperties
config.save();
//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
//an exception here if the blocks have invalid IDs.
// 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
// an exception here if the blocks have invalid IDs.
if (LimboBlockID > 255 || PermaFabricBlockID > 255)
{
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)

View File

@@ -32,14 +32,6 @@ public class CommandCreateDungeonRift extends DDCommandBase
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
protected DDCommandResult processCommand(EntityPlayer sender, String[] command)
{

View File

@@ -21,11 +21,6 @@ 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)
{

View File

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

View File

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

View File

@@ -26,13 +26,6 @@ public class CommandExportDungeon extends DDCommandBase
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
protected DDCommandResult processCommand(EntityPlayer sender, String[] command)
{

View File

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

View File

@@ -23,17 +23,11 @@ public class CommandTeleportPlayer extends DDCommandBase
public static CommandTeleportPlayer instance()
{
if (instance == null)
{
instance = new CommandTeleportPlayer();
}
return instance;
}
@Override
public String getCommandUsage(ICommandSender sender) {
return "Usage: /dd-tp <player name> <dimension id> <x> <y> <z>";
}
/**
* TODO- Change to accept variety of input, like just coords, just dim ID, or two player names.
*/

View File

@@ -39,12 +39,22 @@ public abstract class DDCommandBase extends CommandBase
return name;
}
/*
* Registers the command at server startup.
*/
public void register(FMLServerStartingEvent event)
@Override
public final String getCommandUsage(ICommandSender sender)
{
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
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();
cmp.addText(message);
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
// Register commands with the server
CommandResetDungeons.instance().register(event);
CommandCreateDungeonRift.instance().register(event);
CommandDeleteAllLinks.instance().register(event);
event.registerServerCommand( CommandResetDungeons.instance() );
event.registerServerCommand( CommandCreateDungeonRift.instance() );
event.registerServerCommand( CommandDeleteAllLinks.instance() );
//CommandDeleteDimensionData.instance().register(event);
CommandDeleteRifts.instance().register(event);
CommandExportDungeon.instance().register(event);
event.registerServerCommand( CommandDeleteRifts.instance() );
event.registerServerCommand( CommandExportDungeon.instance() );
//CommandPrintDimensionData.instance().register(event);
//CommandPruneDimensions.instance().register(event);
CommandCreatePocket.instance().register(event);
CommandTeleportPlayer.instance().register(event);
event.registerServerCommand( CommandCreatePocket.instance() );
event.registerServerCommand( CommandTeleportPlayer.instance() );
// Initialize a new DeathTracker
String deathTrackerFile = DimensionManager.getCurrentSaveRootDirectory() + "/DimensionalDoors/data/deaths.txt";

View File

@@ -22,6 +22,7 @@ public class BlockRotator
static
{
hasOrientations[Block.dispenser.blockID] = true;
hasOrientations[Block.dropper.blockID] = true;
hasOrientations[Block.stairsStoneBrick.blockID] = true;
hasOrientations[Block.lever.blockID] = true;
hasOrientations[Block.stoneButton.blockID] = true;
@@ -241,7 +242,7 @@ public class BlockRotator
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)
{
@@ -258,7 +259,36 @@ public class BlockRotator
metadata = 3;
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)
{
@@ -352,7 +382,7 @@ public class BlockRotator
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)
{
@@ -382,7 +412,7 @@ public class BlockRotator
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)
{

View File

@@ -193,7 +193,7 @@ public class MobMonolith extends EntityFlying implements IMob
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);
Point4D destination = new Point4D((int) (coords.posX+entityPlayer.posX), coords.posY, (int) (coords.posZ+entityPlayer.posZ ), mod_pocketDim.properties.LimboDimensionID);