Read from MessageBlocks/Builds (#10981)

* Added ability to read content of messages and sensing the length of the content.

Also some bundle changes for read/write

* this commit will make mindustry unable to compile trust

* oop missed a space
This commit is contained in:
1ue999
2025-07-03 19:25:22 +02:00
committed by GitHub
parent 835c8b4a6c
commit 0852a61caa
3 changed files with 14 additions and 3 deletions

View File

@@ -14,6 +14,7 @@ import arc.util.io.*;
import arc.util.pooling.*;
import mindustry.core.*;
import mindustry.gen.*;
import mindustry.logic.*;
import mindustry.ui.*;
import mindustry.ui.dialogs.*;
import mindustry.world.*;
@@ -165,6 +166,14 @@ public class MessageBlock extends Block{
return !accessible() ? SystemCursor.arrow : super.getCursor();
}
@Override
public double sense(LAccess sensor){
return switch(sensor){
case bufferUsage -> message.length();
default -> super.sense(sensor);
};
}
@Override
public void damage(float damage){
if(privileged) return;