Rendering patches (#5262)

This commit is contained in:
tterrag 2018-12-21 17:45:35 -05:00 committed by LexManos
parent 0bfa76251d
commit b3b8c78527
122 changed files with 2354 additions and 2888 deletions

View File

@ -0,0 +1,36 @@
--- a/net/minecraft/client/renderer/ActiveRenderInfo.java
+++ b/net/minecraft/client/renderer/ActiveRenderInfo.java
@@ -23,6 +23,10 @@
private static float field_74596_h;
public static void func_197924_a(EntityPlayer p_197924_0_, boolean p_197924_1_, float p_197924_2_) {
+ updateRenderInfo((Entity) p_197924_0_, p_197924_1_, p_197924_2_);
+ }
+
+ public static void updateRenderInfo(Entity p_197924_0_, boolean p_197924_1_, float p_197924_2_) {
field_178812_b.clear();
GlStateManager.func_179111_a(2982, field_178812_b);
Matrix4f matrix4f = new Matrix4f();
@@ -65,7 +69,7 @@
}
}
- return iblockstate;
+ return iblockstate.func_177230_c().getStateAtViewpoint(iblockstate, p_186703_0_, blockpos, vec3d);
}
public static IFluidState func_206243_b(IBlockReader p_206243_0_, Entity p_206243_1_, float p_206243_2_) {
@@ -101,4 +105,13 @@
public static float func_178807_f() {
return field_74596_h;
}
+
+ /* ======================================== FORGE START =====================================*/
+
+ /**
+ * Vector from render view entity position (corrected for partialTickTime) to the middle of screen
+ */
+ public static Vec3d getCameraPosition() {
+ return field_178811_e;
+ }
}

View File

@ -0,0 +1,13 @@
--- a/net/minecraft/client/renderer/BlockFluidRenderer.java
+++ b/net/minecraft/client/renderer/BlockFluidRenderer.java
@@ -219,8 +219,8 @@
BlockPos blockpos = p_205346_2_.func_177972_a(enumfacing);
TextureAtlasSprite textureatlassprite2 = atextureatlassprite[1];
if (!flag) {
- Block block = p_205346_1_.func_180495_p(blockpos).func_177230_c();
- if (block == Blocks.field_150359_w || block instanceof BlockStainedGlass) {
+ IBlockState blockstate = p_205346_1_.func_180495_p(blockpos);
+ if (blockstate.func_193401_d(p_205346_1_, blockpos, enumfacing) == net.minecraft.block.state.BlockFaceShape.SOLID) {
textureatlassprite2 = this.field_187501_d;
}
}

View File

@ -0,0 +1,48 @@
--- a/net/minecraft/client/renderer/BlockModelRenderer.java
+++ b/net/minecraft/client/renderer/BlockModelRenderer.java
@@ -45,7 +45,7 @@
}
public boolean func_199324_a(IWorldReader p_199324_1_, IBakedModel p_199324_2_, IBlockState p_199324_3_, BlockPos p_199324_4_, BufferBuilder p_199324_5_, boolean p_199324_6_, Random p_199324_7_, long p_199324_8_) {
- boolean flag = Minecraft.func_71379_u() && p_199324_3_.func_185906_d() == 0 && p_199324_2_.func_177555_b();
+ boolean flag = Minecraft.func_71379_u() && p_199324_3_.getLightValue(p_199324_1_, p_199324_4_) == 0 && p_199324_2_.isAmbientOcclusion(p_199324_3_);
try {
return flag ? this.func_199326_b(p_199324_1_, p_199324_2_, p_199324_3_, p_199324_4_, p_199324_5_, p_199324_6_, p_199324_7_, p_199324_8_) : this.func_199325_c(p_199324_1_, p_199324_2_, p_199324_3_, p_199324_4_, p_199324_5_, p_199324_6_, p_199324_7_, p_199324_8_);
@@ -120,6 +120,13 @@
p_187492_8_.func_187491_a(p_187492_1_, p_187492_2_, p_187492_3_, bakedquad.func_178210_d(), p_187492_6_, p_187492_7_);
p_187492_4_.func_178981_a(bakedquad.func_178209_a());
p_187492_4_.func_178962_a(p_187492_8_.field_178207_c[0], p_187492_8_.field_178207_c[1], p_187492_8_.field_178207_c[2], p_187492_8_.field_178207_c[3]);
+ if(bakedquad.shouldApplyDiffuseLighting()) {
+ float diffuse = net.minecraftforge.client.model.pipeline.LightUtil.diffuseLight(bakedquad.func_178210_d());
+ p_187492_8_.field_178206_b[0] *= diffuse;
+ p_187492_8_.field_178206_b[1] *= diffuse;
+ p_187492_8_.field_178206_b[2] *= diffuse;
+ p_187492_8_.field_178206_b[3] *= diffuse;
+ }
if (bakedquad.func_178212_b()) {
int k = this.field_187499_a.func_186724_a(p_187492_2_, p_187492_1_, p_187492_3_, bakedquad.func_178211_c());
float f = (float)(k >> 16 & 255) / 255.0F;
@@ -229,10 +236,22 @@
float f = (float)(k >> 16 & 255) / 255.0F;
float f1 = (float)(k >> 8 & 255) / 255.0F;
float f2 = (float)(k & 255) / 255.0F;
+ if(bakedquad.shouldApplyDiffuseLighting()) {
+ float diffuse = net.minecraftforge.client.model.pipeline.LightUtil.diffuseLight(bakedquad.func_178210_d());
+ f *= diffuse;
+ f1 *= diffuse;
+ f2 *= diffuse;
+ }
p_187496_6_.func_178978_a(f, f1, f2, 4);
p_187496_6_.func_178978_a(f, f1, f2, 3);
p_187496_6_.func_178978_a(f, f1, f2, 2);
p_187496_6_.func_178978_a(f, f1, f2, 1);
+ } else if(bakedquad.shouldApplyDiffuseLighting()) {
+ float diffuse = net.minecraftforge.client.model.pipeline.LightUtil.diffuseLight(bakedquad.func_178210_d());
+ p_187496_6_.func_178978_a(diffuse, diffuse, diffuse, 4);
+ p_187496_6_.func_178978_a(diffuse, diffuse, diffuse, 3);
+ p_187496_6_.func_178978_a(diffuse, diffuse, diffuse, 2);
+ p_187496_6_.func_178978_a(diffuse, diffuse, diffuse, 1);
}
p_187496_6_.func_178987_a(d0, d1, d2);

View File

@ -1,6 +1,33 @@
--- a/net/minecraft/client/renderer/BlockRendererDispatcher.java
+++ b/net/minecraft/client/renderer/BlockRendererDispatcher.java
@@ -105,4 +105,9 @@
@@ -28,7 +28,7 @@
public BlockRendererDispatcher(BlockModelShapes p_i46577_1_, BlockColors p_i46577_2_) {
this.field_175028_a = p_i46577_1_;
- this.field_175027_c = new BlockModelRenderer(p_i46577_2_);
+ this.field_175027_c = new net.minecraftforge.client.model.pipeline.ForgeBlockModelRenderer(p_i46577_2_);
this.field_175025_e = new BlockFluidRenderer();
}
@@ -40,7 +40,7 @@
if (p_175020_1_.func_185901_i() == EnumBlockRenderType.MODEL) {
IBakedModel ibakedmodel = this.field_175028_a.func_178125_b(p_175020_1_);
long i = p_175020_1_.func_209533_a(p_175020_2_);
- IBakedModel ibakedmodel1 = (new SimpleBakedModel.Builder(p_175020_1_, ibakedmodel, p_175020_3_, this.field_195476_e, i)).func_177645_b();
+ IBakedModel ibakedmodel1 = net.minecraftforge.client.ForgeHooksClient.getDamageModel(ibakedmodel, p_175020_3_, p_175020_1_, p_175020_4_, p_175020_2_);
this.field_175027_c.func_199324_a(p_175020_4_, ibakedmodel1, p_175020_1_, p_175020_2_, Tessellator.func_178181_a().func_178180_c(), true, this.field_195476_e, i);
}
}
@@ -53,6 +53,8 @@
} else {
switch(enumblockrendertype) {
case MODEL:
+ IBakedModel model = this.func_184389_a(p_195475_1_);
+ p_195475_1_ = p_195475_1_.func_177230_c().getExtendedState(p_195475_1_, p_195475_3_, p_195475_2_);
return this.field_175027_c.func_199324_a(p_195475_3_, this.func_184389_a(p_195475_1_), p_195475_1_, p_195475_2_, p_195475_4_, true, p_195475_5_, p_195475_1_.func_209533_a(p_195475_2_));
case ENTITYBLOCK_ANIMATED:
return false;
@@ -105,4 +107,9 @@
public void func_195410_a(IResourceManager p_195410_1_) {
this.field_175025_e.func_178268_a();
}

View File

@ -39,20 +39,20 @@
+
+ //For some unknown reason Mojang changed the vanilla function to hardcode alpha as 255.... So lets re-add the parameter -.-
+ public void putColorRGBA(int index, int red, int green, int blue, int alpha) {
+ if (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN)
+ this.field_178999_b.put(index, alpha << 24 | blue << 16 | green << 8 | red);
+ else
+ this.field_178999_b.put(index, red << 24 | green << 16 | blue << 8 | alpha);
}
+ if (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN)
+ this.field_178999_b.put(index, alpha << 24 | blue << 16 | green << 8 | red);
+ else
+ this.field_178999_b.put(index, red << 24 | green << 16 | blue << 8 | alpha);
+ }
+
+ public boolean isColorDisabled() {
+ return field_78939_q;
+ return field_78939_q;
+ }
+
+ public void putBulkData(ByteBuffer buffer) {
+ func_181670_b(buffer.limit() + this.field_179011_q.func_177338_f());
+ this.field_179001_a.position(this.field_178997_d * this.field_179011_q.func_177338_f());
+ this.field_179001_a.put(buffer);
+ this.field_178997_d += buffer.limit() / this.field_179011_q.func_177338_f();
+ func_181670_b(buffer.limit() + this.field_179011_q.func_177338_f());
+ this.field_179001_a.position(this.field_178997_d * this.field_179011_q.func_177338_f());
+ this.field_179001_a.put(buffer);
+ this.field_178997_d += buffer.limit() / this.field_179011_q.func_177338_f();
+ }
+}
}

View File

@ -0,0 +1,11 @@
--- a/net/minecraft/client/renderer/ChestRenderer.java
+++ b/net/minecraft/client/renderer/ChestRenderer.java
@@ -11,6 +11,7 @@
public void func_178175_a(Block p_178175_1_, float p_178175_2_) {
GlStateManager.func_179131_c(p_178175_2_, p_178175_2_, p_178175_2_, 1.0F);
GlStateManager.func_179114_b(90.0F, 0.0F, 1.0F, 0.0F);
- TileEntityItemStackRenderer.field_147719_a.func_179022_a(new ItemStack(p_178175_1_));
+ ItemStack stack = new ItemStack(p_178175_1_);
+ stack.func_77973_b().getTileEntityItemStackRenderer().func_179022_a(stack);
}
}

View File

@ -1,6 +1,152 @@
--- a/net/minecraft/client/renderer/EntityRenderer.java
+++ b/net/minecraft/client/renderer/EntityRenderer.java
@@ -1182,4 +1182,9 @@
@@ -171,7 +171,7 @@
this.func_175069_a(new ResourceLocation("shaders/post/spider.json"));
} else if (p_175066_1_ instanceof EntityEnderman) {
this.func_175069_a(new ResourceLocation("shaders/post/invert.json"));
- }
+ } else net.minecraftforge.client.ForgeHooksClient.loadEntityShader(p_175066_1_, this);
}
}
@@ -310,7 +310,7 @@
} else if (raytraceresult != null) {
double d3 = vec3d.func_72438_d(raytraceresult.field_72307_f);
if (d3 < d2 || d2 == 0.0D) {
- if (entity1.func_184208_bv() == entity.func_184208_bv()) {
+ if (entity1.func_184208_bv() == entity.func_184208_bv() && !entity1.canRiderInteract()) {
if (d2 == 0.0D) {
this.field_78528_u = entity1;
vec3d3 = raytraceresult.field_72307_f;
@@ -381,7 +381,7 @@
d0 = d0 * 60.0D / 70.0D;
}
- return d0;
+ return net.minecraftforge.client.ForgeHooksClient.getFOVModifier(this, entity, ActiveRenderInfo.func_186703_a(this.field_78531_r.field_71441_e, entity, p_195459_1_), ifluidstate, p_195459_1_, d0);
}
}
@@ -488,8 +488,16 @@
}
if (!this.field_78531_r.field_71474_y.field_74325_U) {
- GlStateManager.func_179114_b(entity.func_195050_f(p_78467_1_), 1.0F, 0.0F, 0.0F);
- GlStateManager.func_179114_b(entity.func_195046_g(p_78467_1_) + 180.0F, 0.0F, 1.0F, 0.0F);
+ float yaw = entity.func_195046_g(p_78467_1_) + 180F;
+ float pitch = entity.func_195050_f(p_78467_1_);
+ float roll = 0.0F;
+ IBlockState state = ActiveRenderInfo.func_186703_a(this.field_78531_r.field_71441_e, entity, p_78467_1_);
+ IFluidState fluidState = ActiveRenderInfo.func_206243_b(this.field_78531_r.field_71441_e, entity, p_78467_1_);
+ net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup event = new net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup(this, entity, state, fluidState, p_78467_1_, yaw, pitch, roll);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event);
+ GlStateManager.func_179114_b(event.getRoll(), 0.0F, 0.0F, 1.0F);
+ GlStateManager.func_179114_b(event.getPitch(), 1.0F, 0.0F, 0.0F);
+ GlStateManager.func_179114_b(event.getYaw(), 0.0F, 1.0F, 0.0F);
}
GlStateManager.func_179109_b(0.0F, -f, 0.0F);
@@ -543,6 +551,8 @@
}
boolean flag = this.field_78531_r.func_175606_aa() instanceof EntityLivingBase && ((EntityLivingBase)this.field_78531_r.func_175606_aa()).func_70608_bn();
+
+ if (!net.minecraftforge.client.ForgeHooksClient.renderFirstPersonHand(field_78531_r.field_71438_f, p_195457_1_))
if (this.field_78531_r.field_71474_y.field_74320_O == 0 && !flag && !this.field_78531_r.field_71474_y.field_74319_N && this.field_78531_r.field_71442_b.func_178889_l() != GameType.SPECTATOR) {
this.func_180436_i();
this.field_78516_c.func_78440_a(p_195457_1_);
@@ -631,13 +641,17 @@
GlStateManager.func_179128_n(5888);
GlStateManager.func_179096_D();
this.field_78531_r.field_195558_d.func_198094_a();
+ // Forge: Fix MC-112292
+ net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.field_147556_a.field_147553_e = this.field_78531_r.func_110434_K();
+ // Forge: also fix rendering text before entering world (not part of MC-112292, but the same reason)
+ net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.field_147556_a.field_147557_n = this.field_78531_r.field_71466_p;
}
if (this.field_78531_r.field_71462_r != null) {
GlStateManager.func_179086_m(256);
try {
- this.field_78531_r.field_71462_r.func_73863_a(i, j, this.field_78531_r.func_193989_ak());
+ net.minecraftforge.client.ForgeHooksClient.drawScreen(this.field_78531_r.field_71462_r, i, j, this.field_78531_r.func_193989_ak());
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.func_85055_a(throwable, "Rendering screen");
CrashReportCategory crashreportcategory = crashreport.func_85058_a("Screen render details");
@@ -698,9 +712,10 @@
ItemStack itemstack = ((EntityPlayer)entity).func_184614_ca();
if (this.field_78531_r.field_71476_x != null && this.field_78531_r.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK) {
BlockPos blockpos = this.field_78531_r.field_71476_x.func_178782_a();
- Block block = this.field_78531_r.field_71441_e.func_180495_p(blockpos).func_177230_c();
+ IBlockState state = this.field_78531_r.field_71441_e.func_180495_p(blockpos);
+ Block block = state.func_177230_c();
if (this.field_78531_r.field_71442_b.func_178889_l() == GameType.SPECTATOR) {
- flag = block.func_149716_u() && this.field_78531_r.field_71441_e.func_175625_s(blockpos) instanceof IInventory;
+ flag = block.hasTileEntity(state) && this.field_78531_r.field_71441_e.func_175625_s(blockpos) instanceof IInventory;
} else {
BlockWorldState blockworldstate = new BlockWorldState(this.field_78531_r.field_71441_e, blockpos, false);
flag = !itemstack.func_190926_b() && (itemstack.func_206848_a(this.field_78531_r.field_71441_e.func_205772_D(), blockworldstate) || itemstack.func_206847_b(this.field_78531_r.field_71441_e.func_205772_D(), blockworldstate));
@@ -738,7 +753,7 @@
GlStateManager.func_179086_m(16640);
this.field_78531_r.field_71424_I.func_76318_c("camera");
this.func_195460_g(p_181560_1_);
- ActiveRenderInfo.func_197924_a(this.field_78531_r.field_71439_g, this.field_78531_r.field_71474_y.field_74320_O == 2, this.field_78530_s);
+ ActiveRenderInfo.updateRenderInfo(this.field_78531_r.func_175606_aa(), this.field_78531_r.field_71474_y.field_74320_O == 2, this.field_78530_s);
this.field_78531_r.field_71424_I.func_76318_c("frustum");
ClippingHelperImpl.func_78558_a();
this.field_78531_r.field_71424_I.func_76318_c("culling");
@@ -782,7 +797,9 @@
GlStateManager.func_179118_c();
renderglobal.func_195464_a(BlockRenderLayer.SOLID, (double)p_181560_1_, entity);
GlStateManager.func_179141_d();
+ this.field_78531_r.func_110434_K().func_110581_b(TextureMap.field_110575_b).func_174936_b(false, this.field_78531_r.field_71474_y.field_151442_I > 0); // FORGE: fix flickering leaves when mods mess up the blurMipmap settings
renderglobal.func_195464_a(BlockRenderLayer.CUTOUT_MIPPED, (double)p_181560_1_, entity);
+ this.field_78531_r.func_110434_K().func_110581_b(TextureMap.field_110575_b).func_174935_a();
this.field_78531_r.func_110434_K().func_110581_b(TextureMap.field_110575_b).func_174936_b(false, false);
renderglobal.func_195464_a(BlockRenderLayer.CUTOUT, (double)p_181560_1_, entity);
this.field_78531_r.func_110434_K().func_110581_b(TextureMap.field_110575_b).func_174935_a();
@@ -793,7 +810,9 @@
GlStateManager.func_179094_E();
RenderHelper.func_74519_b();
this.field_78531_r.field_71424_I.func_76318_c("entities");
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(0);
renderglobal.func_180446_a(entity, icamera, p_181560_1_);
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(0);
RenderHelper.func_74518_a();
this.func_175072_h();
GlStateManager.func_179128_n(5888);
@@ -802,6 +821,7 @@
EntityPlayer entityplayer = (EntityPlayer)entity;
GlStateManager.func_179118_c();
this.field_78531_r.field_71424_I.func_76318_c("outline");
+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, field_78531_r.field_71476_x, 0, p_181560_1_))
renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_181560_1_);
GlStateManager.func_179141_d();
}
@@ -851,6 +871,9 @@
this.field_78531_r.field_71424_I.func_76318_c("aboveClouds");
this.func_195456_a(renderglobal, p_181560_1_, d0, d1, d2);
}
+
+ this.field_78531_r.field_71424_I.func_76318_c("forge_render_last");
+ net.minecraftforge.client.ForgeHooksClient.dispatchRenderLast(renderglobal, p_181560_1_);
this.field_78531_r.field_71424_I.func_76318_c("hand");
if (this.field_175074_C) {
@@ -955,6 +978,11 @@
}
protected void func_78474_d(float p_78474_1_) {
+ net.minecraftforge.client.IRenderHandler renderer = this.field_78531_r.field_71441_e.func_201675_m().getWeatherRenderer();
+ if (renderer != null) {
+ renderer.render(p_78474_1_, this.field_78531_r.field_71441_e, field_78531_r);
+ return;
+ }
float f = this.field_78531_r.field_71441_e.func_72867_j(p_78474_1_);
if (!(f <= 0.0F)) {
this.func_180436_i();
@@ -1182,4 +1210,9 @@
public float func_205001_m() {
return this.field_78530_s;
}

View File

@ -0,0 +1,75 @@
--- a/net/minecraft/client/renderer/FirstPersonRenderer.java
+++ b/net/minecraft/client/renderer/FirstPersonRenderer.java
@@ -286,12 +286,14 @@
if (flag) {
float f4 = enumhand == EnumHand.MAIN_HAND ? f : 0.0F;
float f3 = 1.0F - (this.field_187470_g + (this.field_187469_f - this.field_187470_g) * p_78440_1_);
+ if(!net.minecraftforge.client.ForgeHooksClient.renderSpecificFirstPersonHand(EnumHand.MAIN_HAND, p_78440_1_, f1, f4, f3, this.field_187467_d))
this.func_187457_a(abstractclientplayer, p_78440_1_, f1, EnumHand.MAIN_HAND, f4, this.field_187467_d, f3);
}
if (flag1) {
float f5 = enumhand == EnumHand.OFF_HAND ? f : 0.0F;
float f6 = 1.0F - (this.field_187472_i + (this.field_187471_h - this.field_187472_i) * p_78440_1_);
+ if(!net.minecraftforge.client.ForgeHooksClient.renderSpecificFirstPersonHand(EnumHand.OFF_HAND, p_78440_1_, f1, f5, f6, this.field_187468_e))
this.func_187457_a(abstractclientplayer, p_78440_1_, f1, EnumHand.OFF_HAND, f5, this.field_187468_e, f6);
}
@@ -307,7 +309,7 @@
if (flag && !p_187457_1_.func_82150_aj()) {
this.func_187456_a(p_187457_7_, p_187457_5_, enumhandside);
}
- } else if (p_187457_6_.func_77973_b() == Items.field_151098_aY) {
+ } else if (p_187457_6_.func_77973_b() instanceof net.minecraft.item.ItemMap) {
if (flag && this.field_187468_e.func_190926_b()) {
this.func_187463_a(p_187457_3_, p_187457_7_, p_187457_5_);
} else {
@@ -402,6 +404,7 @@
GlStateManager.func_179118_c();
if (this.field_78455_a.field_71439_g.func_70094_T()) {
IBlockState iblockstate = this.field_78455_a.field_71441_e.func_180495_p(new BlockPos(this.field_78455_a.field_71439_g));
+ BlockPos overlayPos = new BlockPos(this.field_78455_a.field_71439_g);
EntityPlayer entityplayer = this.field_78455_a.field_71439_g;
for(int i = 0; i < 8; ++i) {
@@ -412,20 +415,24 @@
IBlockState iblockstate1 = this.field_78455_a.field_71441_e.func_180495_p(blockpos);
if (iblockstate1.func_191058_s()) {
iblockstate = iblockstate1;
+ overlayPos = blockpos;
}
}
if (iblockstate.func_185901_i() != EnumBlockRenderType.INVISIBLE) {
+ if (!net.minecraftforge.event.ForgeEventFactory.renderBlockOverlay(field_78455_a.field_71439_g, p_78447_1_, net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType.BLOCK, iblockstate, overlayPos))
this.func_178108_a(this.field_78455_a.func_175602_ab().func_175023_a().func_178122_a(iblockstate));
}
}
if (!this.field_78455_a.field_71439_g.func_175149_v()) {
if (this.field_78455_a.field_71439_g.func_208600_a(FluidTags.field_206959_a)) {
+ if (!net.minecraftforge.event.ForgeEventFactory.renderWaterOverlay(field_78455_a.field_71439_g, p_78447_1_))
this.func_78448_c(p_78447_1_);
}
if (this.field_78455_a.field_71439_g.func_70027_ad()) {
+ if (!net.minecraftforge.event.ForgeEventFactory.renderFireOverlay(field_78455_a.field_71439_g, p_78447_1_))
this.func_78442_d();
}
}
@@ -538,6 +545,15 @@
this.field_187471_h = MathHelper.func_76131_a(this.field_187471_h - 0.4F, 0.0F, 1.0F);
} else {
float f = entityplayersp.func_184825_o(1.0F);
+
+ boolean requipM = net.minecraftforge.client.ForgeHooksClient.shouldCauseReequipAnimation(this.field_187467_d, itemstack, entityplayersp.field_71071_by.field_70461_c);
+ boolean requipO = net.minecraftforge.client.ForgeHooksClient.shouldCauseReequipAnimation(this.field_187468_e, itemstack1, -1);
+
+ if (!requipM && !Objects.equals(this.field_187467_d, itemstack))
+ this.field_187467_d = itemstack;
+ if (!requipO && !Objects.equals(this.field_187468_e, itemstack1))
+ this.field_187468_e = itemstack1;
+
this.field_187469_f += MathHelper.func_76131_a((Objects.equals(this.field_187467_d, itemstack) ? f * f * f : 0.0F) - this.field_187469_f, -0.4F, 0.4F);
this.field_187471_h += MathHelper.func_76131_a((float)(Objects.equals(this.field_187468_e, itemstack1) ? 1 : 0) - this.field_187471_h, -0.4F, 0.4F);
}

View File

@ -0,0 +1,54 @@
--- a/net/minecraft/client/renderer/FogRenderer.java
+++ b/net/minecraft/client/renderer/FogRenderer.java
@@ -116,6 +116,9 @@
if (f4 > 1.0F / this.field_205095_e) {
f4 = 1.0F / this.field_205095_e;
}
+
+ // Forge: fix MC-4647 and MC-10480
+ if (Float.isInfinite(f4)) f4 = Math.nextAfter(f4, 0.0);
this.field_205093_c = this.field_205093_c * (1.0F - f2) + this.field_205093_c * f4 * f2;
this.field_205094_d = this.field_205094_d * (1.0F - f2) + this.field_205094_d * f4 * f2;
@@ -130,12 +133,22 @@
if (f5 > 1.0F / this.field_205095_e) {
f5 = 1.0F / this.field_205095_e;
}
+
+ // Forge: fix MC-4647 and MC-10480
+ if (Float.isInfinite(f5)) f5 = Math.nextAfter(f5, 0.0);
this.field_205093_c = this.field_205093_c * (1.0F - f3) + this.field_205093_c * f5 * f3;
this.field_205094_d = this.field_205094_d * (1.0F - f3) + this.field_205094_d * f5 * f3;
this.field_205095_e = this.field_205095_e * (1.0F - f3) + this.field_205095_e * f5 * f3;
}
+
+ net.minecraftforge.client.event.EntityViewRenderEvent.FogColors event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogColors(this, this.field_205104_n, entity, ActiveRenderInfo.func_186703_a(world, entity, p_78466_1_), ifluidstate, p_78466_1_, this.field_205093_c, this.field_205094_d, this.field_205095_e);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event);
+ this.field_205093_c = event.getRed();
+ this.field_205094_d = event.getGreen();
+ this.field_205095_e = event.getBlue();
+
GlStateManager.func_179082_a(this.field_205093_c, this.field_205094_d, this.field_205095_e, 0.0F);
}
@@ -227,6 +240,10 @@
GlStateManager.func_187432_a(0.0F, -1.0F, 0.0F);
GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
IFluidState ifluidstate = ActiveRenderInfo.func_206243_b(this.field_205105_o.field_71441_e, entity, p_78468_2_);
+ net.minecraft.block.state.IBlockState iblockstate = ActiveRenderInfo.func_186703_a(this.field_205105_o.field_71441_e, entity, p_78468_2_);
+ float hook = net.minecraftforge.client.ForgeHooksClient.getFogDensity(this, this.field_205104_n, entity, iblockstate, ifluidstate, p_78468_2_, 0.1F);
+ if (hook >= 0) GlStateManager.func_179095_a(hook);
+ else
if (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70644_a(MobEffects.field_76440_q)) {
float f2 = 5.0F;
int i = ((EntityLivingBase)entity).func_70660_b(MobEffects.field_76440_q).func_76459_b();
@@ -286,6 +303,7 @@
GlStateManager.func_179102_b(f1 * 0.05F);
GlStateManager.func_179153_c(Math.min(f1, 192.0F) * 0.5F);
}
+ net.minecraftforge.client.ForgeHooksClient.onFogRender(this, this.field_205104_n, entity, iblockstate, ifluidstate, p_78468_2_, p_78468_1_, f1);
}
GlStateManager.func_179142_g();

View File

