Defer material getting for ChestTileEntityRenderer into seperate function (#6465)

This commit is contained in:
Yamahari 2020-01-29 22:05:12 +01:00 committed by GitHub
parent 617159c825
commit f12a93fe1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,20 @@
--- a/net/minecraft/client/renderer/tileentity/ChestTileEntityRenderer.java
+++ b/net/minecraft/client/renderer/tileentity/ChestTileEntityRenderer.java
@@ -98,7 +98,7 @@
f1 = 1.0F - f1;
f1 = 1.0F - f1 * f1 * f1;
int i = icallbackwrapper.apply(new DualBrightnessCallback<>()).applyAsInt(p_225616_5_);
- Material material = Atlases.func_228771_a_(p_225616_1_, chesttype, this.field_147509_j);
+ Material material = this.getMaterial(p_225616_1_, chesttype);
IVertexBuilder ivertexbuilder = material.func_229311_a_(p_225616_4_, RenderType::func_228638_b_);
if (flag1) {
if (chesttype == ChestType.LEFT) {
@@ -121,4 +121,8 @@
p_228871_4_.func_228308_a_(p_228871_1_, p_228871_2_, p_228871_7_, p_228871_8_);
p_228871_5_.func_228308_a_(p_228871_1_, p_228871_2_, p_228871_7_, p_228871_8_);
}
+
+ protected Material getMaterial(T tileEntity, ChestType chestType) {
+ return Atlases.func_228771_a_(tileEntity, chestType, this.field_147509_j);
+ }
}