Skip to content
Permalink
Browse files

Bukkit API changed, update for it.

  • Loading branch information...
me4502 committed Nov 15, 2018
1 parent cd243c2 commit 99b335015628ebfa9d54237049c2a56b3db288b1
Showing with 4 additions and 5 deletions.
  1. +4 −5 src/main/java/com/sk89q/craftbook/mechanics/Snow.java
@@ -24,7 +24,6 @@
import org.bukkit.block.BlockFace;
import org.bukkit.block.BlockState;
import org.bukkit.block.data.Bisected;
import org.bukkit.block.data.Levelled;
import org.bukkit.block.data.type.Slab;
import org.bukkit.block.data.type.Stairs;
import org.bukkit.entity.Player;
@@ -157,11 +156,11 @@ public void onPlayerMove(PlayerMoveEvent event) {
CraftBookPlayer player = CraftBookPlugin.inst().wrapPlayer(event.getPlayer());

if (event.getTo().getBlock().getType() == Material.SNOW) {
Levelled levelled = (Levelled) event.getTo().getBlock().getBlockData();
org.bukkit.block.data.type.Snow levelled = (org.bukkit.block.data.type.Snow) event.getTo().getBlock().getBlockData();
if(slowdown) {
if(levelled.getLevel() > 4)
if(levelled.getLayers() > 4)
event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 20, 2), true);
else if(levelled.getLevel() > 0)
else if(levelled.getLayers() > levelled.getMinimumLayers())
event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 20, 1), true);
}

@@ -170,7 +169,7 @@ else if(levelled.getLevel() > 0)
return;

if (CraftBookPlugin.inst().getRandom().nextInt(20) == 0) {
if (levelled.getLevel() == 0 && partialTrample)
if (levelled.getLayers() == levelled.getMinimumLayers() && partialTrample)
return;

if (!player.hasPermission("craftbook.mech.snow.trample"))

0 comments on commit 99b3350

Please sign in to comment.
You can’t perform that action at this time.