mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
Add option to prevent hopper transfers of bottles
This commit is contained in:
parent
ce6892f2e6
commit
8eb6acd60f
@ -10,6 +10,7 @@ Key:
|
|||||||
Version 1.5.01-dev
|
Version 1.5.01-dev
|
||||||
+ Added new feature to Herbalism. Instantly-regrown crops are protected from being broken for 1 second
|
+ Added new feature to Herbalism. Instantly-regrown crops are protected from being broken for 1 second
|
||||||
+ Added option to config.yml to show the /mcstats scoreboard automatically after logging in
|
+ Added option to config.yml to show the /mcstats scoreboard automatically after logging in
|
||||||
|
+ Added option to config.yml for Alchemy. Skills.Alchemy.Prevent_Hopper_Transfer_Bottles
|
||||||
+ Added support for `MATERIAL|data` format in treasures.yml
|
+ Added support for `MATERIAL|data` format in treasures.yml
|
||||||
+ Added API to experience events to get XP gain reason
|
+ Added API to experience events to get XP gain reason
|
||||||
= Fixed bug where the Updater was running on the main thread.
|
= Fixed bug where the Updater was running on the main thread.
|
||||||
@ -18,6 +19,7 @@ Version 1.5.01-dev
|
|||||||
= Fixed bug where dodge would check the wrong player skill level
|
= Fixed bug where dodge would check the wrong player skill level
|
||||||
= Fixed bug which causes /party teleport to stop working
|
= Fixed bug which causes /party teleport to stop working
|
||||||
! Vanished players no longer get hit by AoE effects
|
! Vanished players no longer get hit by AoE effects
|
||||||
|
! Changed Alchemy config option 'Prevent_Hopper_Transfer' renamed to 'Prevent_Hopper_Transfer_Ingredients'
|
||||||
|
|
||||||
Version 1.5.00
|
Version 1.5.00
|
||||||
+ Added Podzol & Red Sand to Excavation
|
+ Added Podzol & Red Sand to Excavation
|
||||||
|
@ -448,7 +448,8 @@ public class Config extends AutoUpdateConfigLoader {
|
|||||||
|
|
||||||
/* Alchemy */
|
/* Alchemy */
|
||||||
public boolean getEnabledForHoppers() { return config.getBoolean("Skills.Alchemy.Enabled_for_Hoppers", true); }
|
public boolean getEnabledForHoppers() { return config.getBoolean("Skills.Alchemy.Enabled_for_Hoppers", true); }
|
||||||
public boolean getPreventHopperTransfer() { return config.getBoolean("Skills.Alchemy.Prevent_Hopper_Transfer", false); }
|
public boolean getPreventHopperTransferIngredients() { return config.getBoolean("Skills.Alchemy.Prevent_Hopper_Transfer_Ingredients", false); }
|
||||||
|
public boolean getPreventHopperTransferBottles() { return config.getBoolean("Skills.Alchemy.Prevent_Hopper_Transfer_Bottles", false); }
|
||||||
|
|
||||||
/* Fishing */
|
/* Fishing */
|
||||||
public boolean getFishingDropsEnabled() { return config.getBoolean("Skills.Fishing.Drops_Enabled", true); }
|
public boolean getFishingDropsEnabled() { return config.getBoolean("Skills.Fishing.Drops_Enabled", true); }
|
||||||
|
@ -51,7 +51,7 @@ public class InventoryListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onInventoryOpen(InventoryOpenEvent event) {
|
public void onInventoryOpen(InventoryOpenEvent event) {
|
||||||
Block furnaceBlock = processInventoryOpenorCloseEvent(event.getInventory());
|
Block furnaceBlock = processInventoryOpenOrCloseEvent(event.getInventory());
|
||||||
|
|
||||||
if (furnaceBlock == null || furnaceBlock.hasMetadata(mcMMO.furnaceMetadataKey)) {
|
if (furnaceBlock == null || furnaceBlock.hasMetadata(mcMMO.furnaceMetadataKey)) {
|
||||||
return;
|
return;
|
||||||
@ -68,7 +68,7 @@ public class InventoryListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onInventoryClose(InventoryCloseEvent event) {
|
public void onInventoryClose(InventoryCloseEvent event) {
|
||||||
Block furnaceBlock = processInventoryOpenorCloseEvent(event.getInventory());
|
Block furnaceBlock = processInventoryOpenOrCloseEvent(event.getInventory());
|
||||||
|
|
||||||
if (furnaceBlock == null || furnaceBlock.hasMetadata(mcMMO.furnaceMetadataKey)) {
|
if (furnaceBlock == null || furnaceBlock.hasMetadata(mcMMO.furnaceMetadataKey)) {
|
||||||
return;
|
return;
|
||||||
@ -295,7 +295,12 @@ public class InventoryListener implements Listener {
|
|||||||
|
|
||||||
ItemStack item = event.getItem();
|
ItemStack item = event.getItem();
|
||||||
|
|
||||||
if (Config.getInstance().getPreventHopperTransfer() && item.getType() != Material.POTION) {
|
if (Config.getInstance().getPreventHopperTransferIngredients() && item.getType() != Material.POTION) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Config.getInstance().getPreventHopperTransferBottles() && item.getType() == Material.POTION) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -327,7 +332,7 @@ public class InventoryListener implements Listener {
|
|||||||
new PlayerUpdateInventoryTask((Player) whoClicked).runTaskLater(plugin, 0);
|
new PlayerUpdateInventoryTask((Player) whoClicked).runTaskLater(plugin, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Block processInventoryOpenorCloseEvent(Inventory inventory) {
|
private Block processInventoryOpenOrCloseEvent(Inventory inventory) {
|
||||||
if (!(inventory instanceof FurnaceInventory)) {
|
if (!(inventory instanceof FurnaceInventory)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -277,7 +277,9 @@ Skills:
|
|||||||
# Allow Hoppers to transfer ingredients and brew Rank 1 Alchemy potions
|
# Allow Hoppers to transfer ingredients and brew Rank 1 Alchemy potions
|
||||||
Enabled_for_Hoppers: true
|
Enabled_for_Hoppers: true
|
||||||
# Prevent Hoppers from transferring ingredients into Brewing Stands
|
# Prevent Hoppers from transferring ingredients into Brewing Stands
|
||||||
Prevent_Hopper_Transfer: false
|
Prevent_Hopper_Transfer_Ingredients: false
|
||||||
|
# Prevent Hoppers from transferring bottles into Brewing Stands
|
||||||
|
Prevent_Hopper_Transfer_Bottles: false
|
||||||
Level_Cap: 0
|
Level_Cap: 0
|
||||||
Archery:
|
Archery:
|
||||||
Enabled_For_PVP: true
|
Enabled_For_PVP: true
|
||||||
|
Loading…
Reference in New Issue
Block a user