Code cleanup
This commit is contained in:
@ -187,9 +187,7 @@ public class Faction extends Entity<Faction> implements FactionsParticipator, MP
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
String ret = this.name;
|
||||
|
||||
return ret;
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
|
@ -90,7 +90,7 @@ public class FactionColl extends Coll<Faction>
|
||||
faction.setPermittedRelations(MPerm.getPermDoor(), MPerm.getPermables(faction));
|
||||
faction.setPermittedRelations(MPerm.getPermContainer(), MPerm.getPermables(faction));
|
||||
faction.setPermittedRelations(MPerm.getPermButton(), MPerm.getPermables(faction));
|
||||
faction.setPermittedRelations(MPerm.getPermLever(), MPerm.getPermables(faction));;
|
||||
faction.setPermittedRelations(MPerm.getPermLever(), MPerm.getPermables(faction));
|
||||
faction.setPermittedRelations(MPerm.getPermDeposit(), Collections.singleton(faction.getLeaderRank())); // Wilderness deposit should be limited as an anti spam meassure.
|
||||
|
||||
return faction;
|
||||
@ -233,7 +233,7 @@ public class FactionColl extends Coll<Faction>
|
||||
boolean peaceful = faction.getFlag(flagPeaceful);
|
||||
for (Rel rel : rels)
|
||||
{
|
||||
ret.put(rel, new ArrayList<String>());
|
||||
ret.put(rel, new ArrayList<>());
|
||||
}
|
||||
|
||||
// Fill
|
||||
|
@ -146,7 +146,7 @@ public class MPerm extends Entity<MPerm> implements Prioritized, Registerable, N
|
||||
}
|
||||
|
||||
public static MPerm getPermBuild() { return getCreative(PRIORITY_BUILD, ID_BUILD, ID_BUILD, "edit the terrain", MUtil.set("LEADER", "OFFICER", "MEMBER"), true, true, true); }
|
||||
public static MPerm getPermPainbuild() { return getCreative(PRIORITY_PAINBUILD, ID_PAINBUILD, ID_PAINBUILD, "edit, take damage", new MassiveSet<String>(), true, true, true); }
|
||||
public static MPerm getPermPainbuild() { return getCreative(PRIORITY_PAINBUILD, ID_PAINBUILD, ID_PAINBUILD, "edit, take damage", new MassiveSet<>(), true, true, true); }
|
||||
public static MPerm getPermDoor() { return getCreative(PRIORITY_DOOR, ID_DOOR, ID_DOOR, "use doors", MUtil.set("LEADER", "OFFICER", "MEMBER", "RECRUIT", "ALLY"), true, true, true); }
|
||||
public static MPerm getPermButton() { return getCreative(PRIORITY_BUTTON, ID_BUTTON, ID_BUTTON, "use stone buttons", MUtil.set("LEADER", "OFFICER", "MEMBER", "RECRUIT", "ALLY"), true, true, true); }
|
||||
public static MPerm getPermLever() { return getCreative(PRIORITY_LEVER, ID_LEVER, ID_LEVER, "use levers", MUtil.set("LEADER", "OFFICER", "MEMBER", "RECRUIT", "ALLY"), true, true, true); }
|
||||
@ -412,9 +412,8 @@ public class MPerm extends Entity<MPerm> implements Prioritized, Registerable, N
|
||||
return accessStatus.hasAccess();
|
||||
}
|
||||
}
|
||||
|
||||
boolean ret = this.has(mplayer, hostFaction, verboose);
|
||||
return ret;
|
||||
|
||||
return this.has(mplayer, hostFaction, verboose);
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -3,7 +3,6 @@ package com.massivecraft.factions.entity;
|
||||
import com.massivecraft.massivecore.store.EntityInternal;
|
||||
import com.massivecraft.massivecore.store.EntityInternalMap;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
import org.apache.commons.lang.ObjectUtils.Null;
|
||||
import org.bukkit.ChatColor;
|
||||
|
||||
import java.util.Map.Entry;
|
||||
|
@ -95,8 +95,7 @@ public class Vote extends EntityInternal<Vote> implements Named
|
||||
public Faction getFaction()
|
||||
{
|
||||
EntityInternalMap<Vote> internalMap = (EntityInternalMap<Vote>) this.getContainer();
|
||||
Faction faction = (Faction) internalMap.getEntity();
|
||||
return faction;
|
||||
return (Faction) internalMap.getEntity();
|
||||
}
|
||||
|
||||
public void clean()
|
||||
|
@ -39,8 +39,7 @@ public class Warp extends EntityInternal<Warp> implements Named
|
||||
public Faction getFaction()
|
||||
{
|
||||
EntityInternalMap<?> internalMap = (EntityInternalMap<?>) this.getContainer();
|
||||
Faction faction = (Faction) internalMap.getEntity();
|
||||
return faction;
|
||||
return (Faction) internalMap.getEntity();
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
Reference in New Issue
Block a user