EntityRenderer, most of RenderGlobal, minor fix to LayerBipedArmor.
This commit is contained in:
parent
153fb6b30d
commit
d35c38d261
|
@ -8,16 +8,41 @@
|
|||
}
|
||||
}
|
||||
|
||||
@@ -398,7 +399,7 @@
|
||||
|
||||
if (d3 < d2 || d2 == 0.0D)
|
||||
{
|
||||
- if (entity1.func_184208_bv() == entity.func_184208_bv())
|
||||
+ if (entity1.func_184208_bv() == entity.func_184208_bv() && !entity.canRiderInteract())
|
||||
{
|
||||
if (d2 == 0.0D)
|
||||
{
|
||||
@@ -491,7 +492,7 @@
|
||||
f = f * 60.0F / 70.0F;
|
||||
}
|
||||
|
||||
- return f;
|
||||
+ return net.minecraftforge.client.ForgeHooksClient.getFOVModifier(this, entity, block, partialTicks, f);
|
||||
+ return net.minecraftforge.client.ForgeHooksClient.getFOVModifier(this, entity, iblockstate, partialTicks, f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -629,17 +630,20 @@
|
||||
@@ -555,14 +556,8 @@
|
||||
{
|
||||
BlockPos blockpos = new BlockPos(entity);
|
||||
IBlockState iblockstate = this.mc.theWorld.getBlockState(blockpos);
|
||||
- Block block = iblockstate.getBlock();
|
||||
+ net.minecraftforge.client.ForgeHooksClient.orientBedCamera(this.mc.theWorld, blockpos, iblockstate, entity);
|
||||
|
||||
- if (block == Blocks.bed)
|
||||
- {
|
||||
- int j = ((EnumFacing)iblockstate.getValue(BlockBed.field_185512_D)).getHorizontalIndex();
|
||||
- GlStateManager.rotate((float)(j * 90), 0.0F, 1.0F, 0.0F);
|
||||
- }
|
||||
-
|
||||
GlStateManager.rotate(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks + 180.0F, 0.0F, -1.0F, 0.0F);
|
||||
GlStateManager.rotate(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks, -1.0F, 0.0F, 0.0F);
|
||||
}
|
||||
@@ -629,17 +624,20 @@
|
||||
|
||||
if (!this.mc.gameSettings.debugCamEnable)
|
||||
{
|
||||
|
@ -36,8 +61,8 @@
|
|||
- {
|
||||
- GlStateManager.rotate(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks + 180.0F, 0.0F, 1.0F, 0.0F);
|
||||
- }
|
||||
+ Block block = ActiveRenderInfo.getBlockAtEntityViewpoint(this.mc.theWorld, entity, partialTicks);
|
||||
+ net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup event = new net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup(this, entity, block, partialTicks, yaw, pitch, roll);
|
||||
+ IBlockState state = ActiveRenderInfo.func_186703_a(this.mc.theWorld, entity, partialTicks);
|
||||
+ net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup event = new net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup(this, entity, state, partialTicks, yaw, pitch, roll);
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event);
|
||||
+ GlStateManager.rotate(event.roll, 0.0F, 0.0F, 1.0F);
|
||||
+ GlStateManager.rotate(event.pitch, 1.0F, 0.0F, 0.0F);
|
||||
|
@ -45,7 +70,15 @@
|
|||
}
|
||||
|
||||
GlStateManager.translate(0.0F, -f, 0.0F);
|
||||
@@ -1092,7 +1096,7 @@
|
||||
@@ -757,6 +755,7 @@
|
||||
|
||||
boolean flag = this.mc.getRenderViewEntity() instanceof EntityLivingBase && ((EntityLivingBase)this.mc.getRenderViewEntity()).isPlayerSleeping();
|
||||
|
||||
+ if (!net.minecraftforge.client.ForgeHooksClient.renderFirstPersonHand(mc.renderGlobal, partialTicks, xOffset))
|
||||
if (this.mc.gameSettings.thirdPersonView == 0 && !flag && !this.mc.gameSettings.hideGUI && !this.mc.playerController.isSpectator())
|
||||
{
|
||||
this.enableLightmap();
|
||||
@@ -1092,7 +1091,7 @@
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -54,7 +87,7 @@
|
|||
}
|
||||
catch (Throwable throwable)
|
||||
{
|
||||
@@ -1187,7 +1191,7 @@
|
||||
@@ -1187,7 +1186,7 @@
|
||||
|
||||
if (this.mc.playerController.getCurrentGameType() == WorldSettings.GameType.SPECTATOR)
|
||||
{
|
||||
|
@ -63,7 +96,7 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
@@ -1312,7 +1316,9 @@
|
||||
@@ -1312,7 +1311,9 @@
|
||||
GlStateManager.pushMatrix();
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
this.mc.mcProfiler.endStartSection("entities");
|
||||
|
@ -73,7 +106,31 @@
|
|||
RenderHelper.disableStandardItemLighting();
|
||||
this.disableLightmap();
|
||||
}
|
||||
@@ -1378,8 +1384,12 @@
|
||||
@@ -1325,6 +1326,7 @@
|
||||
EntityPlayer entityplayer = (EntityPlayer)entity;
|
||||
GlStateManager.disableAlpha();
|
||||
this.mc.mcProfiler.endStartSection("outline");
|
||||
+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, mc.objectMouseOver, 0, partialTicks))
|
||||
renderglobal.drawSelectionBox(entityplayer, this.mc.objectMouseOver, 0, partialTicks);
|
||||
GlStateManager.enableAlpha();
|
||||
}
|
||||
@@ -1366,6 +1368,15 @@
|
||||
GlStateManager.shadeModel(7425);
|
||||
this.mc.mcProfiler.endStartSection("translucent");
|
||||
renderglobal.renderBlockLayer(BlockRenderLayer.TRANSLUCENT, (double)partialTicks, pass, entity);
|
||||
+ if (!this.debugView) //Only render if render pass 0 happens as well.
|
||||
+ {
|
||||
+ RenderHelper.enableStandardItemLighting();
|
||||
+ this.mc.mcProfiler.endStartSection("entities");
|
||||
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(1);
|
||||
+ renderglobal.renderEntities(entity, icamera, partialTicks);
|
||||
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(-1);
|
||||
+ RenderHelper.disableStandardItemLighting();
|
||||
+ }
|
||||
GlStateManager.shadeModel(7424);
|
||||
GlStateManager.depthMask(true);
|
||||
GlStateManager.enableCull();
|
||||
@@ -1378,6 +1389,9 @@
|
||||
this.renderCloudsCheck(renderglobal, partialTicks, pass);
|
||||
}
|
||||
|
||||
|
@ -82,11 +139,8 @@
|
|||
+
|
||||
this.mc.mcProfiler.endStartSection("hand");
|
||||
|
||||
+ if (!net.minecraftforge.client.ForgeHooksClient.renderFirstPersonHand(renderglobal, partialTicks, pass))
|
||||
if (this.renderHand)
|
||||
{
|
||||
GlStateManager.clear(256);
|
||||
@@ -1490,6 +1500,13 @@
|
||||
@@ -1490,6 +1504,13 @@
|
||||
|
||||
protected void renderRainSnow(float partialTicks)
|
||||
{
|
||||
|
@ -100,11 +154,11 @@
|
|||
float f = this.mc.theWorld.getRainStrength(partialTicks);
|
||||
|
||||
if (f > 0.0F)
|
||||
@@ -1820,6 +1837,13 @@
|
||||
@@ -1820,6 +1841,13 @@
|
||||
this.fogColorBlue = f7;
|
||||
}
|
||||
|
||||
+ net.minecraftforge.client.event.EntityViewRenderEvent.FogColors event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogColors(this, entity, block, partialTicks, this.fogColorRed, this.fogColorGreen, this.fogColorBlue);
|
||||
+ net.minecraftforge.client.event.EntityViewRenderEvent.FogColors event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogColors(this, entity, iblockstate, partialTicks, this.fogColorRed, this.fogColorGreen, this.fogColorBlue);
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event);
|
||||
+
|
||||
+ this.fogColorRed = event.red;
|
||||
|
@ -114,11 +168,22 @@
|
|||
GlStateManager.clearColor(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 0.0F);
|
||||
}
|
||||
|
||||
@@ -1915,6 +1939,7 @@
|
||||
@@ -1830,7 +1858,9 @@
|
||||
GlStateManager.func_187432_a(0.0F, -1.0F, 0.0F);
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
IBlockState iblockstate = ActiveRenderInfo.func_186703_a(this.mc.theWorld, entity, partialTicks);
|
||||
-
|
||||
+ float hook = net.minecraftforge.client.ForgeHooksClient.getFogDensity(this, entity, iblockstate, partialTicks, 0.1F);
|
||||
+ if (hook >= 0) GlStateManager.setFogDensity(hook);
|
||||
+ else
|
||||
if (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).isPotionActive(MobEffects.blindness))
|
||||
{
|
||||
float f1 = 5.0F;
|
||||
@@ -1915,6 +1945,7 @@
|
||||
GlStateManager.setFogStart(f * 0.05F);
|
||||
GlStateManager.setFogEnd(Math.min(f, 192.0F) * 0.5F);
|
||||
}
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onFogRender(this, entity, block, partialTicks, p_78468_1_, f);
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onFogRender(this, entity, iblockstate, partialTicks, p_78468_1_, f);
|
||||
}
|
||||
|
||||
GlStateManager.enableColorMaterial();
|
||||
|
|
|
@ -40,7 +40,15 @@
|
|||
++this.countEntitiesRendered;
|
||||
|
||||
if (entity1.isInRangeToRender3d(d0, d1, d2))
|
||||
@@ -672,6 +681,7 @@
|
||||
@@ -599,6 +608,7 @@
|
||||
{
|
||||
for (Entity entity2 : classinheritancemultimap)
|
||||
{
|
||||
+ if(!entity2.shouldRenderInPass(pass)) continue;
|
||||
boolean flag = this.renderManager.shouldRender(entity2, camera, d0, d1, d2) || entity2.func_184215_y(this.mc.thePlayer);
|
||||
|
||||
if (flag)
|
||||
@@ -672,6 +682,7 @@
|
||||
this.theWorld.theProfiler.endStartSection("blockentities");
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
|
||||
|
@ -48,7 +56,7 @@
|
|||
for (RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation1 : this.renderInfos)
|
||||
{
|
||||
List<TileEntity> list3 = renderglobal$containerlocalrenderinformation1.renderChunk.getCompiledChunk().getTileEntities();
|
||||
@@ -680,6 +690,7 @@
|
||||
@@ -680,6 +691,7 @@
|
||||
{
|
||||
for (TileEntity tileentity2 : list3)
|
||||
{
|
||||
|
@ -56,7 +64,7 @@
|
|||
TileEntityRendererDispatcher.instance.renderTileEntity(tileentity2, partialTicks, -1);
|
||||
}
|
||||
}
|
||||
@@ -689,9 +700,11 @@
|
||||
@@ -689,9 +701,11 @@
|
||||
{
|
||||
for (TileEntity tileentity : this.setTileEntities)
|
||||
{
|
||||
|
@ -68,7 +76,7 @@
|
|||
|
||||
this.preRenderDamagedBlocks();
|
||||
|
||||
@@ -718,7 +731,7 @@
|
||||
@@ -718,7 +732,7 @@
|
||||
|
||||
Block block = this.theWorld.getBlockState(blockpos).getBlock();
|
||||
|
||||
|
@ -77,7 +85,21 @@
|
|||
{
|
||||
TileEntityRendererDispatcher.instance.renderTileEntity(tileentity1, partialTicks, destroyblockprogress.getPartialBlockDamage());
|
||||
}
|
||||
@@ -1427,6 +1440,12 @@
|
||||
@@ -1210,6 +1224,13 @@
|
||||
|
||||
public void renderSky(float partialTicks, int pass)
|
||||
{
|
||||
+ net.minecraftforge.client.IRenderHandler renderer = this.theWorld.provider.getSkyRenderer();
|
||||
+ if (renderer != null)
|
||||
+ {
|
||||
+ renderer.render(partialTicks, theWorld, mc);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
if (this.mc.theWorld.provider.func_186058_p().func_186068_a() == 1)
|
||||
{
|
||||
this.renderSkyEnd();
|
||||
@@ -1427,6 +1448,12 @@
|
||||
|
||||
public void renderClouds(float partialTicks, int pass)
|
||||
{
|
||||
|
@ -90,7 +112,7 @@
|
|||
if (this.mc.theWorld.provider.isSurfaceWorld())
|
||||
{
|
||||
if (this.mc.gameSettings.func_181147_e() == 2)
|
||||
@@ -1854,8 +1873,11 @@
|
||||
@@ -1854,8 +1881,11 @@
|
||||
double d4 = (double)blockpos.getY() - d1;
|
||||
double d5 = (double)blockpos.getZ() - d2;
|
||||
Block block = this.theWorld.getBlockState(blockpos).getBlock();
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
}
|
||||
+
|
||||
+ @Override
|
||||
+ protected ModelBiped getArmorModelHook(net.minecraft.entity.EntityLivingBase entity, net.minecraft.item.ItemStack itemStack, int slot, ModelBiped model)
|
||||
+ protected ModelBiped getArmorModelHook(net.minecraft.entity.EntityLivingBase entity, net.minecraft.item.ItemStack itemStack, EntityEquipmentSlot slot, ModelBiped model)
|
||||
+ {
|
||||
+ return net.minecraftforge.client.ForgeHooksClient.getArmorModel(entity, itemStack, slot, model);
|
||||
+ }
|
||||
|
|
|
@ -1,74 +0,0 @@
|
|||
++++ REJECTED PATCH 2
|
||||
|
||||
if (d3 < d2 || d2 == 0.0D)
|
||||
{
|
||||
- if (entity1 == entity.ridingEntity)
|
||||
+ if (entity1 == entity.ridingEntity && !entity.canRiderInteract())
|
||||
{
|
||||
if (d2 == 0.0D)
|
||||
{
|
||||
++++ END PATCH
|
||||
++++ REJECTED PATCH 4
|
||||
{
|
||||
BlockPos blockpos = new BlockPos(entity);
|
||||
IBlockState iblockstate = this.mc.theWorld.getBlockState(blockpos);
|
||||
- Block block = iblockstate.getBlock();
|
||||
+ net.minecraftforge.client.ForgeHooksClient.orientBedCamera(this.mc.theWorld, blockpos, iblockstate, entity);
|
||||
|
||||
- if (block == Blocks.bed)
|
||||
- {
|
||||
- int j = ((EnumFacing)iblockstate.getValue(BlockBed.FACING)).getHorizontalIndex();
|
||||
- GlStateManager.rotate((float)(j * 90), 0.0F, 1.0F, 0.0F);
|
||||
- }
|
||||
-
|
||||
GlStateManager.rotate(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks + 180.0F, 0.0F, -1.0F, 0.0F);
|
||||
GlStateManager.rotate(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks, -1.0F, 0.0F, 0.0F);
|
||||
}
|
||||
++++ END PATCH
|
||||
++++ REJECTED PATCH 9
|
||||
EntityPlayer entityplayer = (EntityPlayer)entity;
|
||||
GlStateManager.disableAlpha();
|
||||
this.mc.mcProfiler.endStartSection("outline");
|
||||
+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, mc.objectMouseOver, 0, entityplayer.getHeldItem(), partialTicks))
|
||||
renderglobal.drawSelectionBox(entityplayer, this.mc.objectMouseOver, 0, partialTicks);
|
||||
GlStateManager.enableAlpha();
|
||||
}
|
||||
++++ END PATCH
|
||||
++++ REJECTED PATCH 10
|
||||
EntityPlayer entityplayer1 = (EntityPlayer)entity;
|
||||
GlStateManager.disableAlpha();
|
||||
this.mc.mcProfiler.endStartSection("outline");
|
||||
+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer1, mc.objectMouseOver, 0, entityplayer1.getHeldItem(), partialTicks))
|
||||
renderglobal.drawSelectionBox(entityplayer1, this.mc.objectMouseOver, 0, partialTicks);
|
||||
GlStateManager.enableAlpha();
|
||||
}
|
||||
++++ END PATCH
|
||||
++++ REJECTED PATCH 11
|
||||
GlStateManager.shadeModel(7425);
|
||||
this.mc.mcProfiler.endStartSection("translucent");
|
||||
renderglobal.renderBlockLayer(EnumWorldBlockLayer.TRANSLUCENT, (double)partialTicks, pass, entity);
|
||||
+ if (!this.debugView) //Only render if render pass 0 happens as well.
|
||||
+ {
|
||||
+ RenderHelper.enableStandardItemLighting();
|
||||
+ this.mc.mcProfiler.endStartSection("entities");
|
||||
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(1);
|
||||
+ renderglobal.renderEntities(entity, icamera, partialTicks);
|
||||
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(-1);
|
||||
+ RenderHelper.disableStandardItemLighting();
|
||||
+ }
|
||||
GlStateManager.shadeModel(7424);
|
||||
GlStateManager.depthMask(true);
|
||||
GlStateManager.enableCull();
|
||||
++++ END PATCH
|
||||
++++ REJECTED PATCH 15
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Block block = ActiveRenderInfo.getBlockAtEntityViewpoint(this.mc.theWorld, entity, partialTicks);
|
||||
|
||||
+ float hook = net.minecraftforge.client.ForgeHooksClient.getFogDensity(this, entity, block, partialTicks, 0.1F);
|
||||
+ if (hook >= 0)
|
||||
+ GlStateManager.setFogDensity(hook);
|
||||
+ else
|
||||
if (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).isPotionActive(Potion.blindness))
|
||||
{
|
||||
float f1 = 5.0F;
|
||||
++++ END PATCH
|
|
@ -1,35 +1,3 @@
|
|||
++++ REJECTED PATCH 4
|
||||
for (int j = 0; j < list.size(); ++j)
|
||||
{
|
||||
Entity entity3 = (Entity)list.get(j);
|
||||
+ if (!entity3.shouldRenderInPass(pass)) continue;
|
||||
boolean flag = this.mc.getRenderViewEntity() instanceof EntityLivingBase && ((EntityLivingBase)this.mc.getRenderViewEntity()).isPlayerSleeping();
|
||||
boolean flag1 = entity3.isInRangeToRender3d(d0, d1, d2) && (entity3.ignoreFrustumCheck || camera.isBoundingBoxInFrustum(entity3.getEntityBoundingBox()) || entity3.riddenByEntity == this.mc.thePlayer) && entity3 instanceof EntityPlayer;
|
||||
|
||||
++++ END PATCH
|
||||
++++ REJECTED PATCH 5
|
||||
}
|
||||
|
||||
entity2 = (Entity)iterator.next();
|
||||
+ if (!entity2.shouldRenderInPass(pass)) continue;
|
||||
flag2 = this.renderManager.shouldRender(entity2, camera, d0, d1, d2) || entity2.riddenByEntity == this.mc.thePlayer;
|
||||
|
||||
if (!flag2)
|
||||
++++ END PATCH
|
||||
++++ REJECTED PATCH 10
|
||||
|
||||
public void renderSky(float partialTicks, int pass)
|
||||
{
|
||||
+ net.minecraftforge.client.IRenderHandler renderer = this.theWorld.provider.getSkyRenderer();
|
||||
+ if (renderer != null)
|
||||
+ {
|
||||
+ renderer.render(partialTicks, theWorld, mc);
|
||||
+ return;
|
||||
+ }
|
||||
if (this.mc.theWorld.provider.getDimensionId() == 1)
|
||||
{
|
||||
this.renderSkyEnd();
|
||||
++++ END PATCH
|
||||
++++ REJECTED PATCH 13
|
||||
if (recordName != null)
|
||||
{
|
||||
|
|
|
@ -49,6 +49,7 @@ import net.minecraft.client.settings.GameSettings;
|
|||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
@ -100,7 +101,7 @@ public class ForgeHooksClient
|
|||
return FMLClientHandler.instance().getClient().renderEngine;
|
||||
}
|
||||
|
||||
public static String getArmorTexture(Entity entity, ItemStack armor, String _default, int slot, String type)
|
||||
public static String getArmorTexture(Entity entity, ItemStack armor, String _default, EntityEquipmentSlot slot, String type)
|
||||
{
|
||||
String result = armor.getItem().getArmorTexture(armor, entity, slot, type);
|
||||
return result != null ? result : _default;
|
||||
|
@ -119,9 +120,9 @@ public class ForgeHooksClient
|
|||
}
|
||||
}
|
||||
|
||||
public static boolean onDrawBlockHighlight(RenderGlobal context, EntityPlayer player, RayTraceResult target, int subID, ItemStack currentItem, float partialTicks)
|
||||
public static boolean onDrawBlockHighlight(RenderGlobal context, EntityPlayer player, RayTraceResult target, int subID, float partialTicks)
|
||||
{
|
||||
return MinecraftForge.EVENT_BUS.post(new DrawBlockHighlightEvent(context, player, target, subID, currentItem, partialTicks));
|
||||
return MinecraftForge.EVENT_BUS.post(new DrawBlockHighlightEvent(context, player, target, subID, partialTicks));
|
||||
}
|
||||
|
||||
public static void dispatchRenderLast(RenderGlobal context, float partialTicks)
|
||||
|
@ -164,9 +165,9 @@ public class ForgeHooksClient
|
|||
renderLayer.set(layer);
|
||||
}
|
||||
|
||||
public static ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int slotID, ModelBiped _default)
|
||||
public static ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, EntityEquipmentSlot slot, ModelBiped _default)
|
||||
{
|
||||
ModelBiped model = itemStack.getItem().getArmorModel(entityLiving, itemStack, slotID, _default);
|
||||
ModelBiped model = itemStack.getItem().getArmorModel(entityLiving, itemStack, slot, _default);
|
||||
return model == null ? _default : model;
|
||||
}
|
||||
|
||||
|
@ -203,8 +204,8 @@ public class ForgeHooksClient
|
|||
return fovUpdateEvent.newfov;
|
||||
}
|
||||
|
||||
public static float getFOVModifier(EntityRenderer renderer, Entity entity, Block block, double renderPartialTicks, float fov) {
|
||||
EntityViewRenderEvent.FOVModifier event = new EntityViewRenderEvent.FOVModifier(renderer, entity, block, renderPartialTicks, fov);
|
||||
public static float getFOVModifier(EntityRenderer renderer, Entity entity, IBlockState state, double renderPartialTicks, float fov) {
|
||||
EntityViewRenderEvent.FOVModifier event = new EntityViewRenderEvent.FOVModifier(renderer, entity, state, renderPartialTicks, fov);
|
||||
MinecraftForge.EVENT_BUS.post(event);
|
||||
return event.getFOV();
|
||||
}
|
||||
|
@ -318,16 +319,16 @@ public class ForgeHooksClient
|
|||
MinecraftForge.EVENT_BUS.post(new GuiScreenEvent.DrawScreenEvent.Post(screen, mouseX, mouseY, partialTicks));
|
||||
}
|
||||
|
||||
public static float getFogDensity(EntityRenderer renderer, Entity entity, Block block, float partial, float density)
|
||||
public static float getFogDensity(EntityRenderer renderer, Entity entity, IBlockState state, float partial, float density)
|
||||
{
|
||||
EntityViewRenderEvent.FogDensity event = new EntityViewRenderEvent.FogDensity(renderer, entity, block, partial, density);
|
||||
EntityViewRenderEvent.FogDensity event = new EntityViewRenderEvent.FogDensity(renderer, entity, state, partial, density);
|
||||
if (MinecraftForge.EVENT_BUS.post(event)) return event.density;
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static void onFogRender(EntityRenderer renderer, Entity entity, Block block, float partial, int mode, float distance)
|
||||
public static void onFogRender(EntityRenderer renderer, Entity entity, IBlockState state, float partial, int mode, float distance)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(new EntityViewRenderEvent.RenderFogEvent(renderer, entity, block, partial, mode, distance));
|
||||
MinecraftForge.EVENT_BUS.post(new EntityViewRenderEvent.RenderFogEvent(renderer, entity, state, partial, mode, distance));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -14,7 +14,6 @@ public class DrawBlockHighlightEvent extends Event
|
|||
public final EntityPlayer player;
|
||||
public final RayTraceResult target;
|
||||
public final int subID;
|
||||
public final ItemStack currentItem;
|
||||
public final float partialTicks;
|
||||
|
||||
public DrawBlockHighlightEvent(RenderGlobal context, EntityPlayer player, RayTraceResult target, int subID, ItemStack currentItem, float partialTicks)
|
||||
|
@ -23,7 +22,6 @@ public class DrawBlockHighlightEvent extends Event
|
|||
this.player = player;
|
||||
this.target = target;
|
||||
this.subID = subID;
|
||||
this.currentItem = currentItem;
|
||||
this.partialTicks= partialTicks;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package net.minecraftforge.client.event;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.EntityRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
||||
|
@ -12,20 +13,40 @@ import net.minecraftforge.fml.common.eventhandler.Event;
|
|||
*/
|
||||
public abstract class EntityViewRenderEvent extends Event
|
||||
{
|
||||
public final EntityRenderer renderer;
|
||||
public final Entity entity;
|
||||
public final Block block;
|
||||
public final double renderPartialTicks;
|
||||
private final EntityRenderer renderer;
|
||||
private final Entity entity;
|
||||
private final IBlockState state;
|
||||
private final double renderPartialTicks;
|
||||
|
||||
public EntityViewRenderEvent(EntityRenderer renderer, Entity entity, Block block, double renderPartialTicks)
|
||||
public EntityViewRenderEvent(EntityRenderer renderer, Entity entity, IBlockState state, double renderPartialTicks)
|
||||
{
|
||||
this.renderer = renderer;
|
||||
this.entity = entity;
|
||||
this.block = block;
|
||||
this.state = state;
|
||||
this.renderPartialTicks = renderPartialTicks;
|
||||
}
|
||||
|
||||
/**
|
||||
public EntityRenderer getRenderer()
|
||||
{
|
||||
return renderer;
|
||||
}
|
||||
|
||||
public Entity getEntity()
|
||||
{
|
||||
return entity;
|
||||
}
|
||||
|
||||
public IBlockState getState()
|
||||
{
|
||||
return state;
|
||||
}
|
||||
|
||||
public double getRenderPartialTicks()
|
||||
{
|
||||
return renderPartialTicks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Event that allows any feature to customize the fog density the player sees.
|
||||
* NOTE: In order to make this event have an effect, you must cancel the event
|
||||
*/
|
||||
|
@ -34,9 +55,9 @@ public abstract class EntityViewRenderEvent extends Event
|
|||
{
|
||||
public float density;
|
||||
|
||||
public FogDensity(EntityRenderer renderer, Entity entity, Block block, double renderPartialTicks, float density)
|
||||
public FogDensity(EntityRenderer renderer, Entity entity, IBlockState state, double renderPartialTicks, float density)
|
||||
{
|
||||
super(renderer, entity, block, renderPartialTicks);
|
||||
super(renderer, entity, state, renderPartialTicks);
|
||||
this.density = density;
|
||||
}
|
||||
}
|
||||
|
@ -50,9 +71,9 @@ public abstract class EntityViewRenderEvent extends Event
|
|||
public final int fogMode;
|
||||
public final float farPlaneDistance;
|
||||
|
||||
public RenderFogEvent(EntityRenderer renderer, Entity entity, Block block, double renderPartialTicks, int fogMode, float farPlaneDistance)
|
||||
public RenderFogEvent(EntityRenderer renderer, Entity entity, IBlockState state, double renderPartialTicks, int fogMode, float farPlaneDistance)
|
||||
{
|
||||
super(renderer, entity, block, renderPartialTicks);
|
||||
super(renderer, entity, state, renderPartialTicks);
|
||||
this.fogMode = fogMode;
|
||||
this.farPlaneDistance = farPlaneDistance;
|
||||
}
|
||||
|
@ -68,9 +89,9 @@ public abstract class EntityViewRenderEvent extends Event
|
|||
public float green;
|
||||
public float blue;
|
||||
|
||||
public FogColors(EntityRenderer renderer, Entity entity, Block block, double renderPartialTicks, float red, float green, float blue)
|
||||
public FogColors(EntityRenderer renderer, Entity entity, IBlockState state, double renderPartialTicks, float red, float green, float blue)
|
||||
{
|
||||
super(renderer, entity, block, renderPartialTicks);
|
||||
super(renderer, entity, state, renderPartialTicks);
|
||||
this.red = red;
|
||||
this.green = green;
|
||||
this.blue = blue;
|
||||
|
@ -86,9 +107,9 @@ public abstract class EntityViewRenderEvent extends Event
|
|||
public float pitch;
|
||||
public float roll;
|
||||
|
||||
public CameraSetup(EntityRenderer renderer, Entity entity, Block block, double renderPartialTicks, float yaw, float pitch, float roll)
|
||||
public CameraSetup(EntityRenderer renderer, Entity entity, IBlockState state, double renderPartialTicks, float yaw, float pitch, float roll)
|
||||
{
|
||||
super(renderer, entity, block, renderPartialTicks);
|
||||
super(renderer, entity, state, renderPartialTicks);
|
||||
this.yaw = yaw;
|
||||
this.pitch = pitch;
|
||||
this.roll = roll;
|
||||
|
@ -103,8 +124,8 @@ public abstract class EntityViewRenderEvent extends Event
|
|||
{
|
||||
private float fov;
|
||||
|
||||
public FOVModifier(EntityRenderer renderer, Entity entity, Block block, double renderPartialTicks, float fov) {
|
||||
super(renderer, entity, block, renderPartialTicks);
|
||||
public FOVModifier(EntityRenderer renderer, Entity entity, IBlockState state, double renderPartialTicks, float fov) {
|
||||
super(renderer, entity, state, renderPartialTicks);
|
||||
this.setFOV(fov);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue