v0.4.2b: fixed some concurrent modification exceptions
This commit is contained in:
parent
433a89b07e
commit
1aed7a7501
|
@ -320,7 +320,7 @@ public abstract class Char extends Actor {
|
|||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends Buff> HashSet<T> buffs( Class<T> c ) {
|
||||
public synchronized <T extends Buff> HashSet<T> buffs( Class<T> c ) {
|
||||
HashSet<T> filtered = new HashSet<>();
|
||||
for (Buff b : buffs) {
|
||||
if (c.isInstance( b )) {
|
||||
|
@ -329,9 +329,9 @@ public abstract class Char extends Actor {
|
|||
}
|
||||
return filtered;
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends Buff> T buff( Class<T> c ) {
|
||||
public synchronized <T extends Buff> T buff( Class<T> c ) {
|
||||
for (Buff b : buffs) {
|
||||
if (c.isInstance( b )) {
|
||||
return (T)b;
|
||||
|
|
|
@ -94,7 +94,7 @@ public class RenderedTextMultiline extends Component {
|
|||
return maxWidth;
|
||||
}
|
||||
|
||||
private void build(){
|
||||
private synchronized void build(){
|
||||
clear();
|
||||
words = new ArrayList<>();
|
||||
boolean highlighting = false;
|
||||
|
@ -133,21 +133,21 @@ public class RenderedTextMultiline extends Component {
|
|||
layout();
|
||||
}
|
||||
|
||||
public void zoom(float zoom){
|
||||
public synchronized void zoom(float zoom){
|
||||
this.zoom = zoom;
|
||||
for (RenderedText word : words) {
|
||||
if (word != null) word.scale.set(zoom);
|
||||
}
|
||||
}
|
||||
|
||||
public void hardlight(int color){
|
||||
public synchronized void hardlight(int color){
|
||||
this.color = color;
|
||||
for (RenderedText word : words) {
|
||||
if (word != null) word.hardlight( color );
|
||||
}
|
||||
}
|
||||
|
||||
public void invert(){
|
||||
public synchronized void invert(){
|
||||
if (words != null) {
|
||||
for (RenderedText word : words) {
|
||||
if (word != null) {
|
||||
|
@ -163,7 +163,7 @@ public class RenderedTextMultiline extends Component {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void layout() {
|
||||
protected synchronized void layout() {
|
||||
super.layout();
|
||||
float x = this.x;
|
||||
float y = this.y;
|
||||
|
|
Loading…
Reference in New Issue
Block a user