Change from using Block to BlockState in many locations

Convert Herbalism ability to use BlockState instead of Block.
Move all block checks back to BlockChecks.
Don't need this if we're using BlockState
Convert Excavation to BlockState. We don't need to return booleans here
because we never edit the block state.Switch ModCheck.getCustomBlock to use BlockState
More work on the conversion to BlockState
More conversion to BlockState
Better way to handle mining drops, I believe.
Remove useless imports.
A test of making the diff look nicer
BlockChecks diff cleanup
Herbalism diff cleanup
Gotta update the block states here.
Moar blockstate.
Little more blockState stuff.
Even more blockstate.
This commit is contained in:
NuclearW
2013-02-22 11:23:46 -05:00
parent 513a9212e4
commit d052d7a3ce
24 changed files with 994 additions and 1037 deletions

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.skills.unarmed;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.entity.Player;
import com.gmail.nossr50.config.AdvancedConfig;
@ -25,20 +25,22 @@ public class Unarmed {
public static double berserkDamageModifier = 1.5;
public static void blockCracker(Player player, Block block) {
if (SkillTools.blockBreakSimulate(block, player, false)) {
Material type = block.getType();
public static boolean blockCracker(Player player, BlockState blockState) {
if (SkillTools.blockBreakSimulate(blockState.getBlock(), player, false)) {
Material type = blockState.getType();
switch (type) {
case SMOOTH_BRICK:
if (blockCrackerSmoothBrick && block.getData() == 0x0) {
block.setData((byte) 0x2);
if (blockCrackerSmoothBrick && blockState.getRawData() == (byte) 0x0) {
blockState.setRawData((byte) 0x2);
}
return;
return true;
default:
return;
return false;
}
}
return false;
}
}