@ -0,0 +1,37 @@
--- a/net/minecraft/client/renderer/InventoryEffectRenderer.java
+++ b/net/minecraft/client/renderer/InventoryEffectRenderer.java
@@ -25,10 +25,16 @@
}
protected void func_175378_g() {
- if (this.field_146297_k.field_71439_g.func_70651_bq().isEmpty()) {
+ boolean hasVisibleEffect = false;
+ for(PotionEffect potioneffect : this.field_146297_k.field_71439_g.func_70651_bq()) {
+ Potion potion = potioneffect.func_188419_a();
+ if(potion.shouldRender(potioneffect)) { hasVisibleEffect = true; break; }
+ }
+ if (this.field_146297_k.field_71439_g.func_70651_bq().isEmpty() || !hasVisibleEffect) {
this.field_147003_i = (this.field_146294_l - this.field_146999_f) / 2;
this.field_147045_u = false;
} else {
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.PotionShiftEvent(this))) this.field_147003_i = (this.field_146294_l - this.field_146999_f) / 2; else
this.field_147003_i = 160 + (this.field_146294_l - this.field_146999_f - 200) / 2;
this.field_147045_u = true;
}
@@ -58,6 +64,7 @@
for(PotionEffect potioneffect : Ordering.natural().sortedCopy(collection)) {
Potion potion = potioneffect.func_188419_a();
+ if(!potion.shouldRender(potioneffect)) continue;
GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
this.field_146297_k.func_110434_K().func_110577_a(field_147001_a);
this.func_73729_b(i, j, 0, 166, 140, 32);
@@ -66,6 +73,8 @@
this.func_73729_b(i + 6, j + 7, i1 % 12 * 18, 198 + i1 / 12 * 18, 18, 18);
}
+ potion.renderInventoryEffect(i, j, potioneffect, field_146297_k);
+ if (!potion.shouldRenderInvText(potioneffect)) { j += l; continue; }
String s1 = I18n.func_135052_a(potion.func_76393_a());
if (potioneffect.func_76458_c() == 1) {
s1 = s1 + ' ' + I18n.func_135052_a("enchantment.level.2");

View File

@ -0,0 +1,12 @@
--- a/net/minecraft/client/renderer/ItemModelMesher.java
+++ b/net/minecraft/client/renderer/ItemModelMesher.java
@@ -31,7 +31,8 @@
public TextureAtlasSprite func_199309_a(ItemStack p_199309_1_) {
IBakedModel ibakedmodel = this.func_178089_a(p_199309_1_);
- return (ibakedmodel == this.field_178090_d.func_174951_a() || ibakedmodel.func_188618_c()) && p_199309_1_.func_77973_b() instanceof ItemBlock ? this.field_178090_d.func_174954_c().func_178122_a(((ItemBlock)p_199309_1_.func_77973_b()).func_179223_d().func_176223_P()) : ibakedmodel.func_177554_e();
+ // FORGE: Make sure to call the item overrides
+ return (ibakedmodel == this.field_178090_d.func_174951_a() || ibakedmodel.func_188618_c()) && p_199309_1_.func_77973_b() instanceof ItemBlock ? this.field_178090_d.func_174954_c().func_178122_a(((ItemBlock)p_199309_1_.func_77973_b()).func_179223_d().func_176223_P()) : ibakedmodel.func_188617_f().func_209581_a(ibakedmodel, p_199309_1_, null, null).func_177554_e();
}
public IBakedModel func_178089_a(ItemStack p_178089_1_) {

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/ItemRenderer.java
+++ b/net/minecraft/client/renderer/ItemRenderer.java
@@ -49,7 +49,7 @@
@@ -49,13 +49,14 @@
public ItemRenderer(TextureManager p_i46552_1_, ModelManager p_i46552_2_, ItemColors p_i46552_3_) {
this.field_175057_n = p_i46552_1_;
@ -9,6 +9,91 @@
for(Item item : Item.field_150901_e) {
if (!field_195411_c.contains(item)) {
this.field_175059_m.func_199311_a(item, new ModelResourceLocation(Item.field_150901_e.func_177774_c(item), "inventory"));
}
}
+ net.minecraftforge.client.model.ModelLoader.onRegisterItems(this.field_175059_m);
this.field_184395_f = p_i46552_3_;
}
@@ -96,7 +97,7 @@
if (p_180454_2_.func_188618_c()) {
GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.func_179091_B();
- TileEntityItemStackRenderer.field_147719_a.func_179022_a(p_180454_1_);
+ p_180454_1_.func_77973_b().getTileEntityItemStackRenderer().func_179022_a(p_180454_1_);
} else {
this.func_191961_a(p_180454_2_, p_180454_1_);
if (p_180454_1_.func_77962_s()) {
@@ -162,7 +163,7 @@
k = k | -16777216;
}
- this.func_191969_a(p_191970_1_, bakedquad, k);
+ net.minecraftforge.client.model.pipeline.LightUtil.renderQuadColor(p_191970_1_, bakedquad, k);
}
}
@@ -223,11 +224,8 @@
GlStateManager.func_179147_l();
GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.func_179094_E();
- ItemCameraTransforms itemcameratransforms = p_184394_2_.func_177552_f();
- ItemCameraTransforms.func_188034_a(itemcameratransforms.func_181688_b(p_184394_3_), p_184394_4_);
- if (this.func_183005_a(itemcameratransforms.func_181688_b(p_184394_3_))) {
- GlStateManager.func_187407_a(GlStateManager.CullFace.FRONT);
- }
+ // TODO: check if negative scale is a thing
+ p_184394_2_ = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(p_184394_2_, p_184394_3_, p_184394_4_);
this.func_180454_a(p_184394_1_, p_184394_2_);
GlStateManager.func_187407_a(GlStateManager.CullFace.BACK);
@@ -258,7 +256,7 @@
GlStateManager.func_187401_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
this.func_180452_a(p_191962_2_, p_191962_3_, p_191962_4_.func_177556_c());
- p_191962_4_.func_177552_f().func_181689_a(ItemCameraTransforms.TransformType.GUI);
+ p_191962_4_ = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(p_191962_4_, ItemCameraTransforms.TransformType.GUI, false);
this.func_180454_a(p_191962_1_, p_191962_4_);
GlStateManager.func_179118_c();
GlStateManager.func_179101_C();
@@ -297,6 +295,7 @@
crashreportcategory.func_189529_a("Item Type", () -> {
return String.valueOf((Object)p_184391_2_.func_77973_b());
});
+ crashreportcategory.func_189529_a("Registry Name", () -> String.valueOf(p_184391_2_.func_77973_b().getRegistryName()));
crashreportcategory.func_189529_a("Item Damage", () -> {
return String.valueOf(p_184391_2_.func_77952_i());
});
@@ -327,9 +326,12 @@
p_180453_1_.func_175063_a(s, (float)(p_180453_3_ + 19 - 2 - p_180453_1_.func_78256_a(s)), (float)(p_180453_4_ + 6 + 3), 16777215);
GlStateManager.func_179145_e();
GlStateManager.func_179126_j();
+ // Fixes opaque cooldown overlay a bit lower
+ // TODO: check if enabled blending still screws things up down the line.
+ GlStateManager.func_179147_l();
}
- if (p_180453_2_.func_77951_h()) {
+ if (p_180453_2_.func_77973_b().showDurabilityBar(p_180453_2_)) {
GlStateManager.func_179140_f();
GlStateManager.func_179097_i();
GlStateManager.func_179090_x();
@@ -337,11 +339,9 @@
GlStateManager.func_179084_k();
Tessellator tessellator = Tessellator.func_178181_a();
BufferBuilder bufferbuilder = tessellator.func_178180_c();
- float f = (float)p_180453_2_.func_77952_i();
- float f1 = (float)p_180453_2_.func_77958_k();
- float f2 = Math.max(0.0F, (f1 - f) / f1);
- int i = Math.round(13.0F - f * 13.0F / f1);
- int j = MathHelper.func_181758_c(f2 / 3.0F, 1.0F, 1.0F);
+ double health = p_180453_2_.func_77973_b().getDurabilityForDisplay(p_180453_2_);
+ int i = Math.round(13.0F - (float)health * 13.0F);
+ int j = p_180453_2_.func_77973_b().getRGBDurabilityForDisplay(p_180453_2_);
this.func_181565_a(bufferbuilder, p_180453_3_ + 2, p_180453_4_ + 13, 13, 2, 0, 0, 0, 255);
this.func_181565_a(bufferbuilder, p_180453_3_ + 2, p_180453_4_ + 13, i, 1, j >> 16 & 255, j >> 8 & 255, j & 255, 255);
GlStateManager.func_179147_l();
@@ -380,4 +380,9 @@
public void func_195410_a(IResourceManager p_195410_1_) {
this.field_175059_m.func_178085_b();

View File

@ -0,0 +1,19 @@
--- a/net/minecraft/client/renderer/LightTexture.java
+++ b/net/minecraft/client/renderer/LightTexture.java
@@ -110,7 +110,16 @@
f11 = 0.28F + f8 * 0.75F;
f12 = 0.25F + f9 * 0.75F;
}
+
+ float[] colors = {f10, f11, f12};
+ world.func_201675_m().getLightmapColors(p_205106_1_, f, f4, f5, colors);
+ f10 = colors[0]; f11 = colors[1]; f12 = colors[2];
+ // Forge: fix MC-58177
+ f10 = net.minecraft.util.math.MathHelper.func_76131_a(f10, 0f, 1f);
+ f11 = net.minecraft.util.math.MathHelper.func_76131_a(f11, 0f, 1f);
+ f12 = net.minecraft.util.math.MathHelper.func_76131_a(f12, 0f, 1f);
+
if (f2 > 0.0F) {
float f17 = 1.0F / f10;
if (f17 > 1.0F / f11) {

View File

@ -0,0 +1,24 @@
--- a/net/minecraft/client/renderer/OpenGlHelper.java
+++ b/net/minecraft/client/renderer/OpenGlHelper.java
@@ -98,6 +98,10 @@
p_203093_0_.put(1286, "Operation on incomplete framebuffer");
});
+ /* Stores the last values sent into glMultiTexCoord2f */
+ public static float lastBrightnessX = 0.0f;
+ public static float lastBrightnessY = 0.0f;
+
public static void func_77474_a() {
GLCapabilities glcapabilities = GL.getCapabilities();
field_153215_z = glcapabilities.GL_ARB_multitexture && !glcapabilities.OpenGL13;
@@ -705,6 +709,10 @@
GL13.glMultiTexCoord2f(p_77475_0_, p_77475_1_, p_77475_2_);
}
+ if (p_77475_0_ == field_77476_b) {
+ lastBrightnessX = p_77475_1_;
+ lastBrightnessY = p_77475_2_;
+ }
}
public static void func_148821_a(int p_148821_0_, int p_148821_1_, int p_148821_2_, int p_148821_3_) {

View File

@ -1,6 +1,146 @@
--- a/net/minecraft/client/renderer/RenderGlobal.java
+++ b/net/minecraft/client/renderer/RenderGlobal.java
@@ -2126,6 +2126,11 @@
@@ -507,7 +507,9 @@
}
public void func_180446_a(Entity p_180446_1_, ICamera p_180446_2_, float p_180446_3_) {
+ int pass = net.minecraftforge.client.MinecraftForgeClient.getRenderPass();
if (this.field_72740_G > 0) {
+ if (pass > 0) return;
--this.field_72740_G;
} else {
double d0 = p_180446_1_.field_70169_q + (p_180446_1_.field_70165_t - p_180446_1_.field_70169_q) * (double)p_180446_3_;
@@ -516,9 +518,11 @@
this.field_72769_h.field_72984_F.func_76320_a("prepare");
TileEntityRendererDispatcher.field_147556_a.func_190056_a(this.field_72769_h, this.field_72777_q.func_110434_K(), this.field_72777_q.field_71466_p, this.field_72777_q.func_175606_aa(), this.field_72777_q.field_71476_x, p_180446_3_);
this.field_175010_j.func_180597_a(this.field_72769_h, this.field_72777_q.field_71466_p, this.field_72777_q.func_175606_aa(), this.field_72777_q.field_147125_j, this.field_72777_q.field_71474_y, p_180446_3_);
+ if(pass == 0) {
this.field_72748_H = 0;
this.field_72749_I = 0;
this.field_72750_J = 0;
+ }
Entity entity = this.field_72777_q.func_175606_aa();
double d3 = entity.field_70142_S + (entity.field_70165_t - entity.field_70142_S) * (double)p_180446_3_;
double d4 = entity.field_70137_T + (entity.field_70163_u - entity.field_70137_T) * (double)p_180446_3_;
@@ -530,10 +534,12 @@
this.field_72777_q.field_71460_t.func_180436_i();
this.field_72769_h.field_72984_F.func_76318_c("global");
List<Entity> list = this.field_72769_h.func_72910_y();
+ if (pass == 0) {
this.field_72748_H = list.size();
-
+ }
for(int i = 0; i < this.field_72769_h.field_73007_j.size(); ++i) {
Entity entity1 = this.field_72769_h.field_73007_j.get(i);
+ if (!entity1.shouldRenderInPass(pass)) continue;
++this.field_72749_I;
if (entity1.func_145770_h(d0, d1, d2)) {
this.field_175010_j.func_188388_a(entity1, p_180446_3_, false);
@@ -550,6 +556,7 @@
ClassInheritanceMultiMap<Entity> classinheritancemultimap = chunk.func_177429_s()[renderglobal$containerlocalrenderinformation.field_178036_a.func_178568_j().func_177956_o() / 16];
if (!classinheritancemultimap.isEmpty()) {
for(Entity entity2 : classinheritancemultimap) {
+ if(!entity2.shouldRenderInPass(pass)) continue;
boolean flag = this.field_175010_j.func_178635_a(entity2, p_180446_2_, d0, d1, d2) || entity2.func_184215_y(this.field_72777_q.field_71439_g);
if (flag) {
boolean flag1 = this.field_72777_q.func_175606_aa() instanceof EntityLivingBase && ((EntityLivingBase)this.field_72777_q.func_175606_aa()).func_70608_bn();
@@ -576,6 +583,7 @@
}
}
+ if(pass == 0)
if (this.func_174985_d() && (!list1.isEmpty() || this.field_184386_ad)) {
this.field_72769_h.field_72984_F.func_76318_c("entityOutlines");
this.field_175015_z.func_147614_f();
@@ -611,10 +619,12 @@
this.field_72769_h.field_72984_F.func_76318_c("blockentities");
RenderHelper.func_74519_b();
+ TileEntityRendererDispatcher.field_147556_a.preDrawBatch();
for(RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation1 : this.field_72755_R) {
List<TileEntity> list3 = renderglobal$containerlocalrenderinformation1.field_178036_a.func_178571_g().func_178485_b();
if (!list3.isEmpty()) {
for(TileEntity tileentity1 : list3) {
+ if (!tileentity1.shouldRenderInPass(pass) || !p_180446_2_.func_78546_a(tileentity1.getRenderBoundingBox())) continue;
TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity1, p_180446_3_, -1);
}
}
@@ -622,10 +632,12 @@
synchronized(this.field_181024_n) {
for(TileEntity tileentity : this.field_181024_n) {
+ if (!tileentity.shouldRenderInPass(pass) || !p_180446_2_.func_78546_a(tileentity.getRenderBoundingBox())) continue;
TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity, p_180446_3_, -1);
}
}
-
+ TileEntityRendererDispatcher.field_147556_a.drawBatch(pass);
+
this.func_180443_s();
for(DestroyBlockProgress destroyblockprogress : this.field_72738_E.values()) {
@@ -767,7 +779,7 @@
for(int j = -this.field_72739_F; j <= this.field_72739_F; ++j) {
for(int k = -this.field_72739_F; k <= this.field_72739_F; ++k) {
RenderChunk renderchunk1 = this.field_175008_n.func_178161_a(new BlockPos((j << 4) + 8, i, (k << 4) + 8));
- if (renderchunk1 != null && p_195473_3_.func_78546_a(renderchunk1.field_178591_c)) {
+ if (renderchunk1 != null && p_195473_3_.func_78546_a(renderchunk1.field_178591_c.func_72321_a(0.0, blockpos1.func_177956_o() > 0 ? Double.POSITIVE_INFINITY : Double.NEGATIVE_INFINITY, 0.0))) { // Forge: fix MC-73139
renderchunk1.func_178577_a(p_195473_4_);
queue.add(new RenderGlobal.ContainerLocalRenderInformation(renderchunk1, (EnumFacing)null, 0));
}
@@ -812,7 +824,7 @@
this.field_147595_R = true;
BlockPos blockpos2 = renderchunk4.func_178568_j().func_177982_a(8, 8, 8);
boolean flag3 = blockpos2.func_177951_i(blockpos1) < 768.0D;
- if (!renderchunk4.func_188281_o() && !flag3) {
+ if (net.minecraftforge.common.ForgeMod.alwaysSetupTerrainOffThread || !renderchunk4.func_188281_o() && !flag3) {
this.field_175009_l.add(renderchunk4);
} else {
this.field_72777_q.field_71424_I.func_76320_a("build near");
@@ -1032,6 +1044,12 @@
}
public void func_195465_a(float p_195465_1_) {
+ net.minecraftforge.client.IRenderHandler renderer = this.field_72769_h.func_201675_m().getSkyRenderer();
+ if (renderer != null) {
+ renderer.render(p_195465_1_, field_72769_h, field_72777_q);
+ return;
+ }
+
if (this.field_72777_q.field_71441_e.field_73011_w.func_186058_p().func_186068_a() == 1) {
this.func_180448_r();
} else if (this.field_72777_q.field_71441_e.field_73011_w.func_76569_d()) {
@@ -1176,6 +1194,7 @@
}
public void func_195466_a(float p_195466_1_, double p_195466_2_, double p_195466_4_, double p_195466_6_) {
+ if (net.minecraftforge.client.CloudRenderer.renderClouds(this.field_72773_u, p_195466_1_, this.field_72769_h, field_72777_q)) return;
if (this.field_72777_q.field_71441_e.field_73011_w.func_76569_d()) {
float f = 12.0F;
float f1 = 4.0F;
@@ -1552,7 +1571,11 @@
DestroyBlockProgress destroyblockprogress = iterator.next();
BlockPos blockpos = destroyblockprogress.func_180246_b();
Block block = this.field_72769_h.func_180495_p(blockpos).func_177230_c();
- if (!(block instanceof BlockChest) && !(block instanceof BlockEnderChest) && !(block instanceof BlockSign) && !(block instanceof BlockAbstractSkull)) {
+ TileEntity te = this.field_72769_h.func_175625_s(blockpos);
+ boolean hasBreak = block instanceof BlockChest || block instanceof BlockEnderChest || block instanceof BlockSign || block instanceof BlockAbstractSkull;
+ if (!hasBreak) hasBreak = te != null && te.canRenderBreaking();
+
+ if (!hasBreak) {
double d3 = (double)blockpos.func_177958_n() - d0;
double d4 = (double)blockpos.func_177956_o() - d1;
double d5 = (double)blockpos.func_177952_p() - d2;
@@ -2006,7 +2029,7 @@
case 2001:
IBlockState iblockstate = Block.func_196257_b(p_180439_4_);
if (!iblockstate.func_196958_f()) {
- SoundType soundtype = iblockstate.func_177230_c().func_185467_w();
+ SoundType soundtype = iblockstate.func_177230_c().getSoundType(iblockstate, field_72769_h, p_180439_3_, null);
this.field_72769_h.func_184156_a(p_180439_3_, soundtype.func_185845_c(), SoundCategory.BLOCKS, (soundtype.func_185843_a() + 1.0F) / 2.0F, soundtype.func_185847_b() * 0.8F, false);
}
@@ -2126,6 +2149,11 @@
}
}

View File

@ -0,0 +1,57 @@
--- a/net/minecraft/client/renderer/WorldVertexBufferUploader.java
+++ b/net/minecraft/client/renderer/WorldVertexBufferUploader.java
@@ -22,25 +22,9 @@
int k = vertexformatelement.func_177367_b().func_177397_c();
int l = vertexformatelement.func_177369_e();
bytebuffer.position(vertexformat.func_181720_d(j));
- switch(vertexformatelement$enumusage) {
- case POSITION:
- GlStateManager.func_187427_b(vertexformatelement.func_177370_d(), k, i, bytebuffer);
- GlStateManager.func_187410_q(32884);
- break;
- case UV:
- OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a + l);
- GlStateManager.func_187404_a(vertexformatelement.func_177370_d(), k, i, bytebuffer);
- GlStateManager.func_187410_q(32888);
- OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a);
- break;
- case COLOR:
- GlStateManager.func_187400_c(vertexformatelement.func_177370_d(), k, i, bytebuffer);
- GlStateManager.func_187410_q(32886);
- break;
- case NORMAL:
- GlStateManager.func_187446_a(k, i, bytebuffer);
- GlStateManager.func_187410_q(32885);
- }
+
+ // moved to VertexFormatElement.preDraw
+ vertexformatelement.func_177375_c().preDraw(vertexformat, j, i, bytebuffer);
}
GlStateManager.func_187439_f(p_181679_1_.func_178979_i(), 0, p_181679_1_.func_178989_h());
@@ -50,22 +34,9 @@
VertexFormatElement vertexformatelement1 = list.get(i1);
VertexFormatElement.EnumUsage vertexformatelement$enumusage1 = vertexformatelement1.func_177375_c();
int k1 = vertexformatelement1.func_177369_e();
- switch(vertexformatelement$enumusage1) {
- case POSITION:
- GlStateManager.func_187429_p(32884);
- break;
- case UV:
- OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a + k1);
- GlStateManager.func_187429_p(32888);
- OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a);
- break;
- case COLOR:
- GlStateManager.func_187429_p(32886);
- GlStateManager.func_179117_G();
- break;
- case NORMAL:
- GlStateManager.func_187429_p(32885);
- }
+
+ // moved to VertexFormatElement.postDraw
+ vertexformatelement1.func_177375_c().postDraw(vertexformat, i1, i, bytebuffer);
}
}

View File

@ -36,7 +36,7 @@
+ @Override
+ public void pipe(net.minecraftforge.client.model.pipeline.IVertexConsumer consumer) {
+ net.minecraftforge.client.model.pipeline.LightUtil.putBakedQuad(consumer, this);
}
+ }
+
+ public net.minecraft.client.renderer.vertex.VertexFormat getFormat() {
+ return format;
@ -45,4 +45,4 @@
+ public boolean shouldApplyDiffuseLighting() {
+ return applyDiffuseLighting;
+ }
+}
}

View File

@ -0,0 +1,22 @@
--- a/net/minecraft/client/renderer/block/model/BakedQuadRetextured.java
+++ b/net/minecraft/client/renderer/block/model/BakedQuadRetextured.java
@@ -17,10 +17,15 @@
private void func_178217_e() {
for(int i = 0; i < 4; ++i) {
- int j = 7 * i;
- this.field_178215_a[j + 4] = Float.floatToRawIntBits(this.field_178218_d.func_94214_a((double)this.field_187509_d.func_188537_a(Float.intBitsToFloat(this.field_178215_a[j + 4]))));
- this.field_178215_a[j + 4 + 1] = Float.floatToRawIntBits(this.field_178218_d.func_94207_b((double)this.field_187509_d.func_188536_b(Float.intBitsToFloat(this.field_178215_a[j + 4 + 1]))));
+ int j = format.func_181719_f() * i;
+ int uvIndex = format.func_177344_b(0) / 4;
+ this.field_178215_a[j + uvIndex] = Float.floatToRawIntBits(this.field_178218_d.func_94214_a((double)this.field_187509_d.func_188537_a(Float.intBitsToFloat(this.field_178215_a[j + uvIndex]))));
+ this.field_178215_a[j + uvIndex + 1] = Float.floatToRawIntBits(this.field_178218_d.func_94207_b((double)this.field_187509_d.func_188536_b(Float.intBitsToFloat(this.field_178215_a[j + uvIndex + 1]))));
}
-
}
+
+ @Override
+ public TextureAtlasSprite func_187508_a() {
+ return field_178218_d;
+ }
}

View File

@ -15,7 +15,7 @@
}
- int[] aint = this.func_188012_a(blockfaceuv, p_199332_4_, p_199332_5_, this.func_199337_a(p_199332_1_, p_199332_2_), p_199332_6_, p_199332_7_, p_199332_9_);
+ int[] aint = this.makeQuadVertexData(blockfaceuv, p_199332_4_, p_199332_5_, this.func_199337_a(p_199332_1_, p_199332_2_), p_199332_6_, p_199332_7_, p_199332_9_);
+ int[] aint = this.makeQuadVertexData(blockfaceuv, p_199332_4_, p_199332_5_, this.func_199337_a(p_199332_1_, p_199332_2_), p_199332_6_, p_199332_7_, false);
EnumFacing enumfacing = func_178410_a(aint);
if (p_199332_7_ == null) {
this.func_178408_a(aint, enumfacing);
@ -23,7 +23,7 @@
- return new BakedQuad(aint, p_199332_3_.field_178245_c, enumfacing, p_199332_4_);
+ net.minecraftforge.client.ForgeHooksClient.fillNormal(aint, enumfacing);
+ return new BakedQuad(aint, p_199332_3_.field_178245_c, enumfacing, p_199332_4_, p_199332_9_, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176600_a);
+ return new BakedQuad(aint, p_199332_3_.field_178245_c, enumfacing, p_199332_4_, p_199332_9_, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176599_b);
}
private BlockFaceUV func_188010_a(BlockFaceUV p_188010_1_, EnumFacing p_188010_2_, ModelRotation p_188010_3_) {

View File

@ -1,6 +1,15 @@
--- a/net/minecraft/client/renderer/block/model/IBakedModel.java
+++ b/net/minecraft/client/renderer/block/model/IBakedModel.java
@@ -21,7 +21,18 @@
@@ -10,7 +10,7 @@
import net.minecraftforge.api.distmarker.OnlyIn;
@OnlyIn(Dist.CLIENT)
-public interface IBakedModel {
+public interface IBakedModel extends net.minecraftforge.client.extensions.IForgeBakedModel {
List<BakedQuad> func_200117_a(@Nullable IBlockState p_200117_1_, @Nullable EnumFacing p_200117_2_, Random p_200117_3_);
boolean func_177555_b();
@@ -21,7 +21,8 @@
TextureAtlasSprite func_177554_e();
@ -9,14 +18,4 @@
+ default ItemCameraTransforms func_177552_f() { return ItemCameraTransforms.field_178357_a; }
ItemOverrideList func_188617_f();
+
+ default boolean isAmbientOcclusion(IBlockState state) { return func_177555_b(); }
+
+ /*
+ * Returns the pair of the model for the given perspective, and the matrix
+ * that should be applied to the GL state before rendering it (matrix may be null).
+ */
+ default org.apache.commons.lang3.tuple.Pair<? extends IBakedModel, javax.vecmath.Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) {
+ return net.minecraftforge.client.ForgeHooksClient.handlePerspective(this, cameraTransformType);
}
+}

View File

@ -22,5 +22,5 @@
+ @Deprecated
+ default IBakedModel func_209558_a(Function<ResourceLocation, IUnbakedModel> p_209558_1_, Function<ResourceLocation, TextureAtlasSprite> p_209558_2_, ModelRotation p_209558_3_, boolean p_209558_4_) {
+ return bake(p_209558_1_, p_209558_2_, p_209558_3_, p_209558_4_, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176600_a);
+ }
}
+}

View File

@ -0,0 +1,11 @@
--- a/net/minecraft/client/renderer/block/model/ModelBakery.java
+++ b/net/minecraft/client/renderer/block/model/ModelBakery.java
@@ -200,7 +200,7 @@
flag = true;
lvt_9_4_ = (List)this.field_177598_f.func_199004_b(resourcelocation1).stream().map((p_209591_1_) -> {
try (InputStream inputstream = p_209591_1_.func_199027_b()) {
- Pair pair1 = Pair.of(p_209591_1_.func_199026_d(), ModelBlockDefinition.func_209577_a(this.field_209610_F, new InputStreamReader(inputstream, StandardCharsets.UTF_8)));
+ Pair pair1 = Pair.of(p_209591_1_.func_199026_d(), ModelBlockDefinition.parseFromReader(this.field_209610_F, new InputStreamReader(inputstream, StandardCharsets.UTF_8), p_209598_1_));
return pair1;
} catch (Exception exception1) {
throw new ModelBakery.BlockStateDefinitionException(String.format("Exception loading blockstate definition: '%s' in resourcepack: '%s': %s", p_209591_1_.func_199029_a(), p_209591_1_.func_199026_d(), exception1.getMessage()));

View File

@ -0,0 +1,18 @@
--- a/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java
+++ b/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java
@@ -30,9 +30,14 @@
private final Map<String, VariantList> field_178332_b = Maps.<String, VariantList>newLinkedHashMap();
private Multipart field_188005_c;
+ @Deprecated
public static ModelBlockDefinition func_209577_a(ModelBlockDefinition.ContainerHolder p_209577_0_, Reader p_209577_1_) {
- return (ModelBlockDefinition)JsonUtils.func_193839_a(p_209577_0_.field_209575_a, p_209577_1_, ModelBlockDefinition.class);
+ return parseFromReader(p_209577_0_, p_209577_1_, null);
}
+
+ public static ModelBlockDefinition parseFromReader(ModelBlockDefinition.ContainerHolder containerHolder, Reader reader, net.minecraft.util.ResourceLocation location) {
+ return net.minecraftforge.client.model.BlockStateLoader.load(reader, location, containerHolder.field_209575_a);
+ }
public ModelBlockDefinition(Map<String, VariantList> p_i46572_1_, Multipart p_i46572_2_) {
this.field_188005_c = p_i46572_2_;

View File

@ -1,6 +1,18 @@
--- a/net/minecraft/client/renderer/block/model/ModelManager.java
+++ b/net/minecraft/client/renderer/block/model/ModelManager.java
@@ -39,4 +39,9 @@
@@ -21,9 +21,10 @@
}
public void func_195410_a(IResourceManager p_195410_1_) {
- ModelBakery modelbakery = new ModelBakery(p_195410_1_, this.field_174956_b);
+ net.minecraftforge.client.model.ModelLoader modelbakery = new net.minecraftforge.client.model.ModelLoader(p_195410_1_, this.field_174956_b);
this.field_174958_a = modelbakery.func_177570_a();
this.field_174955_d = this.field_174958_a.func_82594_a(ModelBakery.field_177604_a);
+ net.minecraftforge.client.ForgeHooksClient.onModelBake(this, this.field_174958_a, modelbakery);
this.field_174957_c.func_178124_c();
}
@@ -39,4 +40,9 @@
public BlockModelShapes func_174954_c() {
return this.field_174957_c;
}

View File

@ -0,0 +1,13 @@
--- a/net/minecraft/client/renderer/block/model/ModelResourceLocation.java
+++ b/net/minecraft/client/renderer/block/model/ModelResourceLocation.java
@@ -2,10 +2,7 @@
import java.util.Locale;
import net.minecraft.util.ResourceLocation;
-import net.minecraftforge.api.distmarker.Dist;
-import net.minecraftforge.api.distmarker.OnlyIn;
-@OnlyIn(Dist.CLIENT)
public class ModelResourceLocation extends ResourceLocation {
private final String field_177519_c;

View File

@ -0,0 +1,11 @@
--- a/net/minecraft/client/renderer/block/model/SimpleBakedModel.java
+++ b/net/minecraft/client/renderer/block/model/SimpleBakedModel.java
@@ -75,7 +75,7 @@
}
public Builder(IBlockState p_i48189_1_, IBakedModel p_i48189_2_, TextureAtlasSprite p_i48189_3_, Random p_i48189_4_, long p_i48189_5_) {
- this(p_i48189_2_.func_177555_b(), p_i48189_2_.func_177556_c(), p_i48189_2_.func_177552_f(), p_i48189_2_.func_188617_f());
+ this(p_i48189_2_.isAmbientOcclusion(p_i48189_1_), p_i48189_2_.func_177556_c(), p_i48189_2_.func_177552_f(), p_i48189_2_.func_188617_f());
this.field_177652_d = p_i48189_2_.func_177554_e();
for(EnumFacing enumfacing : EnumFacing.values()) {

View File

@ -0,0 +1,12 @@
--- a/net/minecraft/client/renderer/block/model/WeightedBakedModel.java
+++ b/net/minecraft/client/renderer/block/model/WeightedBakedModel.java
@@ -30,6 +30,9 @@
public boolean func_177555_b() {
return this.field_177566_c.func_177555_b();
}
+
+ @Override
+ public boolean isAmbientOcclusion(IBlockState state) { return this.field_177566_c.isAmbientOcclusion(state); }
public boolean func_177556_c() {
return this.field_177566_c.func_177556_c();

View File

@ -0,0 +1,18 @@
--- a/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java
+++ b/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java
@@ -44,9 +44,14 @@
private final ChunkRenderWorker field_178525_i;
public ChunkRenderDispatcher() {
+ this(-1);
+ }
+
+ public ChunkRenderDispatcher(int countRenderBuilders) {
int i = Math.max(1, (int)((double)Runtime.getRuntime().maxMemory() * 0.3D) / 10485760);
int j = Math.max(1, MathHelper.func_76125_a(Runtime.getRuntime().availableProcessors(), 1, i / 5));
- this.field_188249_c = MathHelper.func_76125_a(j * 10, 1, i);
+ if(countRenderBuilders < 0) countRenderBuilders = MathHelper.func_76125_a(j * 10, 1, i);
+ this.field_188249_c = countRenderBuilders;
if (j > 1) {
for(int k = 0; k < j; ++k) {
ChunkRenderWorker chunkrenderworker = new ChunkRenderWorker(this);

View File

@ -0,0 +1,74 @@
--- a/net/minecraft/client/renderer/chunk/RenderChunk.java
+++ b/net/minecraft/client/renderer/chunk/RenderChunk.java
@@ -37,7 +37,7 @@
import net.minecraftforge.api.distmarker.OnlyIn;
@OnlyIn(Dist.CLIENT)
-public class RenderChunk {
+public class RenderChunk implements net.minecraftforge.client.extensions.IForgeRenderChunk {
private volatile World field_178588_d;
private final RenderGlobal field_178589_e;
public static int field_178592_a;
@@ -128,7 +128,8 @@
p_178581_4_.func_178540_f().unlock();
}
- ChunkCache lvt_10_1_ = new ChunkCache(world, blockpos.func_177982_a(-1, -1, -1), blockpos.func_177982_a(16, 16, 16), 1);
+ ChunkCache lvt_10_1_ = createRegionRenderCache(this.field_178588_d, blockpos.func_177982_a(-1, -1, -1), blockpos.func_177982_a(16, 16, 16), 1);
+ net.minecraftforge.client.MinecraftForgeClient.onRebuildChunk(this.field_178588_d, this.field_178586_f, lvt_10_1_);
VisGraph lvt_11_1_ = new VisGraph();
HashSet lvt_12_1_ = Sets.newHashSet();
if (!lvt_10_1_.func_72806_N()) {
@@ -145,22 +146,23 @@
lvt_11_1_.func_178606_a(blockpos$mutableblockpos);
}
- if (block.func_149716_u()) {
+ if (block.hasTileEntity(iblockstate)) {
TileEntity tileentity = lvt_10_1_.func_190300_a(blockpos$mutableblockpos, Chunk.EnumCreateEntityType.CHECK);
if (tileentity != null) {
TileEntityRenderer<TileEntity> tileentityrenderer = TileEntityRendererDispatcher.field_147556_a.<TileEntity>func_147547_b(tileentity);
if (tileentityrenderer != null) {
- compiledchunk.func_178490_a(tileentity);
if (tileentityrenderer.func_188185_a(tileentity)) {
lvt_12_1_.add(tileentity);
}
+ else compiledchunk.func_178490_a(tileentity); // FORGE: Fix MC-112730
}
}
}
-
+
IFluidState ifluidstate = lvt_10_1_.func_204610_c(blockpos$mutableblockpos);
- if (!ifluidstate.func_206888_e()) {
- BlockRenderLayer blockrenderlayer1 = ifluidstate.func_180664_k();
+ for(BlockRenderLayer blockrenderlayer1 : BlockRenderLayer.values()) {
+ net.minecraftforge.client.ForgeHooksClient.setRenderLayer(blockrenderlayer1);
+ if (!ifluidstate.func_206888_e() && ifluidstate.canRenderInLayer(blockrenderlayer1)) {
int j = blockrenderlayer1.ordinal();
BufferBuilder bufferbuilder = p_178581_4_.func_178545_d().func_179039_a(j);
if (!compiledchunk.func_178492_d(blockrenderlayer1)) {
@@ -171,17 +173,18 @@
aboolean[j] |= blockrendererdispatcher.func_205318_a(blockpos$mutableblockpos, lvt_10_1_, bufferbuilder, ifluidstate);
}
- if (iblockstate.func_185901_i() != EnumBlockRenderType.INVISIBLE) {
- BlockRenderLayer blockrenderlayer2 = block.func_180664_k();
- int k = blockrenderlayer2.ordinal();
+ if (iblockstate.func_185901_i() != EnumBlockRenderType.INVISIBLE && iblockstate.canRenderInLayer(blockrenderlayer1)) {
+ int k = blockrenderlayer1.ordinal();
BufferBuilder bufferbuilder1 = p_178581_4_.func_178545_d().func_179039_a(k);
- if (!compiledchunk.func_178492_d(blockrenderlayer2)) {
- compiledchunk.func_178493_c(blockrenderlayer2);
+ if (!compiledchunk.func_178492_d(blockrenderlayer1)) {
+ compiledchunk.func_178493_c(blockrenderlayer1);
this.func_178573_a(bufferbuilder1, blockpos);
}
aboolean[k] |= blockrendererdispatcher.func_195475_a(iblockstate, blockpos$mutableblockpos, lvt_10_1_, bufferbuilder1, random);
}
+ }
+ net.minecraftforge.client.ForgeHooksClient.setRenderLayer(null);
}
for(BlockRenderLayer blockrenderlayer : BlockRenderLayer.values()) {

View File

@ -0,0 +1,42 @@
--- a/net/minecraft/client/renderer/color/BlockColors.java
+++ b/net/minecraft/client/renderer/color/BlockColors.java
@@ -21,7 +21,8 @@
@OnlyIn(Dist.CLIENT)
public class BlockColors {
- private final ObjectIntIdentityMap<IBlockColor> field_186725_a = new ObjectIntIdentityMap<IBlockColor>(32);
+ // FORGE: Use RegistryDelegates as non-Vanilla block ids are not constant
+ private final java.util.Map<net.minecraftforge.registries.IRegistryDelegate<Block>, IBlockColor> field_186725_a = new java.util.HashMap<>();
public static BlockColors func_186723_a() {
BlockColors blockcolors = new BlockColors();
@@ -62,11 +63,12 @@
blockcolors.func_186722_a((p_210228_0_, p_210228_1_, p_210228_2_, p_210228_3_) -> {
return p_210228_1_ != null && p_210228_2_ != null ? 2129968 : 7455580;
}, Blocks.field_196651_dG);
+ net.minecraftforge.client.ForgeHooksClient.onBlockColorsInit(blockcolors);
return blockcolors;
}
public int func_189991_a(IBlockState p_189991_1_, World p_189991_2_, BlockPos p_189991_3_) {
- IBlockColor iblockcolor = this.field_186725_a.func_148745_a(Block.field_149771_c.func_148757_b(p_189991_1_.func_177230_c()));
+ IBlockColor iblockcolor = this.field_186725_a.get(p_189991_1_.func_177230_c().delegate);
if (iblockcolor != null) {
return iblockcolor.getColor(p_189991_1_, (IWorldReaderBase)null, (BlockPos)null, 0);
} else {
@@ -76,13 +78,13 @@
}
public int func_186724_a(IBlockState p_186724_1_, @Nullable IWorldReaderBase p_186724_2_, @Nullable BlockPos p_186724_3_, int p_186724_4_) {
- IBlockColor iblockcolor = this.field_186725_a.func_148745_a(Block.field_149771_c.func_148757_b(p_186724_1_.func_177230_c()));
+ IBlockColor iblockcolor = this.field_186725_a.get(p_186724_1_.func_177230_c().delegate);
return iblockcolor == null ? -1 : iblockcolor.getColor(p_186724_1_, p_186724_2_, p_186724_3_, p_186724_4_);
}
public void func_186722_a(IBlockColor p_186722_1_, Block... p_186722_2_) {
for(Block block : p_186722_2_) {
- this.field_186725_a.func_148746_a(p_186722_1_, Block.field_149771_c.func_148757_b(block));
+ this.field_186725_a.put(block.delegate, p_186722_1_);
}
}

View File

@ -0,0 +1,80 @@
--- a/net/minecraft/client/renderer/entity/RenderEntityItem.java
+++ b/net/minecraft/client/renderer/entity/RenderEntityItem.java
@@ -37,7 +37,7 @@
boolean flag = p_177077_9_.func_177556_c();
int i = this.func_177078_a(itemstack);
float f = 0.25F;
- float f1 = MathHelper.func_76126_a(((float)p_177077_1_.func_174872_o() + p_177077_8_) / 10.0F + p_177077_1_.field_70290_d) * 0.1F + 0.1F;
+ float f1 = shouldBob() ? MathHelper.func_76126_a(((float)p_177077_1_.func_174872_o() + p_177077_8_) / 10.0F + p_177077_1_.field_70290_d) * 0.1F + 0.1F : 0;
float f2 = p_177077_9_.func_177552_f().func_181688_b(ItemCameraTransforms.TransformType.GROUND).field_178363_d.func_195900_b();
GlStateManager.func_179109_b((float)p_177077_2_, (float)p_177077_4_ + f1 + 0.25F * f2, (float)p_177077_6_);
if (flag || this.field_76990_c.field_78733_k != null) {
@@ -83,14 +83,11 @@
GlStateManager.func_179094_E();
IBakedModel ibakedmodel = this.field_177080_a.func_184393_a(itemstack, p_76986_1_.field_70170_p, (EntityLivingBase)null);
int j = this.func_177077_a(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_9_, ibakedmodel);
- float f = ibakedmodel.func_177552_f().field_181699_o.field_178363_d.func_195899_a();
- float f1 = ibakedmodel.func_177552_f().field_181699_o.field_178363_d.func_195900_b();
- float f2 = ibakedmodel.func_177552_f().field_181699_o.field_178363_d.func_195902_c();
boolean flag1 = ibakedmodel.func_177556_c();
if (!flag1) {
- float f3 = -0.0F * (float)(j - 1) * 0.5F * f;
- float f4 = -0.0F * (float)(j - 1) * 0.5F * f1;
- float f5 = -0.09375F * (float)(j - 1) * 0.5F * f2;
+ float f3 = -0.0F * (float)(j - 1) * 0.5F;
+ float f4 = -0.0F * (float)(j - 1) * 0.5F;
+ float f5 = -0.09375F * (float)(j - 1) * 0.5F;
GlStateManager.func_179109_b(f3, f4, f5);
}
@@ -106,11 +103,11 @@
float f7 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F;
float f9 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F;
float f6 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F;
- GlStateManager.func_179109_b(f7, f9, f6);
+ GlStateManager.func_179109_b(shouldSpreadItems() ? f7 : 0, shouldSpreadItems() ? f9 : 0, f6);
}
- ibakedmodel.func_177552_f().func_181689_a(ItemCameraTransforms.TransformType.GROUND);
- this.field_177080_a.func_180454_a(itemstack, ibakedmodel);
+ IBakedModel transformedModel = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(ibakedmodel, ItemCameraTransforms.TransformType.GROUND, false);
+ this.field_177080_a.func_180454_a(itemstack, transformedModel);
GlStateManager.func_179121_F();
} else {
GlStateManager.func_179094_E();
@@ -120,10 +117,10 @@
GlStateManager.func_179109_b(f8, f10, 0.0F);
}
- ibakedmodel.func_177552_f().func_181689_a(ItemCameraTransforms.TransformType.GROUND);
- this.field_177080_a.func_180454_a(itemstack, ibakedmodel);
+ IBakedModel transformedModel = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(ibakedmodel, ItemCameraTransforms.TransformType.GROUND, false);
+ this.field_177080_a.func_180454_a(itemstack, transformedModel);
GlStateManager.func_179121_F();
- GlStateManager.func_179109_b(0.0F * f, 0.0F * f1, 0.09375F * f2);
+ GlStateManager.func_179109_b(0.0F, 0.0F, 0.09375F);
}
}
@@ -146,4 +143,21 @@
protected ResourceLocation func_110775_a(EntityItem p_110775_1_) {
return TextureMap.field_110575_b;
}
+
+ /*==================================== FORGE START ===========================================*/
+
+ /**
+ * @return If items should spread out when rendered in 3D
+ */
+ public boolean shouldSpreadItems() {
+ return true;
+ }
+
+ /**
+ * @return If items should have a bob effect
+ */
+ public boolean shouldBob() {
+ return true;
+ }
+ /*==================================== FORGE END =============================================*/
}

View File

@ -0,0 +1,42 @@
--- a/net/minecraft/client/renderer/entity/RenderItemFrame.java
+++ b/net/minecraft/client/renderer/entity/RenderItemFrame.java
@@ -45,7 +45,7 @@
this.field_76990_c.field_78724_e.func_110577_a(TextureMap.field_110575_b);
BlockRendererDispatcher blockrendererdispatcher = this.field_147917_g.func_175602_ab();
ModelManager modelmanager = blockrendererdispatcher.func_175023_a().func_178126_b();
- ModelResourceLocation modelresourcelocation = p_76986_1_.func_82335_i().func_77973_b() == Items.field_151098_aY ? field_209586_g : field_209585_f;
+ ModelResourceLocation modelresourcelocation = p_76986_1_.func_82335_i().func_77973_b() instanceof ItemMap ? field_209586_g : field_209585_f;
GlStateManager.func_179094_E();
GlStateManager.func_179109_b(-0.5F, -0.5F, -0.5F);
if (this.field_188301_f) {
@@ -87,16 +87,18 @@
ItemStack itemstack = p_82402_1_.func_82335_i();
if (!itemstack.func_190926_b()) {
GlStateManager.func_179094_E();
- boolean flag = itemstack.func_77973_b() == Items.field_151098_aY;
- int i = flag ? p_82402_1_.func_82333_j() % 4 * 2 : p_82402_1_.func_82333_j();
+ MapData mapdata = ItemMap.func_195950_a(itemstack, p_82402_1_.field_70170_p);
+ int i = mapdata != null ? p_82402_1_.func_82333_j() % 4 * 2 : p_82402_1_.func_82333_j();
GlStateManager.func_179114_b((float)i * 360.0F / 8.0F, 0.0F, 0.0F, 1.0F);
- if (flag) {
+ net.minecraftforge.client.event.RenderItemInFrameEvent event = new net.minecraftforge.client.event.RenderItemInFrameEvent(p_82402_1_, this);
+ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event))
+ {
+ if (mapdata != null) {
this.field_76990_c.field_78724_e.func_110577_a(field_110789_a);
GlStateManager.func_179114_b(180.0F, 0.0F, 0.0F, 1.0F);
float f = 0.0078125F;
GlStateManager.func_179152_a(0.0078125F, 0.0078125F, 0.0078125F);
GlStateManager.func_179109_b(-64.0F, -64.0F, 0.0F);
- MapData mapdata = ItemMap.func_195950_a(itemstack, p_82402_1_.field_70170_p);
GlStateManager.func_179109_b(0.0F, 0.0F, -1.0F);
if (mapdata != null) {
this.field_147917_g.field_71460_t.func_147701_i().func_148250_a(mapdata, true);
@@ -105,6 +107,7 @@
GlStateManager.func_179152_a(0.5F, 0.5F, 0.5F);
this.field_177074_h.func_181564_a(itemstack, ItemCameraTransforms.TransformType.FIXED);
}
+ }
GlStateManager.func_179121_F();
}

View File

@ -0,0 +1,52 @@
--- a/net/minecraft/client/renderer/entity/RenderLivingBase.java
+++ b/net/minecraft/client/renderer/entity/RenderLivingBase.java
@@ -70,17 +70,19 @@
}
public void func_76986_a(T p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) {
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Pre<T>(p_76986_1_, this, p_76986_9_, p_76986_2_, p_76986_4_, p_76986_6_))) return;
GlStateManager.func_179094_E();
GlStateManager.func_179129_p();
this.field_77045_g.field_78095_p = this.func_77040_d(p_76986_1_, p_76986_9_);
- this.field_77045_g.field_78093_q = p_76986_1_.func_184218_aH();
+ boolean shouldSit = p_76986_1_.func_184218_aH() && (p_76986_1_.func_184187_bx() != null && p_76986_1_.func_184187_bx().shouldRiderSit());
+ this.field_77045_g.field_78093_q = shouldSit;
this.field_77045_g.field_78091_s = p_76986_1_.func_70631_g_();
try {
float f = this.func_77034_a(p_76986_1_.field_70760_ar, p_76986_1_.field_70761_aq, p_76986_9_);
float f1 = this.func_77034_a(p_76986_1_.field_70758_at, p_76986_1_.field_70759_as, p_76986_9_);
float f2 = f1 - f;
- if (p_76986_1_.func_184218_aH() && p_76986_1_.func_184187_bx() instanceof EntityLivingBase) {
+ if (shouldSit && p_76986_1_.func_184187_bx() instanceof EntityLivingBase) {
EntityLivingBase entitylivingbase = (EntityLivingBase)p_76986_1_.func_184187_bx();
f = this.func_77034_a(entitylivingbase.field_70760_ar, entitylivingbase.field_70761_aq, p_76986_9_);
f2 = f1 - f;
@@ -164,6 +166,7 @@
GlStateManager.func_179089_o();
GlStateManager.func_179121_F();
super.func_76986_a(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Post<T>(p_76986_1_, this, p_76986_9_, p_76986_2_, p_76986_4_, p_76986_6_));
}
public float func_188322_c(T p_188322_1_, float p_188322_2_) {
@@ -386,15 +389,18 @@
}
public void func_177067_a(T p_177067_1_, double p_177067_2_, double p_177067_4_, double p_177067_6_) {
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Specials.Pre<T>(p_177067_1_, this, p_177067_2_, p_177067_4_, p_177067_6_))) return;
if (this.func_177070_b(p_177067_1_)) {
double d0 = p_177067_1_.func_70068_e(this.field_76990_c.field_78734_h);
- float f = p_177067_1_.func_70093_af() ? 32.0F : 64.0F;
+ float f = (float) p_177067_1_.func_110148_a(EntityLivingBase.NAMETAG_DISTANCE).func_111126_e();
+ if (p_177067_1_.func_70093_af()) f /= 2;
if (!(d0 >= (double)(f * f))) {
String s = p_177067_1_.func_145748_c_().func_150254_d();
GlStateManager.func_179092_a(516, 0.1F);
this.func_188296_a(p_177067_1_, p_177067_2_, p_177067_4_, p_177067_6_, s, d0);
}
}
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Specials.Post<T>(p_177067_1_, this, p_177067_2_, p_177067_4_, p_177067_6_));
}
protected boolean func_177070_b(T p_177070_1_) {

View File

@ -0,0 +1,30 @@
--- a/net/minecraft/client/renderer/entity/RenderManager.java
+++ b/net/minecraft/client/renderer/entity/RenderManager.java
@@ -242,7 +242,12 @@
this.field_178637_m = new RenderPlayer(this);
this.field_178636_l.put("default", this.field_178637_m);
this.field_178636_l.put("slim", new RenderPlayer(this, true));
+ net.minecraftforge.fml.client.registry.RenderingRegistry.loadEntityRenderers(this, this.field_78729_o);
}
+
+ public Map<String, RenderPlayer> getSkinMap() {
+ return (Map<String, RenderPlayer>) java.util.Collections.unmodifiableMap(field_178636_l);
+ }
public void func_178628_a(double p_178628_1_, double p_178628_3_, double p_178628_5_) {
this.field_78725_b = p_178628_1_;
@@ -278,10 +283,11 @@
this.field_147941_i = p_180597_4_;
this.field_78736_p = p_180597_2_;
if (p_180597_3_ instanceof EntityLivingBase && ((EntityLivingBase)p_180597_3_).func_70608_bn()) {
- IBlockState iblockstate = p_180597_1_.func_180495_p(new BlockPos(p_180597_3_));
+ BlockPos pos = new BlockPos(p_180597_3_);
+ IBlockState iblockstate = p_180597_1_.func_180495_p(pos);
Block block = iblockstate.func_177230_c();
- if (block instanceof BlockBed) {
- int i = ((EnumFacing)iblockstate.func_177229_b(BlockBed.field_185512_D)).func_176736_b();
+ if (block.isBed(iblockstate, p_180597_1_, pos, p_180597_3_)) {
+ int i = block.getBedDirection(iblockstate, p_180597_1_, pos).func_176736_b();
this.field_78735_i = (float)(i * 90 + 180);
this.field_78732_j = 0.0F;
}

View File

@ -0,0 +1,27 @@
--- a/net/minecraft/client/renderer/entity/RenderPlayer.java
+++ b/net/minecraft/client/renderer/entity/RenderPlayer.java
@@ -52,6 +52,7 @@
}
public void func_76986_a(AbstractClientPlayer p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) {
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Pre(p_76986_1_, this, p_76986_9_, p_76986_2_, p_76986_4_, p_76986_6_))) return;
if (!p_76986_1_.func_175144_cb() || this.field_76990_c.field_78734_h == p_76986_1_) {
double d0 = p_76986_4_;
if (p_76986_1_.func_70093_af()) {
@@ -63,6 +64,7 @@
super.func_76986_a(p_76986_1_, p_76986_2_, d0, p_76986_6_, p_76986_8_, p_76986_9_);
GlStateManager.func_187440_b(GlStateManager.Profile.PLAYER_SKIN);
}
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Post(p_76986_1_, this, p_76986_9_, p_76986_2_, p_76986_4_, p_76986_6_));
}
private void func_177137_d(AbstractClientPlayer p_177137_1_) {
@@ -104,6 +106,8 @@
EnumAction enumaction1 = itemstack1.func_77975_n();
if (enumaction1 == EnumAction.BLOCK) {
modelbiped$armpose1 = ModelBiped.ArmPose.BLOCK;
+ } else if (enumaction1 == EnumAction.BOW) { // FORGE: fix MC-88356 allow offhand to use bow and arrow animation TODO Remove in 1.13.1 - Fixed
+ modelbiped$armpose1 = ModelBiped.ArmPose.BOW_AND_ARROW;
} else if (enumaction1 == EnumAction.SPEAR) {
modelbiped$armpose1 = ModelBiped.ArmPose.THROW_SPEAR;
}

View File

@ -0,0 +1,10 @@
--- a/net/minecraft/client/renderer/entity/RenderVillager.java
+++ b/net/minecraft/client/renderer/entity/RenderVillager.java
@@ -27,6 +27,7 @@
}
protected ResourceLocation func_110775_a(EntityVillager p_110775_1_) {
+ if (true) return p_110775_1_.getProfessionForge().getSkin();
switch(p_110775_1_.func_70946_n()) {
case 0:
return field_110904_g;

View File

@ -0,0 +1,10 @@
--- a/net/minecraft/client/renderer/entity/RenderZombieVillager.java
+++ b/net/minecraft/client/renderer/entity/RenderZombieVillager.java
@@ -22,6 +22,7 @@
}
protected ResourceLocation func_110775_a(EntityZombieVillager p_110775_1_) {
+ if (true) return p_110775_1_.getProfessionForge().getZombieSkin();
switch(p_110775_1_.func_190736_dl()) {
case 0:
return field_188330_l;

View File

@ -0,0 +1,96 @@
--- a/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java
+++ b/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java
@@ -2,6 +2,7 @@
import com.google.common.collect.Maps;
import java.util.Map;
+
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderLivingBase;
@@ -50,12 +51,13 @@
ItemArmor itemarmor = (ItemArmor)itemstack.func_77973_b();
if (itemarmor.func_185083_B_() == p_188361_9_) {
T t = this.func_188360_a(p_188361_9_);
+ t = getArmorModelHook(p_188361_1_, itemstack, p_188361_9_, t);
t.func_178686_a(this.field_177190_a.func_177087_b());
t.func_78086_a(p_188361_1_, p_188361_2_, p_188361_3_, p_188361_4_);
this.func_188359_a(t, p_188361_9_);
boolean flag = this.func_188363_b(p_188361_9_);
- this.field_177190_a.func_110776_a(this.func_177181_a(itemarmor, flag));
- if (itemarmor instanceof ItemArmorDyeable) {
+ this.field_177190_a.func_110776_a(this.getArmorResource(p_188361_1_, itemstack, p_188361_9_, null));
+ if (itemarmor instanceof ItemArmorDyeable) { // Allow this for anything, not only cloth
int i = ((ItemArmorDyeable)itemarmor).func_200886_f(itemstack);
float f = (float)(i >> 16 & 255) / 255.0F;
float f1 = (float)(i >> 8 & 255) / 255.0F;
@@ -67,7 +69,7 @@
GlStateManager.func_179131_c(this.field_177184_f, this.field_177185_g, this.field_177192_h, this.field_177187_e);
t.func_78088_a(p_188361_1_, p_188361_2_, p_188361_3_, p_188361_5_, p_188361_6_, p_188361_7_, p_188361_8_);
- if (!this.field_177193_i && itemstack.func_77948_v()) {
+ if (!this.field_177193_i && itemstack.func_77962_s()) {
func_188364_a(this.field_177190_a, p_188361_1_, t, p_188361_2_, p_188361_3_, p_188361_4_, p_188361_5_, p_188361_6_, p_188361_7_, p_188361_8_);
}
@@ -119,10 +121,12 @@
Minecraft.func_71410_x().field_71460_t.func_191514_d(false);
}
+ @Deprecated //Use the more sensitive version getArmorResource below
private ResourceLocation func_177181_a(ItemArmor p_177181_1_, boolean p_177181_2_) {
return this.func_177178_a(p_177181_1_, p_177181_2_, (String)null);
}
+ @Deprecated //Use the more sensitive version getArmorResource below
private ResourceLocation func_177178_a(ItemArmor p_177178_1_, boolean p_177178_2_, String p_177178_3_) {
String s = String.format("textures/models/armor/%s_layer_%d%s.png", p_177178_1_.func_200880_d().func_200897_d(), p_177178_2_ ? 2 : 1, p_177178_3_ == null ? "" : String.format("_%s", p_177178_3_));
ResourceLocation resourcelocation = field_177191_j.get(s);
@@ -137,4 +141,47 @@
protected abstract void func_177177_a();
protected abstract void func_188359_a(T p_188359_1_, EntityEquipmentSlot p_188359_2_);
+
+ /*=================================== FORGE START =========================================*/
+
+ /**
+ * Hook to allow item-sensitive armor model. for LayerBipedArmor.
+ */
+ protected T getArmorModelHook(EntityLivingBase entity, ItemStack itemStack, EntityEquipmentSlot slot, T model) {
+ return model;
+ }
+
+ /**
+ * More generic ForgeHook version of the above function, it allows for Items to have more control over what texture they provide.
+ *
+ * @param entity Entity wearing the armor
+ * @param stack ItemStack for the armor
+ * @param slot Slot ID that the item is in
+ * @param type Subtype, can be null or "overlay"
+ * @return ResourceLocation pointing at the armor's texture
+ */
+ public ResourceLocation getArmorResource(net.minecraft.entity.Entity entity, ItemStack stack, EntityEquipmentSlot slot, @javax.annotation.Nullable String type) {
+ ItemArmor item = (ItemArmor)stack.func_77973_b();
+ String texture = item.func_200880_d().func_200897_d();
+ String domain = "minecraft";
+ int idx = texture.indexOf(':');
+ if (idx != -1)
+ {
+ domain = texture.substring(0, idx);
+ texture = texture.substring(idx + 1);
+ }
+ String s1 = String.format("%s:textures/models/armor/%s_layer_%d%s.png", domain, texture, (func_188363_b(slot) ? 2 : 1), type == null ? "" : String.format("_%s", type));
+
+ s1 = net.minecraftforge.client.ForgeHooksClient.getArmorTexture(entity, stack, s1, slot, type);
+ ResourceLocation resourcelocation = (ResourceLocation)field_177191_j.get(s1);
+
+ if (resourcelocation == null)
+ {
+ resourcelocation = new ResourceLocation(s1);
+ field_177191_j.put(s1, resourcelocation);
+ }
+
+ return resourcelocation;
+ }
+ /*=================================== FORGE END ===========================================*/
}

View File

@ -0,0 +1,12 @@
--- a/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java
+++ b/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java
@@ -44,4 +44,9 @@
protected void func_177194_a(ModelBiped p_177194_1_) {
p_177194_1_.func_178719_a(false);
}
+
+ @Override
+ 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);
+ }
}

View File

@ -0,0 +1,16 @@
--- a/net/minecraft/client/renderer/entity/layers/LayerHeldItem.java
+++ b/net/minecraft/client/renderer/entity/layers/LayerHeldItem.java
@@ -40,11 +40,12 @@
private void func_188358_a(EntityLivingBase p_188358_1_, ItemStack p_188358_2_, ItemCameraTransforms.TransformType p_188358_3_, EnumHandSide p_188358_4_) {
if (!p_188358_2_.func_190926_b()) {
GlStateManager.func_179094_E();
- this.func_191361_a(p_188358_4_);
if (p_188358_1_.func_70093_af()) {
GlStateManager.func_179109_b(0.0F, 0.2F, 0.0F);
}
+ // Forge: moved this call down, fixes incorrect offset while sneaking.
+ this.func_191361_a(p_188358_4_);
GlStateManager.func_179114_b(-90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.func_179114_b(180.0F, 0.0F, 1.0F, 0.0F);
boolean flag = p_188358_4_ == EnumHandSide.LEFT;

View File

@ -0,0 +1,53 @@
--- a/net/minecraft/client/renderer/texture/Stitcher.java
+++ b/net/minecraft/client/renderer/texture/Stitcher.java
@@ -12,6 +12,8 @@
@OnlyIn(Dist.CLIENT)
public class Stitcher {
+ private static final org.apache.logging.log4j.Logger LOGGER = org.apache.logging.log4j.LogManager.getLogger();
+
private final int field_147971_a;
private final Set<Stitcher.Holder> field_94319_a = Sets.<Stitcher.Holder>newHashSetWithExpectedSize(256);
private final List<Stitcher.Slot> field_94317_b = Lists.<Stitcher.Slot>newArrayListWithCapacity(256);
@@ -48,16 +50,22 @@
public void func_94305_f() {
Stitcher.Holder[] astitcher$holder = (Stitcher.Holder[])this.field_94319_a.toArray(new Stitcher.Holder[this.field_94319_a.size()]);
Arrays.sort((Object[])astitcher$holder);
-
+ net.minecraftforge.fml.common.ProgressManager.ProgressBar bar = net.minecraftforge.fml.common.ProgressManager.push("Texture stitching", astitcher$holder.length);
+
for(Stitcher.Holder stitcher$holder : astitcher$holder) {
+ bar.step(stitcher$holder.func_98150_a().func_195668_m().toString());
if (!this.func_94310_b(stitcher$holder)) {
String s = String.format("Unable to fit: %s - size: %dx%d - Maybe try a lowerresolution resourcepack?", stitcher$holder.func_98150_a().func_195668_m(), stitcher$holder.func_98150_a().func_94211_a(), stitcher$holder.func_98150_a().func_94216_b());
+ LOGGER.info(s);
+ for (Stitcher.Holder h : astitcher$holder)
+ LOGGER.info(" {}", h);
throw new StitcherException(stitcher$holder, s);
}
}
this.field_94318_c = MathHelper.func_151236_b(this.field_94318_c);
this.field_94315_d = MathHelper.func_151236_b(this.field_94315_d);
+ net.minecraftforge.fml.common.ProgressManager.pop(bar);
}
public List<TextureAtlasSprite> func_94309_g() {
@@ -121,7 +129,7 @@
boolean flag4 = flag2 && l != j1;
boolean flag;
if (flag3 ^ flag4) {
- flag = flag3;
+ flag = !flag3 && flag1; // Forge: Fix stitcher not expanding entire height before growing width, and (potentially) growing larger then the max size.
} else {
flag = flag1 && k <= l;
}
@@ -195,7 +203,7 @@
}
public String toString() {
- return "Holder{width=" + this.field_94204_c + ", height=" + this.field_94201_d + '}';
+ return "Holder{width=" + this.field_94204_c + ", height=" + this.field_94201_d + ", name=" + this.field_98151_a.func_195668_m() + '}';
}
public int compareTo(Stitcher.Holder p_compareTo_1_) {

View File

@ -1,6 +1,65 @@
--- a/net/minecraft/client/renderer/texture/TextureAtlasSprite.java
+++ b/net/minecraft/client/renderer/texture/TextureAtlasSprite.java
@@ -439,4 +439,10 @@
@@ -17,7 +17,7 @@
import net.minecraftforge.api.distmarker.OnlyIn;
@OnlyIn(Dist.CLIENT)
-public class TextureAtlasSprite {
+public class TextureAtlasSprite implements net.minecraftforge.client.extensions.IForgeTextureAtlasSprite {
private final ResourceLocation field_110984_i;
protected final int field_130223_c;
protected final int field_130224_d;
@@ -89,7 +89,10 @@
anativeimage[k1] = this.field_195670_c[k1];
} else {
NativeImage nativeimage1 = anativeimage[k1 - 1];
- NativeImage nativeimage = new NativeImage(nativeimage1.func_195702_a() >> 1, nativeimage1.func_195714_b() >> 1, false);
+ int width = nativeimage1.func_195702_a() >> 1;
+ int height = nativeimage1.func_195714_b() >> 1;
+ if (width > 0 && height > 0) { // FORGE force higher mipmap levels when a texture is not square
+ NativeImage nativeimage = new NativeImage(width, height, false);
int k = nativeimage.func_195702_a();
int l = nativeimage.func_195714_b();
@@ -98,8 +101,11 @@
nativeimage.func_195700_a(i1, j1, func_195661_b(nativeimage1.func_195709_a(i1 * 2 + 0, j1 * 2 + 0), nativeimage1.func_195709_a(i1 * 2 + 1, j1 * 2 + 0), nativeimage1.func_195709_a(i1 * 2 + 0, j1 * 2 + 1), nativeimage1.func_195709_a(i1 * 2 + 1, j1 * 2 + 1), flag));
}
}
-
+
anativeimage[k1] = nativeimage;
+ } else {
+ anativeimage[k1] = nativeimage1;
+ }
}
}
@@ -181,6 +187,7 @@
private void func_195667_a(int p_195667_1_, int p_195667_2_, NativeImage[] p_195667_3_) {
for(int i = 0; i < this.field_195670_c.length; ++i) {
+ if ((this.field_130223_c >> i <= 0) || (this.field_130224_d >> i <= 0)) break;
p_195667_3_[i].func_195706_a(i, this.field_110975_c >> i, this.field_110974_d >> i, p_195667_1_ >> i, p_195667_2_ >> i, this.field_130223_c >> i, this.field_130224_d >> i, this.field_195670_c.length > 1);
}
@@ -190,12 +197,10 @@
this.field_110975_c = p_110971_3_;
this.field_110974_d = p_110971_4_;
this.field_130222_e = p_110971_5_;
- float f = (float)((double)0.01F / (double)p_110971_1_);
- float f1 = (float)((double)0.01F / (double)p_110971_2_);
- this.field_110979_l = (float)p_110971_3_ / (float)((double)p_110971_1_) + f;
- this.field_110980_m = (float)(p_110971_3_ + this.field_130223_c) / (float)((double)p_110971_1_) - f;
- this.field_110977_n = (float)p_110971_4_ / (float)p_110971_2_ + f1;
- this.field_110978_o = (float)(p_110971_4_ + this.field_130224_d) / (float)p_110971_2_ - f1;
+ this.field_110979_l = (float)p_110971_3_ / (float)((double)p_110971_1_);
+ this.field_110980_m = (float)(p_110971_3_ + this.field_130223_c) / (float)((double)p_110971_1_);
+ this.field_110977_n = (float)p_110971_4_ / (float)p_110971_2_;
+ this.field_110978_o = (float)(p_110971_4_ + this.field_130224_d) / (float)p_110971_2_;
}
public int func_94211_a() {
@@ -439,4 +444,10 @@
public void func_195663_q() {
this.func_195659_d(0);
}

View File

@ -1,12 +1,36 @@
--- a/net/minecraft/client/renderer/texture/TextureManager.java
+++ b/net/minecraft/client/renderer/texture/TextureManager.java
@@ -127,4 +127,9 @@
@@ -106,6 +106,7 @@
public void func_147645_c(ResourceLocation p_147645_1_) {
ITextureObject itextureobject = this.func_110581_b(p_147645_1_);
if (itextureobject != null) {
+ this.field_110585_a.remove(p_147645_1_); // Forge: fix MC-98707
TextureUtil.func_147942_a(itextureobject.func_110552_b());
}
}
+
@@ -113,11 +114,13 @@
public void func_195410_a(IResourceManager p_195410_1_) {
MissingTextureSprite.func_195676_d();
+ net.minecraftforge.fml.common.ProgressManager.ProgressBar bar = net.minecraftforge.fml.common.ProgressManager.push("Reloading Texture Manager", this.field_110585_a.entrySet().size(), true);
Iterator<Entry<ResourceLocation, ITextureObject>> iterator = this.field_110585_a.entrySet().iterator();
while(iterator.hasNext()) {
Entry<ResourceLocation, ITextureObject> entry = iterator.next();
ResourceLocation resourcelocation = entry.getKey();
+ bar.step(resourcelocation.toString());
ITextureObject itextureobject = entry.getValue();
if (itextureobject == MissingTextureSprite.func_195676_d() && !resourcelocation.equals(MissingTextureSprite.func_195675_b())) {
iterator.remove();
@@ -125,6 +128,11 @@
this.func_110579_a(entry.getKey(), itextureobject);
}
}
+ net.minecraftforge.fml.common.ProgressManager.pop(bar);
+ }
+ @Override
+ public net.minecraftforge.resource.IResourceType getResourceType() {
+ return net.minecraftforge.resource.VanillaResourceType.TEXTURES;
+ }
}
}

View File

@ -0,0 +1,178 @@
--- a/net/minecraft/client/renderer/texture/TextureMap.java
+++ b/net/minecraft/client/renderer/texture/TextureMap.java
@@ -44,6 +44,7 @@
public void func_195426_a(IResourceManager p_195426_1_, Iterable<ResourceLocation> p_195426_2_) {
this.field_195427_i.clear();
+ net.minecraftforge.client.ForgeHooksClient.onTextureStitchedPre(this);
p_195426_2_.forEach((p_195423_2_) -> {
this.func_199362_a(p_195426_1_, p_195423_2_);
});
@@ -56,37 +57,76 @@
this.func_195419_g();
int j = Integer.MAX_VALUE;
int k = 1 << this.field_147636_j;
-
- for(ResourceLocation resourcelocation : this.field_195427_i) {
+ field_147635_d.info("Max texture size: {}", i);
+ net.minecraftforge.fml.common.ProgressManager.ProgressBar bar = net.minecraftforge.fml.common.ProgressManager.push("Texture stitching", this.field_195427_i.size());
+ loadedSprites.clear();
+
+ for(ResourceLocation resourcelocation : Sets.newHashSet(this.field_195427_i)) {
+ ResourceLocation resourcelocation1 = this.func_195420_b(resourcelocation);
+ bar.step(resourcelocation1.toString());
if (!this.field_94249_f.func_195668_m().equals(resourcelocation)) {
- ResourceLocation resourcelocation1 = this.func_195420_b(resourcelocation);
+ j = loadTexture(stitcher, p_195421_1_, resourcelocation, bar, j, k);
+ }
+ }
+ finishLoading(stitcher, p_195421_1_, bar, j, k);
+ }
+
+ private int loadTexture(Stitcher stitcher, IResourceManager manager, ResourceLocation resourcelocation, net.minecraftforge.fml.common.ProgressManager.ProgressBar bar, int j, int k) {
+ if (loadedSprites.contains(resourcelocation)) {
+ return j;
+ }
+ TextureAtlasSprite textureatlassprite;
+ ResourceLocation resourcelocation1 = this.func_195420_b(resourcelocation);
+ for(ResourceLocation loading : loadingSprites) {
+ if(resourcelocation1.equals(loading)) {
+ final String error = "circular model dependencies, stack: [" + com.google.common.base.Joiner.on(", ").join(loadingSprites) + "]";
+ net.minecraftforge.fml.client.ClientHooks.trackBrokenTexture(resourcelocation, error);
+ }
+ }
+ loadingSprites.addLast(resourcelocation1);
+ try (IResource iresource = manager.func_199002_a(resourcelocation1)) {
+ PngSizeInfo pngsizeinfo = new PngSizeInfo(iresource);
+ AnimationMetadataSection animationmetadatasection = (AnimationMetadataSection)iresource.func_199028_a(AnimationMetadataSection.field_195817_a);
+ textureatlassprite = new TextureAtlasSprite(resourcelocation, pngsizeinfo, animationmetadatasection);
- TextureAtlasSprite textureatlassprite;
- try (IResource iresource = p_195421_1_.func_199002_a(resourcelocation1)) {
- PngSizeInfo pngsizeinfo = new PngSizeInfo(iresource);
- AnimationMetadataSection animationmetadatasection = (AnimationMetadataSection)iresource.func_199028_a(AnimationMetadataSection.field_195817_a);
- textureatlassprite = new TextureAtlasSprite(resourcelocation, pngsizeinfo, animationmetadatasection);
- } catch (RuntimeException runtimeexception) {
- field_147635_d.error("Unable to parse metadata from {} : {}", resourcelocation1, runtimeexception);
- continue;
- } catch (IOException ioexception) {
- field_147635_d.error("Using missing texture, unable to load {} : {}", resourcelocation1, ioexception);
- continue;
+ for (ResourceLocation dependency : textureatlassprite.getDependencies()) {
+ if (!field_195427_i.contains(dependency.toString())) {
+ func_199362_a(manager, dependency);
}
-
- j = Math.min(j, Math.min(textureatlassprite.func_94211_a(), textureatlassprite.func_94216_b()));
- int j1 = Math.min(Integer.lowestOneBit(textureatlassprite.func_94211_a()), Integer.lowestOneBit(textureatlassprite.func_94216_b()));
- if (j1 < k) {
- field_147635_d.warn("Texture {} with size {}x{} limits mip level from {} to {}", resourcelocation1, textureatlassprite.func_94211_a(), textureatlassprite.func_94216_b(), MathHelper.func_151239_c(k), MathHelper.func_151239_c(j1));
- k = j1;
+ j = loadTexture(stitcher, manager, dependency, bar, j, k);
+ }
+ if (textureatlassprite.hasCustomLoader(manager, resourcelocation)) {
+ if (textureatlassprite.load(manager, resourcelocation, l -> field_94252_e.get(l.toString()))) {
+ return j;
}
-
- stitcher.func_110934_a(textureatlassprite);
}
+ j = Math.min(j, Math.min(textureatlassprite.func_94211_a(), textureatlassprite.func_94216_b()));
+ int j1 = Math.min(Integer.lowestOneBit(textureatlassprite.func_94211_a()), Integer.lowestOneBit(textureatlassprite.func_94216_b()));
+ if (j1 < k) {
+ // FORGE: do not lower the mipmap level, just log the problematic textures
+ field_147635_d.warn("Texture {} with size {}x{} will have visual artifacts at mip level {}, it can only support level {}. Please report to the mod author that the texture should be some multiple of 16x16.", resourcelocation1, textureatlassprite.func_94211_a(), textureatlassprite.func_94216_b(), MathHelper.func_151239_c(k), MathHelper.func_151239_c(j1));
+ }
+ if (func_195422_a(manager, textureatlassprite))
+ stitcher.func_110934_a(textureatlassprite);
+ return j;
+ } catch (RuntimeException runtimeexception) {
+ net.minecraftforge.fml.client.ClientHooks.trackBrokenTexture(resourcelocation, runtimeexception.getMessage());
+ return j;
+ } catch (IOException ioexception) {
+ net.minecraftforge.fml.client.ClientHooks.trackMissingTexture(resourcelocation);
+ return j;
+ } finally {
+ loadingSprites.removeLast();
+ field_195427_i.add(resourcelocation1);
}
-
+ }
+
+ private void finishLoading(Stitcher stitcher, IResourceManager manager, net.minecraftforge.fml.common.ProgressManager.ProgressBar bar, int j, int k)
+ {
+ net.minecraftforge.fml.common.ProgressManager.pop(bar);
int l = Math.min(j, k);
int i1 = MathHelper.func_151239_c(l);
+ if (false) // FORGE: do not lower the mipmap level
if (i1 < this.field_147636_j) {
field_147635_d.warn("{}: dropping miplevel from {} to {}, because of minimum power of two: {}", this.field_94254_c, this.field_147636_j, i1, l);
this.field_147636_j = i1;
@@ -94,18 +134,26 @@
this.field_94249_f.func_147963_d(this.field_147636_j);
stitcher.func_110934_a(this.field_94249_f);
-
+ bar = net.minecraftforge.fml.common.ProgressManager.push("Texture creation", 2);
+
try {
+ bar.step("Stitching");
stitcher.func_94305_f();
} catch (StitcherException stitcherexception) {
throw stitcherexception;
}
field_147635_d.info("Created: {}x{} {}-atlas", stitcher.func_110935_a(), stitcher.func_110936_b(), this.field_94254_c);
+ bar.step("Allocating GL texture");
TextureUtil.func_180600_a(this.func_110552_b(), this.field_147636_j, stitcher.func_110935_a(), stitcher.func_110936_b());
+
+ net.minecraftforge.fml.common.ProgressManager.pop(bar);
+ bar = net.minecraftforge.fml.common.ProgressManager.push("Texture mipmap and upload", stitcher.func_94309_g().size());
for(TextureAtlasSprite textureatlassprite1 : stitcher.func_94309_g()) {
- if (textureatlassprite1 == this.field_94249_f || this.func_195422_a(p_195421_1_, textureatlassprite1)) {
+ bar.step(textureatlassprite1.func_195668_m().toString());
+ // FORGE: Sprite loading is now done during stitching, short-circuit this check
+ if (true || textureatlassprite1 == this.field_94249_f || this.func_195422_a(manager, textureatlassprite1)) {
this.field_94252_e.put(textureatlassprite1.func_195668_m(), textureatlassprite1);
try {
@@ -124,6 +172,8 @@
}
}
+ net.minecraftforge.client.ForgeHooksClient.onTextureStitchedPost(this);
+ net.minecraftforge.fml.common.ProgressManager.pop(bar);
}
private boolean func_195422_a(IResourceManager p_195422_1_, TextureAtlasSprite p_195422_2_) {
@@ -132,6 +182,7 @@
label62: {
boolean flag;
+ if (p_195422_2_.hasCustomLoader(p_195422_1_, resourcelocation)) break label62;
try {
iresource = p_195422_1_.func_199002_a(resourcelocation);
p_195422_2_.func_195664_a(iresource, this.field_147636_j + 1);
@@ -216,4 +267,21 @@
this.field_94252_e.clear();
this.field_94258_i.clear();
}
+
+ //===================================================================================================
+ // Forge Start
+ //===================================================================================================
+
+ private final java.util.Deque<ResourceLocation> loadingSprites = new java.util.ArrayDeque<>();
+ private final java.util.Set<ResourceLocation> loadedSprites = new java.util.HashSet<>();
+
+ public String getBasePath()
+ {
+ return field_94254_c;
+ }
+
+ public int getMipmapLevels()
+ {
+ return field_147636_j;
+ }
}

View File

@ -0,0 +1,13 @@
--- a/net/minecraft/client/renderer/texture/TextureUtil.java
+++ b/net/minecraft/client/renderer/texture/TextureUtil.java
@@ -43,7 +43,10 @@
}
public static void func_211682_a(NativeImage.PixelFormatGLCode p_211682_0_, int p_211682_1_, int p_211682_2_, int p_211682_3_, int p_211682_4_) {
+ synchronized (net.minecraftforge.fml.client.SplashProgress.class)
+ {
func_94277_a(p_211682_1_);
+ }
if (p_211682_2_ >= 0) {
GlStateManager.func_187421_b(3553, 33085, p_211682_2_);
GlStateManager.func_187421_b(3553, 33082, 0);

View File

@ -0,0 +1,91 @@
--- a/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java
+++ b/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java
@@ -88,7 +88,7 @@
@Nullable
public <T extends TileEntity> TileEntityRenderer<T> func_147547_b(@Nullable TileEntity p_147547_1_) {
- return p_147547_1_ == null ? null : this.func_147546_a(p_147547_1_.getClass());
+ return p_147547_1_ == null || p_147547_1_.func_145837_r() ? null : this.func_147546_a(p_147547_1_.getClass());
}
public void func_190056_a(World p_190056_1_, TextureManager p_190056_2_, FontRenderer p_190056_3_, Entity p_190056_4_, RayTraceResult p_190056_5_, float p_190056_6_) {
@@ -109,12 +109,15 @@
public void func_180546_a(TileEntity p_180546_1_, float p_180546_2_, int p_180546_3_) {
if (p_180546_1_.func_145835_a(this.field_147560_j, this.field_147561_k, this.field_147558_l) < p_180546_1_.func_145833_n()) {
+ if(!drawingBatch || !p_180546_1_.hasFastRenderer())
+ {
RenderHelper.func_74519_b();
int i = this.field_147550_f.func_175626_b(p_180546_1_.func_174877_v(), 0);
int j = i % 65536;
int k = i / 65536;
OpenGlHelper.func_77475_a(OpenGlHelper.field_77476_b, (float)j, (float)k);
GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
+ }
BlockPos blockpos = p_180546_1_.func_174877_v();
this.func_203602_a(p_180546_1_, (double)blockpos.func_177958_n() - field_147554_b, (double)blockpos.func_177956_o() - field_147555_c, (double)blockpos.func_177952_p() - field_147552_d, p_180546_2_, p_180546_3_, false);
}
@@ -137,6 +140,9 @@
return;
}
+ if(drawingBatch && p_203602_1_.hasFastRenderer())
+ tileentityrenderer.renderTileEntityFast(p_203602_1_, p_203602_2_, p_203602_4_, p_203602_6_, p_203602_8_, p_203602_9_, batchBuffer.func_178180_c());
+ else
tileentityrenderer.func_199341_a(p_203602_1_, p_203602_2_, p_203602_4_, p_203602_6_, p_203602_8_, p_203602_9_);
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.func_85055_a(throwable, "Rendering Block Entity");
@@ -159,4 +165,53 @@
public FontRenderer func_147548_a() {
return this.field_147557_n;
}
+
+ /* ======================================== FORGE START =====================================*/
+ /**
+ * Buffer used for batched TESRs
+ */
+ private net.minecraft.client.renderer.Tessellator batchBuffer = new net.minecraft.client.renderer.Tessellator(0x200000);
+ private boolean drawingBatch = false;
+
+ /**
+ * Prepare for a batched TESR rendering.
+ * You probably shouldn't call this manually.
+ */
+ public void preDrawBatch()
+ {
+ batchBuffer.func_178180_c().func_181668_a(org.lwjgl.opengl.GL11.GL_QUADS, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176600_a);
+ drawingBatch = true;
+ }
+
+ /**
+ * Render all TESRs batched so far.
+ * You probably shouldn't call this manually.
+ */
+ public void drawBatch(int pass)
+ {
+ field_147553_e.func_110577_a(net.minecraft.client.renderer.texture.TextureMap.field_110575_b);
+ net.minecraft.client.renderer.RenderHelper.func_74518_a();
+ GlStateManager.func_179112_b(org.lwjgl.opengl.GL11.GL_SRC_ALPHA, org.lwjgl.opengl.GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GlStateManager.func_179147_l();
+ GlStateManager.func_179129_p();
+
+ if (net.minecraft.client.Minecraft.func_71379_u())
+ {
+ GlStateManager.func_179103_j(org.lwjgl.opengl.GL11.GL_SMOOTH);
+ }
+ else
+ {
+ GlStateManager.func_179103_j(org.lwjgl.opengl.GL11.GL_FLAT);
+ }
+
+ if(pass > 0)
+ {
+ net.minecraft.util.math.Vec3d cameraPos = net.minecraft.client.renderer.ActiveRenderInfo.getCameraPosition();
+ batchBuffer.func_178180_c().func_181674_a((float)cameraPos.field_72450_a, (float)cameraPos.field_72448_b, (float)cameraPos.field_72449_c);
+ }
+ batchBuffer.func_78381_a();
+
+ net.minecraft.client.renderer.RenderHelper.func_74519_b();
+ drawingBatch = false;
+ }
}

View File

@ -1,22 +1,24 @@
--- a/net/minecraft/entity/EntityLivingBase.java
+++ b/net/minecraft/entity/EntityLivingBase.java
@@ -92,6 +92,7 @@
@@ -92,6 +92,8 @@
private static final Logger field_190632_a = LogManager.getLogger();
private static final UUID field_110156_b = UUID.fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D");
private static final AttributeModifier field_110157_c = (new AttributeModifier(field_110156_b, "Sprinting speed boost", (double)0.3F, 2)).func_111168_a(false);
+ public static final net.minecraft.entity.ai.attributes.IAttribute SWIM_SPEED = new net.minecraft.entity.ai.attributes.RangedAttribute(null, "forge.swimSpeed", 1.0D, 0.0D, 1024.0D).func_111112_a(true);
+ public static final net.minecraft.entity.ai.attributes.IAttribute NAMETAG_DISTANCE = new net.minecraft.entity.ai.attributes.RangedAttribute(null, "forge.nameTagDistance", 64.0D, 0.0D, Float.MAX_VALUE).func_111112_a(true);
protected static final DataParameter<Byte> field_184621_as = EntityDataManager.<Byte>func_187226_a(EntityLivingBase.class, DataSerializers.field_187191_a);
private static final DataParameter<Float> field_184632_c = EntityDataManager.<Float>func_187226_a(EntityLivingBase.class, DataSerializers.field_187193_c);
private static final DataParameter<Integer> field_184633_f = EntityDataManager.<Integer>func_187226_a(EntityLivingBase.class, DataSerializers.field_187192_b);
@@ -199,6 +200,7 @@
@@ -199,6 +201,8 @@
this.func_110140_aT().func_111150_b(SharedMonsterAttributes.field_111263_d);
this.func_110140_aT().func_111150_b(SharedMonsterAttributes.field_188791_g);
this.func_110140_aT().func_111150_b(SharedMonsterAttributes.field_189429_h);
+ this.func_110140_aT().func_111150_b(SWIM_SPEED);
+ this.func_110140_aT().func_111150_b(NAMETAG_DISTANCE);
}
protected void func_184231_a(double p_184231_1_, boolean p_184231_3_, IBlockState p_184231_4_, BlockPos p_184231_5_) {
@@ -208,9 +210,10 @@
@@ -208,9 +212,10 @@
if (!this.field_70170_p.field_72995_K && this.field_70143_R > 3.0F && p_184231_3_) {
float f = (float)MathHelper.func_76123_f(this.field_70143_R - 3.0F);
@ -28,7 +30,7 @@
((WorldServer)this.field_70170_p).func_195598_a(new BlockParticleData(Particles.field_197611_d, p_184231_4_), this.field_70165_t, this.field_70163_u, this.field_70161_v, i, 0.0D, 0.0D, 0.0D, (double)0.15F);
}
}
@@ -274,7 +277,7 @@
@@ -274,7 +279,7 @@
}
}
@ -37,7 +39,7 @@
this.func_184210_p();
}
} else if (this.func_70086_ai() < this.func_205010_bg()) {
@@ -356,6 +359,7 @@
@@ -356,6 +361,7 @@
if (!this.field_70170_p.field_72995_K && (this.func_70684_aJ() || this.field_70718_bc > 0 && this.func_146066_aG() && this.field_70170_p.func_82736_K().func_82766_b("doMobLoot"))) {
int i = this.func_70693_a(this.field_70717_bb);
@ -45,7 +47,7 @@
while(i > 0) {
int j = EntityXPOrb.func_70527_a(i);
i -= j;
@@ -412,6 +416,7 @@
@@ -412,6 +418,7 @@
public void func_70604_c(@Nullable EntityLivingBase p_70604_1_) {
this.field_70755_b = p_70604_1_;
this.field_70756_c = this.field_70173_aa;
@ -53,7 +55,7 @@
}
public EntityLivingBase func_110144_aD() {
@@ -584,8 +589,10 @@
@@ -584,8 +591,10 @@
this.func_82142_c(false);
} else {
Collection<PotionEffect> collection = this.field_70713_bf.values();
@ -66,7 +68,7 @@
this.func_82142_c(this.func_70644_a(MobEffects.field_76441_p));
}
@@ -622,6 +629,27 @@
@@ -622,6 +631,27 @@
}
}
@ -94,7 +96,7 @@
public Collection<PotionEffect> func_70651_bq() {
return this.field_70713_bf.values();
}
@@ -714,6 +742,8 @@
@@ -714,6 +744,8 @@
}
public void func_70691_i(float p_70691_1_) {
@ -103,7 +105,7 @@
float f = this.func_110143_aJ();
if (f > 0.0F) {
this.func_70606_j(f + p_70691_1_);
@@ -730,6 +760,7 @@
@@ -730,6 +762,7 @@
}
public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) {
@ -111,7 +113,7 @@
if (this.func_180431_b(p_70097_1_)) {
return false;
} else if (this.field_70170_p.field_72995_K) {
@@ -789,8 +820,8 @@
@@ -789,8 +822,8 @@
if (entity1 instanceof EntityPlayer) {
this.field_70718_bc = 100;
this.field_70717_bb = (EntityPlayer)entity1;
@ -122,7 +124,7 @@
if (entitywolf.func_70909_n()) {
this.field_70718_bc = 100;
this.field_70717_bb = null;
@@ -938,11 +969,12 @@
@@ -938,11 +971,12 @@
}
public void func_70669_a(ItemStack p_70669_1_) {
@ -136,7 +138,7 @@
if (!this.field_70729_aU) {
Entity entity = p_70645_1_.func_76346_g();
EntityLivingBase entitylivingbase = this.func_94060_bK();
@@ -957,15 +989,16 @@
@@ -957,15 +991,16 @@
this.field_70729_aU = true;
this.func_110142_aN().func_94549_h();
if (!this.field_70170_p.field_72995_K) {
@ -157,7 +159,7 @@
}
this.field_70170_p.func_72960_a(this, (byte)3);
@@ -981,6 +1014,9 @@
@@ -981,6 +1016,9 @@
}
public void func_70653_a(Entity p_70653_1_, float p_70653_2_, double p_70653_3_, double p_70653_5_) {
@ -167,7 +169,7 @@
if (!(this.field_70146_Z.nextDouble() < this.func_110148_a(SharedMonsterAttributes.field_111266_c).func_111126_e())) {
this.field_70160_al = true;
float f = MathHelper.func_76133_a(p_70653_3_ * p_70653_3_ + p_70653_5_ * p_70653_5_);
@@ -1025,12 +1061,7 @@
@@ -1025,12 +1063,7 @@
} else {
BlockPos blockpos = new BlockPos(i, j, k);
IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos);
@ -181,7 +183,7 @@
}
}
@@ -1050,6 +1081,9 @@
@@ -1050,6 +1083,9 @@
}
public void func_180430_e(float p_180430_1_, float p_180430_2_) {
@ -191,7 +193,7 @@
super.func_180430_e(p_180430_1_, p_180430_2_);
PotionEffect potioneffect = this.func_70660_b(MobEffects.field_76430_j);
float f = potioneffect == null ? 0.0F : (float)(potioneffect.func_76458_c() + 1);
@@ -1062,7 +1096,7 @@
@@ -1062,7 +1098,7 @@
int l = MathHelper.func_76128_c(this.field_70161_v);
IBlockState iblockstate = this.field_70170_p.func_180495_p(new BlockPos(j, k, l));
if (!iblockstate.func_196958_f()) {
@ -200,7 +202,7 @@
this.func_184185_a(soundtype.func_185842_g(), soundtype.func_185843_a() * 0.5F, soundtype.func_185847_b() * 0.75F);
}
}
@@ -1122,15 +1156,18 @@
@@ -1122,15 +1158,18 @@
protected void func_70665_d(DamageSource p_70665_1_, float p_70665_2_) {
if (!this.func_180431_b(p_70665_1_)) {
@ -220,7 +222,7 @@
this.func_110149_m(this.func_110139_bj() - p_70665_2_);
}
}
@@ -1172,6 +1209,8 @@
@@ -1172,6 +1211,8 @@
}
public void func_184609_a(EnumHand p_184609_1_) {
@ -229,7 +231,7 @@
if (!this.field_82175_bq || this.field_110158_av >= this.func_82166_i() / 2 || this.field_110158_av < 0) {
this.field_110158_av = -1;
this.field_82175_bq = true;
@@ -1356,18 +1395,18 @@
@@ -1356,18 +1397,18 @@
double d12 = d6 + d10;
AxisAlignedBB axisalignedbb1 = axisalignedbb.func_72317_d(d9, 0.0D, d10);
if (this.field_70170_p.func_195586_b((Entity)null, axisalignedbb1)) {
@ -251,7 +253,7 @@
d1 = d11;
d13 = this.field_70163_u + 2.0D;
d14 = d12;
@@ -1422,15 +1461,16 @@
@@ -1422,15 +1463,16 @@
}
this.field_70160_al = true;
@ -270,7 +272,7 @@
}
protected float func_189749_co() {
@@ -1501,7 +1541,7 @@
@@ -1501,7 +1543,7 @@
try (BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185345_c(this.field_70165_t, this.func_174813_aQ().field_72338_b - 1.0D, this.field_70161_v)) {
if (this.field_70122_E) {
@ -279,7 +281,7 @@
}
float f8 = 0.16277137F / (f7 * f7 * f7);
@@ -1515,7 +1555,7 @@
@@ -1515,7 +1557,7 @@
this.func_191958_b(p_191986_1_, p_191986_2_, p_191986_3_, f9);
f7 = 0.91F;
if (this.field_70122_E) {
@ -288,7 +290,7 @@
}
if (this.func_70617_f_()) {
@@ -1646,6 +1686,7 @@
@@ -1646,6 +1688,7 @@
}
public void func_70071_h_() {
@ -296,7 +298,7 @@
super.func_70071_h_();
this.func_184608_ct();
this.func_205014_p();
@@ -1677,7 +1718,9 @@
@@ -1677,7 +1720,9 @@
ItemStack itemstack1 = this.func_184582_a(entityequipmentslot);
if (!ItemStack.func_77989_b(itemstack1, itemstack)) {
@ -306,7 +308,7 @@
if (!itemstack.func_190926_b()) {
this.func_110140_aT().func_111148_a(itemstack.func_111283_C(entityequipmentslot));
}
@@ -2117,11 +2160,18 @@
@@ -2117,11 +2162,18 @@
protected void func_184608_ct() {
if (this.func_184587_cr()) {
if (this.func_184586_b(this.func_184600_cs()) == this.field_184627_bm) {
@ -326,7 +328,7 @@
this.func_71036_o();
}
} else {
@@ -2155,8 +2205,10 @@
@@ -2155,8 +2207,10 @@
public void func_184598_c(EnumHand p_184598_1_) {
ItemStack itemstack = this.func_184586_b(p_184598_1_);
if (!itemstack.func_190926_b() && !this.func_184587_cr()) {
@ -338,7 +340,7 @@
if (!this.field_70170_p.field_72995_K) {
this.func_204802_c(1, true);
this.func_204802_c(2, p_184598_1_ == EnumHand.OFF_HAND);
@@ -2212,6 +2264,9 @@
@@ -2212,6 +2266,9 @@
vec3d1 = vec3d1.func_178789_a(-this.field_70125_A * ((float)Math.PI / 180F));
vec3d1 = vec3d1.func_178785_b(-this.field_70177_z * ((float)Math.PI / 180F));
vec3d1 = vec3d1.func_72441_c(this.field_70165_t, this.field_70163_u + (double)this.func_70047_e(), this.field_70161_v);
@ -348,7 +350,7 @@
this.field_70170_p.func_195594_a(new ItemParticleData(Particles.field_197591_B, p_195062_1_), vec3d1.field_72450_a, vec3d1.field_72448_b, vec3d1.field_72449_c, vec3d.field_72450_a, vec3d.field_72448_b + 0.05D, vec3d.field_72449_c);
}
@@ -2220,7 +2275,9 @@
@@ -2220,7 +2277,9 @@
protected void func_71036_o() {
if (!this.field_184627_bm.func_190926_b() && this.func_184587_cr()) {
this.func_184584_a(this.field_184627_bm, 16);
@ -359,7 +361,7 @@
this.func_184602_cy();
}
@@ -2240,6 +2297,7 @@
@@ -2240,6 +2299,7 @@
public void func_184597_cx() {
if (!this.field_184627_bm.func_190926_b()) {
@ -367,7 +369,7 @@
this.field_184627_bm.func_77974_b(this.field_70170_p, this, this.func_184605_cv());
}
@@ -2346,4 +2404,53 @@
@@ -2346,4 +2406,53 @@
@OnlyIn(Dist.CLIENT)
public void func_191987_a(BlockPos p_191987_1_, boolean p_191987_2_) {
}

View File

@ -1,15 +1,18 @@
--- a/net/minecraft/entity/EntityTrackerEntry.java
+++ b/net/minecraft/entity/EntityTrackerEntry.java
@@ -143,7 +143,7 @@
@@ -142,9 +142,8 @@
if (this.field_73132_a instanceof EntityItemFrame && this.field_73136_m % 10 == 0) {
EntityItemFrame entityitemframe = (EntityItemFrame)this.field_73132_a;
ItemStack itemstack = entityitemframe.func_82335_i();
if (itemstack.func_77973_b() instanceof ItemMap) {
- if (itemstack.func_77973_b() instanceof ItemMap) {
- MapData mapdata = ItemMap.func_195950_a(itemstack, this.field_73132_a.field_70170_p);
+ MapData mapdata = ((ItemMap)itemstack.func_77973_b()).getMapDataOverride(itemstack, this.field_73132_a.field_70170_p);
-
+ MapData mapdata = ItemMap.func_195950_a(itemstack, this.field_73132_a.field_70170_p);
+ if (mapdata != null) { // FORGE: No need to instanceof check, getMapData handles this
for(EntityPlayer entityplayer : p_73122_1_) {
EntityPlayerMP entityplayermp = (EntityPlayerMP)entityplayer;
@@ -376,11 +376,13 @@
mapdata.func_76191_a(entityplayermp, itemstack);
@@ -376,11 +375,13 @@
this.field_73132_a.func_184178_b(p_73117_1_);
p_73117_1_.func_184848_d(this.field_73132_a);
@ -23,7 +26,7 @@
}
}
@@ -409,6 +411,9 @@
@@ -409,6 +410,9 @@
field_151262_p.warn("Fetching addPacket for removed entity");
}

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/item/ItemMap.java
+++ b/net/minecraft/item/ItemMap.java
@@ -41,20 +41,26 @@
@@ -41,15 +41,25 @@
public static ItemStack func_195952_a(World p_195952_0_, int p_195952_1_, int p_195952_2_, byte p_195952_3_, boolean p_195952_4_, boolean p_195952_5_) {
ItemStack itemstack = new ItemStack(Items.field_151098_aY);
@ -9,9 +9,18 @@
return itemstack;
}
+ @Deprecated //Forge: Use instance version below
@Nullable
public static MapData func_195950_a(ItemStack p_195950_0_, World p_195950_1_) {
+ // FORGE: Add instance method for mods to override
+ Item map = p_195950_0_.func_77973_b();
+ if (map instanceof ItemMap) {
+ return ((ItemMap)map).getCustomMapData(p_195950_0_, p_195950_1_);
+ }
+ return null;
+ }
+
+ @Nullable
+ protected MapData getCustomMapData(ItemStack p_195950_0_, World p_195950_1_) {
MapData mapdata = func_195953_a(p_195950_1_, "map_" + func_195949_f(p_195950_0_));
if (mapdata == null && !p_195950_1_.field_72995_K) {
- mapdata = func_195951_a(p_195950_0_, p_195950_1_, p_195950_1_.func_72912_H().func_76079_c(), p_195950_1_.func_72912_H().func_76074_e(), 3, false, false, p_195950_1_.field_73011_w.func_186058_p().func_186068_a());
@ -19,17 +28,7 @@
}
return mapdata;
}
+ @Nullable //Forge: Item instance override version instead of static.
+ public MapData getMapDataOverride(ItemStack stack, World world) {
+ return ItemMap.func_195950_a(stack, world);
+ }
+
public static int func_195949_f(ItemStack p_195949_0_) {
NBTTagCompound nbttagcompound = p_195949_0_.func_77978_p();
return nbttagcompound != null && nbttagcompound.func_150297_b("map", 99) ? nbttagcompound.func_74762_e("map") : 0;
@@ -75,7 +81,7 @@
@@ -75,7 +85,7 @@
}
public void func_77872_a(World p_77872_1_, Entity p_77872_2_, MapData p_77872_3_) {
@ -38,7 +37,7 @@
int i = 1 << p_77872_3_.field_76197_d;
int j = p_77872_3_.field_76201_a;
int k = p_77872_3_.field_76199_b;
@@ -215,7 +221,7 @@
@@ -215,7 +225,7 @@
public static void func_190905_a(World p_190905_0_, ItemStack p_190905_1_) {
MapData mapdata = func_195950_a(p_190905_1_, p_190905_0_);
if (mapdata != null) {

View File

@ -1,38 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/ActiveRenderInfo.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/ActiveRenderInfo.java
@@ -30,6 +30,11 @@
public static void func_74583_a(EntityPlayer p_74583_0_, boolean p_74583_1_)
{
+ updateRenderInfo((Entity) p_74583_0_, p_74583_1_);
+ }
+
+ public static void updateRenderInfo(Entity p_74583_0_, boolean p_74583_1_)
+ {
GlStateManager.func_179111_a(2982, field_178812_b);
GlStateManager.func_179111_a(2983, field_178813_c);
GlStateManager.func_187445_a(2978, field_178814_a);
@@ -81,7 +86,7 @@
}
}
- return iblockstate;
+ return iblockstate.func_177230_c().getStateAtViewpoint(iblockstate, p_186703_0_, blockpos, vec3d);
}
public static float func_178808_b()
@@ -108,4 +113,14 @@
{
return field_74596_h;
}
+
+ /* ======================================== FORGE START =====================================*/
+
+ /**
+ * Vector from render view entity position (corrected for partialTickTime) to the middle of screen
+ */
+ public static Vec3d getCameraPosition()
+ {
+ return field_178811_e;
+ }
}

View File

@ -1,14 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/BlockFluidRenderer.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/BlockFluidRenderer.java
@@ -184,9 +184,9 @@
if (!flag)
{
- Block block = p_178270_1_.func_180495_p(blockpos).func_177230_c();
+ IBlockState state = p_178270_1_.func_180495_p(blockpos);
- if (block == Blocks.field_150359_w || block == Blocks.field_150399_cn)
+ if (state.func_193401_d(p_178270_1_, blockpos, EnumFacing.field_82609_l[i1+2].func_176734_d()) == net.minecraft.block.state.BlockFaceShape.SOLID)
{
textureatlassprite1 = this.field_187501_d;
}

View File

@ -1,54 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java
@@ -40,7 +40,7 @@
public boolean func_187493_a(IBlockAccess p_187493_1_, IBakedModel p_187493_2_, IBlockState p_187493_3_, BlockPos p_187493_4_, BufferBuilder p_187493_5_, boolean p_187493_6_, long p_187493_7_)
{
- boolean flag = Minecraft.func_71379_u() && p_187493_3_.func_185906_d() == 0 && p_187493_2_.func_177555_b();
+ boolean flag = Minecraft.func_71379_u() && p_187493_3_.getLightValue(p_187493_1_, p_187493_4_) == 0 && p_187493_2_.isAmbientOcclusion(p_187493_3_);
try
{
@@ -128,7 +128,14 @@
p_187492_8_.func_187491_a(p_187492_1_, p_187492_2_, p_187492_3_, bakedquad.func_178210_d(), p_187492_6_, p_187492_7_);
p_187492_4_.func_178981_a(bakedquad.func_178209_a());
p_187492_4_.func_178962_a(p_187492_8_.field_178207_c[0], p_187492_8_.field_178207_c[1], p_187492_8_.field_178207_c[2], p_187492_8_.field_178207_c[3]);
-
+ if(bakedquad.shouldApplyDiffuseLighting())
+ {
+ float diffuse = net.minecraftforge.client.model.pipeline.LightUtil.diffuseLight(bakedquad.func_178210_d());
+ p_187492_8_.field_178206_b[0] *= diffuse;
+ p_187492_8_.field_178206_b[1] *= diffuse;
+ p_187492_8_.field_178206_b[2] *= diffuse;
+ p_187492_8_.field_178206_b[3] *= diffuse;
+ }
if (bakedquad.func_178212_b())
{
int k = this.field_187499_a.func_186724_a(p_187492_2_, p_187492_1_, p_187492_3_, bakedquad.func_178211_c());
@@ -262,11 +269,26 @@
float f = (float)(k >> 16 & 255) / 255.0F;
float f1 = (float)(k >> 8 & 255) / 255.0F;
float f2 = (float)(k & 255) / 255.0F;
+ if(bakedquad.shouldApplyDiffuseLighting())
+ {
+ float diffuse = net.minecraftforge.client.model.pipeline.LightUtil.diffuseLight(bakedquad.func_178210_d());
+ f *= diffuse;
+ f1 *= diffuse;
+ f2 *= diffuse;
+ }
p_187496_6_.func_178978_a(f, f1, f2, 4);
p_187496_6_.func_178978_a(f, f1, f2, 3);
p_187496_6_.func_178978_a(f, f1, f2, 2);
p_187496_6_.func_178978_a(f, f1, f2, 1);
}
+ else if(bakedquad.shouldApplyDiffuseLighting())
+ {
+ float diffuse = net.minecraftforge.client.model.pipeline.LightUtil.diffuseLight(bakedquad.func_178210_d());
+ p_187496_6_.func_178978_a(diffuse, diffuse, diffuse, 4);
+ p_187496_6_.func_178978_a(diffuse, diffuse, diffuse, 3);
+ p_187496_6_.func_178978_a(diffuse, diffuse, diffuse, 2);
+ p_187496_6_.func_178978_a(diffuse, diffuse, diffuse, 1);
+ }
p_187496_6_.func_178987_a(d0, d1, d2);
}

View File

@ -1,9 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/BlockModelShapes.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/BlockModelShapes.java
@@ -391,5 +391,6 @@
return new ModelResourceLocation(s + "_double_slab", s1);
}
});
+ net.minecraftforge.client.model.ModelLoader.onRegisterAllBlocks(this);
}
}

View File

@ -1,31 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java
@@ -28,7 +28,7 @@
public BlockRendererDispatcher(BlockModelShapes p_i46577_1_, BlockColors p_i46577_2_)
{
this.field_175028_a = p_i46577_1_;
- this.field_175027_c = new BlockModelRenderer(p_i46577_2_);
+ this.field_175027_c = new net.minecraftforge.client.model.pipeline.ForgeBlockModelRenderer(p_i46577_2_);
this.field_175025_e = new BlockFluidRenderer(p_i46577_2_);
}
@@ -43,7 +43,7 @@
{
p_175020_1_ = p_175020_1_.func_185899_b(p_175020_4_, p_175020_2_);
IBakedModel ibakedmodel = this.field_175028_a.func_178125_b(p_175020_1_);
- IBakedModel ibakedmodel1 = (new SimpleBakedModel.Builder(p_175020_1_, ibakedmodel, p_175020_3_, p_175020_2_)).func_177645_b();
+ IBakedModel ibakedmodel1 = net.minecraftforge.client.ForgeHooksClient.getDamageModel(ibakedmodel, p_175020_3_, p_175020_1_, p_175020_4_, p_175020_2_);
this.field_175027_c.func_178267_a(p_175020_4_, ibakedmodel1, p_175020_1_, p_175020_2_, Tessellator.func_178181_a().func_178180_c(), true);
}
}
@@ -75,7 +75,9 @@
switch (enumblockrendertype)
{
case MODEL:
- return this.field_175027_c.func_178267_a(p_175018_3_, this.func_184389_a(p_175018_1_), p_175018_1_, p_175018_2_, p_175018_4_, true);
+ IBakedModel model = this.func_184389_a(p_175018_1_);
+ p_175018_1_ = p_175018_1_.func_177230_c().getExtendedState(p_175018_1_, p_175018_3_, p_175018_2_);
+ return this.field_175027_c.func_178267_a(p_175018_3_, model, p_175018_1_, p_175018_2_, p_175018_4_, true);
case ENTITYBLOCK_ANIMATED:
return false;
case LIQUID:

View File

@ -1,70 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/BufferBuilder.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/BufferBuilder.java
@@ -123,6 +123,8 @@
bitset.set(i1);
}
+ this.field_178999_b.limit(this.field_178999_b.capacity());
+ this.field_178999_b.position(this.func_181664_j());
}
public BufferBuilder.State func_181672_a()
@@ -415,7 +417,7 @@
public void func_178981_a(int[] p_178981_1_)
{
- this.func_181670_b(p_178981_1_.length * 4);
+ this.func_181670_b(p_178981_1_.length * 4 + this.field_179011_q.func_177338_f());//Forge, fix MC-122110
this.field_178999_b.position(this.func_181664_j());
this.field_178999_b.put(p_178981_1_);
this.field_178997_d += p_178981_1_.length / this.field_179011_q.func_181719_f();
@@ -506,15 +508,15 @@
break;
case USHORT:
case SHORT:
- this.field_179001_a.putShort(i, (short)((int)p_181663_1_ * 32767 & 65535));
- this.field_179001_a.putShort(i + 2, (short)((int)p_181663_2_ * 32767 & 65535));
- this.field_179001_a.putShort(i + 4, (short)((int)p_181663_3_ * 32767 & 65535));
+ this.field_179001_a.putShort(i, (short)((int)(p_181663_1_ * 32767) & 65535));
+ this.field_179001_a.putShort(i + 2, (short)((int)(p_181663_2_ * 32767) & 65535));
+ this.field_179001_a.putShort(i + 4, (short)((int)(p_181663_3_ * 32767) & 65535));
break;
case UBYTE:
case BYTE:
- this.field_179001_a.put(i, (byte)((int)p_181663_1_ * 127 & 255));
- this.field_179001_a.put(i + 1, (byte)((int)p_181663_2_ * 127 & 255));
- this.field_179001_a.put(i + 2, (byte)((int)p_181663_3_ * 127 & 255));
+ this.field_179001_a.put(i, (byte)((int)(p_181663_1_ * 127) & 255));
+ this.field_179001_a.put(i + 1, (byte)((int)(p_181663_2_ * 127) & 255));
+ this.field_179001_a.put(i + 2, (byte)((int)(p_181663_3_ * 127) & 255));
}
this.func_181667_k();
@@ -605,4 +607,27 @@
return this.field_179018_e;
}
}
+
+
+ //For some unknown reason Mojang changed the vanilla function to hardcode alpha as 255.... So lets re-add the parameter -.-
+ public void putColorRGBA(int index, int red, int green, int blue, int alpha)
+ {
+ if (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN)
+ this.field_178999_b.put(index, alpha << 24 | blue << 16 | green << 8 | red);
+ else
+ this.field_178999_b.put(index, red << 24 | green << 16 | blue << 8 | alpha);
+ }
+
+ public boolean isColorDisabled()
+ {
+ return this.field_78939_q;
+ }
+
+ public void putBulkData(ByteBuffer buffer)
+ {
+ func_181670_b(buffer.limit() + this.field_179011_q.func_177338_f());
+ this.field_179001_a.position(this.field_178997_d * this.field_179011_q.func_177338_f());
+ this.field_179001_a.put(buffer);
+ this.field_178997_d += buffer.limit() / this.field_179011_q.func_177338_f();
+ }
}

View File

@ -1,11 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/ChestRenderer.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/ChestRenderer.java
@@ -13,6 +13,7 @@
{
GlStateManager.func_179131_c(p_178175_2_, p_178175_2_, p_178175_2_, 1.0F);
GlStateManager.func_179114_b(90.0F, 0.0F, 1.0F, 0.0F);
- TileEntityItemStackRenderer.field_147719_a.func_179022_a(new ItemStack(p_178175_1_));
+ ItemStack stack = new ItemStack(p_178175_1_);
+ stack.func_77973_b().getTileEntityItemStackRenderer().func_179022_a(stack);
}
}

View File

@ -1,296 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/EntityRenderer.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/EntityRenderer.java
@@ -211,6 +211,7 @@
{
this.func_175069_a(new ResourceLocation("shaders/post/invert.json"));
}
+ else net.minecraftforge.client.ForgeHooksClient.loadEntityShader(p_175066_1_, this);
}
}
@@ -290,7 +291,7 @@
this.field_78531_r.func_175607_a(this.field_78531_r.field_71439_g);
}
- float f3 = this.field_78531_r.field_71441_e.func_175724_o(new BlockPos(this.field_78531_r.func_175606_aa()));
+ float f3 = this.field_78531_r.field_71441_e.func_175724_o(new BlockPos(this.field_78531_r.func_175606_aa().func_174824_e(1F))); // Forge: fix MC-51150
float f4 = (float)this.field_78531_r.field_71474_y.field_151451_c / 32.0F;
float f2 = f3 * (1.0F - f4) + f4;
this.field_78539_ae += (f2 - this.field_78539_ae) * 0.1F;
@@ -412,7 +413,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() && !entity1.canRiderInteract())
{
if (d2 == 0.0D)
{
@@ -505,7 +506,7 @@
f = f * 60.0F / 70.0F;
}
- return f;
+ return net.minecraftforge.client.ForgeHooksClient.getFOVModifier(this, entity, iblockstate, p_78481_1_, f);
}
}
@@ -569,14 +570,8 @@
{
BlockPos blockpos = new BlockPos(entity);
IBlockState iblockstate = this.field_78531_r.field_71441_e.func_180495_p(blockpos);
- Block block = iblockstate.func_177230_c();
+ net.minecraftforge.client.ForgeHooksClient.orientBedCamera(this.field_78531_r.field_71441_e, blockpos, iblockstate, entity);
- if (block == Blocks.field_150324_C)
- {
- int j = ((EnumFacing)iblockstate.func_177229_b(BlockBed.field_185512_D)).func_176736_b();
- GlStateManager.func_179114_b((float)(j * 90), 0.0F, 1.0F, 0.0F);
- }
-
GlStateManager.func_179114_b(entity.field_70126_B + (entity.field_70177_z - entity.field_70126_B) * p_78467_1_ + 180.0F, 0.0F, -1.0F, 0.0F);
GlStateManager.func_179114_b(entity.field_70127_C + (entity.field_70125_A - entity.field_70127_C) * p_78467_1_, -1.0F, 0.0F, 0.0F);
}
@@ -643,17 +638,20 @@
if (!this.field_78531_r.field_71474_y.field_74325_U)
{
- GlStateManager.func_179114_b(entity.field_70127_C + (entity.field_70125_A - entity.field_70127_C) * p_78467_1_, 1.0F, 0.0F, 0.0F);
-
+ float yaw = entity.field_70126_B + (entity.field_70177_z - entity.field_70126_B) * p_78467_1_ + 180.0F;
+ float pitch = entity.field_70127_C + (entity.field_70125_A - entity.field_70127_C) * p_78467_1_;
+ float roll = 0.0F;
if (entity instanceof EntityAnimal)
{
EntityAnimal entityanimal = (EntityAnimal)entity;
- GlStateManager.func_179114_b(entityanimal.field_70758_at + (entityanimal.field_70759_as - entityanimal.field_70758_at) * p_78467_1_ + 180.0F, 0.0F, 1.0F, 0.0F);
+ yaw = entityanimal.field_70758_at + (entityanimal.field_70759_as - entityanimal.field_70758_at) * p_78467_1_ + 180.0F;
}
- else
- {
- GlStateManager.func_179114_b(entity.field_70126_B + (entity.field_70177_z - entity.field_70126_B) * p_78467_1_ + 180.0F, 0.0F, 1.0F, 0.0F);
- }
+ IBlockState state = ActiveRenderInfo.func_186703_a(this.field_78531_r.field_71441_e, entity, p_78467_1_);
+ net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup event = new net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup(this, entity, state, p_78467_1_, yaw, pitch, roll);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event);
+ GlStateManager.func_179114_b(event.getRoll(), 0.0F, 0.0F, 1.0F);
+ GlStateManager.func_179114_b(event.getPitch(), 1.0F, 0.0F, 0.0F);
+ GlStateManager.func_179114_b(event.getYaw(), 0.0F, 1.0F, 0.0F);
}
GlStateManager.func_179109_b(0.0F, -f, 0.0F);
@@ -771,6 +769,7 @@
boolean flag = this.field_78531_r.func_175606_aa() instanceof EntityLivingBase && ((EntityLivingBase)this.field_78531_r.func_175606_aa()).func_70608_bn();
+ if (!net.minecraftforge.client.ForgeHooksClient.renderFirstPersonHand(field_78531_r.field_71438_f, p_78476_1_, p_78476_2_))
if (this.field_78531_r.field_71474_y.field_74320_O == 0 && !flag && !this.field_78531_r.field_71474_y.field_74319_N && !this.field_78531_r.field_71442_b.func_78747_a())
{
this.func_180436_i();
@@ -875,6 +874,15 @@
f10 = 0.25F + f7 * 0.75F;
}
+ float[] colors = {f8, f9, f10};
+ world.field_73011_w.getLightmapColors(p_78472_1_, f, f2, f3, colors);
+ f8 = colors[0]; f9 = colors[1]; f10 = colors[2];
+
+ // Forge: fix MC-58177
+ f8 = MathHelper.func_76131_a(f8, 0f, 1f);
+ f9 = MathHelper.func_76131_a(f9, 0f, 1f);
+ f10 = MathHelper.func_76131_a(f10, 0f, 1f);
+
if (this.field_78531_r.field_71439_g.func_70644_a(MobEffects.field_76439_r))
{
float f15 = this.func_180438_a(this.field_78531_r.field_71439_g, p_78472_1_);
@@ -1101,6 +1109,10 @@
GlStateManager.func_179096_D();
this.func_78478_c();
this.field_78510_Z = System.nanoTime();
+ // Forge: Fix MC-112292
+ net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.field_147556_a.field_147553_e = this.field_78531_r.func_110434_K();
+ // Forge: also fix rendering text before entering world (not part of MC-112292, but the same reason)
+ net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.field_147556_a.field_147557_n = this.field_78531_r.field_71466_p;
}
if (this.field_78531_r.field_71462_r != null)
@@ -1109,7 +1121,7 @@
try
{
- this.field_78531_r.field_71462_r.func_73863_a(k1, l1, this.field_78531_r.func_193989_ak());
+ net.minecraftforge.client.ForgeHooksClient.drawScreen(this.field_78531_r.field_71462_r, k1, l1, this.field_78531_r.func_193989_ak());
}
catch (Throwable throwable)
{
@@ -1204,7 +1216,7 @@
if (this.field_78531_r.field_71442_b.func_178889_l() == GameType.SPECTATOR)
{
- flag = block.func_149716_u() && this.field_78531_r.field_71441_e.func_175625_s(blockpos) instanceof IInventory;
+ flag = block.hasTileEntity(this.field_78531_r.field_71441_e.func_180495_p(blockpos)) && this.field_78531_r.field_71441_e.func_175625_s(blockpos) instanceof IInventory;
}
else
{
@@ -1262,7 +1274,7 @@
GlStateManager.func_179086_m(16640);
this.field_78531_r.field_71424_I.func_76318_c("camera");
this.func_78479_a(p_175068_2_, p_175068_1_);
- ActiveRenderInfo.func_74583_a(this.field_78531_r.field_71439_g, this.field_78531_r.field_71474_y.field_74320_O == 2);
+ ActiveRenderInfo.updateRenderInfo(this.field_78531_r.func_175606_aa(), this.field_78531_r.field_71474_y.field_74320_O == 2); //Forge: MC-46445 Spectator mode particles and sounds computed from where you have been before
this.field_78531_r.field_71424_I.func_76318_c("frustum");
ClippingHelperImpl.func_78558_a();
this.field_78531_r.field_71424_I.func_76318_c("culling");
@@ -1315,7 +1327,9 @@
GlStateManager.func_179118_c();
renderglobal.func_174977_a(BlockRenderLayer.SOLID, (double)p_175068_2_, p_175068_1_, entity);
GlStateManager.func_179141_d();
+ this.field_78531_r.func_110434_K().func_110581_b(TextureMap.field_110575_b).func_174936_b(false, this.field_78531_r.field_71474_y.field_151442_I > 0); // FORGE: fix flickering leaves when mods mess up the blurMipmap settings
renderglobal.func_174977_a(BlockRenderLayer.CUTOUT_MIPPED, (double)p_175068_2_, p_175068_1_, entity);
+ this.field_78531_r.func_110434_K().func_110581_b(TextureMap.field_110575_b).func_174935_a();
this.field_78531_r.func_110434_K().func_110581_b(TextureMap.field_110575_b).func_174936_b(false, false);
renderglobal.func_174977_a(BlockRenderLayer.CUTOUT, (double)p_175068_2_, p_175068_1_, entity);
this.field_78531_r.func_110434_K().func_110581_b(TextureMap.field_110575_b).func_174935_a();
@@ -1329,7 +1343,9 @@
GlStateManager.func_179094_E();
RenderHelper.func_74519_b();
this.field_78531_r.field_71424_I.func_76318_c("entities");
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(0);
renderglobal.func_180446_a(entity, icamera, p_175068_2_);
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(0);
RenderHelper.func_74518_a();
this.func_175072_h();
}
@@ -1342,6 +1358,7 @@
EntityPlayer entityplayer = (EntityPlayer)entity;
GlStateManager.func_179118_c();
this.field_78531_r.field_71424_I.func_76318_c("outline");
+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, field_78531_r.field_71476_x, 0, p_175068_2_))
renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_175068_2_);
GlStateManager.func_179141_d();
}
@@ -1388,6 +1405,17 @@
GlStateManager.func_179103_j(7425);
this.field_78531_r.field_71424_I.func_76318_c("translucent");
renderglobal.func_174977_a(BlockRenderLayer.TRANSLUCENT, (double)p_175068_2_, p_175068_1_, entity);
+ if (!this.field_175078_W) //Only render if render pass 0 happens as well.
+ {
+ RenderHelper.func_74519_b();
+ this.field_78531_r.field_71424_I.func_76318_c("entities");
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(1);
+ renderglobal.func_180446_a(entity, icamera, p_175068_2_);
+ // restore blending function changed by RenderGlobal.preRenderDamagedBlocks
+ GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(-1);
+ RenderHelper.func_74518_a();
+ }
GlStateManager.func_179103_j(7424);
GlStateManager.func_179132_a(true);
GlStateManager.func_179089_o();
@@ -1400,6 +1428,9 @@
this.func_180437_a(renderglobal, p_175068_2_, p_175068_1_, d0, d1, d2);
}
+ this.field_78531_r.field_71424_I.func_76318_c("forge_render_last");
+ net.minecraftforge.client.ForgeHooksClient.dispatchRenderLast(renderglobal, p_175068_2_);
+
this.field_78531_r.field_71424_I.func_76318_c("hand");
if (this.field_175074_C)
@@ -1515,6 +1546,13 @@
protected void func_78474_d(float p_78474_1_)
{
+ net.minecraftforge.client.IRenderHandler renderer = this.field_78531_r.field_71441_e.field_73011_w.getWeatherRenderer();
+ if (renderer != null)
+ {
+ renderer.render(p_78474_1_, this.field_78531_r.field_71441_e, field_78531_r);
+ return;
+ }
+
float f = this.field_78531_r.field_71441_e.func_72867_j(p_78474_1_);
if (f > 0.0F)
@@ -1749,30 +1787,17 @@
this.field_175082_R = (float)vec3d3.field_72448_b;
this.field_175081_S = (float)vec3d3.field_72449_c;
}
- else if (iblockstate.func_185904_a() == Material.field_151586_h)
+ else
{
- float f12 = 0.0F;
-
- if (entity instanceof EntityLivingBase)
- {
- f12 = (float)EnchantmentHelper.func_185292_c((EntityLivingBase)entity) * 0.2F;
-
- if (((EntityLivingBase)entity).func_70644_a(MobEffects.field_76427_o))
- {
- f12 = f12 * 0.3F + 0.6F;
- }
- }
-
- this.field_175080_Q = 0.02F + f12;
- this.field_175082_R = 0.02F + f12;
- this.field_175081_S = 0.2F + f12;
+ //Forge Moved to Block.
+ Vec3d viewport = ActiveRenderInfo.func_178806_a(entity, p_78466_1_);
+ BlockPos viewportPos = new BlockPos(viewport);
+ IBlockState viewportState = this.field_78531_r.field_71441_e.func_180495_p(viewportPos);
+ Vec3d inMaterialColor = viewportState.func_177230_c().getFogColor(this.field_78531_r.field_71441_e, viewportPos, viewportState, entity, new Vec3d(field_175080_Q, field_175082_R, field_175081_S), p_78466_1_);
+ this.field_175080_Q = (float)inMaterialColor.field_72450_a;
+ this.field_175082_R = (float)inMaterialColor.field_72448_b;
+ this.field_175081_S = (float)inMaterialColor.field_72449_c;
}
- else if (iblockstate.func_185904_a() == Material.field_151587_i)
- {
- this.field_175080_Q = 0.6F;
- this.field_175082_R = 0.1F;
- this.field_175081_S = 0.0F;
- }
float f13 = this.field_78535_ad + (this.field_78539_ae - this.field_78535_ad) * p_78466_1_;
this.field_175080_Q *= f13;
@@ -1830,6 +1855,9 @@
f6 = 1.0F / this.field_175081_S;
}
+ // Forge: fix MC-4647 and MC-10480
+ if (Float.isInfinite(f6)) f6 = Math.nextAfter(f6, 0.0);
+
this.field_175080_Q = this.field_175080_Q * (1.0F - f15) + this.field_175080_Q * f6 * f15;
this.field_175082_R = this.field_175082_R * (1.0F - f15) + this.field_175082_R * f6 * f15;
this.field_175081_S = this.field_175081_S * (1.0F - f15) + this.field_175081_S * f6 * f15;
@@ -1845,6 +1873,13 @@
this.field_175081_S = f7;
}
+ net.minecraftforge.client.event.EntityViewRenderEvent.FogColors event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogColors(this, entity, iblockstate, p_78466_1_, this.field_175080_Q, this.field_175082_R, this.field_175081_S);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event);
+
+ this.field_175080_Q = event.getRed();
+ this.field_175082_R = event.getGreen();
+ this.field_175081_S = event.getBlue();
+
GlStateManager.func_179082_a(this.field_175080_Q, this.field_175082_R, this.field_175081_S, 0.0F);
}
@@ -1855,7 +1890,9 @@
GlStateManager.func_187432_a(0.0F, -1.0F, 0.0F);
GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
IBlockState iblockstate = ActiveRenderInfo.func_186703_a(this.field_78531_r.field_71441_e, entity, p_78468_2_);
-
+ float hook = net.minecraftforge.client.ForgeHooksClient.getFogDensity(this, entity, iblockstate, p_78468_2_, 0.1F);
+ if (hook >= 0) GlStateManager.func_179095_a(hook);
+ else
if (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70644_a(MobEffects.field_76440_q))
{
float f1 = 5.0F;
@@ -1940,6 +1977,7 @@
GlStateManager.func_179102_b(f * 0.05F);
GlStateManager.func_179153_c(Math.min(f, 192.0F) * 0.5F);
}
+ net.minecraftforge.client.ForgeHooksClient.onFogRender(this, entity, iblockstate, p_78468_2_, p_78468_1_, f);
}
GlStateManager.func_179142_g();

View File

@ -1,40 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java
@@ -28,13 +28,19 @@
protected void func_175378_g()
{
- if (this.field_146297_k.field_71439_g.func_70651_bq().isEmpty())
+ boolean hasVisibleEffect = false;
+ for(PotionEffect potioneffect : this.field_146297_k.field_71439_g.func_70651_bq()) {
+ Potion potion = potioneffect.func_188419_a();
+ if(potion.shouldRender(potioneffect)) { hasVisibleEffect = true; break; }
+ }
+ if (this.field_146297_k.field_71439_g.func_70651_bq().isEmpty() || !hasVisibleEffect)
{
this.field_147003_i = (this.field_146294_l - this.field_146999_f) / 2;
this.field_147045_u = false;
}
else
{
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.PotionShiftEvent(this))) this.field_147003_i = (this.field_146294_l - this.field_146999_f) / 2; else
this.field_147003_i = 160 + (this.field_146294_l - this.field_146999_f - 200) / 2;
this.field_147045_u = true;
}
@@ -71,6 +77,7 @@
for (PotionEffect potioneffect : Ordering.natural().sortedCopy(collection))
{
Potion potion = potioneffect.func_188419_a();
+ if(!potion.shouldRender(potioneffect)) continue;
GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
this.field_146297_k.func_110434_K().func_110577_a(field_147001_a);
this.func_73729_b(i, j, 0, 166, 140, 32);
@@ -81,6 +88,8 @@
this.func_73729_b(i + 6, j + 7, 0 + i1 % 8 * 18, 198 + i1 / 8 * 18, 18, 18);
}
+ potion.renderInventoryEffect(i, j, potioneffect, field_146297_k);
+ if (!potion.shouldRenderInvText(potioneffect)) { j += l; continue; }
String s1 = I18n.func_135052_a(potion.func_76393_a());
if (potioneffect.func_76458_c() == 1)

View File

@ -1,13 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/ItemModelMesher.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/ItemModelMesher.java
@@ -33,7 +33,9 @@
public TextureAtlasSprite func_178087_a(Item p_178087_1_, int p_178087_2_)
{
- return this.func_178089_a(new ItemStack(p_178087_1_, 1, p_178087_2_)).func_177554_e();
+ ItemStack stack = new ItemStack(p_178087_1_, 1, p_178087_2_);
+ IBakedModel model = this.func_178089_a(stack);
+ return model.func_188617_f().handleItemState(model, stack, null, null).func_177554_e();
}
public IBakedModel func_178089_a(ItemStack p_178089_1_)

View File

@ -1,101 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/ItemRenderer.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/ItemRenderer.java
@@ -216,7 +216,7 @@
bufferbuilder.func_181662_b(135.0D, -7.0D, 0.0D).func_187315_a(1.0D, 0.0D).func_181675_d();
bufferbuilder.func_181662_b(-7.0D, -7.0D, 0.0D).func_187315_a(0.0D, 0.0D).func_181675_d();
tessellator.func_78381_a();
- MapData mapdata = Items.field_151098_aY.func_77873_a(p_187461_1_, this.field_78455_a.field_71441_e);
+ MapData mapdata = ((net.minecraft.item.ItemMap) p_187461_1_.func_77973_b()).func_77873_a(p_187461_1_, this.field_78455_a.field_71441_e);
if (mapdata != null)
{
@@ -312,7 +312,7 @@
{
ItemStack itemstack = abstractclientplayer.func_184607_cu();
- if (itemstack.func_77973_b() == Items.field_151031_f)
+ if (!itemstack.func_190926_b() && itemstack.func_77973_b() == Items.field_151031_f) //Forge: Data watcher can desync and cause this to NPE...
{
EnumHand enumhand1 = abstractclientplayer.func_184600_cs();
flag = enumhand1 == EnumHand.MAIN_HAND;
@@ -329,6 +329,7 @@
{
float f3 = enumhand == EnumHand.MAIN_HAND ? f : 0.0F;
float f5 = 1.0F - (this.field_187470_g + (this.field_187469_f - this.field_187470_g) * p_78440_1_);
+ if(!net.minecraftforge.client.ForgeHooksClient.renderSpecificFirstPersonHand(EnumHand.MAIN_HAND, p_78440_1_, f1, f3, f5, this.field_187467_d))
this.func_187457_a(abstractclientplayer, p_78440_1_, f1, EnumHand.MAIN_HAND, f3, this.field_187467_d, f5);
}
@@ -336,6 +337,7 @@
{
float f4 = enumhand == EnumHand.OFF_HAND ? f : 0.0F;
float f6 = 1.0F - (this.field_187472_i + (this.field_187471_h - this.field_187472_i) * p_78440_1_);
+ if(!net.minecraftforge.client.ForgeHooksClient.renderSpecificFirstPersonHand(EnumHand.OFF_HAND, p_78440_1_, f1, f4, f6, this.field_187468_e))
this.func_187457_a(abstractclientplayer, p_78440_1_, f1, EnumHand.OFF_HAND, f4, this.field_187468_e, f6);
}
@@ -356,7 +358,7 @@
this.func_187456_a(p_187457_7_, p_187457_5_, enumhandside);
}
}
- else if (p_187457_6_.func_77973_b() == Items.field_151098_aY)
+ else if (p_187457_6_.func_77973_b() instanceof net.minecraft.item.ItemMap)
{
if (flag && this.field_187468_e.func_190926_b())
{
@@ -440,6 +442,7 @@
if (this.field_78455_a.field_71439_g.func_70094_T())
{
IBlockState iblockstate = this.field_78455_a.field_71441_e.func_180495_p(new BlockPos(this.field_78455_a.field_71439_g));
+ BlockPos overlayPos = new BlockPos(this.field_78455_a.field_71439_g);
EntityPlayer entityplayer = this.field_78455_a.field_71439_g;
for (int i = 0; i < 8; ++i)
@@ -453,11 +456,13 @@
if (iblockstate1.func_191058_s())
{
iblockstate = iblockstate1;
+ overlayPos = blockpos;
}
}
if (iblockstate.func_185901_i() != EnumBlockRenderType.INVISIBLE)
{
+ if (!net.minecraftforge.event.ForgeEventFactory.renderBlockOverlay(field_78455_a.field_71439_g, p_78447_1_, net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType.BLOCK, iblockstate, overlayPos))
this.func_178108_a(this.field_78455_a.func_175602_ab().func_175023_a().func_178122_a(iblockstate));
}
}
@@ -466,11 +471,13 @@
{
if (this.field_78455_a.field_71439_g.func_70055_a(Material.field_151586_h))
{
+ if (!net.minecraftforge.event.ForgeEventFactory.renderWaterOverlay(field_78455_a.field_71439_g, p_78447_1_))
this.func_78448_c(p_78447_1_);
}
if (this.field_78455_a.field_71439_g.func_70027_ad())
{
+ if (!net.minecraftforge.event.ForgeEventFactory.renderFireOverlay(field_78455_a.field_71439_g, p_78447_1_))
this.func_78442_d();
}
}
@@ -592,8 +599,17 @@
else
{
float f = entityplayersp.func_184825_o(1.0F);
- this.field_187469_f += MathHelper.func_76131_a((Objects.equals(this.field_187467_d, itemstack) ? f * f * f : 0.0F) - this.field_187469_f, -0.4F, 0.4F);
- this.field_187471_h += MathHelper.func_76131_a((float)(Objects.equals(this.field_187468_e, itemstack1) ? 1 : 0) - this.field_187471_h, -0.4F, 0.4F);
+
+ boolean requipM = net.minecraftforge.client.ForgeHooksClient.shouldCauseReequipAnimation(this.field_187467_d, itemstack, entityplayersp.field_71071_by.field_70461_c);
+ boolean requipO = net.minecraftforge.client.ForgeHooksClient.shouldCauseReequipAnimation(this.field_187468_e, itemstack1, -1);
+
+ if (!requipM && !Objects.equals(this.field_187467_d, itemstack))
+ this.field_187467_d = itemstack;
+ if (!requipM && !Objects.equals(this.field_187468_e, itemstack1))
+ this.field_187468_e = itemstack1;
+
+ this.field_187469_f += MathHelper.func_76131_a((!requipM ? f * f * f : 0.0F) - this.field_187469_f, -0.4F, 0.4F);
+ this.field_187471_h += MathHelper.func_76131_a((float)(!requipO ? 1 : 0) - this.field_187471_h, -0.4F, 0.4F);
}
if (this.field_187469_f < 0.1F)

View File

@ -1,26 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/OpenGlHelper.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/OpenGlHelper.java
@@ -93,6 +93,10 @@
public static int field_176089_P;
public static int field_148826_e;
+ /* Stores the last values sent into setLightmapTextureCoords */
+ public static float lastBrightnessX = 0.0f;
+ public static float lastBrightnessY = 0.0f;
+
public static void func_77474_a()
{
ContextCapabilities contextcapabilities = GLContext.getCapabilities();
@@ -853,6 +857,12 @@
{
GL13.glMultiTexCoord2f(p_77475_0_, p_77475_1_, p_77475_2_);
}
+
+ if (p_77475_0_ == field_77476_b)
+ {
+ lastBrightnessX = p_77475_1_;
+ lastBrightnessY = p_77475_2_;
+ }
}
public static void func_148821_a(int p_148821_0_, int p_148821_1_, int p_148821_2_, int p_148821_3_)

View File

@ -1,158 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/RenderGlobal.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/RenderGlobal.java
@@ -553,8 +553,10 @@
public void func_180446_a(Entity p_180446_1_, ICamera p_180446_2_, float p_180446_3_)
{
+ int pass = net.minecraftforge.client.MinecraftForgeClient.getRenderPass();
if (this.field_72740_G > 0)
{
+ if (pass > 0) return;
--this.field_72740_G;
}
else
@@ -565,9 +567,12 @@
this.field_72769_h.field_72984_F.func_76320_a("prepare");
TileEntityRendererDispatcher.field_147556_a.func_190056_a(this.field_72769_h, this.field_72777_q.func_110434_K(), this.field_72777_q.field_71466_p, this.field_72777_q.func_175606_aa(), this.field_72777_q.field_71476_x, p_180446_3_);
this.field_175010_j.func_180597_a(this.field_72769_h, this.field_72777_q.field_71466_p, this.field_72777_q.func_175606_aa(), this.field_72777_q.field_147125_j, this.field_72777_q.field_71474_y, p_180446_3_);
+ if(pass == 0)
+ {
this.field_72748_H = 0;
this.field_72749_I = 0;
this.field_72750_J = 0;
+ }
Entity entity = this.field_72777_q.func_175606_aa();
double d3 = entity.field_70142_S + (entity.field_70165_t - entity.field_70142_S) * (double)p_180446_3_;
double d4 = entity.field_70137_T + (entity.field_70163_u - entity.field_70137_T) * (double)p_180446_3_;
@@ -579,11 +584,15 @@
this.field_72777_q.field_71460_t.func_180436_i();
this.field_72769_h.field_72984_F.func_76318_c("global");
List<Entity> list = this.field_72769_h.func_72910_y();
+ if (pass == 0)
+ {
this.field_72748_H = list.size();
+ }
for (int i = 0; i < this.field_72769_h.field_73007_j.size(); ++i)
{
Entity entity1 = this.field_72769_h.field_73007_j.get(i);
+ if (!entity1.shouldRenderInPass(pass)) continue;
++this.field_72749_I;
if (entity1.func_145770_h(d0, d1, d2))
@@ -606,6 +615,7 @@
{
for (Entity entity2 : classinheritancemultimap)
{
+ if(!entity2.shouldRenderInPass(pass)) continue;
boolean flag = this.field_175010_j.func_178635_a(entity2, p_180446_2_, d0, d1, d2) || entity2.func_184215_y(this.field_72777_q.field_71439_g);
if (flag)
@@ -642,6 +652,7 @@
}
}
+ if(pass == 0)
if (this.func_174985_d() && (!list1.isEmpty() || this.field_184386_ad))
{
this.field_72769_h.field_72984_F.func_76318_c("entityOutlines");
@@ -681,6 +692,7 @@
this.field_72769_h.field_72984_F.func_76318_c("blockentities");
RenderHelper.func_74519_b();
+ TileEntityRendererDispatcher.field_147556_a.preDrawBatch();
for (RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation1 : this.field_72755_R)
{
List<TileEntity> list3 = renderglobal$containerlocalrenderinformation1.field_178036_a.func_178571_g().func_178485_b();
@@ -689,6 +701,7 @@
{
for (TileEntity tileentity2 : list3)
{
+ if (!tileentity2.shouldRenderInPass(pass) || !p_180446_2_.func_78546_a(tileentity2.getRenderBoundingBox())) continue;
TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity2, p_180446_3_, -1);
}
}
@@ -698,9 +711,11 @@
{
for (TileEntity tileentity : this.field_181024_n)
{
+ if (!tileentity.shouldRenderInPass(pass) || !p_180446_2_.func_78546_a(tileentity.getRenderBoundingBox())) continue;
TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity, p_180446_3_, -1);
}
}
+ TileEntityRendererDispatcher.field_147556_a.drawBatch(pass);
this.func_180443_s();
@@ -895,7 +910,7 @@
{
RenderChunk renderchunk1 = this.field_175008_n.func_178161_a(new BlockPos((j << 4) + 8, i, (k << 4) + 8));
- if (renderchunk1 != null && p_174970_4_.func_78546_a(renderchunk1.field_178591_c))
+ if (renderchunk1 != null && p_174970_4_.func_78546_a(renderchunk1.field_178591_c.func_72321_a(0.0, blockpos1.func_177956_o() > 0 ? Double.POSITIVE_INFINITY : Double.NEGATIVE_INFINITY, 0.0))) // Forge: fix MC-73139
{
renderchunk1.func_178577_a(p_174970_5_);
queue.add(new RenderGlobal.ContainerLocalRenderInformation(renderchunk1, (EnumFacing)null, 0));
@@ -951,7 +966,7 @@
BlockPos blockpos2 = renderchunk4.func_178568_j().func_177982_a(8, 8, 8);
boolean flag3 = blockpos2.func_177951_i(blockpos1) < 768.0D;
- if (!renderchunk4.func_188281_o() && !flag3)
+ if (net.minecraftforge.common.ForgeModContainer.alwaysSetupTerrainOffThread || (!renderchunk4.func_188281_o() && !flag3))
{
this.field_175009_l.add(renderchunk4);
}
@@ -1253,6 +1268,13 @@
public void func_174976_a(float p_174976_1_, int p_174976_2_)
{
+ net.minecraftforge.client.IRenderHandler renderer = this.field_72769_h.field_73011_w.getSkyRenderer();
+ if (renderer != null)
+ {
+ renderer.render(p_174976_1_, field_72769_h, field_72777_q);
+ return;
+ }
+
if (this.field_72777_q.field_71441_e.field_73011_w.func_186058_p().func_186068_a() == 1)
{
this.func_180448_r();
@@ -1470,6 +1492,7 @@
public void func_180447_b(float p_180447_1_, int p_180447_2_, double p_180447_3_, double p_180447_5_, double p_180447_7_)
{
+ if (net.minecraftforge.fml.client.FMLClientHandler.instance().renderClouds(this.field_72773_u, p_180447_1_)) return;
if (this.field_72777_q.field_71441_e.field_73011_w.func_76569_d())
{
if (this.field_72777_q.field_71474_y.func_181147_e() == 2)
@@ -1852,7 +1875,8 @@
GlStateManager.func_187428_a(GlStateManager.SourceFactor.DST_COLOR, GlStateManager.DestFactor.SRC_COLOR, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.func_179147_l();
GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 0.5F);
- GlStateManager.func_179136_a(-3.0F, -3.0F);
+ // FORGE: Fix MC-234
+ GlStateManager.func_179136_a(-1.0F, -10.0F);
GlStateManager.func_179088_q();
GlStateManager.func_179092_a(516, 0.1F);
GlStateManager.func_179141_d();
@@ -1892,8 +1916,11 @@
double d7 = (double)blockpos.func_177956_o() - d4;
double d8 = (double)blockpos.func_177952_p() - d5;
Block block = this.field_72769_h.func_180495_p(blockpos).func_177230_c();
+ TileEntity te = this.field_72769_h.func_175625_s(blockpos);
+ boolean hasBreak = block instanceof BlockChest || block instanceof BlockEnderChest || block instanceof BlockSign || block instanceof BlockSkull;
+ if (!hasBreak) hasBreak = te != null && te.canRenderBreaking();
- if (!(block instanceof BlockChest) && !(block instanceof BlockEnderChest) && !(block instanceof BlockSign) && !(block instanceof BlockSkull))
+ if (!hasBreak)
{
if (d6 * d6 + d7 * d7 + d8 * d8 > 1024.0D)
{
@@ -2388,7 +2415,7 @@
if (block.func_176223_P().func_185904_a() != Material.field_151579_a)
{
- SoundType soundtype = block.func_185467_w();
+ SoundType soundtype = block.getSoundType(Block.func_176220_d(p_180439_4_), field_72769_h, p_180439_3_, null);
this.field_72769_h.func_184156_a(p_180439_3_, soundtype.func_185845_c(), SoundCategory.BLOCKS, (soundtype.func_185843_a() + 1.0F) / 2.0F, soundtype.func_185847_b() * 0.8F, false);
}

View File

@ -1,120 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/RenderItem.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/RenderItem.java
@@ -71,7 +71,7 @@
public RenderItem(TextureManager p_i46552_1_, ModelManager p_i46552_2_, ItemColors p_i46552_3_)
{
this.field_175057_n = p_i46552_1_;
- this.field_175059_m = new ItemModelMesher(p_i46552_2_);
+ this.field_175059_m = new net.minecraftforge.client.ItemModelMesherForge(p_i46552_2_);
this.func_175041_b();
this.field_184395_f = p_i46552_3_;
}
@@ -137,7 +137,7 @@
{
GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.func_179091_B();
- TileEntityItemStackRenderer.field_147719_a.func_179022_a(p_180454_1_);
+ p_180454_1_.func_77973_b().getTileEntityItemStackRenderer().func_179022_a(p_180454_1_);
}
else
{
@@ -218,7 +218,7 @@
k = k | -16777216;
}
- this.func_191969_a(p_191970_1_, bakedquad, k);
+ net.minecraftforge.client.model.pipeline.LightUtil.renderQuadColor(p_191970_1_, bakedquad, k);
}
}
@@ -240,17 +240,7 @@
public IBakedModel func_184393_a(ItemStack p_184393_1_, @Nullable World p_184393_2_, @Nullable EntityLivingBase p_184393_3_)
{
IBakedModel ibakedmodel = this.field_175059_m.func_178089_a(p_184393_1_);
- Item item = p_184393_1_.func_77973_b();
-
- if (item != null && item.func_185040_i())
- {
- ResourceLocation resourcelocation = ibakedmodel.func_188617_f().func_188021_a(p_184393_1_, p_184393_2_, p_184393_3_);
- return resourcelocation == null ? ibakedmodel : this.field_175059_m.func_178083_a().func_174953_a(new ModelResourceLocation(resourcelocation, "inventory"));
- }
- else
- {
- return ibakedmodel;
- }
+ return ibakedmodel.func_188617_f().handleItemState(ibakedmodel, p_184393_1_, p_184393_2_, p_184393_3_);
}
public void func_184392_a(ItemStack p_184392_1_, EntityLivingBase p_184392_2_, ItemCameraTransforms.TransformType p_184392_3_, boolean p_184392_4_)
@@ -274,14 +264,9 @@
GlStateManager.func_179147_l();
GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.func_179094_E();
- ItemCameraTransforms itemcameratransforms = p_184394_2_.func_177552_f();
- ItemCameraTransforms.func_188034_a(itemcameratransforms.func_181688_b(p_184394_3_), p_184394_4_);
+ // TODO: check if negative scale is a thing
+ p_184394_2_ = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(p_184394_2_, p_184394_3_, p_184394_4_);
- if (this.func_183005_a(itemcameratransforms.func_181688_b(p_184394_3_)))
- {
- GlStateManager.func_187407_a(GlStateManager.CullFace.FRONT);
- }
-
this.func_180454_a(p_184394_1_, p_184394_2_);
GlStateManager.func_187407_a(GlStateManager.CullFace.BACK);
GlStateManager.func_179121_F();
@@ -314,7 +299,7 @@
GlStateManager.func_187401_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
this.func_180452_a(p_191962_2_, p_191962_3_, p_191962_4_.func_177556_c());
- p_191962_4_.func_177552_f().func_181689_a(ItemCameraTransforms.TransformType.GUI);
+ p_191962_4_ = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(p_191962_4_, ItemCameraTransforms.TransformType.GUI, false);
this.func_180454_a(p_191962_1_, p_191962_4_);
GlStateManager.func_179118_c();
GlStateManager.func_179101_C();
@@ -367,6 +352,7 @@
return String.valueOf((Object)p_184391_2_.func_77973_b());
}
});
+ crashreportcategory.func_189529_a("Registry Name", () -> String.valueOf(p_184391_2_.func_77973_b().getRegistryName()));
crashreportcategory.func_189529_a("Item Aux", new ICrashReportDetail<String>()
{
public String call() throws Exception
@@ -413,9 +399,12 @@
p_180453_1_.func_175063_a(s, (float)(p_180453_3_ + 19 - 2 - p_180453_1_.func_78256_a(s)), (float)(p_180453_4_ + 6 + 3), 16777215);
GlStateManager.func_179145_e();
GlStateManager.func_179126_j();
+ // Fixes opaque cooldown overlay a bit lower
+ // TODO: check if enabled blending still screws things up down the line.
+ GlStateManager.func_179147_l();
}
- if (p_180453_2_.func_77951_h())
+ if (p_180453_2_.func_77973_b().showDurabilityBar(p_180453_2_))
{
GlStateManager.func_179140_f();
GlStateManager.func_179097_i();
@@ -424,11 +413,10 @@
GlStateManager.func_179084_k();
Tessellator tessellator = Tessellator.func_178181_a();
BufferBuilder bufferbuilder = tessellator.func_178180_c();
- float f = (float)p_180453_2_.func_77952_i();
- float f1 = (float)p_180453_2_.func_77958_k();
- float f2 = Math.max(0.0F, (f1 - f) / f1);
- int i = Math.round(13.0F - f * 13.0F / f1);
- int j = MathHelper.func_181758_c(f2 / 3.0F, 1.0F, 1.0F);
+ double health = p_180453_2_.func_77973_b().getDurabilityForDisplay(p_180453_2_);
+ int rgbfordisplay = p_180453_2_.func_77973_b().getRGBDurabilityForDisplay(p_180453_2_);
+ int i = Math.round(13.0F - (float)health * 13.0F);
+ int j = rgbfordisplay;
this.func_181565_a(bufferbuilder, p_180453_3_ + 2, p_180453_4_ + 13, 13, 2, 0, 0, 0, 255);
this.func_181565_a(bufferbuilder, p_180453_3_ + 2, p_180453_4_ + 13, i, 1, j >> 16 & 255, j >> 8 & 255, j & 255, 255);
GlStateManager.func_179147_l();
@@ -1099,6 +1087,7 @@
this.func_175029_a(Blocks.field_185779_df, TileEntityStructure.Mode.LOAD.func_185110_a(), "structure_block");
this.func_175029_a(Blocks.field_185779_df, TileEntityStructure.Mode.CORNER.func_185110_a(), "structure_block");
this.func_175029_a(Blocks.field_185779_df, TileEntityStructure.Mode.DATA.func_185110_a(), "structure_block");
+ net.minecraftforge.client.model.ModelLoader.onRegisterItems(this.field_175059_m);
}
public void func_110549_a(IResourceManager p_110549_1_)

View File

@ -1,57 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java
@@ -27,26 +27,8 @@
int l = vertexformatelement.func_177369_e();
bytebuffer.position(vertexformat.func_181720_d(j));
- switch (vertexformatelement$enumusage)
- {
- case POSITION:
- GlStateManager.func_187427_b(vertexformatelement.func_177370_d(), k, i, bytebuffer);
- GlStateManager.func_187410_q(32884);
- break;
- case UV:
- OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a + l);
- GlStateManager.func_187404_a(vertexformatelement.func_177370_d(), k, i, bytebuffer);
- GlStateManager.func_187410_q(32888);
- OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a);
- break;
- case COLOR:
- GlStateManager.func_187400_c(vertexformatelement.func_177370_d(), k, i, bytebuffer);
- GlStateManager.func_187410_q(32886);
- break;
- case NORMAL:
- GlStateManager.func_187446_a(k, i, bytebuffer);
- GlStateManager.func_187410_q(32885);
- }
+ // moved to VertexFormatElement.preDraw
+ vertexformatelement.func_177375_c().preDraw(vertexformat, j, i, bytebuffer);
}
GlStateManager.func_187439_f(p_181679_1_.func_178979_i(), 0, p_181679_1_.func_178989_h());
@@ -58,23 +40,8 @@
VertexFormatElement.EnumUsage vertexformatelement$enumusage1 = vertexformatelement1.func_177375_c();
int k1 = vertexformatelement1.func_177369_e();
- switch (vertexformatelement$enumusage1)
- {
- case POSITION:
- GlStateManager.func_187429_p(32884);
- break;
- case UV:
- OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a + k1);
- GlStateManager.func_187429_p(32888);
- OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a);
- break;
- case COLOR:
- GlStateManager.func_187429_p(32886);
- GlStateManager.func_179117_G();
- break;
- case NORMAL:
- GlStateManager.func_187429_p(32885);
- }
+ // moved to VertexFormatElement.postDraw
+ vertexformatelement1.func_177375_c().postDraw(vertexformat, i1, i, bytebuffer);
}
}

View File

@ -1,54 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java
@@ -6,15 +6,26 @@
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
-public class BakedQuad
+public class BakedQuad implements net.minecraftforge.client.model.pipeline.IVertexProducer
{
protected final int[] field_178215_a;
protected final int field_178213_b;
protected final EnumFacing field_178214_c;
protected final TextureAtlasSprite field_187509_d;
+ /**
+ * @deprecated Use constructor with the format argument.
+ */
+ @Deprecated
public BakedQuad(int[] p_i46574_1_, int p_i46574_2_, EnumFacing p_i46574_3_, TextureAtlasSprite p_i46574_4_)
{
+ this(p_i46574_1_, p_i46574_2_, p_i46574_3_, p_i46574_4_, true, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176599_b);
+ }
+
+ public BakedQuad(int[] p_i46574_1_, int p_i46574_2_, EnumFacing p_i46574_3_, TextureAtlasSprite p_i46574_4_, boolean applyDiffuseLighting, net.minecraft.client.renderer.vertex.VertexFormat format)
+ {
+ this.format = format;
+ this.applyDiffuseLighting = applyDiffuseLighting;
this.field_178215_a = p_i46574_1_;
this.field_178213_b = p_i46574_2_;
this.field_178214_c = p_i46574_3_;
@@ -45,4 +56,23 @@
{
return this.field_178214_c;
}
+
+ protected final net.minecraft.client.renderer.vertex.VertexFormat format;
+ protected final boolean applyDiffuseLighting;
+
+ @Override
+ public void pipe(net.minecraftforge.client.model.pipeline.IVertexConsumer consumer)
+ {
+ net.minecraftforge.client.model.pipeline.LightUtil.putBakedQuad(consumer, this);
+ }
+
+ public net.minecraft.client.renderer.vertex.VertexFormat getFormat()
+ {
+ return format;
+ }
+
+ public boolean shouldApplyDiffuseLighting()
+ {
+ return applyDiffuseLighting;
+ }
}

View File

@ -1,31 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/BakedQuadRetextured.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/BakedQuadRetextured.java
@@ -12,7 +12,7 @@
public BakedQuadRetextured(BakedQuad p_i46217_1_, TextureAtlasSprite p_i46217_2_)
{
- super(Arrays.copyOf(p_i46217_1_.func_178209_a(), p_i46217_1_.func_178209_a().length), p_i46217_1_.field_178213_b, FaceBakery.func_178410_a(p_i46217_1_.func_178209_a()), p_i46217_1_.func_187508_a());
+ super(Arrays.copyOf(p_i46217_1_.func_178209_a(), p_i46217_1_.func_178209_a().length), p_i46217_1_.field_178213_b, FaceBakery.func_178410_a(p_i46217_1_.func_178209_a()), p_i46217_1_.func_187508_a(), p_i46217_1_.applyDiffuseLighting, p_i46217_1_.format);
this.field_178218_d = p_i46217_2_;
this.func_178217_e();
}
@@ -21,9 +21,16 @@
{
for (int i = 0; i < 4; ++i)
{
- int j = 7 * i;
- this.field_178215_a[j + 4] = Float.floatToRawIntBits(this.field_178218_d.func_94214_a((double)this.field_187509_d.func_188537_a(Float.intBitsToFloat(this.field_178215_a[j + 4]))));
- this.field_178215_a[j + 4 + 1] = Float.floatToRawIntBits(this.field_178218_d.func_94207_b((double)this.field_187509_d.func_188536_b(Float.intBitsToFloat(this.field_178215_a[j + 4 + 1]))));
+ int j = format.func_181719_f() * i;
+ int uvIndex = format.func_177344_b(0) / 4;
+ this.field_178215_a[j + uvIndex] = Float.floatToRawIntBits(this.field_178218_d.func_94214_a((double)this.field_187509_d.func_188537_a(Float.intBitsToFloat(this.field_178215_a[j + uvIndex]))));
+ this.field_178215_a[j + uvIndex + 1] = Float.floatToRawIntBits(this.field_178218_d.func_94207_b((double)this.field_187509_d.func_188536_b(Float.intBitsToFloat(this.field_178215_a[j + uvIndex + 1]))));
}
}
+
+ @Override
+ public TextureAtlasSprite func_187508_a()
+ {
+ return field_178218_d;
+ }
}

View File

@ -1,105 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java
@@ -49,14 +49,19 @@
public BakedQuad func_178414_a(Vector3f p_178414_1_, Vector3f p_178414_2_, BlockPartFace p_178414_3_, TextureAtlasSprite p_178414_4_, EnumFacing p_178414_5_, ModelRotation p_178414_6_, @Nullable BlockPartRotation p_178414_7_, boolean p_178414_8_, boolean p_178414_9_)
{
+ return makeBakedQuad(p_178414_1_, p_178414_2_, p_178414_3_, p_178414_4_, p_178414_5_, (net.minecraftforge.common.model.ITransformation)p_178414_6_, p_178414_7_, p_178414_8_, p_178414_9_);
+ }
+
+ public BakedQuad makeBakedQuad(Vector3f p_178414_1_, Vector3f p_178414_2_, BlockPartFace p_178414_3_, TextureAtlasSprite p_178414_4_, EnumFacing p_178414_5_, net.minecraftforge.common.model.ITransformation p_178414_6_, BlockPartRotation p_178414_7_, boolean p_178414_8_, boolean p_178414_9_)
+ {
BlockFaceUV blockfaceuv = p_178414_3_.field_178243_e;
if (p_178414_8_)
{
- blockfaceuv = this.func_188010_a(p_178414_3_.field_178243_e, p_178414_5_, p_178414_6_);
+ blockfaceuv = net.minecraftforge.client.ForgeHooksClient.applyUVLock(p_178414_3_.field_178243_e, p_178414_5_, p_178414_6_);
}
- int[] aint = this.func_188012_a(blockfaceuv, p_178414_4_, p_178414_5_, this.func_178403_a(p_178414_1_, p_178414_2_), p_178414_6_, p_178414_7_, p_178414_9_);
+ int[] aint = this.makeQuadVertexData(blockfaceuv, p_178414_4_, p_178414_5_, this.func_178403_a(p_178414_1_, p_178414_2_), p_178414_6_, p_178414_7_, false);
EnumFacing enumfacing = func_178410_a(aint);
if (p_178414_7_ == null)
@@ -64,7 +69,8 @@
this.func_178408_a(aint, enumfacing);
}
- return new BakedQuad(aint, p_178414_3_.field_178245_c, enumfacing, p_178414_4_);
+ net.minecraftforge.client.ForgeHooksClient.fillNormal(aint, enumfacing);
+ return new BakedQuad(aint, p_178414_3_.field_178245_c, enumfacing, p_178414_4_, p_178414_9_, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176599_b);
}
private BlockFaceUV func_188010_a(BlockFaceUV p_188010_1_, EnumFacing p_188010_2_, ModelRotation p_188010_3_)
@@ -74,11 +80,16 @@
private int[] func_188012_a(BlockFaceUV p_188012_1_, TextureAtlasSprite p_188012_2_, EnumFacing p_188012_3_, float[] p_188012_4_, ModelRotation p_188012_5_, @Nullable BlockPartRotation p_188012_6_, boolean p_188012_7_)
{
+ return makeQuadVertexData(p_188012_1_, p_188012_2_, p_188012_3_, p_188012_4_, (net.minecraftforge.common.model.ITransformation)p_188012_5_, p_188012_6_, p_188012_7_);
+ }
+
+ private int[] makeQuadVertexData(BlockFaceUV uvs, TextureAtlasSprite sprite, EnumFacing orientation, float[] p_188012_4_, net.minecraftforge.common.model.ITransformation rotationIn, BlockPartRotation partRotation, boolean shade)
+ {
int[] aint = new int[28];
for (int i = 0; i < 4; ++i)
{
- this.func_188015_a(aint, i, p_188012_3_, p_188012_1_, p_188012_4_, p_188012_2_, p_188012_5_, p_188012_6_, p_188012_7_);
+ this.fillVertexData(aint, i, orientation, uvs, p_188012_4_, sprite, rotationIn, partRotation, shade);
}
return aint;
@@ -124,12 +135,17 @@
private void func_188015_a(int[] p_188015_1_, int p_188015_2_, EnumFacing p_188015_3_, BlockFaceUV p_188015_4_, float[] p_188015_5_, TextureAtlasSprite p_188015_6_, ModelRotation p_188015_7_, @Nullable BlockPartRotation p_188015_8_, boolean p_188015_9_)
{
- EnumFacing enumfacing = p_188015_7_.func_177523_a(p_188015_3_);
+ fillVertexData(p_188015_1_, p_188015_2_, p_188015_3_, p_188015_4_, p_188015_5_, p_188015_6_, (net.minecraftforge.common.model.ITransformation)p_188015_7_, p_188015_8_, p_188015_9_);
+ }
+
+ private void fillVertexData(int[] p_188015_1_, int p_188015_2_, EnumFacing p_188015_3_, BlockFaceUV p_188015_4_, float[] p_188015_5_, TextureAtlasSprite p_188015_6_, net.minecraftforge.common.model.ITransformation p_188015_7_, BlockPartRotation p_188015_8_, boolean p_188015_9_)
+ {
+ EnumFacing enumfacing = p_188015_7_.rotate(p_188015_3_);
int i = p_188015_9_ ? this.func_178413_a(enumfacing) : -1;
EnumFaceDirection.VertexInformation enumfacedirection$vertexinformation = EnumFaceDirection.func_179027_a(p_188015_3_).func_179025_a(p_188015_2_);
Vector3f vector3f = new Vector3f(p_188015_5_[enumfacedirection$vertexinformation.field_179184_a], p_188015_5_[enumfacedirection$vertexinformation.field_179182_b], p_188015_5_[enumfacedirection$vertexinformation.field_179183_c]);
this.func_178407_a(vector3f, p_188015_8_);
- int j = this.func_188011_a(vector3f, p_188015_3_, p_188015_2_, p_188015_7_);
+ int j = this.rotateVertex(vector3f, p_188015_3_, p_188015_2_, p_188015_7_);
this.func_178404_a(p_188015_1_, j, p_188015_2_, vector3f, i, p_188015_6_, p_188015_4_);
}
@@ -140,8 +156,8 @@
p_178404_1_[i + 1] = Float.floatToRawIntBits(p_178404_4_.y);
p_178404_1_[i + 2] = Float.floatToRawIntBits(p_178404_4_.z);
p_178404_1_[i + 3] = p_178404_5_;
- p_178404_1_[i + 4] = Float.floatToRawIntBits(p_178404_6_.func_94214_a((double)p_178404_7_.func_178348_a(p_178404_3_)));
- p_178404_1_[i + 4 + 1] = Float.floatToRawIntBits(p_178404_6_.func_94207_b((double)p_178404_7_.func_178346_b(p_178404_3_)));
+ p_178404_1_[i + 4] = Float.floatToRawIntBits(p_178404_6_.func_94214_a((double)p_178404_7_.func_178348_a(p_178404_3_) * .999 + p_178404_7_.func_178348_a((p_178404_3_ + 2) % 4) * .001));
+ p_178404_1_[i + 4 + 1] = Float.floatToRawIntBits(p_178404_6_.func_94207_b((double)p_178404_7_.func_178346_b(p_178404_3_) * .999 + p_178404_7_.func_178346_b((p_178404_3_ + 2) % 4) * .001));
}
private void func_178407_a(Vector3f p_178407_1_, @Nullable BlockPartRotation p_178407_2_)
@@ -190,14 +206,19 @@
public int func_188011_a(Vector3f p_188011_1_, EnumFacing p_188011_2_, int p_188011_3_, ModelRotation p_188011_4_)
{
+ return rotateVertex(p_188011_1_, p_188011_2_, p_188011_3_, (net.minecraftforge.common.model.ITransformation)p_188011_4_);
+ }
+
+ public int rotateVertex(Vector3f p_188011_1_, EnumFacing p_188011_2_, int p_188011_3_, net.minecraftforge.common.model.ITransformation p_188011_4_)
+ {
if (p_188011_4_ == ModelRotation.X0_Y0)
{
return p_188011_3_;
}
else
{
- this.func_178406_a(p_188011_1_, new Vector3f(0.5F, 0.5F, 0.5F), p_188011_4_.func_177525_a(), new Vector3f(1.0F, 1.0F, 1.0F));
- return p_188011_4_.func_177520_a(p_188011_2_, p_188011_3_);
+ net.minecraftforge.client.ForgeHooksClient.transform(p_188011_1_, p_188011_4_.getMatrix());
+ return p_188011_4_.rotate(p_188011_2_, p_188011_3_);
}
}

View File

@ -1,22 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/IBakedModel.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/IBakedModel.java
@@ -21,7 +21,18 @@
TextureAtlasSprite func_177554_e();
- ItemCameraTransforms func_177552_f();
+ @Deprecated
+ default ItemCameraTransforms func_177552_f() { return ItemCameraTransforms.field_178357_a; }
ItemOverrideList func_188617_f();
+
+ default boolean isAmbientOcclusion(IBlockState state) { return func_177555_b(); }
+
+ /*
+ * Returns the pair of the model for the given perspective, and the matrix
+ * that should be applied to the GL state before rendering it (matrix may be null).
+ */
+ default org.apache.commons.lang3.tuple.Pair<? extends IBakedModel, javax.vecmath.Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) {
+ return net.minecraftforge.client.ForgeHooksClient.handlePerspective(this, cameraTransformType);
+ }
}

View File

@ -1,45 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java
@@ -12,6 +12,9 @@
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.util.vector.Quaternion;
+/*
+ * @deprecated use {@link net.minecraftforge.client.model.IPerspectiveAwareModel} instead
+ */
@SideOnly(Side.CLIENT)
public class ItemCameraTransforms
{
@@ -39,6 +42,7 @@
this(ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a);
}
+ @Deprecated
public ItemCameraTransforms(ItemCameraTransforms p_i46443_1_)
{
this.field_188036_k = p_i46443_1_.field_188036_k;
@@ -51,6 +55,7 @@
this.field_181700_p = p_i46443_1_.field_181700_p;
}
+ @Deprecated
public ItemCameraTransforms(ItemTransformVec3f p_i46569_1_, ItemTransformVec3f p_i46569_2_, ItemTransformVec3f p_i46569_3_, ItemTransformVec3f p_i46569_4_, ItemTransformVec3f p_i46569_5_, ItemTransformVec3f p_i46569_6_, ItemTransformVec3f p_i46569_7_, ItemTransformVec3f p_i46569_8_)
{
this.field_188036_k = p_i46569_1_;
@@ -103,6 +108,7 @@
return new Quaternion(f3 * f6 * f8 + f4 * f5 * f7, f4 * f5 * f8 - f3 * f6 * f7, f3 * f5 * f8 + f4 * f6 * f7, f4 * f6 * f8 - f3 * f5 * f7);
}
+ @Deprecated
public ItemTransformVec3f func_181688_b(ItemCameraTransforms.TransformType p_181688_1_)
{
switch (p_181688_1_)
@@ -169,7 +175,7 @@
}
@SideOnly(Side.CLIENT)
- public static enum TransformType
+ public static enum TransformType implements net.minecraftforge.common.model.IModelPart
{
NONE,
THIRD_PERSON_LEFT_HAND,

View File

@ -1,33 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ItemOverrideList.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ItemOverrideList.java
@@ -29,6 +29,7 @@
}
@Nullable
+ @Deprecated
public ResourceLocation func_188021_a(ItemStack p_188021_1_, @Nullable World p_188021_2_, @Nullable EntityLivingBase p_188021_3_)
{
if (!this.field_188023_b.isEmpty())
@@ -44,4 +45,22 @@
return null;
}
+
+ public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, @Nullable World world, @Nullable EntityLivingBase entity)
+ {
+ if (!stack.func_190926_b() && stack.func_77973_b().func_185040_i())
+ {
+ ResourceLocation location = func_188021_a(stack, world, entity);
+ if (location != null)
+ {
+ return net.minecraft.client.Minecraft.func_71410_x().func_175599_af().func_175037_a().func_178083_a().func_174953_a(net.minecraftforge.client.model.ModelLoader.getInventoryVariant(location.toString()));
+ }
+ }
+ return originalModel;
+ }
+
+ public com.google.common.collect.ImmutableList<ItemOverride> getOverrides()
+ {
+ return com.google.common.collect.ImmutableList.copyOf(field_188023_b);
+ }
}

View File

@ -1,18 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java
@@ -13,9 +13,14 @@
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.util.vector.Vector3f;
+/*
+ * @deprecated use {@link net.minecraftforge.client.model.IModelState} and {@link net.minecraftforge.client.model.TRSRTransformation}
+ */
@SideOnly(Side.CLIENT)
-public class ItemTransformVec3f
+@Deprecated
+public class ItemTransformVec3f implements net.minecraftforge.common.model.IModelState
{
+ public java.util.Optional<net.minecraftforge.common.model.TRSRTransformation> apply(java.util.Optional<? extends net.minecraftforge.common.model.IModelPart> part) { return net.minecraftforge.client.ForgeHooksClient.applyTransform(this, part); }
public static final ItemTransformVec3f field_178366_a = new ItemTransformVec3f(new Vector3f(), new Vector3f(), new Vector3f(1.0F, 1.0F, 1.0F));
public final Vector3f field_178364_b;
public final Vector3f field_178365_c;

View File

@ -1,20 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java
@@ -32,11 +32,16 @@
private final Map<String, VariantList> field_178332_b = Maps.<String, VariantList>newHashMap();
private Multipart field_188005_c;
+ @Deprecated
public static ModelBlockDefinition func_178331_a(Reader p_178331_0_)
{
- return (ModelBlockDefinition)JsonUtils.func_193839_a(field_178333_a, p_178331_0_, ModelBlockDefinition.class);
+ return parseFromReader(p_178331_0_, null);
}
+ public static ModelBlockDefinition parseFromReader(Reader reader, net.minecraft.util.ResourceLocation location) {
+ return net.minecraftforge.client.model.BlockStateLoader.load(reader, location, field_178333_a);
+ }
+
public ModelBlockDefinition(Map<String, VariantList> p_i46572_1_, Multipart p_i46572_2_)
{
this.field_188005_c = p_i46572_2_;

View File

@ -1,14 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ModelManager.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ModelManager.java
@@ -24,9 +24,10 @@
public void func_110549_a(IResourceManager p_110549_1_)
{
- ModelBakery modelbakery = new ModelBakery(p_110549_1_, this.field_174956_b, this.field_174957_c);
+ net.minecraftforge.client.model.ModelLoader modelbakery = new net.minecraftforge.client.model.ModelLoader(p_110549_1_, this.field_174956_b, this.field_174957_c);
this.field_174958_a = modelbakery.func_177570_a();
this.field_174955_d = this.field_174958_a.func_82594_a(ModelBakery.field_177604_a);
+ net.minecraftforge.client.ForgeHooksClient.onModelBake(this, this.field_174958_a, modelbakery);
this.field_174957_c.func_178124_c();
}

View File

@ -1,14 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ModelResourceLocation.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ModelResourceLocation.java
@@ -2,11 +2,8 @@
import java.util.Locale;
import net.minecraft.util.ResourceLocation;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
import org.apache.commons.lang3.StringUtils;
-@SideOnly(Side.CLIENT)
public class ModelResourceLocation extends ResourceLocation
{
private final String field_177519_c;

View File

@ -1,21 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ModelRotation.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ModelRotation.java
@@ -10,7 +10,7 @@
import org.lwjgl.util.vector.Vector3f;
@SideOnly(Side.CLIENT)
-public enum ModelRotation
+public enum ModelRotation implements net.minecraftforge.common.model.IModelState, net.minecraftforge.common.model.ITransformation
{
X0_Y0(0, 0),
X0_Y90(0, 90),
@@ -116,4 +116,9 @@
field_177546_q.put(Integer.valueOf(modelrotation.field_177545_r), modelrotation);
}
}
+
+ public java.util.Optional<net.minecraftforge.common.model.TRSRTransformation> apply(java.util.Optional<? extends net.minecraftforge.common.model.IModelPart> part) { return net.minecraftforge.client.ForgeHooksClient.applyTransform(this, part); }
+ public javax.vecmath.Matrix4f getMatrix() { return net.minecraftforge.common.model.TRSRTransformation.from(this).getMatrix(); }
+ public EnumFacing rotate(EnumFacing facing) { return func_177523_a(facing); }
+ public int rotate(EnumFacing facing, int vertexIndex) { return func_177520_a(facing, vertexIndex); }
}

View File

@ -1,11 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/SimpleBakedModel.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/SimpleBakedModel.java
@@ -88,7 +88,7 @@
public Builder(IBlockState p_i46989_1_, IBakedModel p_i46989_2_, TextureAtlasSprite p_i46989_3_, BlockPos p_i46989_4_)
{
- this(p_i46989_2_.func_177555_b(), p_i46989_2_.func_177556_c(), p_i46989_2_.func_177552_f(), p_i46989_2_.func_188617_f());
+ this(p_i46989_2_.isAmbientOcclusion(p_i46989_1_), p_i46989_2_.func_177556_c(), p_i46989_2_.func_177552_f(), p_i46989_2_.func_188617_f());
this.field_177652_d = p_i46989_2_.func_177554_e();
long i = MathHelper.func_180186_a(p_i46989_4_);

View File

@ -1,39 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/Variant.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/Variant.java
@@ -12,7 +12,7 @@
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
-public class Variant
+public class Variant implements net.minecraftforge.client.model.ISmartVariant
{
private final ResourceLocation field_188050_a;
private final ModelRotation field_188051_b;
@@ -32,11 +32,17 @@
return this.field_188050_a;
}
+ @Deprecated
public ModelRotation func_188048_b()
{
return this.field_188051_b;
}
+ public net.minecraftforge.common.model.IModelState getState()
+ {
+ return this.field_188051_b;
+ }
+
public boolean func_188049_c()
{
return this.field_188052_c;
@@ -138,4 +144,9 @@
}
}
}
+
+ public net.minecraftforge.client.model.IModel process(net.minecraftforge.client.model.IModel base)
+ {
+ return base.uvlock(func_188049_c());
+ }
}

View File

@ -1,11 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/WeightedBakedModel.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/WeightedBakedModel.java
@@ -41,6 +41,8 @@
return this.field_177566_c.func_177555_b();
}
+ public boolean isAmbientOcclusion(IBlockState state) { return this.field_177566_c.isAmbientOcclusion(state); }
+
public boolean func_177556_c()
{
return this.field_177566_c.func_177556_c();

View File

@ -1,11 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java
@@ -39,7 +39,7 @@
}
else
{
- s = this.func_187490_a(this.field_178142_a, map);
+ s = String.format("%s:%s", Block.field_149771_c.func_177774_c(p_178132_1_.func_177230_c()).func_110624_b(), this.func_187490_a(this.field_178142_a, map));
}
if (this.field_178141_c != null)

View File

@ -1,19 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java
@@ -44,9 +44,15 @@
public ChunkRenderDispatcher()
{
+ this(-1);
+ }
+
+ public ChunkRenderDispatcher(int countRenderBuilders)
+ {
int i = Math.max(1, (int)((double)Runtime.getRuntime().maxMemory() * 0.3D) / 10485760);
int j = Math.max(1, MathHelper.func_76125_a(Runtime.getRuntime().availableProcessors(), 1, i / 5));
- this.field_188249_c = MathHelper.func_76125_a(j * 10, 1, i);
+ if(countRenderBuilders < 0) countRenderBuilders = MathHelper.func_76125_a(j * 10, 1, i);
+ this.field_188249_c = countRenderBuilders;
if (j > 1)
{

View File

@ -1,80 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java
@@ -162,7 +162,7 @@
lvt_9_1_.func_178606_a(blockpos$mutableblockpos);
}
- if (block.func_149716_u())
+ if (block.hasTileEntity(iblockstate))
{
TileEntity tileentity = this.field_189564_r.func_190300_a(blockpos$mutableblockpos, Chunk.EnumCreateEntityType.CHECK);
@@ -172,17 +172,19 @@
if (tileentityspecialrenderer != null)
{
- compiledchunk.func_178490_a(tileentity);
if (tileentityspecialrenderer.func_188185_a(tileentity))
{
lvt_10_1_.add(tileentity);
}
+ else compiledchunk.func_178490_a(tileentity); // FORGE: Fix MC-112730
}
}
}
- BlockRenderLayer blockrenderlayer1 = block.func_180664_k();
+ for(BlockRenderLayer blockrenderlayer1 : BlockRenderLayer.values()) {
+ if(!block.canRenderInLayer(iblockstate, blockrenderlayer1)) continue;
+ net.minecraftforge.client.ForgeHooksClient.setRenderLayer(blockrenderlayer1);
int j = blockrenderlayer1.ordinal();
if (block.func_176223_P().func_185901_i() != EnumBlockRenderType.INVISIBLE)
@@ -197,6 +199,8 @@
aboolean[j] |= blockrendererdispatcher.func_175018_a(iblockstate, blockpos$mutableblockpos, this.field_189564_r, bufferbuilder);
}
+ }
+ net.minecraftforge.client.ForgeHooksClient.setRenderLayer(null);
}
for (BlockRenderLayer blockrenderlayer : BlockRenderLayer.values())
@@ -278,7 +282,9 @@
private void func_189563_q()
{
int i = 1;
- this.field_189564_r = new ChunkCache(this.field_178588_d, this.field_178586_f.func_177982_a(-1, -1, -1), this.field_178586_f.func_177982_a(16, 16, 16), 1);
+ ChunkCache cache = createRegionRenderCache(this.field_178588_d, this.field_178586_f.func_177982_a(-1, -1, -1), this.field_178586_f.func_177982_a(16, 16, 16), 1);
+ net.minecraftforge.client.MinecraftForgeClient.onRebuildChunk(this.field_178588_d, this.field_178586_f, cache);
+ this.field_189564_r = cache;
}
@Nullable
@@ -427,6 +433,26 @@
return this.field_178593_n && this.field_188284_q;
}
+ /* ======================================== FORGE START =====================================*/
+ /**
+ * Creates a new RegionRenderCache instance.<br>
+ * Extending classes can change the behavior of the cache, allowing to visually change
+ * blocks (schematics etc).
+ *
+ * @see RegionRenderCache
+ * @param world The world to cache.
+ * @param from The starting position of the chunk minus one on each axis.
+ * @param to The ending position of the chunk plus one on each axis.
+ * @param subtract Padding used internally by the RegionRenderCache constructor to make
+ * the cache a 20x20x20 cube, for a total of 8000 states in the cache.
+ * @return new RegionRenderCache instance
+ */
+ protected ChunkCache createRegionRenderCache(World world, BlockPos from, BlockPos to, int subtract)
+ {
+ return new ChunkCache(world, from, to, subtract);
+ }
+ /* ========================================= FORGE END ======================================*/
+
public BlockPos func_181701_a(EnumFacing p_181701_1_)
{
return this.field_181702_p[p_181701_1_.ordinal()];

View File

@ -1,47 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/color/BlockColors.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/color/BlockColors.java
@@ -27,7 +27,8 @@
@SideOnly(Side.CLIENT)
public class BlockColors
{
- private final ObjectIntIdentityMap<IBlockColor> field_186725_a = new ObjectIntIdentityMap<IBlockColor>(32);
+ // FORGE: Use RegistryDelegates as non-Vanilla block ids are not constant
+ private final java.util.Map<net.minecraftforge.registries.IRegistryDelegate<Block>, IBlockColor> blockColorMap = com.google.common.collect.Maps.newHashMap();
public static BlockColors func_186723_a()
{
@@ -159,12 +160,13 @@
return p_186720_2_ != null && p_186720_3_ != null ? 2129968 : 7455580;
}
}, Blocks.field_150392_bi);
+ net.minecraftforge.client.ForgeHooksClient.onBlockColorsInit(blockcolors);
return blockcolors;
}
public int func_189991_a(IBlockState p_189991_1_, World p_189991_2_, BlockPos p_189991_3_)
{
- IBlockColor iblockcolor = this.field_186725_a.func_148745_a(Block.func_149682_b(p_189991_1_.func_177230_c()));
+ IBlockColor iblockcolor = this.blockColorMap.get(p_189991_1_.func_177230_c().delegate);
if (iblockcolor != null)
{
@@ -179,7 +181,7 @@
public int func_186724_a(IBlockState p_186724_1_, @Nullable IBlockAccess p_186724_2_, @Nullable BlockPos p_186724_3_, int p_186724_4_)
{
- IBlockColor iblockcolor = this.field_186725_a.func_148745_a(Block.func_149682_b(p_186724_1_.func_177230_c()));
+ IBlockColor iblockcolor = this.blockColorMap.get(p_186724_1_.func_177230_c().delegate);
return iblockcolor == null ? -1 : iblockcolor.func_186720_a(p_186724_1_, p_186724_2_, p_186724_3_, p_186724_4_);
}
@@ -187,7 +189,9 @@
{
for (Block block : p_186722_2_)
{
- this.field_186725_a.func_148746_a(p_186722_1_, Block.func_149682_b(block));
+ if (block == null) throw new IllegalArgumentException("Block registered to block color handler cannot be null!");
+ if (block.getRegistryName() == null) throw new IllegalArgumentException("Block must be registered before assigning color handler.");
+ this.blockColorMap.put(block.delegate, p_186722_1_);
}
}
}

View File

@ -1,49 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/color/ItemColors.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/color/ItemColors.java
@@ -26,7 +26,8 @@
@SideOnly(Side.CLIENT)
public class ItemColors
{
- private final ObjectIntIdentityMap<IItemColor> field_186732_a = new ObjectIntIdentityMap<IItemColor>(32);
+ // FORGE: Use RegistryDelegates as non-Vanilla item ids are not constant
+ private final java.util.Map<net.minecraftforge.registries.IRegistryDelegate<Item>, IItemColor> itemColorMap = com.google.common.collect.Maps.newHashMap();
public static ItemColors func_186729_a(final BlockColors p_186729_0_)
{
@@ -137,12 +138,13 @@
return p_186726_2_ == 0 ? -1 : ItemMap.func_190907_h(p_186726_1_);
}
}, Items.field_151098_aY);
+ net.minecraftforge.client.ForgeHooksClient.onItemColorsInit(itemcolors, p_186729_0_);
return itemcolors;
}
public int func_186728_a(ItemStack p_186728_1_, int p_186728_2_)
{
- IItemColor iitemcolor = this.field_186732_a.func_148745_a(Item.field_150901_e.func_148757_b(p_186728_1_.func_77973_b()));
+ IItemColor iitemcolor = this.itemColorMap.get(p_186728_1_.func_77973_b().delegate);
return iitemcolor == null ? -1 : iitemcolor.func_186726_a(p_186728_1_, p_186728_2_);
}
@@ -150,7 +152,9 @@
{
for (Block block : p_186731_2_)
{
- this.field_186732_a.func_148746_a(p_186731_1_, Item.func_150891_b(Item.func_150898_a(block)));
+ if (block == null) throw new IllegalArgumentException("Block registered to item color handler cannot be null!");
+ if (block.getRegistryName() == null) throw new IllegalArgumentException("Block must be registered before assigning color handler.");
+ this.itemColorMap.put(Item.func_150898_a(block).delegate, p_186731_1_);
}
}
@@ -158,7 +162,9 @@
{
for (Item item : p_186730_2_)
{
- this.field_186732_a.func_148746_a(p_186730_1_, Item.func_150891_b(item));
+ if (item == null) throw new IllegalArgumentException("Item registered to item color handler cannot be null!");
+ if (item.getRegistryName() == null) throw new IllegalArgumentException("Item must be registered before assigning color handler.");
+ this.itemColorMap.put(item.delegate, p_186730_1_);
}
}
}

