Empires Mod

Empires Mod

2.5k Downloads

[BUG] [RAIDING] Overclaim Restrictions Not Working

Paralaxus opened this issue ยท 1 comments

commented

Apparently all Empires can be raided despite their power matching their territory.
There are IF statements to correct this bug but the most important one fails to trigger...

`
@ Command(
name = "overclaim",
permission = "Empires.cmd.officer.overclaim",
parentName = "Empires.cmd",
syntax = "/empire overclaim")
public static CommandResponse overclaimCommand(ICommandSender sender, List args) {
EntityPlayer player = (EntityPlayer) sender;
Citizen res = EmpiresUniverse.instance.getOrMakeCitizen(sender);
EmpireBlock block = getBlockAtCitizen(res);
Empire empire = block.getEmpire();

  //  try {
    Empire CitizensEmpire = CommandsEMP.getEmpireFromCitizen(res);

    if (CitizensEmpire == null) {
    	throw new EmpiresCommandException("Empires.cmd.err.overclaim.userNotInEmpire");
    }
    if (CitizensEmpire == block.getEmpire()) {
	    throw new EmpiresCommandException("Empires.cmd.err.overclaim.presentEmpire");
    }
    
    
    if (block.getEmpire().empireBlocksContainer.size() > block.getEmpire().getPower()) {
        throw new EmpiresCommandException("Empires.cmd.err.overclaim.powerException");
    }
    
    if (res.getPower() < 7) {
    	throw new EmpiresCommandException("Empires.cmd.err.overclaim.minPowerRequired");
    }

    				
    if (block.isPointIn(empire.getSpawn().getDim(), empire.getSpawn().getX(), empire.getSpawn().getZ())) {
    getDatasource().deleteEmpire(empire); 
    empire.notifyEveryone(getLocal().getLocalization("Empires.notification.empire.overclaimed.deleted", empire, res));
    }
    				
    getDatasource().deleteBlock(block);
    ChatManager.send(sender, "Empires.notification.block.overclaimed", block.getX() << 4, block.getZ() << 4, block.getX() << 4 + 15, block.getZ() << 4 + 15, empire);
    return CommandResponse.DONE;
}

`

commented

Fixed.