mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 14:46:46 +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.ChatManager;
|
||||||
import com.gmail.nossr50.chat.ChatManagerFactory;
|
import com.gmail.nossr50.chat.ChatManagerFactory;
|
||||||
import com.gmail.nossr50.chat.PartyChatManager;
|
import com.gmail.nossr50.chat.PartyChatManager;
|
||||||
import com.gmail.nossr50.config.Config;
|
|
||||||
import com.gmail.nossr50.config.MainConfig;
|
import com.gmail.nossr50.config.MainConfig;
|
||||||
import com.gmail.nossr50.config.WorldBlacklist;
|
import com.gmail.nossr50.config.WorldBlacklist;
|
||||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
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.entity.Player;
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public class PlayerUpdateInventoryTask extends BukkitRunnable {
|
public class PlayerUpdateInventoryTask extends BukkitRunnable {
|
||||||
private Player player;
|
private Player player;
|
||||||
|
|
||||||
|
@ -18,8 +18,6 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
public class AlchemyBrewTask extends 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 BlockState brewingStand;
|
||||||
private Location location;
|
private Location location;
|
||||||
@ -34,8 +32,8 @@ public class AlchemyBrewTask extends BukkitRunnable {
|
|||||||
this.location = brewingStand.getLocation();
|
this.location = brewingStand.getLocation();
|
||||||
this.player = player;
|
this.player = player;
|
||||||
|
|
||||||
brewSpeed = DEFAULT_BREW_SPEED;
|
brewSpeed = 1.0;
|
||||||
brewTimer = DEFAULT_BREW_TICKS;
|
brewTimer = 400;
|
||||||
|
|
||||||
if (player != null && !Misc.isNPCEntity(player) && Permissions.isSubSkillEnabled(player, SubSkillType.ALCHEMY_CATALYSIS)) {
|
if (player != null && !Misc.isNPCEntity(player) && Permissions.isSubSkillEnabled(player, SubSkillType.ALCHEMY_CATALYSIS)) {
|
||||||
double catalysis = UserManager.getPlayer(player).getAlchemyManager().calculateBrewSpeed(Permissions.lucky(player, PrimarySkillType.ALCHEMY));
|
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;
|
import java.util.List;
|
||||||
|
|
||||||
public class AlchemyManager extends SkillManager {
|
public class AlchemyManager extends SkillManager {
|
||||||
private final double LUCKY_MODIFIER = 4.0 / 3.0;
|
|
||||||
|
|
||||||
public AlchemyManager(McMMOPlayer mcMMOPlayer) {
|
public AlchemyManager(McMMOPlayer mcMMOPlayer) {
|
||||||
super(mcMMOPlayer, PrimarySkillType.ALCHEMY);
|
super(mcMMOPlayer, PrimarySkillType.ALCHEMY);
|
||||||
@ -49,6 +48,7 @@ public class AlchemyManager extends SkillManager {
|
|||||||
return Alchemy.catalysisMinSpeed;
|
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);
|
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;
|
import java.io.File;
|
||||||
|
|
||||||
public class BlockStoreConversionMain implements Runnable {
|
public class BlockStoreConversionMain implements Runnable {
|
||||||
private int taskID, i;
|
private int taskID;
|
||||||
private org.bukkit.World world;
|
private org.bukkit.World world;
|
||||||
BukkitScheduler scheduler;
|
BukkitScheduler scheduler;
|
||||||
File dataDir;
|
File dataDir;
|
||||||
@ -52,12 +52,12 @@ public class BlockStoreConversionMain implements Runnable {
|
|||||||
|
|
||||||
this.xDirs = this.dataDir.listFiles();
|
this.xDirs = this.dataDir.listFiles();
|
||||||
|
|
||||||
for (this.i = 0; (this.i < ChunkConversionOptions.getConversionRate()) && (this.i < this.xDirs.length); this.i++) {
|
for (int i = 0; (i < ChunkConversionOptions.getConversionRate()) && (i < this.xDirs.length); i++) {
|
||||||
if (this.converters[this.i] == null) {
|
if (this.converters[i] == null) {
|
||||||
this.converters[this.i] = new BlockStoreConversionXDirectory();
|
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();
|
softStop();
|
||||||
|
@ -7,7 +7,7 @@ import org.bukkit.scheduler.BukkitScheduler;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
public class BlockStoreConversionXDirectory implements Runnable {
|
public class BlockStoreConversionXDirectory implements Runnable {
|
||||||
private int taskID, i;
|
private int taskID;
|
||||||
private org.bukkit.World world;
|
private org.bukkit.World world;
|
||||||
BukkitScheduler scheduler;
|
BukkitScheduler scheduler;
|
||||||
File dataDir;
|
File dataDir;
|
||||||
@ -53,12 +53,12 @@ public class BlockStoreConversionXDirectory implements Runnable {
|
|||||||
|
|
||||||
this.zDirs = this.dataDir.listFiles();
|
this.zDirs = this.dataDir.listFiles();
|
||||||
|
|
||||||
for (this.i = 0; (this.i < ChunkConversionOptions.getConversionRate()) && (this.i < this.zDirs.length); this.i++) {
|
for (int i = 0; (i < ChunkConversionOptions.getConversionRate()) && (i < this.zDirs.length); i++) {
|
||||||
if (this.converters[this.i] == null) {
|
if (this.converters[i] == null) {
|
||||||
this.converters[this.i] = new BlockStoreConversionZDirectory();
|
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();
|
stop();
|
||||||
|
@ -23,7 +23,6 @@ public class BlockStoreConversionZDirectory implements Runnable {
|
|||||||
private PrimitiveChunkletStore primitiveChunklet = null;
|
private PrimitiveChunkletStore primitiveChunklet = null;
|
||||||
private PrimitiveExChunkletStore primitiveExChunklet = null;
|
private PrimitiveExChunkletStore primitiveExChunklet = null;
|
||||||
private PrimitiveChunkStore currentChunk;
|
private PrimitiveChunkStore currentChunk;
|
||||||
private boolean[] oldArray, newArray;
|
|
||||||
|
|
||||||
public BlockStoreConversionZDirectory() {
|
public BlockStoreConversionZDirectory() {
|
||||||
this.taskID = -1;
|
this.taskID = -1;
|
||||||
@ -130,27 +129,25 @@ public class BlockStoreConversionZDirectory implements Runnable {
|
|||||||
|
|
||||||
for (this.x = 0; this.x < 16; this.x++) {
|
for (this.x = 0; this.x < 16; this.x++) {
|
||||||
for (this.z = 0; this.z < 16; this.z++) {
|
for (this.z = 0; this.z < 16; this.z++) {
|
||||||
if (this.primitiveChunklet != null) {
|
boolean[] oldArray;
|
||||||
this.oldArray = this.primitiveChunklet.store[x][z];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.primitiveExChunklet != null) {
|
if (this.primitiveExChunklet != null) {
|
||||||
this.oldArray = this.primitiveExChunklet.store[x][z];
|
oldArray = this.primitiveExChunklet.store[x][z];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return;
|
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;
|
return;
|
||||||
}
|
}
|
||||||
else if (this.newArray.length < ((this.y * 64) + 64)) {
|
else if (newArray.length < ((this.y * 64) + 64)) {
|
||||||
return;
|
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