View File

@ -1,86 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java
@@ -44,7 +44,7 @@
boolean flag = p_177077_9_.func_177556_c();
int i = this.func_177078_a(itemstack);
float f = 0.25F;
- float f1 = MathHelper.func_76126_a(((float)p_177077_1_.func_174872_o() + p_177077_8_) / 10.0F + p_177077_1_.field_70290_d) * 0.1F + 0.1F;
+ float f1 = shouldBob() ? MathHelper.func_76126_a(((float)p_177077_1_.func_174872_o() + p_177077_8_) / 10.0F + p_177077_1_.field_70290_d) * 0.1F + 0.1F : 0;
float f2 = p_177077_9_.func_177552_f().func_181688_b(ItemCameraTransforms.TransformType.GROUND).field_178363_d.y;
GlStateManager.func_179109_b((float)p_177077_2_, (float)p_177077_4_ + f1 + 0.25F * f2, (float)p_177077_6_);
@@ -104,16 +104,13 @@
GlStateManager.func_179094_E();
IBakedModel ibakedmodel = this.field_177080_a.func_184393_a(itemstack, p_76986_1_.field_70170_p, (EntityLivingBase)null);
int j = this.func_177077_a(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_9_, ibakedmodel);
- float f = ibakedmodel.func_177552_f().field_181699_o.field_178363_d.x;
- float f1 = ibakedmodel.func_177552_f().field_181699_o.field_178363_d.y;
- float f2 = ibakedmodel.func_177552_f().field_181699_o.field_178363_d.z;
boolean flag1 = ibakedmodel.func_177556_c();
if (!flag1)
{
- float f3 = -0.0F * (float)(j - 1) * 0.5F * f;
- float f4 = -0.0F * (float)(j - 1) * 0.5F * f1;
- float f5 = -0.09375F * (float)(j - 1) * 0.5F * f2;
+ float f3 = -0.0F * (float)(j - 1) * 0.5F;
+ float f4 = -0.0F * (float)(j - 1) * 0.5F;
+ float f5 = -0.09375F * (float)(j - 1) * 0.5F;
GlStateManager.func_179109_b(f3, f4, f5);
}
@@ -134,11 +131,11 @@
float f7 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F;
float f9 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F;
float f6 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F;
- GlStateManager.func_179109_b(f7, f9, f6);
+ GlStateManager.func_179109_b(shouldSpreadItems() ? f7 : 0, shouldSpreadItems() ? f9 : 0, f6);
}
- ibakedmodel.func_177552_f().func_181689_a(ItemCameraTransforms.TransformType.GROUND);
- this.field_177080_a.func_180454_a(itemstack, ibakedmodel);
+ IBakedModel transformedModel = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(ibakedmodel, ItemCameraTransforms.TransformType.GROUND, false);
+ this.field_177080_a.func_180454_a(itemstack, transformedModel);
GlStateManager.func_179121_F();
}
else
@@ -152,10 +149,10 @@
GlStateManager.func_179109_b(f8, f10, 0.0F);
}
- ibakedmodel.func_177552_f().func_181689_a(ItemCameraTransforms.TransformType.GROUND);
- this.field_177080_a.func_180454_a(itemstack, ibakedmodel);
+ IBakedModel transformedModel = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(ibakedmodel, ItemCameraTransforms.TransformType.GROUND, false);
+ this.field_177080_a.func_180454_a(itemstack, transformedModel);
GlStateManager.func_179121_F();
- GlStateManager.func_179109_b(0.0F * f, 0.0F * f1, 0.09375F * f2);
+ GlStateManager.func_179109_b(0.0F, 0.0F, 0.09375F);
}
}
@@ -182,4 +179,25 @@
{
return TextureMap.field_110575_b;
}
+
+ /*==================================== FORGE START ===========================================*/
+
+ /**
+ * Items should spread out when rendered in 3d?
+ * @return
+ */
+ public boolean shouldSpreadItems()
+ {
+ return true;
+ }
+
+ /**
+ * Items should have a bob effect
+ * @return
+ */
+ public boolean shouldBob()
+ {
+ return true;
+ }
+ /*==================================== FORGE END =============================================*/
}

