mirror of
https://github.com/DieReicheErethons/Brewery.git
synced 2024-11-15 10:25:15 +01:00
patch #541, bump version
This commit is contained in:
parent
5c2acaa70e
commit
457a4ec1f3
2
pom.xml
2
pom.xml
@ -4,7 +4,7 @@
|
||||
|
||||
<groupId>com.dre</groupId>
|
||||
<artifactId>Brewery</artifactId>
|
||||
<version>3.1.3</version>
|
||||
<version>3.1.4</version>
|
||||
<name>Brewery</name>
|
||||
|
||||
<properties>
|
||||
|
@ -384,7 +384,7 @@ public class BCauldron {
|
||||
Block clickedBlock = event.getClickedBlock();
|
||||
assert clickedBlock != null;
|
||||
|
||||
if (materialInHand == null || materialInHand == Material.AIR || materialInHand == Material.BUCKET) {
|
||||
if (materialInHand == Material.AIR || materialInHand == Material.BUCKET) {
|
||||
return;
|
||||
|
||||
} else if (materialInHand == LegacyUtil.CLOCK) {
|
||||
|
@ -2,14 +2,19 @@ package com.dre.brewery.listeners;
|
||||
|
||||
import com.dre.brewery.BCauldron;
|
||||
import com.dre.brewery.utility.LegacyUtil;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.data.Levelled;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockPistonExtendEvent;
|
||||
import org.bukkit.event.block.CauldronLevelChangeEvent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CauldronListener implements Listener {
|
||||
|
||||
/**
|
||||
@ -36,8 +41,9 @@ public class CauldronListener implements Listener {
|
||||
}
|
||||
} else { // newType == Material.WATER_CAULDRON
|
||||
// Water level change
|
||||
Levelled oldCauldron = ((Levelled) event.getBlock().getBlockData());
|
||||
Levelled newCauldron = ((Levelled) newState.getBlockData());
|
||||
|
||||
Levelled oldCauldron = (Levelled) event.getBlock().getBlockData();
|
||||
Levelled newCauldron = (Levelled) newState.getBlockData();
|
||||
|
||||
// Water Level increased somehow, might be Bucket, Bottle, Rain, etc.
|
||||
if (newCauldron.getLevel() > oldCauldron.getLevel()) {
|
||||
@ -47,6 +53,17 @@ public class CauldronListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
/* PATCH - "My friend found a way to dupe brews #541" https://github.com/DieReicheErethons/Brewery/issues/541
|
||||
* Check if piston is pushing a BreweryCauldron and remove it
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onPistonExtend(BlockPistonExtendEvent event) {
|
||||
for (Block block : event.getBlocks()) {
|
||||
if (BCauldron.bcauldrons.containsKey(block)) {
|
||||
BCauldron.remove(block);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void oldCauldronChange(CauldronLevelChangeEvent event) {
|
||||
|
Loading…
Reference in New Issue
Block a user