Refactored Generation and class structure
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package eu.mhsl.minenet.minigames.util;
|
||||
|
||||
public class SingleExecution {
|
||||
public static SingleExecution make() {
|
||||
return new SingleExecution();
|
||||
}
|
||||
|
||||
private boolean wasExecuted = false;
|
||||
|
||||
public void reset() {
|
||||
this.wasExecuted = false;
|
||||
}
|
||||
|
||||
public void singleRun(Runnable task) {
|
||||
if(wasExecuted) return;
|
||||
task.run();
|
||||
this.wasExecuted = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user