View File

@ -1,43 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderItemFrame.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderItemFrame.java
@@ -49,7 +49,7 @@
ModelManager modelmanager = blockrendererdispatcher.func_175023_a().func_178126_b();
IBakedModel ibakedmodel;
- if (p_76986_1_.func_82335_i().func_77973_b() == Items.field_151098_aY)
+ if (p_76986_1_.func_82335_i().func_77973_b() instanceof net.minecraft.item.ItemMap)
{
ibakedmodel = modelmanager.func_174953_a(this.field_177073_g);
}
@@ -96,10 +96,13 @@
{
GlStateManager.func_179094_E();
GlStateManager.func_179140_f();
- boolean flag = itemstack.func_77973_b() == Items.field_151098_aY;
+ boolean flag = itemstack.func_77973_b() instanceof net.minecraft.item.ItemMap;
int i = flag ? p_82402_1_.func_82333_j() % 4 * 2 : p_82402_1_.func_82333_j();
GlStateManager.func_179114_b((float)i * 360.0F / 8.0F, 0.0F, 0.0F, 1.0F);
+ net.minecraftforge.client.event.RenderItemInFrameEvent event = new net.minecraftforge.client.event.RenderItemInFrameEvent(p_82402_1_, this);
+ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event))
+ {
if (flag)
{
this.field_76990_c.field_78724_e.func_110577_a(field_110789_a);
@@ -107,7 +110,7 @@
float f = 0.0078125F;
GlStateManager.func_179152_a(0.0078125F, 0.0078125F, 0.0078125F);
GlStateManager.func_179109_b(-64.0F, -64.0F, 0.0F);
- MapData mapdata = Items.field_151098_aY.func_77873_a(itemstack, p_82402_1_.field_70170_p);
+ MapData mapdata = ((net.minecraft.item.ItemMap) itemstack.func_77973_b()).func_77873_a(itemstack, p_82402_1_.field_70170_p);
GlStateManager.func_179109_b(0.0F, 0.0F, -1.0F);
if (mapdata != null)
@@ -124,6 +127,7 @@
RenderHelper.func_74518_a();
GlStateManager.func_179099_b();
}
+ }
GlStateManager.func_179145_e();
GlStateManager.func_179121_F();

