mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 23:26:45 +01:00
Squashed commit of the following:
commit ba0ba3d2881dc672ef3dc40010278a0fbe158436 Author: NuclearW <incongruency@gmail.com> Date: Fri Mar 8 16:27:19 2013 -0500 Line endings, yo commitb93f0f54f5
Author: md-5 <md_5@live.com.au> Date: Sat Mar 9 08:18:49 2013 +1100 Use correct state, not block refrence to fix compile. commit1063ad5c68
Author: md-5 <md_5@live.com.au> Date: Sat Mar 9 08:12:34 2013 +1100 Fix errors in furnace listener. Bad GJ!
This commit is contained in:
parent
a07f14e326
commit
0b53f8266a
@ -94,7 +94,7 @@ public class InventoryListener implements Listener {
|
|||||||
BlockState furnaceState = furnaceBlock.getState();
|
BlockState furnaceState = furnaceBlock.getState();
|
||||||
|
|
||||||
if (furnaceState instanceof Furnace) {
|
if (furnaceState instanceof Furnace) {
|
||||||
ItemStack smelting = ((Furnace) furnaceBlock).getInventory().getSmelting();
|
ItemStack smelting = ((Furnace) furnaceState).getInventory().getSmelting();
|
||||||
|
|
||||||
if (furnaceBlock.hasMetadata(mcMMO.furnaceMetadataKey) && smelting != null && ItemUtils.isSmeltable(smelting)) {
|
if (furnaceBlock.hasMetadata(mcMMO.furnaceMetadataKey) && smelting != null && ItemUtils.isSmeltable(smelting)) {
|
||||||
// We can make this assumption because we (should) be the only ones using this exact metadata
|
// We can make this assumption because we (should) be the only ones using this exact metadata
|
||||||
@ -115,7 +115,7 @@ public class InventoryListener implements Listener {
|
|||||||
BlockState furnaceState = furnaceBlock.getState();
|
BlockState furnaceState = furnaceBlock.getState();
|
||||||
|
|
||||||
if (furnaceState instanceof Furnace) {
|
if (furnaceState instanceof Furnace) {
|
||||||
ItemStack smelting = ((Furnace) furnaceBlock).getInventory().getSmelting();
|
ItemStack smelting = ((Furnace) furnaceState).getInventory().getSmelting();
|
||||||
|
|
||||||
if (furnaceBlock.hasMetadata(mcMMO.furnaceMetadataKey) && smelting != null && ItemUtils.isSmeltable(smelting)) {
|
if (furnaceBlock.hasMetadata(mcMMO.furnaceMetadataKey) && smelting != null && ItemUtils.isSmeltable(smelting)) {
|
||||||
// We can make this assumption because we (should) be the only ones using this exact metadata
|
// We can make this assumption because we (should) be the only ones using this exact metadata
|
||||||
@ -132,14 +132,14 @@ public class InventoryListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void onFurnaceExtractEvent(FurnaceExtractEvent event) {
|
public void onFurnaceExtractEvent(FurnaceExtractEvent event) {
|
||||||
BlockState furnaceBlock = event.getBlock().getState();
|
BlockState furnaceState = event.getBlock().getState();
|
||||||
|
|
||||||
if (furnaceBlock instanceof Furnace) {
|
if (furnaceState instanceof Furnace) {
|
||||||
ItemStack result = ((Furnace) furnaceBlock).getInventory().getResult();
|
ItemStack result = ((Furnace) furnaceState).getInventory().getResult();
|
||||||
|
|
||||||
if (furnaceBlock.hasMetadata(mcMMO.furnaceMetadataKey) && result != null && ItemUtils.isSmelted(result)) {
|
if (furnaceState.hasMetadata(mcMMO.furnaceMetadataKey) && result != null && ItemUtils.isSmelted(result)) {
|
||||||
// We can make this assumption because we (should) be the only ones using this exact metadata
|
// We can make this assumption because we (should) be the only ones using this exact metadata
|
||||||
Player player = plugin.getServer().getPlayer(furnaceBlock.getMetadata(mcMMO.furnaceMetadataKey).get(0).asString());
|
Player player = plugin.getServer().getPlayer(furnaceState.getMetadata(mcMMO.furnaceMetadataKey).get(0).asString());
|
||||||
|
|
||||||
SmeltingManager smeltingManager = UserManager.getPlayer(player).getSmeltingManager();
|
SmeltingManager smeltingManager = UserManager.getPlayer(player).getSmeltingManager();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user