mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-19 03:39:09 +00:00
Merge branch 'dev' into 4.2
This commit is contained in:
commit
22258c2dac
2 files changed
+21
-8
No files matched your search
@@ -10,13 +10,14 @@
|
||||
******************************************************************************/
|
||||
package forestry.core;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.RenderGlobal;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent;
|
||||
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.utils.GeneticsUtil;
|
||||
|
||||
public class TickHandlerCoreClient {
|
||||
@@ -24,18 +25,30 @@ public class TickHandlerCoreClient {
|
||||
private boolean hasNaturalistEye;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerTick(PlayerTickEvent event) {
|
||||
public void onClientTick(TickEvent.ClientTickEvent event) {
|
||||
if (event.phase != Phase.END) {
|
||||
return;
|
||||
}
|
||||
|
||||
EntityPlayer player = event.player;
|
||||
Minecraft minecraft = Minecraft.getMinecraft();
|
||||
if (minecraft == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
EntityPlayer player = minecraft.thePlayer;
|
||||
if (player == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean hasNaturalistEye = GeneticsUtil.hasNaturalistEye(player);
|
||||
if (this.hasNaturalistEye != hasNaturalistEye) {
|
||||
this.hasNaturalistEye = hasNaturalistEye;
|
||||
Proxies.common.getClientInstance().renderGlobal.markBlockRangeForRenderUpdate(
|
||||
(int) player.posX - 32, (int) player.posY - 32, (int) player.posZ - 32,
|
||||
(int) player.posX + 32, (int) player.posY + 32, (int) player.posZ + 32);
|
||||
RenderGlobal renderGlobal = minecraft.renderGlobal;
|
||||
if (renderGlobal != null) {
|
||||
renderGlobal.markBlockRangeForRenderUpdate(
|
||||
(int) player.posX - 32, (int) player.posY - 32, (int) player.posZ - 32,
|
||||
(int) player.posX + 32, (int) player.posY + 32, (int) player.posZ + 32);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user