Fix wrong tile entities being destroyed by replaceMaterial