Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.

Commit

Permalink
Fix a few too optimistic changed calls
Browse files Browse the repository at this point in the history
  • Loading branch information
oloflarsson committed Apr 30, 2018
1 parent fd8c4b1 commit f1b9176
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 14 deletions.
5 changes: 3 additions & 2 deletions src/com/massivecraft/massivegates/entity/GSender.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ public Gate getSelectedGate()

public void setSelectedGate(Gate val)
{
this.selectedGateId = (val == null ? null : val.getId());
this.changed();
String target = (val == null ? null : val.getId());
this.changed(this.selectedGateId, target);
this.selectedGateId = target;
}

// -------------------------------------------- //
Expand Down
50 changes: 38 additions & 12 deletions src/com/massivecraft/massivegates/entity/Gate.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,10 @@ public Gate()
// Raw
public void setOpen(boolean open)
{
this.changed(this.open, open);

this.open = open;
this.changed();

this.fillContent();

// Trigger!
Expand Down Expand Up @@ -171,8 +173,15 @@ public void setOpen(boolean open)

// Raw
@Override
public String getName() { return this.name; }
public void setName(String val) { this.name = val; this.changed(); }
public String getName()
{
return this.name;
}
public void setName(String val)
{
this.changed(this.name, val);
this.name = val;
}

// Finer
public String getIdNameStringShort()
Expand Down Expand Up @@ -200,8 +209,15 @@ public String getIdNameStringLong()
// -------------------------------------------- //

// Raw
public String getDesc() { return this.desc; }
public void setDesc(String val) { this.desc = val; this.changed(); }
public String getDesc()
{
return this.desc;
}
public void setDesc(String val)
{
this.changed(this.desc, val);
this.desc = val;
}

// -------------------------------------------- //
// FIELD: matopen
Expand All @@ -215,13 +231,15 @@ public Material getMatopen()

public void setMatopen(Material mat, Byte data)
{
this.changed(this.matopen, mat);
this.changed(this.dataopen, data);

this.matopen = mat;
this.dataopen = data;
if (this.open == true)
if (this.open)
{
this.fillContent(this.matopen, this.dataopen);
}
this.changed();
}

public Byte getDataopen()
Expand All @@ -240,13 +258,15 @@ public Material getMatclosed()

public void setMatclosed(Material mat, Byte data)
{
this.changed(this.matclosed, mat);
this.changed(this.dataclosed, data);

this.matclosed = mat;
this.dataclosed = data;
if (this.open == false)
{
this.fillContent(this.matclosed, this.dataclosed);
}
this.changed();
}

public Byte getDataclosed()
Expand All @@ -259,8 +279,15 @@ public Byte getDataclosed()
// -------------------------------------------- //

//Raw
public PS getExit() { return this.exit; }
public void setExit(PS val) { this.exit = val; this.changed(); }
public PS getExit()
{
return this.exit;
}
public void setExit(PS val)
{
this.changed(this.exit, val);
this.exit = val;
}

// Finer
public String getExitDesc()
Expand Down Expand Up @@ -619,7 +646,6 @@ public List<Entry<Action, String>> getActionArgs(Trigger trigger)
if (action == null) continue;
Entry<Action, String> actionArg = new SimpleEntry<>(action, arg);
ret.add(actionArg);
this.changed();
}
return ret;
}
Expand Down Expand Up @@ -669,8 +695,8 @@ public int delActions(Trigger trigger)
}
public void delActions()
{
if (!this.trigger2ActionIdArgs.isEmpty()) this.changed();
this.trigger2ActionIdArgs.clear();
this.changed();
}
public void trigger(Trigger trigger, org.bukkit.entity.Entity entity, Cancellable cancellable)
{
Expand Down

0 comments on commit f1b9176

Please sign in to comment.