@@ -71,30 +71,30 @@ public void setBlock(int x, int y, int z, Block block) {
71
71
this .chunkData .setBlock (x , y , z , bukkitBlock .getBlockData ());
72
72
73
73
if (bukkitBlock .getMaterial ().equals (org .bukkit .Material .SPAWNER )) {
74
- // CraftBlock craftBlock = ((CraftBlock) world.getBlockAt(x, y, z));
75
- // world.getBlockAt(x, y, z).getState().update();
76
- org .bukkit .block .Block bblock = world .getBlockAt (x , y , z );
77
- bblock .getState ().setType (org .bukkit .Material .SPAWNER );
78
- bblock .getState ().update (true , true );
79
- CraftBlock craftBlock = (CraftBlock ) bblock ;
80
- CraftBlockState blockState = (CraftBlockState ) craftBlock .getState ();
81
-
82
-
83
- Underilla .getInstance ().getLogger ()
84
- .info ("setBlock: Spawner block detected at " + x + ", " + y + ", " + z + " with class " + bblock .getClass ()
85
- + ", material " + bblock .getType () + ", state " + bblock .getState () + ", blockData " + bblock .getBlockData ()
86
- + ", blockData class " + bblock .getBlockData ().getClass () + ", blockData material "
87
- + bblock .getBlockData ().getMaterial () + ", blockData class " + bblock .getBlockData ().getClass ());
88
- // CreatureSpawner creatureSpawner = new CraftCreatureSpawner(world,
89
- // new SpawnerBlockEntity(craftBlock.getPosition(), craftBlock.getState()));
90
- // creatureSpawner.
91
-
92
- // TODO it's not a CreatureSpawner, it's stay at the previous block type (Deepslate, mostly).
93
- if (bblock .getState () instanceof CreatureSpawner creatureSpawner ) {
94
- creatureSpawner .setSpawnedType (bukkitBlock .getSpawnedType ().orElse (org .bukkit .entity .EntityType .ZOMBIE ));
95
- // creatureSpawner.update();
96
- Underilla .getInstance ().getLogger ().info ("setBlock: Spawner type set to " + creatureSpawner .getSpawnedType ());
97
- }
74
+ // // CraftBlock craftBlock = ((CraftBlock) world.getBlockAt(x, y, z));
75
+ // // world.getBlockAt(x, y, z).getState().update();
76
+ // org.bukkit.block.Block bblock = world.getBlockAt(x, y, z);
77
+ // bblock.getState().setType(org.bukkit.Material.SPAWNER);
78
+ // bblock.getState().update(true, true);
79
+ // CraftBlock craftBlock = (CraftBlock) bblock;
80
+ // CraftBlockState blockState = (CraftBlockState) craftBlock.getState();
81
+
82
+
83
+ // Underilla.getInstance().getLogger()
84
+ // .info("setBlock: Spawner block detected at " + x + ", " + y + ", " + z + " with class " + bblock.getClass()
85
+ // + ", material " + bblock.getType() + ", state " + bblock.getState() + ", blockData " + bblock.getBlockData()
86
+ // + ", blockData class " + bblock.getBlockData().getClass() + ", blockData material "
87
+ // + bblock.getBlockData().getMaterial() + ", blockData class " + bblock.getBlockData().getClass());
88
+ // // CreatureSpawner creatureSpawner = new CraftCreatureSpawner(world,
89
+ // // new SpawnerBlockEntity(craftBlock.getPosition(), craftBlock.getState()));
90
+ // // creatureSpawner.
91
+
92
+ // // TODO it's not a CreatureSpawner, it's stay at the previous block type (Deepslate, mostly).
93
+ // if (bblock.getState() instanceof CreatureSpawner creatureSpawner) {
94
+ // creatureSpawner.setSpawnedType(bukkitBlock.getSpawnedType().orElse(org.bukkit.entity.EntityType.ZOMBIE));
95
+ // // creatureSpawner.update();
96
+ // Underilla.getInstance().getLogger().info("setBlock: Spawner type set to " + creatureSpawner.getSpawnedType());
97
+ // }
98
98
}
99
99
100
100
}
0 commit comments