View File

@ -1,72 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderLivingBase.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderLivingBase.java
@@ -32,6 +32,9 @@
protected List<LayerRenderer<T>> field_177097_h = Lists.<LayerRenderer<T>>newArrayList();
protected boolean field_188323_j;
+ public static float NAME_TAG_RANGE = 64.0f;
+ public static float NAME_TAG_RANGE_SNEAK = 32.0f;
+
public RenderLivingBase(RenderManager p_i46156_1_, ModelBase p_i46156_2_, float p_i46156_3_)
{
super(p_i46156_1_);
@@ -72,10 +75,12 @@
public void func_76986_a(T p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
{
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Pre<T>(p_76986_1_, this, p_76986_9_, p_76986_2_, p_76986_4_, p_76986_6_))) return;
GlStateManager.func_179094_E();
GlStateManager.func_179129_p();
this.field_77045_g.field_78095_p = this.func_77040_d(p_76986_1_, p_76986_9_);
- this.field_77045_g.field_78093_q = p_76986_1_.func_184218_aH();
+ boolean shouldSit = p_76986_1_.func_184218_aH() && (p_76986_1_.func_184187_bx() != null && p_76986_1_.func_184187_bx().shouldRiderSit());
+ this.field_77045_g.field_78093_q = shouldSit;
this.field_77045_g.field_78091_s = p_76986_1_.func_70631_g_();
try
@@ -84,7 +89,7 @@
float f1 = this.func_77034_a(p_76986_1_.field_70758_at, p_76986_1_.field_70759_as, p_76986_9_);
float f2 = f1 - f;
- if (p_76986_1_.func_184218_aH() && p_76986_1_.func_184187_bx() instanceof EntityLivingBase)
+ if (shouldSit && p_76986_1_.func_184187_bx() instanceof EntityLivingBase)
{
EntityLivingBase entitylivingbase = (EntityLivingBase)p_76986_1_.func_184187_bx();
f = this.func_77034_a(entitylivingbase.field_70760_ar, entitylivingbase.field_70761_aq, p_76986_9_);
@@ -133,6 +138,7 @@
{
f5 = 1.0F;
}
+ f2 = f1 - f; // Forge: Fix MC-1207
}
GlStateManager.func_179141_d();
@@ -194,6 +200,7 @@
GlStateManager.func_179089_o();
GlStateManager.func_179121_F();
super.func_76986_a(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Post<T>(p_76986_1_, this, p_76986_9_, p_76986_2_, p_76986_4_, p_76986_6_));
}
public float func_188322_c(T p_188322_1_, float p_188322_2_)
@@ -454,10 +461,11 @@
public void func_177067_a(T p_177067_1_, double p_177067_2_, double p_177067_4_, double p_177067_6_)
{
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Specials.Pre<T>(p_177067_1_, this, p_177067_2_, p_177067_4_, p_177067_6_))) return;
if (this.func_177070_b(p_177067_1_))
{
double d0 = p_177067_1_.func_70068_e(this.field_76990_c.field_78734_h);
- float f = p_177067_1_.func_70093_af() ? 32.0F : 64.0F;
+ float f = p_177067_1_.func_70093_af() ? NAME_TAG_RANGE_SNEAK : NAME_TAG_RANGE;
if (d0 < (double)(f * f))
{
@@ -466,6 +474,7 @@
this.func_188296_a(p_177067_1_, p_177067_2_, p_177067_4_, p_177067_6_, s, d0);
}
}
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Specials.Post<T>(p_177067_1_, this, p_177067_2_, p_177067_4_, p_177067_6_));
}
protected boolean func_177070_b(T p_177070_1_)

