Adds checkLightFor event back to WorldPatch
This commit is contained in:
parent
ff69cc8e8e
commit
580885498a
|
@ -115,16 +115,12 @@ public final class NoLagModule extends Module {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* We need to find a new optimized method to do this.
|
||||
* @param event
|
||||
*/
|
||||
// @Listener
|
||||
// public void onUpdateLighting(EventLightUpdate event) {
|
||||
// if (this.light.getValue()) {
|
||||
// event.setCanceled(true);
|
||||
// }
|
||||
// }
|
||||
@Listener
|
||||
public void onUpdateLighting(EventLightUpdate event) {
|
||||
if (this.light.getValue()) {
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
// @Listener
|
||||
// public void onRenderBlockModel(EventRenderBlockModel event) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import me.rigamortis.seppuku.api.event.world.EventSetOpaqueCube;
|
|||
import me.rigamortis.seppuku.api.module.Module;
|
||||
import me.rigamortis.seppuku.api.value.Value;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockLiquid;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
|
@ -74,9 +75,14 @@ public final class XrayModule extends Module {
|
|||
}
|
||||
|
||||
// re-render the block
|
||||
final IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState(state);
|
||||
state = state.getBlock().getExtendedState(state, event.getAccess(), pos);
|
||||
Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModel(event.getAccess(), model, state, pos, event.getBufferBuilder(), false);
|
||||
|
||||
if (state.getBlock() instanceof BlockLiquid) {
|
||||
Minecraft.getMinecraft().getBlockRendererDispatcher().fluidRenderer.renderFluid(event.getAccess(), state, pos, event.getBufferBuilder());
|
||||
} else {
|
||||
final IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState(state);
|
||||
Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModel(event.getAccess(), model, state, pos, event.getBufferBuilder(), false);
|
||||
}
|
||||
}
|
||||
|
||||
@Listener
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
package me.rigamortis.seppuku.impl.patch;
|
||||
|
||||
import me.rigamortis.seppuku.Seppuku;
|
||||
import me.rigamortis.seppuku.api.event.world.EventAddEntity;
|
||||
import me.rigamortis.seppuku.api.event.world.EventRainStrength;
|
||||
import me.rigamortis.seppuku.api.event.world.EventRemoveEntity;
|
||||
import me.rigamortis.seppuku.api.event.world.EventSpawnParticle;
|
||||
import me.rigamortis.seppuku.api.event.world.*;
|
||||
import me.rigamortis.seppuku.api.patch.ClassPatch;
|
||||
import me.rigamortis.seppuku.api.patch.MethodPatch;
|
||||
import me.rigamortis.seppuku.impl.management.PatchManager;
|
||||
|
@ -32,7 +29,6 @@ public final class WorldPatch extends ClassPatch {
|
|||
* @param methodNode
|
||||
* @param env
|
||||
*/
|
||||
/*
|
||||
@MethodPatch(
|
||||
mcpName = "checkLightFor",
|
||||
notchName = "c",
|
||||
|
@ -60,14 +56,31 @@ public final class WorldPatch extends ClassPatch {
|
|||
public static boolean checkLightForHook() {
|
||||
final EventLightUpdate event = new EventLightUpdate();
|
||||
Seppuku.INSTANCE.getEventManager().dispatchEvent(event);
|
||||
|
||||
if (Minecraft.getMinecraft().isSingleplayer()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return event.isCanceled();
|
||||
}
|
||||
*/
|
||||
|
||||
/* @MethodPatch(
|
||||
mcpName = "checkLight",
|
||||
notchName = "w",
|
||||
mcpDesc = "(Lnet/minecraft/util/math/BlockPos;)Z",
|
||||
notchDesc = "(Let;)Z")
|
||||
public void checkLight(MethodNode methodNode, PatchManager.Environment env) {
|
||||
final InsnList list = new InsnList();
|
||||
list.add(new MethodInsnNode(INVOKESTATIC, Type.getInternalName(this.getClass()), "checkLightHook", "()Z", false));
|
||||
final LabelNode jmp = new LabelNode();
|
||||
list.add(new JumpInsnNode(IFEQ, jmp));
|
||||
// by default, this function will return false if the area is not loaded or checked for light
|
||||
list.add(new InsnNode(ICONST_0));
|
||||
list.add(new InsnNode(IRETURN));
|
||||
list.add(jmp);
|
||||
methodNode.instructions.insert(list);
|
||||
}
|
||||
|
||||
public static boolean checkLightHook() {
|
||||
final EventLightUpdate event = new EventLightUpdate();
|
||||
Seppuku.INSTANCE.getEventManager().dispatchEvent(event);
|
||||
return event.isCanceled();
|
||||
}*/
|
||||
|
||||
@MethodPatch(
|
||||
mcpName = "getRainStrength",
|
||||
|
|
|
@ -123,3 +123,4 @@ public net.minecraft.network.play.client.CPacketCloseWindow field_149556_a
|
|||
public net.minecraft.client.renderer.chunk.RenderChunk field_189564_r # ChunkCache worldView, notch class: bxr
|
||||
public net.minecraft.client.renderer.RenderGlobal field_175008_n # ViewFrustum viewFrustum
|
||||
public net.minecraft.client.renderer.ViewFrustum func_178161_a(Lnet.minecraft.util.math.BlockPos;)Lnet.minecraft.client.renderer.chunk.RenderChunk; # ViewFrustum getRenderChunk
|
||||
public-f net.minecraft.client.renderer.BlockRendererDispatcher field_175025_e # BlockFluidRenderer fluidRenderer
|
||||
|
|
Loading…
Reference in New Issue