literally disable the entire thing

This commit is contained in:
Leijurv 2019-02-06 21:00:53 -08:00
parent aa8773a67e
commit b484e6fa3f
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
3 changed files with 23 additions and 0 deletions

View File

@ -378,6 +378,13 @@ public final class Settings {
*/
public final Setting<Boolean> pruneRegionsFromRAM = new Setting<>(false);
/**
* Remember the contents of containers (chests, echests, furnaces)
* <p>
* Really buggy since the packet stuff is multithreaded badly thanks to brady
*/
public final Setting<Boolean> containerMemory = new Setting<>(false);
/**
* Print all the debug messages to chat
*/

View File

@ -65,6 +65,9 @@ public final class MemoryBehavior extends Behavior {
@Override
public synchronized void onTick(TickEvent event) {
if (!Baritone.settings().containerMemory.get()) {
return;
}
if (event.getType() == TickEvent.Type.OUT) {
enderChestWindowId = null;
futureInventories.clear();
@ -80,6 +83,9 @@ public final class MemoryBehavior extends Behavior {
@Override
public synchronized void onSendPacket(PacketEvent event) {
if (!Baritone.settings().containerMemory.get()) {
return;
}
Packet p = event.getPacket();
if (event.getState() == EventState.PRE) {
@ -116,6 +122,9 @@ public final class MemoryBehavior extends Behavior {
@Override
public synchronized void onReceivePacket(PacketEvent event) {
if (!Baritone.settings().containerMemory.get()) {
return;
}
Packet p = event.getPacket();
if (event.getState() == EventState.PRE) {
@ -162,6 +171,9 @@ public final class MemoryBehavior extends Behavior {
private void updateInventory() {
if (!Baritone.settings().containerMemory.get()) {
return;
}
int windowId = ctx.player().openContainer.windowId;
if (enderChestWindowId != null) {
if (windowId == enderChestWindowId) {

View File

@ -17,6 +17,7 @@
package baritone.cache;
import baritone.Baritone;
import baritone.api.cache.IContainerMemory;
import baritone.api.cache.IRememberedInventory;
import baritone.api.utils.IPlayerContext;
@ -69,6 +70,9 @@ public class ContainerMemory implements IContainerMemory {
}
public synchronized void save() throws IOException {
if (!Baritone.settings().containerMemory.get()) {
return;
}
ByteBuf buf = Unpooled.buffer(0, Integer.MAX_VALUE);
PacketBuffer out = new PacketBuffer(buf);
out.writeInt(inventories.size());