mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-04 02:53:43 +01:00 
			
		
		
		
	Merge pull request #252 from mcunha/master
Fix ore dupe bug with ore blocks on pistons
This commit is contained in:
		@@ -58,13 +58,17 @@ public class BlockListener implements Listener {
 | 
			
		||||
    public void onBlockPistonExtend(BlockPistonExtendEvent event) {
 | 
			
		||||
        List<Block> blocks = event.getBlocks();
 | 
			
		||||
        BlockFace direction = event.getDirection();
 | 
			
		||||
        // Block that would be air after piston is finished
 | 
			
		||||
        Block futureEmptyBlock = event.getBlock().getRelative(direction);
 | 
			
		||||
 | 
			
		||||
        for (Block b : blocks) {
 | 
			
		||||
            if (mcMMO.placeStore.isTrue(b)) {
 | 
			
		||||
                b.getRelative(direction).setMetadata("pistonTrack", new FixedMetadataValue(plugin, true));
 | 
			
		||||
                if (b.equals(futureEmptyBlock)) {
 | 
			
		||||
                    mcMMO.placeStore.setFalse(b);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        for (Block b : blocks) {
 | 
			
		||||
            if (b.getRelative(direction).hasMetadata("pistonTrack")) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user