Prevent chests from losing items.
import org.terasology.network.NetworkComponent;
import org.terasology.physics.components.RigidBodyComponent;
import org.terasology.registry.In;
+import org.terasology.rendering.logic.MeshComponent;
import org.terasology.rendering.world.WorldRenderer;
@RegisterSystem(RegisterMode.CLIENT)
@@ -155,11 +156,9 @@ private void linkHeldItemLocationForLocalPlayer(EntityRef newItem, EntityRef old
if (mountPointComponent != null) {
if (clientHeldItem.exists()) {
- clientHeldItem.destroy();
- clientHeldItem = EntityRef.NULL;
+ clientHeldItem.removeComponent(MeshComponent.class);
}
-
// remove the location from the old item
if (oldItem != null && oldItem.exists()) {
oldItem.removeComponent(ItemIsHeldComponent.class);
