use of com.dreammaster.modfixes.oilgen.OilGeneratorFix in project NewHorizonsCoreMod by GTNewHorizons.
the class AllPurposeDebugCommand method processCommand.
@Override
public void processCommand(ICommandSender pCmdSender, String[] pArgs) {
try {
if (pArgs.length == 0) {
moarArgs(pCmdSender);
return;
} else if (pArgs[0].equalsIgnoreCase("ci")) {
EntityPlayer tEP = ((EntityPlayer) pCmdSender);
World tWorldObj = tEP.worldObj;
int x = (int) tEP.posX;
int z = (int) tEP.posZ;
BiomeGenBase tBiomeInfo = tWorldObj.getBiomeGenForCoords(x, z);
PlayerChatHelper.SendInfo(pCmdSender, "POS: x/z %d / %d", x, z);
PlayerChatHelper.SendInfo(pCmdSender, "DimID: %d", tWorldObj.provider.dimensionId);
PlayerChatHelper.SendInfo(pCmdSender, "BiomeID / Name: %d / %s", tBiomeInfo.biomeID, tBiomeInfo.biomeName);
} else if (pArgs[0].equalsIgnoreCase("reloadconfig")) {
MainRegistry.CoreConfig.LoadConfig();
PlayerChatHelper.SendInfo(pCmdSender, "Config reloaded");
} else if (pArgs[0].equalsIgnoreCase("test")) {
if (pArgs.length == 2) {
PlayerChatHelper.SendInfo(pCmdSender, "LOC: %d %d %d", (int) ((EntityPlayer) pCmdSender).posX, (int) ((EntityPlayer) pCmdSender).posY, (int) ((EntityPlayer) pCmdSender).posZ);
Vec3 calculatedPos = PlayerHelper.addDistanceByPlayerDirection((EntityPlayer) pCmdSender, Integer.parseInt(pArgs[1]));
PlayerChatHelper.SendInfo(pCmdSender, "Calculated Block: %d %d %d", (int) calculatedPos.xCoord, (int) calculatedPos.yCoord, (int) calculatedPos.zCoord);
((EntityPlayer) pCmdSender).getEntityWorld().setBlock((int) calculatedPos.xCoord, (int) calculatedPos.yCoord, (int) calculatedPos.zCoord, Blocks.bedrock);
} else
moarArgs(pCmdSender);
} else if (pArgs[0].equalsIgnoreCase("oilstruct")) {
IModFix tModFix = ModFixesMaster.getModFixInstance(OilGeneratorFix.ModFixName);
if (tModFix == null) {
PlayerChatHelper.SendError(pCmdSender, "Required ModFix is not loaded");
return;
}
OilGeneratorFix tOilGenFix = (OilGeneratorFix) tModFix;
if (pArgs.length == 5) {
String[] tBlock = pArgs[1].split(":");
Vec3 tSourcePos = Vec3.createVectorHelper(((EntityPlayer) pCmdSender).posX, (double) Integer.parseInt(pArgs[2]), ((EntityPlayer) pCmdSender).posZ);
// Offset Structure-gen by 50 Blocks from players current location
Vec3 tOilStructPos = PlayerHelper.addDistanceByVecAndYaw(tSourcePos, ((EntityPlayer) pCmdSender).rotationYaw, 50);
int tStructRadius = Integer.parseInt(pArgs[3]);
int tStructGroundLevel = Integer.parseInt(pArgs[4]);
Block tTargetBlock = GameRegistry.findBlock(tBlock[0], tBlock[1]);
if (tTargetBlock != null) {
PlayerChatHelper.SendInfo(pCmdSender, "Creating oilStruct at location %d / %d / %d, radius [%d], virtual groundLevel [%d] with block [%s]", (int) tOilStructPos.xCoord, (int) tOilStructPos.yCoord, (int) tOilStructPos.zCoord, tStructRadius, tStructGroundLevel, pArgs[1]);
tOilGenFix.buildOilStructure(((EntityPlayer) pCmdSender).worldObj, new Random(), (int) tOilStructPos.xCoord, (int) tOilStructPos.yCoord, (int) tOilStructPos.zCoord, tStructRadius, tStructGroundLevel, tTargetBlock, false);
} else
PlayerChatHelper.SendError(pCmdSender, "Unknown block [%s]", pArgs[1]);
} else {
moarArgs(pCmdSender);
return;
}
}
} catch (Exception e) {
e.printStackTrace();
PlayerChatHelper.SendError(pCmdSender, "Unknown error occoured [%s]", e.getMessage());
}
}
Aggregations