mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-11-04 03:03:43 +01:00 
			
		
		
		
	Compare commits
	
		
			1 Commits
		
	
	
		
			fix/4639
			...
			feature/v6
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					d1aeef85d4 | 
@@ -282,7 +282,7 @@ public class BukkitQueueCoordinator extends BasicQueueCoordinator {
 | 
				
			|||||||
                CompoundTag tag = block.getNbtData();
 | 
					                CompoundTag tag = block.getNbtData();
 | 
				
			||||||
                StateWrapper sw = new StateWrapper(tag);
 | 
					                StateWrapper sw = new StateWrapper(tag);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                sw.restoreTag(getWorld().getName(), existing.getX(), existing.getY(), existing.getZ());
 | 
					                sw.restoreTag(existing);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -44,6 +44,7 @@ import org.bukkit.enchantments.Enchantment;
 | 
				
			|||||||
import org.bukkit.inventory.Inventory;
 | 
					import org.bukkit.inventory.Inventory;
 | 
				
			||||||
import org.bukkit.inventory.InventoryHolder;
 | 
					import org.bukkit.inventory.InventoryHolder;
 | 
				
			||||||
import org.bukkit.inventory.ItemStack;
 | 
					import org.bukkit.inventory.ItemStack;
 | 
				
			||||||
 | 
					import org.checkerframework.checker.nullness.qual.NonNull;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import java.util.ArrayList;
 | 
					import java.util.ArrayList;
 | 
				
			||||||
import java.util.HashMap;
 | 
					import java.util.HashMap;
 | 
				
			||||||
@@ -166,14 +167,32 @@ public class StateWrapper {
 | 
				
			|||||||
        return str;
 | 
					        return str;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @SuppressWarnings("deprecation") // #setLine is needed for Spigot compatibility
 | 
					    /**
 | 
				
			||||||
 | 
					     * Restore the TileEntity data to the given world at the given coordinates.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @param worldName World name
 | 
				
			||||||
 | 
					     * @param x         x position
 | 
				
			||||||
 | 
					     * @param y         y position
 | 
				
			||||||
 | 
					     * @param z         z position
 | 
				
			||||||
 | 
					     * @return true if successful
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
    public boolean restoreTag(String worldName, int x, int y, int z) {
 | 
					    public boolean restoreTag(String worldName, int x, int y, int z) {
 | 
				
			||||||
        if (this.tag == null) {
 | 
					        World world = BukkitUtil.getWorld(worldName);
 | 
				
			||||||
 | 
					        if (world == null) {
 | 
				
			||||||
            return false;
 | 
					            return false;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        World world = BukkitUtil.getWorld(worldName);
 | 
					        return restoreTag(world.getBlockAt(x, y, z));
 | 
				
			||||||
        Block block = world.getBlockAt(x, y, z);
 | 
					    }
 | 
				
			||||||
        if (block == null) {
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Restore the TileEntity data to the given block
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @param block Block to restore to
 | 
				
			||||||
 | 
					     * @return true if successful
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    @SuppressWarnings("deprecation") // #setLine is needed for Spigot compatibility
 | 
				
			||||||
 | 
					    public boolean restoreTag(@NonNull Block block) {
 | 
				
			||||||
 | 
					        if (this.tag == null) {
 | 
				
			||||||
            return false;
 | 
					            return false;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        org.bukkit.block.BlockState state = block.getState();
 | 
					        org.bukkit.block.BlockState state = block.getState();
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user