Skip to content
Permalink
Browse files

Fixed a few places using getData that Spigot has broken

  • Loading branch information...
me4502 committed May 30, 2019
1 parent 9f413c8 commit ab3974fdf2768af4f4e64548fc4a324df5d5d3e1
@@ -269,11 +269,14 @@ public void run () {
Bukkit.getScheduler().runTaskLater(CraftBookPlugin.inst(), new SnowHandler(highest, 1), animationTicks);
}
} else if (meltMode) {
if (highest.getType() == Material.SNOW && meltPartial)
if (highest.getData() == 0)
if (highest.getType() == Material.SNOW && meltPartial) {
if (((org.bukkit.block.data.type.Snow) highest.getBlockData()).getLayers() == 0) {
return;
if (highest.getTemperature() > 0.05)
}
}
if (highest.getTemperature() > 0.05) {
Bukkit.getScheduler().runTaskLater(CraftBookPlugin.inst(), new SnowHandler(highest, -1), animationTicks);
}
}
}

@@ -66,7 +66,7 @@
*/
public class Gate extends AbstractCraftBookMechanic {

/**
/**get
* Toggles the gate closest to a location.
*
* @param player The player
@@ -25,17 +25,17 @@
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.BlockState;
import org.bukkit.block.Dropper;
import org.bukkit.block.Furnace;
import org.bukkit.block.Jukebox;
import org.bukkit.block.data.BlockData;
import org.bukkit.block.data.Directional;
import org.bukkit.block.data.type.Piston;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.SignChangeEvent;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.material.Directional;
import org.bukkit.util.Vector;

import java.util.ArrayList;
@@ -103,13 +103,13 @@ private static boolean isPiston(Block block) {
}

private static ChangedSign getSignOnPiston(Block block) {
BlockState state = block.getState();
BlockData blockData = block.getBlockData();
BlockFace facing = BlockFace.SELF;
if(state.getData() instanceof Directional)
facing = ((Directional) state.getData()).getFacing();
if(blockData instanceof Directional) {
facing = ((Directional) blockData).getFacing();
}

for(BlockFace face : LocationUtil.getDirectFaces()) {

if(face == facing || !SignUtil.isSign(block.getRelative(face)))
continue;
if(block.getRelative(face).getType() != Material.SIGN && (face == BlockFace.UP || face == BlockFace.DOWN))
@@ -526,10 +526,8 @@ public static ItemStack getSmeletedResult(ItemStack item) {
return new ItemStack(Material.QUARTZ);
case STONE_BRICKS:
return new ItemStack(Material.CRACKED_STONE_BRICKS);
case SPONGE:
if (item.getData().getData() == 0)
return null;
else return new ItemStack(Material.SPONGE);
case WET_SPONGE:
return new ItemStack(Material.SPONGE);
case WHITE_TERRACOTTA:
return new ItemStack(Material.WHITE_GLAZED_TERRACOTTA);
case ORANGE_TERRACOTTA:
@@ -598,8 +596,6 @@ public static ItemStack getSmeletedResult(ItemStack item) {

public static Material getWoolFromColour(DyeColor color) {
switch (color) {
case WHITE:
return Material.WHITE_WOOL;
case ORANGE:
return Material.ORANGE_WOOL;
case MAGENTA:
@@ -637,8 +633,6 @@ public static Material getWoolFromColour(DyeColor color) {

public static Material getBoatFromTree(TreeSpecies treeSpecies) {
switch (treeSpecies) {
case GENERIC:
return Material.OAK_BOAT;
case REDWOOD:
return Material.SPRUCE_BOAT;
case BIRCH:

0 comments on commit ab3974f

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