mcMMO/src/main/java/com/gmail/nossr50/runnables/GreenThumbTimer.java

44 lines
1.4 KiB
Java
Raw Normal View History

package com.gmail.nossr50.runnables;
import org.bukkit.CropState;
import org.bukkit.Material;
import org.bukkit.block.Block;
import com.gmail.nossr50.datatypes.AbilityType;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
public class GreenThumbTimer implements Runnable {
private Block block;
2012-07-03 16:04:04 +02:00
private PlayerProfile profile;
2012-07-03 16:04:04 +02:00
public GreenThumbTimer(Block block, PlayerProfile profile) {
this.block = block;
2012-07-03 16:04:04 +02:00
this.profile = profile;
}
@Override
public void run() {
block.setType(Material.CROPS);
//This replants the wheat at a certain stage in development based on Herbalism Skill
2012-07-03 16:04:04 +02:00
if (!profile.getAbilityMode(AbilityType.GREEN_TERRA)) {
if (profile.getSkillLevel(SkillType.HERBALISM) >= 600) {
block.setData(CropState.MEDIUM.getData());
}
2012-07-03 16:04:04 +02:00
else if (profile.getSkillLevel(SkillType.HERBALISM) >= 400) {
block.setData(CropState.SMALL.getData());
}
2012-07-03 16:04:04 +02:00
else if (profile.getSkillLevel(SkillType.HERBALISM) >= 200) {
block.setData(CropState.VERY_SMALL.getData());
}
else {
block.setData(CropState.GERMINATED.getData());
}
}
else {
block.setData(CropState.MEDIUM.getData());
}
}
}