diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/utils/cursor/RCursor.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/utils/cursor/RCursor.java index f4ec7cd0..c9de7cab 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/utils/cursor/RCursor.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/utils/cursor/RCursor.java @@ -44,7 +44,8 @@ public class RCursor { RayTraceUtils.RRayTraceResult rayTraceResult = RayTraceUtils.traceREntity(owner, owner.getLocation(), targetServer.getEntities()); if (rayTraceResult == null) { - cursorEntity.die(); + if(cursorEntity != null) cursorEntity.die(); + cursorEntity = null; return; } @@ -58,12 +59,15 @@ public class RCursor { if (cursorEntity == null) { cursorEntity = new RFallingBlockEntity(targetServer, activeCursorLocation, activeCursorMaterial); cursorEntity.setNoGravity(true); - } else if (cursorEntity.getMaterial() == activeCursorMaterial) { + } if (cursorEntity.getMaterial() == activeCursorMaterial) { cursorEntity.move(activeCursorLocation); } else { cursorEntity.die(); cursorEntity = new RFallingBlockEntity(targetServer, activeCursorLocation, activeCursorMaterial); cursorEntity.setNoGravity(true); + if(activeCursorMaterial == highlightMaterial) { + cursorEntity.setGlowing(true); + } } } @@ -71,6 +75,7 @@ public class RCursor { visible = false; if (cursorEntity != null) { cursorEntity.die(); + cursorEntity = null; } }