mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 06:36:45 +01:00
minor cleanup
This commit is contained in:
parent
9acf597eb9
commit
7bbf1acd5d
@ -3,7 +3,6 @@ package com.gmail.nossr50.listeners;
|
||||
import com.gmail.nossr50.chat.ChatManager;
|
||||
import com.gmail.nossr50.chat.ChatManagerFactory;
|
||||
import com.gmail.nossr50.chat.PartyChatManager;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.MainConfig;
|
||||
import com.gmail.nossr50.config.WorldBlacklist;
|
||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
||||
|
@ -3,7 +3,6 @@ package com.gmail.nossr50.runnables.player;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class PlayerUpdateInventoryTask extends BukkitRunnable {
|
||||
private Player player;
|
||||
|
||||
|
@ -18,8 +18,6 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
public class AlchemyBrewTask extends BukkitRunnable {
|
||||
private static double DEFAULT_BREW_SPEED = 1.0;
|
||||
private static int DEFAULT_BREW_TICKS = 400;
|
||||
|
||||
private BlockState brewingStand;
|
||||
private Location location;
|
||||
@ -34,8 +32,8 @@ public class AlchemyBrewTask extends BukkitRunnable {
|
||||
this.location = brewingStand.getLocation();
|
||||
this.player = player;
|
||||
|
||||
brewSpeed = DEFAULT_BREW_SPEED;
|
||||
brewTimer = DEFAULT_BREW_TICKS;
|
||||
brewSpeed = 1.0;
|
||||
brewTimer = 400;
|
||||
|
||||
if (player != null && !Misc.isNPCEntity(player) && Permissions.isSubSkillEnabled(player, SubSkillType.ALCHEMY_CATALYSIS)) {
|
||||
double catalysis = UserManager.getPlayer(player).getAlchemyManager().calculateBrewSpeed(Permissions.lucky(player, PrimarySkillType.ALCHEMY));
|
||||
|
@ -16,7 +16,6 @@ import org.bukkit.inventory.ItemStack;
|
||||
import java.util.List;
|
||||
|
||||
public class AlchemyManager extends SkillManager {
|
||||
private final double LUCKY_MODIFIER = 4.0 / 3.0;
|
||||
|
||||
public AlchemyManager(McMMOPlayer mcMMOPlayer) {
|
||||
super(mcMMOPlayer, PrimarySkillType.ALCHEMY);
|
||||
@ -49,6 +48,7 @@ public class AlchemyManager extends SkillManager {
|
||||
return Alchemy.catalysisMinSpeed;
|
||||
}
|
||||
|
||||
double LUCKY_MODIFIER = 4.0 / 3.0;
|
||||
return Math.min(Alchemy.catalysisMaxSpeed, Alchemy.catalysisMinSpeed + (Alchemy.catalysisMaxSpeed - Alchemy.catalysisMinSpeed) * (skillLevel - Alchemy.catalysisUnlockLevel) / (Alchemy.catalysisMaxBonusLevel - Alchemy.catalysisUnlockLevel)) * (isLucky ? LUCKY_MODIFIER : 1.0);
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@ import org.bukkit.scheduler.BukkitScheduler;
|
||||
import java.io.File;
|
||||
|
||||
public class BlockStoreConversionMain implements Runnable {
|
||||
private int taskID, i;
|
||||
private int taskID;
|
||||
private org.bukkit.World world;
|
||||
BukkitScheduler scheduler;
|
||||
File dataDir;
|
||||
@ -52,12 +52,12 @@ public class BlockStoreConversionMain implements Runnable {
|
||||
|
||||
this.xDirs = this.dataDir.listFiles();
|
||||
|
||||
for (this.i = 0; (this.i < ChunkConversionOptions.getConversionRate()) && (this.i < this.xDirs.length); this.i++) {
|
||||
if (this.converters[this.i] == null) {
|
||||
this.converters[this.i] = new BlockStoreConversionXDirectory();
|
||||
for (int i = 0; (i < ChunkConversionOptions.getConversionRate()) && (i < this.xDirs.length); i++) {
|
||||
if (this.converters[i] == null) {
|
||||
this.converters[i] = new BlockStoreConversionXDirectory();
|
||||
}
|
||||
|
||||
this.converters[this.i].start(this.world, this.xDirs[this.i]);
|
||||
this.converters[i].start(this.world, this.xDirs[i]);
|
||||
}
|
||||
|
||||
softStop();
|
||||
|
@ -7,7 +7,7 @@ import org.bukkit.scheduler.BukkitScheduler;
|
||||
import java.io.File;
|
||||
|
||||
public class BlockStoreConversionXDirectory implements Runnable {
|
||||
private int taskID, i;
|
||||
private int taskID;
|
||||
private org.bukkit.World world;
|
||||
BukkitScheduler scheduler;
|
||||
File dataDir;
|
||||
@ -53,12 +53,12 @@ public class BlockStoreConversionXDirectory implements Runnable {
|
||||
|
||||
this.zDirs = this.dataDir.listFiles();
|
||||
|
||||
for (this.i = 0; (this.i < ChunkConversionOptions.getConversionRate()) && (this.i < this.zDirs.length); this.i++) {
|
||||
if (this.converters[this.i] == null) {
|
||||
this.converters[this.i] = new BlockStoreConversionZDirectory();
|
||||
for (int i = 0; (i < ChunkConversionOptions.getConversionRate()) && (i < this.zDirs.length); i++) {
|
||||
if (this.converters[i] == null) {
|
||||
this.converters[i] = new BlockStoreConversionZDirectory();
|
||||
}
|
||||
|
||||
this.converters[this.i].start(this.world, this.dataDir, this.zDirs[this.i]);
|
||||
this.converters[i].start(this.world, this.dataDir, this.zDirs[i]);
|
||||
}
|
||||
|
||||
stop();
|
||||
|
@ -23,7 +23,6 @@ public class BlockStoreConversionZDirectory implements Runnable {
|
||||
private PrimitiveChunkletStore primitiveChunklet = null;
|
||||
private PrimitiveExChunkletStore primitiveExChunklet = null;
|
||||
private PrimitiveChunkStore currentChunk;
|
||||
private boolean[] oldArray, newArray;
|
||||
|
||||
public BlockStoreConversionZDirectory() {
|
||||
this.taskID = -1;
|
||||
@ -130,27 +129,25 @@ public class BlockStoreConversionZDirectory implements Runnable {
|
||||
|
||||
for (this.x = 0; this.x < 16; this.x++) {
|
||||
for (this.z = 0; this.z < 16; this.z++) {
|
||||
if (this.primitiveChunklet != null) {
|
||||
this.oldArray = this.primitiveChunklet.store[x][z];
|
||||
}
|
||||
boolean[] oldArray;
|
||||
|
||||
if (this.primitiveExChunklet != null) {
|
||||
this.oldArray = this.primitiveExChunklet.store[x][z];
|
||||
oldArray = this.primitiveExChunklet.store[x][z];
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
|
||||
this.newArray = this.currentChunk.store[x][z];
|
||||
boolean[] newArray = this.currentChunk.store[x][z];
|
||||
|
||||
if (this.oldArray.length < 64) {
|
||||
if (oldArray.length < 64) {
|
||||
return;
|
||||
}
|
||||
else if (this.newArray.length < ((this.y * 64) + 64)) {
|
||||
else if (newArray.length < ((this.y * 64) + 64)) {
|
||||
return;
|
||||
}
|
||||
|
||||
System.arraycopy(this.oldArray, 0, this.newArray, (this.y * 64), 64);
|
||||
System.arraycopy(oldArray, 0, newArray, (this.y * 64), 64);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user