瀏覽代碼

Static Abuse Removal - Misc Tasks

nossr50 6 年之前
父節點
當前提交
cf46ec7498

+ 5 - 1
src/main/java/com/gmail/nossr50/runnables/MobHealthDisplayUpdaterTask.java

@@ -1,15 +1,19 @@
 package com.gmail.nossr50.runnables;
 
 import com.gmail.nossr50.core.MetadataConstants;
+import com.gmail.nossr50.mcMMO;
 import org.bukkit.entity.LivingEntity;
 import org.bukkit.scheduler.BukkitRunnable;
 
 public class MobHealthDisplayUpdaterTask extends BukkitRunnable {
+    private final mcMMO pluginRef;
     private LivingEntity target;
     private String oldName;
     private boolean oldNameVisible;
 
-    public MobHealthDisplayUpdaterTask(LivingEntity target) {
+    public MobHealthDisplayUpdaterTask(mcMMO pluginRef, LivingEntity target) {
+        this.pluginRef = pluginRef;
+
         if (target.isValid()) {
             this.target = target;
             this.oldName = target.getMetadata(MetadataConstants.CUSTOM_NAME_METAKEY).get(0).asString();

+ 4 - 1
src/main/java/com/gmail/nossr50/runnables/PistonTrackerTask.java

@@ -1,6 +1,7 @@
 package com.gmail.nossr50.runnables;
 
 import com.gmail.nossr50.core.MetadataConstants;
+import com.gmail.nossr50.mcMMO;
 import com.gmail.nossr50.util.BlockUtils;
 import org.bukkit.block.Block;
 import org.bukkit.block.BlockFace;
@@ -9,11 +10,13 @@ import org.bukkit.scheduler.BukkitRunnable;
 import java.util.List;
 
 public class PistonTrackerTask extends BukkitRunnable {
+    private final mcMMO pluginRef;
     private List<Block> blocks;
     private BlockFace direction;
     private Block futureEmptyBlock;
 
-    public PistonTrackerTask(List<Block> blocks, BlockFace direction, Block futureEmptyBlock) {
+    public PistonTrackerTask(mcMMO pluginRef, List<Block> blocks, BlockFace direction, Block futureEmptyBlock) {
+        this.pluginRef = pluginRef;
         this.blocks = blocks;
         this.direction = direction;
         this.futureEmptyBlock = futureEmptyBlock;

+ 8 - 0
src/main/java/com/gmail/nossr50/runnables/SaveTimerTask.java

@@ -1,10 +1,18 @@
 package com.gmail.nossr50.runnables;
 
 import com.gmail.nossr50.datatypes.player.McMMOPlayer;
+import com.gmail.nossr50.mcMMO;
 import com.gmail.nossr50.runnables.player.PlayerProfileSaveTask;
 import org.bukkit.scheduler.BukkitRunnable;
 
 public class SaveTimerTask extends BukkitRunnable {
+
+    private final mcMMO pluginRef;
+
+    public SaveTimerTask(mcMMO pluginRef) {
+        this.pluginRef = pluginRef;
+    }
+
     @Override
     public void run() {
         // All player data will be saved periodically through this

+ 4 - 1
src/main/java/com/gmail/nossr50/runnables/StickyPistonTrackerTask.java

@@ -1,16 +1,19 @@
 package com.gmail.nossr50.runnables;
 
+import com.gmail.nossr50.mcMMO;
 import com.gmail.nossr50.util.BlockUtils;
 import org.bukkit.block.Block;
 import org.bukkit.block.BlockFace;
 import org.bukkit.scheduler.BukkitRunnable;
 
 public class StickyPistonTrackerTask extends BukkitRunnable {
+    private final mcMMO pluginRef;
     private BlockFace direction;
     private Block block;
     private Block movedBlock;
 
-    public StickyPistonTrackerTask(BlockFace direction, Block block, Block movedBlock) {
+    public StickyPistonTrackerTask(mcMMO pluginRef, BlockFace direction, Block block, Block movedBlock) {
+        this.pluginRef = pluginRef;
         this.direction = direction;
         this.block = block;
         this.movedBlock = movedBlock;