mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2024-11-30 04:00:50 +01:00
block & replace logics and bugfix
This commit is contained in:
parent
e141cf0f2c
commit
02f2384374
@ -2,6 +2,7 @@ package extensions.blockreplacepackets;
|
|||||||
|
|
||||||
import extensions.blockreplacepackets.rules.BlockReplaceRule;
|
import extensions.blockreplacepackets.rules.BlockReplaceRule;
|
||||||
import extensions.blockreplacepackets.rules.RuleFactory;
|
import extensions.blockreplacepackets.rules.RuleFactory;
|
||||||
|
import gearth.extensions.Extension;
|
||||||
import gearth.protocol.HMessage;
|
import gearth.protocol.HMessage;
|
||||||
import gearth.protocol.HPacket;
|
import gearth.protocol.HPacket;
|
||||||
import gearth.ui.GEarthController;
|
import gearth.ui.GEarthController;
|
||||||
@ -173,7 +174,14 @@ public class BlockAndReplacePackets extends ExtensionForm {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initExtension() {
|
protected void initExtension() {
|
||||||
intercept(HMessage.Side.TOSERVER, message -> System.out.println("just testing"));
|
Extension.MessageListener messageListener = message -> {
|
||||||
|
for (BlockReplaceRule rule : rules) {
|
||||||
|
rule.appendRuleToMessage(message);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
intercept(HMessage.Side.TOSERVER, messageListener);
|
||||||
|
intercept(HMessage.Side.TOCLIENT, messageListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -53,6 +53,7 @@ public class UiLoggerController implements Initializable {
|
|||||||
initialized = true;
|
initialized = true;
|
||||||
if (!appendLater.isEmpty()) {
|
if (!appendLater.isEmpty()) {
|
||||||
appendLog(appendLater);
|
appendLog(appendLater);
|
||||||
|
appendLater.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ public class UiLogger implements PacketLogger {
|
|||||||
for (Elem elem : appendLater) {
|
for (Elem elem : appendLater) {
|
||||||
controller.appendMessage(elem.packet, elem.types);
|
controller.appendMessage(elem.packet, elem.types);
|
||||||
}
|
}
|
||||||
|
appendLater.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
stage = new Stage();
|
stage = new Stage();
|
||||||
|
Loading…
Reference in New Issue
Block a user