Allergy reaction kicked in. This commit removes the Spout features. I have nothing against spout but if we are going to have them we should do them properly. They should be coded in such a way that they could be in an external plugin alltogether. Also removed netbeans stuff from IDE that should not be in the github repo.
This commit is contained in:
@ -18,7 +18,6 @@ import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.Lang;
|
||||
import com.massivecraft.factions.Rel;
|
||||
import com.massivecraft.factions.RelationParticipator;
|
||||
import com.massivecraft.factions.integration.SpoutFeatures;
|
||||
import com.massivecraft.factions.util.*;
|
||||
import com.massivecraft.mcore.mixin.Mixin;
|
||||
import com.massivecraft.mcore.ps.PS;
|
||||
@ -50,7 +49,6 @@ public class Faction extends Entity<Faction> implements EconomyParticipator
|
||||
this.setDescription(that.description);
|
||||
this.home = that.home;
|
||||
this.setPowerBoost(that.powerBoost);
|
||||
this.cape = that.cape;
|
||||
this.open = that.open;
|
||||
this.setInvitedPlayerIds(that.invitedPlayerIds);
|
||||
this.setRelationWishes(that.relationWish);
|
||||
@ -83,10 +81,6 @@ public class Faction extends Entity<Faction> implements EconomyParticipator
|
||||
// The powerBoost is a custom increase/decrease to default and maximum power.
|
||||
private Double powerBoost = null;
|
||||
|
||||
// The cape field is used by the Spout integration features.
|
||||
// It's the URL to the faction cape.
|
||||
private String cape = null;
|
||||
|
||||
// Can anyone join the Faction?
|
||||
// If the faction is open they can.
|
||||
// If the faction is closed an invite is required.
|
||||
@ -280,21 +274,6 @@ public class Faction extends Entity<Faction> implements EconomyParticipator
|
||||
return this.getPowerBoost() != 0D;
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// FIELD: cape
|
||||
// -------------------------------------------- //
|
||||
|
||||
public String getCape()
|
||||
{
|
||||
return cape;
|
||||
}
|
||||
|
||||
public void setCape(String cape)
|
||||
{
|
||||
this.cape = cape;
|
||||
SpoutFeatures.updateCape(this, null);
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// FIELD: open
|
||||
// -------------------------------------------- //
|
||||
|
41
src/com/massivecraft/factions/entity/MPlayer.java
Normal file
41
src/com/massivecraft/factions/entity/MPlayer.java
Normal file
@ -0,0 +1,41 @@
|
||||
package com.massivecraft.factions.entity;
|
||||
|
||||
import com.massivecraft.mcore.store.SenderEntity;
|
||||
|
||||
public class MPlayer extends SenderEntity<MPlayer>
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// META
|
||||
// -------------------------------------------- //
|
||||
|
||||
public static MPlayer get(Object oid)
|
||||
{
|
||||
return MPlayerColl.get().get(oid);
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// OVERRIDE
|
||||
// -------------------------------------------- //
|
||||
|
||||
@Override
|
||||
public MPlayer load(MPlayer that)
|
||||
{
|
||||
// TODO
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDefault()
|
||||
{
|
||||
// TODO
|
||||
//return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// FIELDS
|
||||
// -------------------------------------------- //
|
||||
|
||||
}
|
22
src/com/massivecraft/factions/entity/MPlayerColl.java
Normal file
22
src/com/massivecraft/factions/entity/MPlayerColl.java
Normal file
@ -0,0 +1,22 @@
|
||||
package com.massivecraft.factions.entity;
|
||||
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.Const;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.mcore.store.MStore;
|
||||
import com.massivecraft.mcore.store.SenderColl;
|
||||
|
||||
public class MPlayerColl extends SenderColl<MPlayer>
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// INSTANCE & CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
private static MPlayerColl i = new MPlayerColl();
|
||||
public static MPlayerColl get() { return i; }
|
||||
private MPlayerColl()
|
||||
{
|
||||
super(Const.COLLECTION_BASENAME_MPLAYER, MPlayer.class, MStore.getDb(ConfServer.dburi), Factions.get());
|
||||
}
|
||||
|
||||
}
|
@ -22,7 +22,6 @@ import com.massivecraft.factions.event.FactionsEventPowerChange;
|
||||
import com.massivecraft.factions.event.FactionsEventPowerChange.PowerChangeReason;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
import com.massivecraft.factions.integration.LWCFeatures;
|
||||
import com.massivecraft.factions.integration.SpoutFeatures;
|
||||
import com.massivecraft.factions.integration.Worldguard;
|
||||
import com.massivecraft.factions.util.RelationUtil;
|
||||
import com.massivecraft.mcore.mixin.Mixin;
|
||||
@ -121,12 +120,8 @@ public class UPlayer extends SenderEntity<UPlayer> implements EconomyParticipato
|
||||
// FIELDS: RAW TRANSIENT
|
||||
// -------------------------------------------- //
|
||||
|
||||
// Where did this player stand the last time we checked?
|
||||
private transient PS currentChunk = null;
|
||||
public PS getCurrentChunk() { return this.currentChunk; }
|
||||
public void setCurrentChunk(PS currentChunk) { this.currentChunk = currentChunk.getChunk(true); }
|
||||
|
||||
// FIELD: mapAutoUpdating
|
||||
// TODO: Move this to the MPlayer
|
||||
private transient boolean mapAutoUpdating = false;
|
||||
public void setMapAutoUpdating(boolean mapAutoUpdating) { this.mapAutoUpdating = mapAutoUpdating; }
|
||||
public boolean isMapAutoUpdating() { return mapAutoUpdating; }
|
||||
@ -153,11 +148,11 @@ public class UPlayer extends SenderEntity<UPlayer> implements EconomyParticipato
|
||||
// GSON need this noarg constructor.
|
||||
public UPlayer()
|
||||
{
|
||||
this.resetFactionData(false);
|
||||
this.resetFactionData();
|
||||
//this.power = ConfServer.powerStarting;
|
||||
}
|
||||
|
||||
public void resetFactionData(boolean doSpoutUpdate)
|
||||
public void resetFactionData()
|
||||
{
|
||||
// The default neutral faction
|
||||
this.setFactionId(null);
|
||||
@ -165,18 +160,6 @@ public class UPlayer extends SenderEntity<UPlayer> implements EconomyParticipato
|
||||
this.setTitle(null);
|
||||
|
||||
this.autoClaimFor = null;
|
||||
|
||||
if (doSpoutUpdate)
|
||||
{
|
||||
SpoutFeatures.updateTitle(this, null);
|
||||
SpoutFeatures.updateTitle(null, this);
|
||||
SpoutFeatures.updateCape(this.getPlayer(), null);
|
||||
}
|
||||
}
|
||||
|
||||
public void resetFactionData()
|
||||
{
|
||||
this.resetFactionData(true);
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
@ -230,10 +213,6 @@ public class UPlayer extends SenderEntity<UPlayer> implements EconomyParticipato
|
||||
if (!this.getColl().inited()) return;
|
||||
if (!Factions.get().isDatabaseInitialized()) return;
|
||||
|
||||
// Spout Derp
|
||||
SpoutFeatures.updateTitle(this, null);
|
||||
SpoutFeatures.updateTitle(null, this);
|
||||
|
||||
// Update index
|
||||
Faction oldFaction = FactionColls.get().get(this).get(oldFactionId);
|
||||
Faction faction = FactionColls.get().get(this).get(factionId);
|
||||
@ -270,7 +249,6 @@ public class UPlayer extends SenderEntity<UPlayer> implements EconomyParticipato
|
||||
{
|
||||
this.role = role;
|
||||
}
|
||||
SpoutFeatures.updateTitle(this, null);
|
||||
this.changed();
|
||||
}
|
||||
|
||||
@ -638,21 +616,6 @@ public class UPlayer extends SenderEntity<UPlayer> implements EconomyParticipato
|
||||
// TODO: Use Mixin to get this PS instead
|
||||
return BoardColls.get().getFactionAt(Mixin.getSenderPs(this.getId())).getRelationTo(this) == Rel.ENEMY;
|
||||
}
|
||||
|
||||
public void sendFactionHereMessage()
|
||||
{
|
||||
if (SpoutFeatures.updateTerritoryDisplay(this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
Faction factionHere = BoardColls.get().getFactionAt(this.getCurrentChunk());
|
||||
String msg = Txt.parse("<i>")+" ~ "+factionHere.getTag(this);
|
||||
if (factionHere.hasDescription())
|
||||
{
|
||||
msg += " - "+factionHere.getDescription();
|
||||
}
|
||||
this.sendMessage(msg);
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// ACTIONS
|
||||
@ -846,7 +809,6 @@ public class UPlayer extends SenderEntity<UPlayer> implements EconomyParticipato
|
||||
}
|
||||
|
||||
BoardColls.get().setFactionAt(psChunk, forFaction);
|
||||
SpoutFeatures.updateTerritoryDisplayLoc(psChunk);
|
||||
|
||||
if (MConf.get().logLandClaims)
|
||||
{
|
||||
|
@ -66,7 +66,6 @@ public class UPlayerColl extends SenderColl<UPlayer>
|
||||
if (FactionColls.get().get(this).containsId(uplayer.getFactionId())) continue;
|
||||
|
||||
Factions.get().log("Reset faction data (invalid faction) for player "+uplayer.getName());
|
||||
uplayer.resetFactionData(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user