View File

@ -1,28 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderManager.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderManager.java
@@ -227,8 +227,13 @@
this.field_178637_m = new RenderPlayer(this);
this.field_178636_l.put("default", this.field_178637_m);
this.field_178636_l.put("slim", new RenderPlayer(this, true));
+ net.minecraftforge.fml.client.registry.RenderingRegistry.loadEntityRenderers(this, this.field_78729_o);
}
+ public Map<String, RenderPlayer> getSkinMap() {
+ return (Map<String, RenderPlayer>) java.util.Collections.unmodifiableMap(field_178636_l);
+ }
+
public void func_178628_a(double p_178628_1_, double p_178628_3_, double p_178628_5_)
{
this.field_78725_b = p_178628_1_;
@@ -277,9 +282,9 @@
IBlockState iblockstate = p_180597_1_.func_180495_p(new BlockPos(p_180597_3_));
Block block = iblockstate.func_177230_c();
- if (block == Blocks.field_150324_C)
+ if (block.isBed(iblockstate, p_180597_1_, new BlockPos(p_180597_3_), (EntityLivingBase)p_180597_3_))
{
- int i = ((EnumFacing)iblockstate.func_177229_b(BlockBed.field_185512_D)).func_176736_b();
+ int i = block.getBedDirection(iblockstate, p_180597_1_, new BlockPos(p_180597_3_)).func_176736_b();
this.field_78735_i = (float)(i * 90 + 180);
this.field_78732_j = 0.0F;
}

View File

@ -1,30 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java
@@ -56,6 +56,7 @@
public void func_76986_a(AbstractClientPlayer p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
{
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Pre(p_76986_1_, this, p_76986_9_, p_76986_2_, p_76986_4_, p_76986_6_))) return;
if (!p_76986_1_.func_175144_cb() || this.field_76990_c.field_78734_h == p_76986_1_)
{
double d0 = p_76986_4_;
@@ -70,6 +71,7 @@
super.func_76986_a(p_76986_1_, p_76986_2_, d0, p_76986_6_, p_76986_8_, p_76986_9_);
GlStateManager.func_187440_b(GlStateManager.Profile.PLAYER_SKIN);
}
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Post(p_76986_1_, this, p_76986_9_, p_76986_2_, p_76986_4_, p_76986_6_));
}
private void func_177137_d(AbstractClientPlayer p_177137_1_)
@@ -128,6 +130,11 @@
{
modelbiped$armpose1 = ModelBiped.ArmPose.BLOCK;
}
+ // FORGE: fix MC-88356 allow offhand to use bow and arrow animation
+ else if (enumaction1 == EnumAction.BOW)
+ {
+ modelbiped$armpose1 = ModelBiped.ArmPose.BOW_AND_ARROW;
+ }
}
}

