Static Abuse Removal - Misc Tasks

This commit is contained in:
nossr50 2019-07-03 01:36:46 -07:00
parent 3ea739d111
commit cf46ec7498
4 changed files with 21 additions and 3 deletions

View File

@ -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();

View File

@ -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;

View File

@ -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

View File

@ -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;