[SPIGOT-779] Block#setType not working for pressure plate Created: 07/Apr/15  Updated: 09/Apr/15  Resolved: 09/Apr/15

Status: Closed
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Mr Sugar Caney Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: 1.8, Craftbukkit, spigot
Environment:

spigot-1.8.3 and craftbukkit-1.8.3. Run on laptop (windows 7). Intel i5 4GB ram. Running Java 8 update 25. Started with "java -jar xxx-1.8.3.jar".


Attachments: PNG File 2015-04-08_00.09.56.png    

 Description   

When I try to change the material of a block, blocks with Material.STONE_PLATE do not get updated. Other blocks work just fine, however I can't get the pressure plates replaced.

The code I used (in PlayerInteractEvent: p=player):

Block b = e.getClickedBlock();
Location blockLocation = b.getLocation();
for (int x = -1; x <= 1; x++) {
    for (int z = -1; z <= 1; z++) {
        Location loc = new Location(b.getWorld(), b.getX() + x, 
                p.getLocation().getY(), p.getLocation().getZ() + z);
        //if (loc.getBlock().getType() == Material.STONE_PLATE) {							        
                loc.getBlock().setType(Material.GLOWING_REDSTONE_ORE);
        //}
    }
}

(Complete source of CrystalQuest: https://github.com/MrSugarCaney/CrystalQuest
ItemListener class: https://github.com/MrSugarCaney/CrystalQuest/blob/master/src/nl/SugCube/CrystalQuest/Items/ItemListener.java)



 Comments   
Comment by md_5 [ 09/Apr/15 ]

Cannot reproduce.

Code:
event.getClickedBlock().setType(Material.GLOWING_REDSTONE_ORE);

Comment by SpigotMC [ 07/Apr/15 ]

Your build is not the latest and therefore may be the reason you are having this issue. Spigot is 0 version(s) behind. CraftBukkit is 2942 version(s) behind. This message was automatically generated and is not guaranteed to be a solution to your issue.

Generated at Mon Apr 07 22:29:22 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.