View File

@ -1,26 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderVillager.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderVillager.java
@@ -31,22 +31,7 @@
protected ResourceLocation func_110775_a(EntityVillager p_110775_1_)
{
- switch (p_110775_1_.func_70946_n())
- {
- case 0:
- return field_110904_g;
- case 1:
- return field_110908_h;
- case 2:
- return field_110907_k;
- case 3:
- return field_110905_l;
- case 4:
- return field_110906_m;
- case 5:
- default:
- return field_110903_f;
- }
+ return p_110775_1_.getProfessionForge().getSkin();
}
protected void func_77041_b(EntityVillager p_77041_1_, float p_77041_2_)

View File

@ -1,10 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderZombieVillager.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderZombieVillager.java
@@ -25,6 +25,7 @@
protected ResourceLocation func_110775_a(EntityZombieVillager p_110775_1_)
{
+ if (true) return p_110775_1_.getForgeProfession().getZombieSkin();
switch (p_110775_1_.func_190736_dl())
{
case 0:

View File

@ -1,107 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java
@@ -58,31 +58,29 @@
if (itemarmor.func_185083_B_() == p_188361_9_)
{
T t = this.func_188360_a(p_188361_9_);
+ t = getArmorModelHook(p_188361_1_, itemstack, p_188361_9_, t);
t.func_178686_a(this.field_177190_a.func_177087_b());
t.func_78086_a(p_188361_1_, p_188361_2_, p_188361_3_, p_188361_4_);
this.func_188359_a(t, p_188361_9_);
boolean flag = this.func_188363_b(p_188361_9_);
- this.field_177190_a.func_110776_a(this.func_177181_a(itemarmor, flag));
+ this.field_177190_a.func_110776_a(this.getArmorResource(p_188361_1_, itemstack, p_188361_9_, null));
- switch (itemarmor.func_82812_d())
{
- case LEATHER:
+ if (itemarmor.hasOverlay(itemstack)) // Allow this for anything, not only cloth
+ {
int i = itemarmor.func_82814_b(itemstack);
float f = (float)(i >> 16 & 255) / 255.0F;
float f1 = (float)(i >> 8 & 255) / 255.0F;
float f2 = (float)(i & 255) / 255.0F;
GlStateManager.func_179131_c(this.field_177184_f * f, this.field_177185_g * f1, this.field_177192_h * f2, this.field_177187_e);
t.func_78088_a(p_188361_1_, p_188361_2_, p_188361_3_, p_188361_5_, p_188361_6_, p_188361_7_, p_188361_8_);
- this.field_177190_a.func_110776_a(this.func_177178_a(itemarmor, flag, "overlay"));
- case CHAIN:
- case IRON:
- case GOLD:
- case DIAMOND:
+ this.field_177190_a.func_110776_a(this.getArmorResource(p_188361_1_, itemstack, p_188361_9_, "overlay"));
+ }
+ { // Non-colored
GlStateManager.func_179131_c(this.field_177184_f, this.field_177185_g, this.field_177192_h, this.field_177187_e);
t.func_78088_a(p_188361_1_, p_188361_2_, p_188361_3_, p_188361_5_, p_188361_6_, p_188361_7_, p_188361_8_);
- default:
-
- if (!this.field_177193_i && itemstack.func_77948_v())
+ } // Default
+ if (!this.field_177193_i && itemstack.func_77962_s())
{
func_188364_a(this.field_177190_a, p_188361_1_, t, p_188361_2_, p_188361_3_, p_188361_4_, p_188361_5_, p_188361_6_, p_188361_7_, p_188361_8_);
}
@@ -139,11 +137,13 @@
Minecraft.func_71410_x().field_71460_t.func_191514_d(false);
}
+ @Deprecated //Use the more sensitive version getArmorResource below
private ResourceLocation func_177181_a(ItemArmor p_177181_1_, boolean p_177181_2_)
{
return this.func_177178_a(p_177181_1_, p_177181_2_, (String)null);
}
+ @Deprecated //Use the more sensitive version getArmorResource below
private ResourceLocation func_177178_a(ItemArmor p_177178_1_, boolean p_177178_2_, String p_177178_3_)
{
String s = String.format("textures/models/armor/%s_layer_%d%s.png", p_177178_1_.func_82812_d().func_179242_c(), p_177178_2_ ? 2 : 1, p_177178_3_ == null ? "" : String.format("_%s", p_177178_3_));
@@ -161,4 +161,49 @@
protected abstract void func_177177_a();
protected abstract void func_188359_a(T p_188359_1_, EntityEquipmentSlot p_188359_2_);
+
+ /*=================================== FORGE START =========================================*/
+
+ /**
+ * Hook to allow item-sensitive armor model. for LayerBipedArmor.
+ */
+ protected T getArmorModelHook(EntityLivingBase entity, ItemStack itemStack, EntityEquipmentSlot slot, T model)
+ {
+ return model;
+ }
+
+ /**
+ * More generic ForgeHook version of the above function, it allows for Items to have more control over what texture they provide.
+ *
+ * @param entity Entity wearing the armor
+ * @param stack ItemStack for the armor
+ * @param slot Slot ID that the item is in
+ * @param type Subtype, can be null or "overlay"
+ * @return ResourceLocation pointing at the armor's texture
+ */
+ public ResourceLocation getArmorResource(net.minecraft.entity.Entity entity, ItemStack stack, EntityEquipmentSlot slot, String type)
+ {
+ ItemArmor item = (ItemArmor)stack.func_77973_b();
+ String texture = item.func_82812_d().func_179242_c();
+ String domain = "minecraft";
+ int idx = texture.indexOf(':');
+ if (idx != -1)
+ {
+ domain = texture.substring(0, idx);
+ texture = texture.substring(idx + 1);
+ }
+ String s1 = String.format("%s:textures/models/armor/%s_layer_%d%s.png", domain, texture, (func_188363_b(slot) ? 2 : 1), type == null ? "" : String.format("_%s", type));
+
+ s1 = net.minecraftforge.client.ForgeHooksClient.getArmorTexture(entity, stack, s1, slot, type);
+ ResourceLocation resourcelocation = (ResourceLocation)field_177191_j.get(s1);
+
+ if (resourcelocation == null)
+ {
+ resourcelocation = new ResourceLocation(s1);
+ field_177191_j.put(s1, resourcelocation);
+ }
+
+ return resourcelocation;
+ }
+ /*=================================== FORGE END ===========================================*/
}

View File

@ -1,13 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java
@@ -51,4 +51,10 @@
{
p_177194_1_.func_178719_a(false);
}
+
+ @Override
+ 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);
+ }
}

