Fully separate dependency on launch package from other packages

This commit is contained in:
Brady 2018-09-04 17:18:30 -05:00
parent 4f07d655d6
commit 8c9bb85d4b
No known key found for this signature in database
GPG Key ID: 73A788379A197567
6 changed files with 90 additions and 19 deletions

View File

@ -18,8 +18,8 @@
package baritone.chunk; package baritone.chunk;
import baritone.Baritone; import baritone.Baritone;
import baritone.launch.mixins.accessor.IAnvilChunkLoader; import baritone.utils.accessor.IAnvilChunkLoader;
import baritone.launch.mixins.accessor.IChunkProviderServer; import baritone.utils.accessor.IChunkProviderServer;
import baritone.utils.Helper; import baritone.utils.Helper;
import net.minecraft.client.multiplayer.WorldClient; import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.server.integrated.IntegratedServer; import net.minecraft.server.integrated.IntegratedServer;

View File

@ -0,0 +1,41 @@
/*
* This file is part of Baritone.
*
* Baritone is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Baritone is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Baritone. If not, see <https://www.gnu.org/licenses/>.
*/
package baritone.launch.mixins;
import baritone.utils.accessor.IAnvilChunkLoader;
import net.minecraft.world.chunk.storage.AnvilChunkLoader;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import java.io.File;
/**
* @author Brady
* @since 9/4/2018
*/
@Mixin(AnvilChunkLoader.class)
public class MixinAnvilChunkLoader implements IAnvilChunkLoader {
@Shadow @Final private File chunkSaveLocation;
@Override
public File getChunkSaveLocation() {
return this.chunkSaveLocation;
}
}

View File

@ -0,0 +1,40 @@
/*
* This file is part of Baritone.
*
* Baritone is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Baritone is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Baritone. If not, see <https://www.gnu.org/licenses/>.
*/
package baritone.launch.mixins;
import baritone.utils.accessor.IChunkProviderServer;
import net.minecraft.world.chunk.storage.IChunkLoader;
import net.minecraft.world.gen.ChunkProviderServer;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
/**
* @author Brady
* @since 9/4/2018
*/
@Mixin(ChunkProviderServer.class)
public class MixinChunkProviderServer implements IChunkProviderServer {
@Shadow @Final private IChunkLoader chunkLoader;
@Override
public IChunkLoader getChunkLoader() {
return this.chunkLoader;
}
}

View File

@ -15,11 +15,7 @@
* along with Baritone. If not, see <https://www.gnu.org/licenses/>. * along with Baritone. If not, see <https://www.gnu.org/licenses/>.
*/ */
package baritone.launch.mixins.accessor; package baritone.utils.accessor;
import net.minecraft.world.chunk.storage.AnvilChunkLoader;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
import java.io.File; import java.io.File;
@ -27,8 +23,7 @@ import java.io.File;
* @author Brady * @author Brady
* @since 8/4/2018 11:36 AM * @since 8/4/2018 11:36 AM
*/ */
@Mixin(AnvilChunkLoader.class)
public interface IAnvilChunkLoader { public interface IAnvilChunkLoader {
@Accessor File getChunkSaveLocation(); File getChunkSaveLocation();
} }

View File

@ -15,19 +15,15 @@
* along with Baritone. If not, see <https://www.gnu.org/licenses/>. * along with Baritone. If not, see <https://www.gnu.org/licenses/>.
*/ */
package baritone.launch.mixins.accessor; package baritone.utils.accessor;
import net.minecraft.world.chunk.storage.IChunkLoader; import net.minecraft.world.chunk.storage.IChunkLoader;
import net.minecraft.world.gen.ChunkProviderServer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
/** /**
* @author Brady * @author Brady
* @since 8/4/2018 11:33 AM * @since 8/4/2018 11:33 AM
*/ */
@Mixin(ChunkProviderServer.class)
public interface IChunkProviderServer { public interface IChunkProviderServer {
@Accessor IChunkLoader getChunkLoader(); IChunkLoader getChunkLoader();
} }

View File

@ -8,7 +8,9 @@
"maxShiftBy": 2 "maxShiftBy": 2
}, },
"client": [ "client": [
"MixinAnvilChunkLoader",
"MixinBlockPos", "MixinBlockPos",
"MixinChunkProviderServer",
"MixinEntity", "MixinEntity",
"MixinEntityPlayerSP", "MixinEntityPlayerSP",
"MixinEntityRenderer", "MixinEntityRenderer",
@ -20,9 +22,6 @@
"MixinMinecraft", "MixinMinecraft",
"MixinNetHandlerPlayClient", "MixinNetHandlerPlayClient",
"MixinNetworkManager", "MixinNetworkManager",
"MixinWorldClient", "MixinWorldClient"
"accessor.IAnvilChunkLoader",
"accessor.IChunkProviderServer"
] ]
} }