This commit is contained in:
Leijurv 2019-01-28 19:02:07 -08:00
parent 735cf47c35
commit 784b2f541d
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 41 additions and 0 deletions

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 Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Baritone. If not, see <https://www.gnu.org/licenses/>.
*/
package baritone.launch.mixins;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ChunkRenderContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.chunk.RenderChunk;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(ChunkRenderContainer.class)
public class MixinChunkRenderContainer {
@Inject(
method = "preRenderChunk",
at = @At("HEAD")
)
private void preRenderChunk(RenderChunk renderChunkIn, CallbackInfo ci) {
if (Minecraft.getMinecraft().world.getChunk(renderChunkIn.getPosition()).isEmpty()) {
GlStateManager.translate(0, Math.sin(System.currentTimeMillis() / 1000D + (renderChunkIn.getPosition().getX() + renderChunkIn.getPosition().getZ()) / 16D) * 4, 0);
}
}
}

View File

@ -13,6 +13,7 @@
"MixinChunkCache",
"MixinChunkProviderClient",
"MixinChunkProviderServer",
"MixinChunkRenderContainer",
"MixinChunkRenderWorker",
"MixinEntity",
"MixinEntityLivingBase",