Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge #468 from @sdab - railgun tweaks

  • Loading branch information...
commit b8d922ae5fb2e92e600a0ff89b9f7cfba6a17ff5 2 parents 4e8d1d4 + 6d1e874
@Cervator Cervator authored
View
11 src/main/java/org/terasology/componentSystem/action/TunnelAction.java
@@ -19,11 +19,7 @@
import org.terasology.components.actions.TunnelActionComponent;
import org.terasology.entityFactory.DroppedBlockFactory;
-import org.terasology.entitySystem.EntityManager;
-import org.terasology.entitySystem.EntityRef;
-import org.terasology.entitySystem.EventHandlerSystem;
-import org.terasology.entitySystem.ReceiveEvent;
-import org.terasology.entitySystem.RegisterComponentSystem;
+import org.terasology.entitySystem.*;
import org.terasology.events.ActivateEvent;
import org.terasology.game.CoreRegistry;
import org.terasology.math.Vector3i;
@@ -61,7 +57,7 @@ public void initialise() {
public void shutdown() {
}
- @ReceiveEvent(components = TunnelActionComponent.class)
+ @ReceiveEvent(components = TunnelActionComponent.class, priority = EventPriority.PRIORITY_HIGH)
public void onActivate(ActivateEvent event, EntityRef entity) {
Vector3f dir = new Vector3f(event.getDirection());
@@ -111,5 +107,8 @@ public void onActivate(ActivateEvent event, EntityRef entity) {
}
}
}
+ //If no blocks were destroyed, cancel the event
+ if(blockCounter == MAX_DESTROYED_BLOCKS)
+ event.cancel();
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.