View File

@ -1,18 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/entity/layers/LayerHeldItem.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/layers/LayerHeldItem.java
@@ -49,13 +49,13 @@
if (!p_188358_2_.func_190926_b())
{
GlStateManager.func_179094_E();
- this.func_191361_a(p_188358_4_);
if (p_188358_1_.func_70093_af())
{
GlStateManager.func_179109_b(0.0F, 0.2F, 0.0F);
}
-
+ // Forge: moved this call down, fixes incorrect offset while sneaking.
+ this.func_191361_a(p_188358_4_);
GlStateManager.func_179114_b(-90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.func_179114_b(180.0F, 0.0F, 1.0F, 0.0F);
boolean flag = p_188358_4_ == EnumHandSide.LEFT;

View File

@ -1,45 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/texture/Stitcher.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/texture/Stitcher.java
@@ -56,18 +56,24 @@
{
Stitcher.Holder[] astitcher$holder = (Stitcher.Holder[])this.field_94319_a.toArray(new Stitcher.Holder[this.field_94319_a.size()]);
Arrays.sort((Object[])astitcher$holder);
+ net.minecraftforge.fml.common.ProgressManager.ProgressBar bar = net.minecraftforge.fml.common.ProgressManager.push("Texture stitching", astitcher$holder.length);
for (Stitcher.Holder stitcher$holder : astitcher$holder)
{
+ bar.step(stitcher$holder.func_98150_a().func_94215_i());
if (!this.func_94310_b(stitcher$holder))
{
String s = String.format("Unable to fit: %s - size: %dx%d - Maybe try a lowerresolution resourcepack?", stitcher$holder.func_98150_a().func_94215_i(), stitcher$holder.func_98150_a().func_94211_a(), stitcher$holder.func_98150_a().func_94216_b());
+ net.minecraftforge.fml.common.FMLLog.log.info(s);
+ for (Stitcher.Holder h : astitcher$holder)
+ net.minecraftforge.fml.common.FMLLog.log.info(" {}", h);
throw new StitcherException(stitcher$holder, s);
}
}
this.field_94318_c = MathHelper.func_151236_b(this.field_94318_c);
this.field_94315_d = MathHelper.func_151236_b(this.field_94315_d);
+ net.minecraftforge.fml.common.ProgressManager.pop(bar);
}
public List<TextureAtlasSprite> func_94309_g()
@@ -148,7 +154,7 @@
if (flag3 ^ flag4)
{
- flag = flag3;
+ flag = !flag3 && flag1; //Forge: Fix stitcher not expanding entire height before growing width, and {potentially} growing larger then the max size.
}
else
{
@@ -240,7 +246,7 @@
public String toString()
{
- return "Holder{width=" + this.field_94204_c + ", height=" + this.field_94201_d + '}';
+ return "Holder{width=" + this.field_94204_c + ", height=" + this.field_94201_d + ", name=" + this.field_98151_a.func_94215_i() + '}';
}
public int compareTo(Stitcher.Holder p_compareTo_1_)

View File

@ -1,59 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java
@@ -50,12 +50,10 @@
this.field_110975_c = p_110971_3_;
this.field_110974_d = p_110971_4_;
this.field_130222_e = p_110971_5_;
- float f = (float)(0.009999999776482582D / (double)p_110971_1_);
- float f1 = (float)(0.009999999776482582D / (double)p_110971_2_);
- this.field_110979_l = (float)p_110971_3_ / (float)((double)p_110971_1_) + f;
- this.field_110980_m = (float)(p_110971_3_ + this.field_130223_c) / (float)((double)p_110971_1_) - f;
- this.field_110977_n = (float)p_110971_4_ / (float)p_110971_2_ + f1;
- this.field_110978_o = (float)(p_110971_4_ + this.field_130224_d) / (float)p_110971_2_ - f1;
+ this.field_110979_l = (float)p_110971_3_ / (float)p_110971_1_;
+ this.field_110980_m = (float)(p_110971_3_ + this.field_130223_c) / (float)p_110971_1_;
+ this.field_110977_n = (float)p_110971_4_ / (float)p_110971_2_;
+ this.field_110978_o = (float)(p_110971_4_ + this.field_130224_d) / (float)p_110971_2_;
}
public void func_94217_a(TextureAtlasSprite p_94217_1_)
@@ -398,4 +396,39 @@
{
return "TextureAtlasSprite{name='" + this.field_110984_i + '\'' + ", frameCount=" + this.field_110976_a.size() + ", rotated=" + this.field_130222_e + ", x=" + this.field_110975_c + ", y=" + this.field_110974_d + ", height=" + this.field_130224_d + ", width=" + this.field_130223_c + ", u0=" + this.field_110979_l + ", u1=" + this.field_110980_m + ", v0=" + this.field_110977_n + ", v1=" + this.field_110978_o + '}';
}
+
+ /*===================================== FORGE START =====================================*/
+ /**
+ * The result of this function determines is the below 'load' function is called, and the
+ * default vanilla loading code is bypassed completely.
+ * @param manager Main resource manager
+ * @param location File resource location
+ * @return True to use your own custom load code and bypass vanilla loading.
+ */
+ public boolean hasCustomLoader(net.minecraft.client.resources.IResourceManager manager, net.minecraft.util.ResourceLocation location)
+ {
+ return false;
+ }
+
+ /**
+ * Load the specified resource as this sprite's data.
+ * Returning false from this function will prevent this icon from being stitched onto the master texture.
+ * @param manager Main resource manager
+ * @param location File resource location
+ * @param textureGetter accessor for dependencies. All of them will be loaded before this one
+ * @return False to prevent this Icon from being stitched
+ */
+ public boolean load(net.minecraft.client.resources.IResourceManager manager, net.minecraft.util.ResourceLocation location, java.util.function.Function<ResourceLocation, TextureAtlasSprite> textureGetter)
+ {
+ return true;
+ }
+
+ /**
+ * @return all textures that should be loaded before this texture.
+ */
+ public java.util.Collection<ResourceLocation> getDependencies() {
+ return com.google.common.collect.ImmutableList.of();
+ }
+
+ /*===================================== FORGE END ======================================*/
}

View File

@ -1,30 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/texture/TextureManager.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureManager.java
@@ -137,17 +137,20 @@
if (itextureobject != null)
{
+ this.field_110585_a.remove(p_147645_1_); // Forge: fix MC-98707
TextureUtil.func_147942_a(itextureobject.func_110552_b());
}
}
public void func_110549_a(IResourceManager p_110549_1_)
{
+ net.minecraftforge.fml.common.ProgressManager.ProgressBar bar = net.minecraftforge.fml.common.ProgressManager.push("Reloading Texture Manager", this.field_110585_a.keySet().size(), true);
Iterator<Entry<ResourceLocation, ITextureObject>> iterator = this.field_110585_a.entrySet().iterator();
while (iterator.hasNext())
{
Entry<ResourceLocation, ITextureObject> entry = (Entry)iterator.next();
+ bar.step(entry.getKey().toString());
ITextureObject itextureobject = entry.getValue();
if (itextureobject == TextureUtil.field_111001_a)
@@ -159,5 +162,6 @@
this.func_110579_a(entry.getKey(), itextureobject);
}
}
+ net.minecraftforge.fml.common.ProgressManager.pop(bar);
}
}

View File

@ -1,246 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/texture/TextureMap.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureMap.java
@@ -45,6 +45,16 @@
public TextureMap(String p_i46100_1_, @Nullable ITextureMapPopulator p_i46100_2_)
{
+ this(p_i46100_1_, p_i46100_2_, false);
+ }
+
+ public TextureMap(String basePathIn, boolean skipFirst)
+ {
+ this(basePathIn, null, skipFirst);
+ }
+
+ public TextureMap(String p_i46100_1_, @Nullable ITextureMapPopulator p_i46100_2_, boolean skipFirst)
+ {
this.field_94258_i = Lists.<TextureAtlasSprite>newArrayList();
this.field_110574_e = Maps.<String, TextureAtlasSprite>newHashMap();
this.field_94252_e = Maps.<String, TextureAtlasSprite>newHashMap();
@@ -74,6 +84,7 @@
public void func_174943_a(IResourceManager p_174943_1_, ITextureMapPopulator p_174943_2_)
{
this.field_110574_e.clear();
+ net.minecraftforge.client.ForgeHooksClient.onTextureStitchedPre(this);
p_174943_2_.func_177059_a(this);
this.func_110569_e();
this.func_147631_c();
@@ -88,13 +99,55 @@
this.field_94258_i.clear();
int j = Integer.MAX_VALUE;
int k = 1 << this.field_147636_j;
+ net.minecraftforge.fml.common.FMLLog.log.info("Max texture size: {}", i);
+ net.minecraftforge.fml.common.ProgressManager.ProgressBar bar = net.minecraftforge.fml.common.ProgressManager.push("Texture stitching", this.field_110574_e.size());
+ loadedSprites.clear();
- for (Entry<String, TextureAtlasSprite> entry : this.field_110574_e.entrySet())
+ for (Entry<String, TextureAtlasSprite> entry : Maps.newHashMap(this.field_110574_e).entrySet())
{
- TextureAtlasSprite textureatlassprite = entry.getValue();
- ResourceLocation resourcelocation = this.func_184396_a(textureatlassprite);
- IResource iresource = null;
+ final ResourceLocation location = new ResourceLocation(entry.getKey());
+ bar.step(location.toString());
+ j = loadTexture(stitcher, p_110571_1_, location, entry.getValue(), bar, j, k);
+ }
+ finishLoading(stitcher, bar, j, k);
+ }
+ private int loadTexture(Stitcher stitcher, IResourceManager p_110571_1_, ResourceLocation location, TextureAtlasSprite textureatlassprite, net.minecraftforge.fml.common.ProgressManager.ProgressBar bar, int j, int k)
+ {
+ if (loadedSprites.contains(location)) {
+ return j;
+ }
+ ResourceLocation resourcelocation = this.func_184396_a(textureatlassprite);
+ IResource iresource = null;
+
+ for(ResourceLocation loading : loadingSprites)
+ {
+ if(location.equals(loading))
+ {
+ final String error = "circular model dependencies, stack: [" + com.google.common.base.Joiner.on(", ").join(loadingSprites) + "]";
+ net.minecraftforge.fml.client.FMLClientHandler.instance().trackBrokenTexture(resourcelocation, error);
+ }
+ }
+ loadingSprites.addLast(location);
+ try
+ {
+ for (ResourceLocation dependency : textureatlassprite.getDependencies())
+ {
+ if (!field_110574_e.containsKey(dependency.toString()))
+ {
+ func_174942_a(dependency);
+ }
+ TextureAtlasSprite depSprite = field_110574_e.get(dependency.toString());
+ j = loadTexture(stitcher, p_110571_1_, dependency, depSprite, bar, j, k);
+ }
+ if (textureatlassprite.hasCustomLoader(p_110571_1_, resourcelocation))
+ {
+ if (textureatlassprite.load(p_110571_1_, resourcelocation, l -> field_110574_e.get(l.toString())))
+ {
+ return j;
+ }
+ }
+ else
try
{
PngSizeInfo pngsizeinfo = PngSizeInfo.func_188532_a(p_110571_1_.func_110536_a(resourcelocation));
@@ -104,13 +157,13 @@
}
catch (RuntimeException runtimeexception)
{
- field_147635_d.error("Unable to parse metadata from {}", resourcelocation, runtimeexception);
- continue;
+ net.minecraftforge.fml.client.FMLClientHandler.instance().trackBrokenTexture(resourcelocation, runtimeexception.getMessage());
+ return j;
}
catch (IOException ioexception)
{
- field_147635_d.error("Using missing texture, unable to load {}", resourcelocation, ioexception);
- continue;
+ net.minecraftforge.fml.client.FMLClientHandler.instance().trackMissingTexture(resourcelocation);
+ return j;
}
finally
{
@@ -122,16 +175,28 @@
if (j1 < k)
{
- field_147635_d.warn("Texture {} with size {}x{} limits mip level from {} to {}", resourcelocation, Integer.valueOf(textureatlassprite.func_94211_a()), Integer.valueOf(textureatlassprite.func_94216_b()), Integer.valueOf(MathHelper.func_151239_c(k)), Integer.valueOf(MathHelper.func_151239_c(j1)));
- k = j1;
+ // FORGE: do not lower the mipmap level, just log the problematic textures
+ field_147635_d.warn("Texture {} with size {}x{} will have visual artifacts at mip level {}, it can only support level {}. Please report to the mod author that the texture should be some multiple of 16x16.", resourcelocation, Integer.valueOf(textureatlassprite.func_94211_a()), Integer.valueOf(textureatlassprite.func_94216_b()), Integer.valueOf(MathHelper.func_151239_c(k)), Integer.valueOf(MathHelper.func_151239_c(j1)));
}
+ if (func_184397_a(p_110571_1_, textureatlassprite))
stitcher.func_110934_a(textureatlassprite);
+ return j;
}
+ finally
+ {
+ loadingSprites.removeLast();
+ loadedSprites.add(location);
+ }
+ }
+ private void finishLoading(Stitcher stitcher, net.minecraftforge.fml.common.ProgressManager.ProgressBar bar, int j, int k)
+ {
+ net.minecraftforge.fml.common.ProgressManager.pop(bar);
int l = Math.min(j, k);
int i1 = MathHelper.func_151239_c(l);
+ if (false) // FORGE: do not lower the mipmap level
if (i1 < this.field_147636_j)
{
field_147635_d.warn("{}: dropping miplevel from {} to {}, because of minimum power of two: {}", this.field_94254_c, Integer.valueOf(this.field_147636_j), Integer.valueOf(i1), Integer.valueOf(l));
@@ -140,9 +205,11 @@
this.field_94249_f.func_147963_d(this.field_147636_j);
stitcher.func_110934_a(this.field_94249_f);
+ bar = net.minecraftforge.fml.common.ProgressManager.push("Texture creation", 2);
try
{
+ bar.step("Stitching");
stitcher.func_94305_f();
}
catch (StitcherException stitcherexception)
@@ -151,12 +218,16 @@
}
field_147635_d.info("Created: {}x{} {}-atlas", Integer.valueOf(stitcher.func_110935_a()), Integer.valueOf(stitcher.func_110936_b()), this.field_94254_c);
+ bar.step("Allocating GL texture");
TextureUtil.func_180600_a(this.func_110552_b(), this.field_147636_j, stitcher.func_110935_a(), stitcher.func_110936_b());
Map<String, TextureAtlasSprite> map = Maps.<String, TextureAtlasSprite>newHashMap(this.field_110574_e);
+ net.minecraftforge.fml.common.ProgressManager.pop(bar);
+ bar = net.minecraftforge.fml.common.ProgressManager.push("Texture mipmap and upload", stitcher.func_94309_g().size());
+
for (TextureAtlasSprite textureatlassprite1 : stitcher.func_94309_g())
{
- if (textureatlassprite1 == this.field_94249_f || this.func_184397_a(p_110571_1_, textureatlassprite1))
+ bar.step(textureatlassprite1.func_94215_i());
{
String s = textureatlassprite1.func_94215_i();
map.remove(s);
@@ -186,6 +257,8 @@
{
textureatlassprite2.func_94217_a(this.field_94249_f);
}
+ net.minecraftforge.client.ForgeHooksClient.onTextureStitchedPost(this);
+ net.minecraftforge.fml.common.ProgressManager.pop(bar);
}
private boolean func_184397_a(IResourceManager p_184397_1_, final TextureAtlasSprite p_184397_2_)
@@ -195,7 +268,7 @@
label62:
{
boolean flag;
-
+ if (p_184397_2_.hasCustomLoader(p_184397_1_, resourcelocation)) break label62;
try
{
iresource = p_184397_1_.func_110536_a(resourcelocation);
@@ -292,7 +365,7 @@
}
else
{
- TextureAtlasSprite textureatlassprite = this.field_110574_e.get(p_174942_1_);
+ TextureAtlasSprite textureatlassprite = this.field_110574_e.get(p_174942_1_.toString());
if (textureatlassprite == null)
{
@@ -318,4 +391,52 @@
{
return this.field_94249_f;
}
+
+ //===================================================================================================
+ // Forge Start
+ //===================================================================================================
+
+ private final java.util.Deque<ResourceLocation> loadingSprites = new java.util.ArrayDeque<>();
+ private final java.util.Set<ResourceLocation> loadedSprites = new java.util.HashSet<>();
+
+ /**
+ * Grabs the registered entry for the specified name, returning null if there was not a entry.
+ * Opposed to registerIcon, this will not instantiate the entry, useful to test if a mapping exists.
+ *
+ * @param name The name of the entry to find
+ * @return The registered entry, null if nothing was registered.
+ */
+ @Nullable
+ public TextureAtlasSprite getTextureExtry(String name)
+ {
+ return field_110574_e.get(name);
+ }
+
+ /**
+ * Adds a texture registry entry to this map for the specified name if one does not already exist.
+ * Returns false if the map already contains a entry for the specified name.
+ *
+ * @param entry Entry instance
+ * @return True if the entry was added to the map, false otherwise.
+ */
+ public boolean setTextureEntry(TextureAtlasSprite entry)
+ {
+ String name = entry.func_94215_i();
+ if (!field_110574_e.containsKey(name))
+ {
+ field_110574_e.put(name, entry);
+ return true;
+ }
+ return false;
+ }
+
+ public String getBasePath()
+ {
+ return field_94254_c;
+ }
+
+ public int getMipmapLevels()
+ {
+ return field_147636_j;
+ }
}

View File

@ -1,39 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java
@@ -83,6 +83,7 @@
int[] aint1 = aint[l1 - 1];
int[] aint2 = new int[aint1.length >> 2];
int j = p_147949_1_ >> l1;
+ if (j > 0) { // FORGE: forcing higher mipmap levels on odd textures needs this check
int k = aint2.length / j;
int l = j << 1;
@@ -94,6 +95,7 @@
aint2[i1 + j1 * j] = func_147943_a(aint1[k1 + 0], aint1[k1 + 1], aint1[k1 + 0 + l], aint1[k1 + 1 + l], flag);
}
}
+ } // end if (j > 0)
aint[l1] = aint2;
}
@@ -168,6 +170,7 @@
for (int i = 0; i < p_147955_0_.length; ++i)
{
int[] aint = p_147955_0_[i];
+ if ((p_147955_1_ >> i <= 0) || (p_147955_2_ >> i <= 0)) break;
func_147947_a(i, aint, p_147955_1_ >> i, p_147955_2_ >> i, p_147955_3_ >> i, p_147955_4_ >> i, p_147955_5_, p_147955_6_, p_147955_0_.length > 1);
}
}
@@ -202,9 +205,11 @@
public static void func_180600_a(int p_180600_0_, int p_180600_1_, int p_180600_2_, int p_180600_3_)
{
+ synchronized (net.minecraftforge.fml.client.SplashProgress.class)
+ {
func_147942_a(p_180600_0_);
func_94277_a(p_180600_0_);
-
+ }
if (p_180600_1_ >= 0)
{
GlStateManager.func_187421_b(3553, 33085, p_180600_1_);

View File

@ -1,10 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java
@@ -118,6 +118,7 @@
{
TileEntityRendererDispatcher.field_147556_a.func_192855_a(field_191274_b[BlockShulkerBox.func_190955_b(item).func_176765_a()], 0.0D, 0.0D, 0.0D, 0.0F, p_192838_2_);
}
+ else if (Block.func_149634_a(item) != Blocks.field_150486_ae) net.minecraftforge.client.ForgeHooksClient.renderTileItem(p_192838_1_.func_77973_b(), p_192838_1_.func_77960_j());
else
{
TileEntityRendererDispatcher.field_147556_a.func_192855_a(this.field_147717_b, 0.0D, 0.0D, 0.0D, 0.0F, p_192838_2_);

View File

@ -1,15 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/tileentity/TileEntityPistonRenderer.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/tileentity/TileEntityPistonRenderer.java
@@ -23,10 +23,11 @@
@SideOnly(Side.CLIENT)
public class TileEntityPistonRenderer extends TileEntitySpecialRenderer<TileEntityPiston>
{
- private final BlockRendererDispatcher field_178462_c = Minecraft.func_71410_x().func_175602_ab();
+ private BlockRendererDispatcher field_178462_c;
public void func_192841_a(TileEntityPiston p_192841_1_, double p_192841_2_, double p_192841_4_, double p_192841_6_, float p_192841_8_, int p_192841_9_, float p_192841_10_)
{
+ if (field_178462_c == null) field_178462_c = Minecraft.func_71410_x().func_175602_ab(); //Forge: Delay this from constructor to allow us to change it later
BlockPos blockpos = p_192841_1_.func_174877_v();
IBlockState iblockstate = p_192841_1_.func_174927_b();
Block block = iblockstate.func_177230_c();

Some files were not shown because too many files have changed in this diff Show More