Update mappings to 09/21 snapshots.

Conflict with getMatrix in ITransformation, so renamed to getMatrixVec.
This commit is contained in:
LexManos committed 2018-09-22 03:40:22 -07:00
1 parent 5ed03945a0
commit 94e1a8e0a4
210 files changed
+1052 -978

No files matched your search

@@ -65,7 +65,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
private static final boolean WIREFRAME = false;
// Instance fields
private final Minecraft mc = Minecraft.getMinecraft();
private final Minecraft mc = Minecraft.getInstance();
private final ResourceLocation texture = new ResourceLocation("textures/environment/clouds.png");
private int displayList = -1;
@@ -81,7 +81,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
public CloudRenderer()
{
// Resource manager should always be reloadable.
((IReloadableResourceManager) mc.func_195551_G()).func_199006_a(this);
((IReloadableResourceManager) mc.getResourceManager()).addReloadListener(this);
}
private int getScale()
@@ -243,7 +243,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
if (OpenGlHelper.useVbo())
vbo = new VertexBuffer(FORMAT);
else
GlStateManager.glNewList(displayList = GLAllocation.generateDisplayLists(1), GL11.GL_COMPILE);
GlStateManager.newList(displayList = GLAllocation.generateDisplayLists(1), GL11.GL_COMPILE);
vertices(buffer);
@@ -256,7 +256,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
else
{
tess.draw();
GlStateManager.glEndList();
GlStateManager.endList();
}
}
@@ -275,7 +275,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
boolean newEnabled = ForgeMod.forgeCloudsEnabled
&& mc.gameSettings.shouldRenderClouds() != 0
&& mc.world != null
&& mc.world.provider.isSurfaceWorld();
&& mc.world.dimension.isSurfaceWorld();
if (isBuilt()
&& (!newEnabled
@@ -305,7 +305,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
double x = entity.prevPosX + (entity.posX - entity.prevPosX) * partialTicks
+ totalOffset * 0.03;
double y = mc.world.provider.getCloudHeight()
double y = mc.world.dimension.getCloudHeight()
- (entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * partialTicks)
+ 0.33;
double z = entity.prevPosZ + (entity.posZ - entity.prevPosZ) * partialTicks;
@@ -322,7 +322,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
GlStateManager.pushMatrix();
// Translate by the remainder after the UV offset.
GlStateManager.translate((offU * scale) - x, y, (offV * scale) - z);
GlStateManager.translated((offU * scale) - x, y, (offV * scale) - z);
// Modulo to prevent texture samples becoming inaccurate at extreme offsets.
offU = offU % texW;
@@ -330,13 +330,13 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
// Translate the texture.
GlStateManager.matrixMode(GL11.GL_TEXTURE);
GlStateManager.translate(offU * PX_SIZE, offV * PX_SIZE, 0);
GlStateManager.translatef(offU * PX_SIZE, offV * PX_SIZE, 0);
GlStateManager.matrixMode(GL11.GL_MODELVIEW);
GlStateManager.disableCull();
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(
GlStateManager.blendFuncSeparate(
GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA,
GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
@@ -350,19 +350,19 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
COLOR_TEX = new DynamicTexture(1, 1, false);
// Apply a color multiplier through a texture upload if shaders aren't supported.
COLOR_TEX.func_195414_e().func_195700_a(0, 0, 255 << 24
COLOR_TEX.getTextureData().setPixelRGBA(0, 0, 255 << 24
| ((int) (r * 255)) << 16
| ((int) (g * 255)) << 8
| (int) (b * 255));
COLOR_TEX.updateDynamicTexture();
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.activeTexture(OpenGlHelper.GL_TEXTURE1);
GlStateManager.bindTexture(COLOR_TEX.getGlTextureId());
GlStateManager.enableTexture2D();
// Bind the clouds texture last so the shader's sampler2D is correct.
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
mc.renderEngine.bindTexture(texture);
GlStateManager.activeTexture(OpenGlHelper.GL_TEXTURE0);
mc.textureManager.bindTexture(texture);
ByteBuffer buffer = Tessellator.getInstance().getBuffer().getByteBuffer();
@@ -372,12 +372,12 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
vbo.bindBuffer();
int stride = FORMAT.getSize();
GlStateManager.glVertexPointer(3, GL11.GL_FLOAT, stride, 0);
GlStateManager.glEnableClientState(GL11.GL_VERTEX_ARRAY);
GlStateManager.glTexCoordPointer(2, GL11.GL_FLOAT, stride, 12);
GlStateManager.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
GlStateManager.glColorPointer(4, GL11.GL_UNSIGNED_BYTE, stride, 20);
GlStateManager.glEnableClientState(GL11.GL_COLOR_ARRAY);
GlStateManager.vertexPointer(3, GL11.GL_FLOAT, stride, 0);
GlStateManager.enableClientState(GL11.GL_VERTEX_ARRAY);
GlStateManager.texCoordPointer(2, GL11.GL_FLOAT, stride, 12);
GlStateManager.enableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
GlStateManager.colorPointer(4, GL11.GL_UNSIGNED_BYTE, stride, 20);
GlStateManager.enableClientState(GL11.GL_COLOR_ARRAY);
}
else
{
@@ -400,8 +400,8 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
// Wireframe for debug.
if (WIREFRAME)
{
GlStateManager.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_LINE);
GlStateManager.glLineWidth(2.0F);
GlStateManager.polygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_LINE);
GlStateManager.lineWidth(2.0F);
GlStateManager.disableTexture2D();
GlStateManager.depthMask(false);
GlStateManager.disableFog();
@@ -409,7 +409,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
vbo.drawArrays(GL11.GL_QUADS);
else
GlStateManager.callList(displayList);
GlStateManager.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_FILL);
GlStateManager.polygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_FILL);
GlStateManager.depthMask(true);
GlStateManager.enableTexture2D();
GlStateManager.enableFog();
@@ -431,9 +431,9 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
buffer.position(0);
// Disable our coloring.
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.activeTexture(OpenGlHelper.GL_TEXTURE1);
GlStateManager.disableTexture2D();
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
GlStateManager.activeTexture(OpenGlHelper.GL_TEXTURE0);
// Reset texture matrix.
GlStateManager.matrixMode(GL11.GL_TEXTURE);
@@ -450,9 +450,9 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
private void reloadTextures()
{
if (mc.renderEngine != null)
if (mc.textureManager != null)
{
mc.renderEngine.bindTexture(texture);
mc.textureManager.bindTexture(texture);
texW = GlStateManager.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH);
texH = GlStateManager.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_HEIGHT);
}
@@ -482,7 +482,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
public static boolean renderClouds(int cloudTicks, float partialTicks, WorldClient world, Minecraft client)
{
IRenderHandler renderer = world.provider.getCloudRenderer();
IRenderHandler renderer = world.dimension.getCloudRenderer();
if (renderer != null)
{
renderer.render(partialTicks, world, client);
@@ -45,7 +45,7 @@ public class ForgeClientHandler
{
if (FluidRegistry.isUniversalBucketEnabled())
{
event.getItemColors().func_199877_a(new FluidContainerColorer(), ForgeMod.getInstance().universalBucket);
event.getItemColors().register(new FluidContainerColorer(), ForgeMod.getInstance().universalBucket);
}
}
}
@@ -266,7 +266,7 @@ public class ForgeHooksClient
}
skyInit = true;
GameSettings settings = Minecraft.getMinecraft().gameSettings;
GameSettings settings = Minecraft.getInstance().gameSettings;
int[] ranges = ForgeMod.blendRanges;
int distance = 0;
if (settings.fancyGraphics && ranges.length > 0)
@@ -360,7 +360,7 @@ public class ForgeHooksClient
public static void drawScreen(GuiScreen screen, int mouseX, int mouseY, float partialTicks)
{
if (!MinecraftForge.EVENT_BUS.post(new GuiScreenEvent.DrawScreenEvent.Pre(screen, mouseX, mouseY, partialTicks)))
screen.drawScreen(mouseX, mouseY, partialTicks);
screen.render(mouseX, mouseY, partialTicks);
MinecraftForge.EVENT_BUS.post(new GuiScreenEvent.DrawScreenEvent.Post(screen, mouseX, mouseY, partialTicks));
}
@@ -389,18 +389,18 @@ public class ForgeHooksClient
m.setIdentity();
m.setTranslation(TRSRTransformation.toVecmath(transform.translation));
t.setIdentity();
t.rotY(transform.rotation.func_195900_b());
t.rotY(transform.rotation.getY());
m.mul(t);
t.setIdentity();
t.rotX(transform.rotation.func_195899_a());
t.rotX(transform.rotation.getX());
m.mul(t);
t.setIdentity();
t.rotZ(transform.rotation.func_195902_c());
t.rotZ(transform.rotation.getZ());
m.mul(t);
t.setIdentity();
t.m00 = transform.scale.func_195899_a();
t.m11 = transform.scale.func_195900_b();
t.m22 = transform.scale.func_195902_c();
t.m00 = transform.scale.getX();
t.m11 = transform.scale.getY();
t.m22 = transform.scale.getZ();
m.mul(t);
return m;
}
@@ -471,10 +471,10 @@ public class ForgeHooksClient
glEnableClientState(GL_COLOR_ARRAY);
break;
case UV:
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + attr.getIndex());
OpenGlHelper.glClientActiveTexture(OpenGlHelper.GL_TEXTURE0 + attr.getIndex());
glTexCoordPointer(count, constant, stride, buffer);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
OpenGlHelper.glClientActiveTexture(OpenGlHelper.GL_TEXTURE0);
break;
case PADDING:
break;
@@ -503,9 +503,9 @@ public class ForgeHooksClient
GlStateManager.resetColor();
break;
case UV:
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + attr.getIndex());
OpenGlHelper.glClientActiveTexture(OpenGlHelper.GL_TEXTURE0 + attr.getIndex());
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
OpenGlHelper.glClientActiveTexture(OpenGlHelper.GL_TEXTURE0);
break;
case PADDING:
break;
@@ -518,15 +518,15 @@ public class ForgeHooksClient
public static void transform(net.minecraft.client.renderer.Vector3f vec, Matrix4f m)
{
Vector4f tmp = new Vector4f(vec.func_195899_a(), vec.func_195900_b(), vec.func_195902_c(), 1f);
Vector4f tmp = new Vector4f(vec.getX(), vec.getY(), vec.getZ(), 1f);
m.transform(tmp);
if(Math.abs(tmp.w - 1f) > 1e-5) tmp.scale(1f / tmp.w);
vec.func_195905_a(tmp.x, tmp.y, tmp.z);
vec.set(tmp.x, tmp.y, tmp.z);
}
public static Matrix4f getMatrix(ModelRotation modelRotation)
{
Matrix4f ret = new Matrix4f(TRSRTransformation.toVecmath(modelRotation.func_195820_a()), new Vector3f(), 1), tmp = new Matrix4f();
Matrix4f ret = new Matrix4f(TRSRTransformation.toVecmath(modelRotation.getMatrix()), new Vector3f(), 1), tmp = new Matrix4f();
tmp.setIdentity();
tmp.m03 = tmp.m13 = tmp.m23 = .5f;
ret.mul(tmp, ret);
@@ -570,7 +570,7 @@ public class ForgeHooksClient
TileEntityRenderer<?> r = TileEntityRendererDispatcher.instance.getRenderer(tileClass);
if (r != null)
{
r.func_199341_a(null, 0, 0, 0, 0, -1);
r.render(null, 0, 0, 0, 0, -1);
}
}
}
@@ -646,7 +646,7 @@ public class ForgeHooksClient
public static IBakedModel getDamageModel(IBakedModel ibakedmodel, TextureAtlasSprite texture, IBlockState state, IWorldReader world, BlockPos pos)
{
state = state.getBlock().getExtendedState(state, world, pos);
return (new SimpleBakedModel.Builder(state, ibakedmodel, texture, new Random(), 42)).makeBakedModel();
return (new SimpleBakedModel.Builder(state, ibakedmodel, texture, new Random(), 42)).build();
}
private static int slotMainHand = 0;
@@ -675,8 +675,8 @@ public class ForgeHooksClient
public static BlockFaceUV applyUVLock(BlockFaceUV blockFaceUV, EnumFacing originalSide, ITransformation rotation)
{
TRSRTransformation global = new TRSRTransformation(rotation.getMatrix());
Matrix4f uv = global.getUVLockTransform(originalSide).getMatrix();
TRSRTransformation global = new TRSRTransformation(rotation.getMatrixVec());
Matrix4f uv = global.getUVLockTransform(originalSide).getMatrixVec();
Vector4f vec = new Vector4f(0, 0, 0, 1);
float u0 = blockFaceUV.getVertexU(blockFaceUV.getVertexRotatedRev(0));
float v0 = blockFaceUV.getVertexV(blockFaceUV.getVertexRotatedRev(0));
@@ -740,7 +740,7 @@ public class ForgeHooksClient
{
TRSRTransformation tr = TRSRTransformation.from(model.getItemCameraTransforms().getTransform(type));
Matrix4f mat = null;
if(!tr.equals(TRSRTransformation.identity())) mat = tr.getMatrix();
if(!tr.equals(TRSRTransformation.identity())) mat = tr.getMatrixVec();
return Pair.of(model, mat);
}
@@ -106,9 +106,9 @@ public class GuiIngameForge extends GuiIngame
@Override
public void renderGameOverlay(float partialTicks)
{
this.field_194811_H = this.mc.field_195558_d.func_198107_o();
this.field_194812_I = this.mc.field_195558_d.func_198087_p();
eventParent = new RenderGameOverlayEvent(partialTicks, this.mc.field_195558_d);
this.scaledWidth = this.mc.mainWindow.getScaledWidth();
this.scaledHeight = this.mc.mainWindow.getScaledHeight();
eventParent = new RenderGameOverlayEvent(partialTicks, this.mc.mainWindow);
renderHealthMount = mc.player.getRidingEntity() instanceof EntityLivingBase;
renderFood = mc.player.getRidingEntity() == null;
renderJumpBar = mc.player.isRidingHorse();
@@ -124,71 +124,71 @@ public class GuiIngameForge extends GuiIngame
if (renderVignette && Minecraft.isFancyGraphicsEnabled())
{
func_194800_d(mc.player.getBrightness());
renderVignette(mc.player.getBrightness());
}
else
{
GlStateManager.enableDepth();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.enableDepthTest();
GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
}
if (renderHelmet) renderHelmet(partialTicks);
if (renderPortal && !mc.player.isPotionActive(MobEffects.NAUSEA))
{
func_194805_e(partialTicks);
renderPortal(partialTicks);
}
if (renderHotbar) func_194806_b(partialTicks);
if (renderHotbar) renderHotbar(partialTicks);
if (!this.mc.gameSettings.hideGUI) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
zLevel = -90.0F;
rand.setSeed((long)(updateCounter * 312871));
rand.setSeed((long)(ticks * 312871));
if (renderCrosshairs) func_194798_c(partialTicks);
if (renderCrosshairs) renderAttackIndicator(partialTicks);
if (renderBossHealth) renderBossHealth();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
if (this.mc.playerController.shouldDrawHUD() && this.mc.getRenderViewEntity() instanceof EntityPlayer)
{
if (renderHealth) renderHealth(this.field_194811_H, this.field_194812_I);
if (renderArmor) renderArmor(this.field_194811_H, this.field_194812_I);
if (renderFood) renderFood(this.field_194811_H, this.field_194812_I);
if (renderHealthMount) renderHealthMount(this.field_194811_H, this.field_194812_I);
if (renderAir) renderAir(this.field_194811_H, this.field_194812_I);
if (renderHealth) renderHealth(this.scaledWidth, this.scaledHeight);
if (renderArmor) renderArmor(this.scaledWidth, this.scaledHeight);
if (renderFood) renderFood(this.scaledWidth, this.scaledHeight);
if (renderHealthMount) renderHealthMount(this.scaledWidth, this.scaledHeight);
if (renderAir) renderAir(this.scaledWidth, this.scaledHeight);
}
if (renderJumpBar)
{
func_194803_a(this.field_194811_H / 2 - 91);
renderHorseJumpBar(this.scaledWidth / 2 - 91);
}
else if (renderExperiance)
{
renderExperience(this.field_194811_H / 2 - 91);
renderExperience(this.scaledWidth / 2 - 91);
}
if (this.mc.gameSettings.heldItemTooltips && this.mc.playerController.getCurrentGameType() != GameType.SPECTATOR) {
this.func_194801_c();
this.renderSelectedItem();
} else if (this.mc.player.isSpectator()) {
this.spectatorGui.func_195623_a();
this.spectatorGui.renderSelectedItem();
}
}
renderSleepFade(this.field_194811_H, this.field_194812_I);
renderSleepFade(this.scaledWidth, this.scaledHeight);
renderHUDText(this.field_194811_H, this.field_194812_I);
renderHUDText(this.scaledWidth, this.scaledHeight);
renderFPSGraph();
func_194809_b();
renderPotionEffects();
if (!mc.gameSettings.hideGUI) {
renderRecordOverlay(this.field_194811_H, this.field_194812_I, partialTicks);
renderRecordOverlay(this.scaledWidth, this.scaledHeight, partialTicks);
renderSubtitles();
renderTitle(this.field_194811_H, this.field_194812_I, partialTicks);
renderTitle(this.scaledWidth, this.scaledHeight, partialTicks);
}
Scoreboard scoreboard = this.mc.world.getScoreboard();
ScoreObjective objective = null;
ScorePlayerTeam scoreplayerteam = scoreboard.getPlayersTeam(mc.player.func_195047_I_());
ScorePlayerTeam scoreplayerteam = scoreboard.getPlayersTeam(mc.player.getScoreboardName());
if (scoreplayerteam != null)
{
int slot = scoreplayerteam.getColor().getColorIndex();
@@ -197,46 +197,46 @@ public class GuiIngameForge extends GuiIngame
ScoreObjective scoreobjective1 = objective != null ? objective : scoreboard.getObjectiveInDisplaySlot(1);
if (renderObjective && scoreobjective1 != null)
{
this.func_194802_a(scoreobjective1);
this.renderScoreboard(scoreobjective1);
}
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
GlStateManager.disableAlpha();
GlStateManager.blendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
GlStateManager.disableAlphaTest();
renderChat(this.field_194811_H, this.field_194812_I);
renderChat(this.scaledWidth, this.scaledHeight);
renderPlayerList(this.field_194811_H, this.field_194812_I);
renderPlayerList(this.scaledWidth, this.scaledHeight);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableLighting();
GlStateManager.enableAlpha();
GlStateManager.enableAlphaTest();
post(ALL);
}
@Override
protected void func_194798_c(float partialTicks)
protected void renderAttackIndicator(float partialTicks)
{
if (pre(CROSSHAIRS)) return;
bind(Gui.ICONS);
GlStateManager.enableBlend();
super.func_194798_c(partialTicks);
super.renderAttackIndicator(partialTicks);
post(CROSSHAIRS);
}
@Override
protected void func_194809_b()
protected void renderPotionEffects()
{
if (pre(POTION_ICONS)) return;
super.func_194809_b();
super.renderPotionEffects();
post(POTION_ICONS);
}
protected void renderSubtitles()
{
if (pre(SUBTITLES)) return;
this.overlaySubtitle.func_195620_a();
this.overlaySubtitle.render();
post(SUBTITLES);
}
@@ -245,7 +245,7 @@ public class GuiIngameForge extends GuiIngame
{
if (pre(BOSSHEALTH)) return;
bind(Gui.ICONS);
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
mc.profiler.startSection("bossHealth");
GlStateManager.enableBlend();
this.overlayBoss.renderBossHealth();
@@ -255,16 +255,16 @@ public class GuiIngameForge extends GuiIngame
}
@Override
protected void func_194800_d(float lightLevel)
protected void renderVignette(float lightLevel)
{
if (pre(VIGNETTE))
{
// Need to put this here, since Vanilla assumes this state after the vignette was rendered.
GlStateManager.enableDepth();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.enableDepthTest();
GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
return;
}
super.func_194800_d(lightLevel);
super.renderVignette(lightLevel);
post(VIGNETTE);
}
@@ -277,13 +277,13 @@ public class GuiIngameForge extends GuiIngame
if (this.mc.gameSettings.thirdPersonView == 0 && !itemstack.isEmpty())
{
Item item = itemstack.getItem();
if (item == Blocks.field_196625_cS.func_199767_j())
if (item == Blocks.CARVED_PUMPKIN.asItem())
{
func_194808_p();
renderPumpkinOverlay();
}
else
{
item.renderHelmetOverlay(itemstack, mc.player, this.field_194811_H, this.field_194812_I, partialTicks);
item.renderHelmetOverlay(itemstack, mc.player, this.scaledWidth, this.scaledHeight, partialTicks);
}
}
@@ -324,7 +324,7 @@ public class GuiIngameForge extends GuiIngame
}
@Override
protected void func_194805_e(float partialTicks)
protected void renderPortal(float partialTicks)
{
if (pre(PORTAL)) return;
@@ -332,24 +332,24 @@ public class GuiIngameForge extends GuiIngame
if (f1 > 0.0F)
{
super.func_194805_e(f1);
super.renderPortal(f1);
}
post(PORTAL);
}
@Override
protected void func_194806_b(float partialTicks)
protected void renderHotbar(float partialTicks)
{
if (pre(HOTBAR)) return;
if (mc.playerController.getCurrentGameType() == GameType.SPECTATOR)
{
this.spectatorGui.func_195622_a(partialTicks);
this.spectatorGui.renderTooltip(partialTicks);
}
else
{
super.func_194806_b(partialTicks);
super.renderHotbar(partialTicks);
}
post(HOTBAR);
@@ -371,7 +371,7 @@ public class GuiIngameForge extends GuiIngame
int top = height - right_height;
int air = player.getAir();
if (player.func_208600_a(FluidTags.field_206959_a) || air < 300)
if (player.areEyesInFluid(FluidTags.WATER) || air < 300)
{
int full = MathHelper.ceil((double)(air - 2) * 10.0D / 300.0D);
int partial = MathHelper.ceil((double)air * 10.0D / 300.0D) - full;
@@ -397,37 +397,37 @@ public class GuiIngameForge extends GuiIngame
EntityPlayer player = (EntityPlayer)this.mc.getRenderViewEntity();
int health = MathHelper.ceil(player.getHealth());
boolean highlight = healthUpdateCounter > (long)updateCounter && (healthUpdateCounter - (long)updateCounter) / 3L %2L == 1L;
boolean highlight = healthUpdateCounter > (long)ticks && (healthUpdateCounter - (long)ticks) / 3L %2L == 1L;
if (health < this.playerHealth && player.hurtResistantTime > 0)
{
this.lastSystemTime = Util.func_211177_b();
this.healthUpdateCounter = (long)(this.updateCounter + 20);
this.lastSystemTime = Util.milliTime();
this.healthUpdateCounter = (long)(this.ticks + 20);
}
else if (health > this.playerHealth && player.hurtResistantTime > 0)
{
this.lastSystemTime = Util.func_211177_b();
this.healthUpdateCounter = (long)(this.updateCounter + 10);
this.lastSystemTime = Util.milliTime();
this.healthUpdateCounter = (long)(this.ticks + 10);
}
if (Util.func_211177_b() - this.lastSystemTime > 1000L)
if (Util.milliTime() - this.lastSystemTime > 1000L)
{
this.playerHealth = health;
this.lastPlayerHealth = health;
this.lastSystemTime = Util.func_211177_b();
this.lastSystemTime = Util.milliTime();
}
this.playerHealth = health;
int healthLast = this.lastPlayerHealth;
IAttributeInstance attrMaxHealth = player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH);
float healthMax = (float)attrMaxHealth.getAttributeValue();
IAttributeInstance attrMaxHealth = player.getAttribute(SharedMonsterAttributes.MAX_HEALTH);
float healthMax = (float)attrMaxHealth.getValue();
float absorb = MathHelper.ceil(player.getAbsorptionAmount());
int healthRows = MathHelper.ceil((healthMax + absorb) / 2.0F / 10.0F);
int rowHeight = Math.max(10 - (healthRows - 2), 3);
this.rand.setSeed((long)(updateCounter * 312871));
this.rand.setSeed((long)(ticks * 312871));
int left = width / 2 - 91;
int top = height - left_height;
@@ -437,10 +437,10 @@ public class GuiIngameForge extends GuiIngame
int regen = -1;
if (player.isPotionActive(MobEffects.REGENERATION))
{
regen = updateCounter % 25;
regen = ticks % 25;
}
final int TOP = 9 * (mc.world.getWorldInfo().isHardcoreModeEnabled() ? 5 : 0);
final int TOP = 9 * (mc.world.getWorldInfo().isHardcore() ? 5 : 0);
final int BACKGROUND = (highlight ? 25 : 16);
int MARGIN = 16;
if (player.isPotionActive(MobEffects.POISON)) MARGIN += 36;
@@ -524,7 +524,7 @@ public class GuiIngameForge extends GuiIngame
}
if (unused) background = 1; //Probably should be a += 1 but vanilla never uses this
if (player.getFoodStats().getSaturationLevel() <= 0.0F && updateCounter % (level * 3 + 1) == 0)
if (player.getFoodStats().getSaturationLevel() <= 0.0F && ticks % (level * 3 + 1) == 0)
{
y = top + (rand.nextInt(3) - 1);
}
@@ -546,8 +546,8 @@ public class GuiIngameForge extends GuiIngame
if (mc.player.getSleepTimer() > 0)
{
mc.profiler.startSection("sleep");
GlStateManager.disableDepth();
GlStateManager.disableAlpha();
GlStateManager.disableDepthTest();
GlStateManager.disableAlphaTest();
int sleepTime = mc.player.getSleepTimer();
float opacity = (float)sleepTime / 100.0F;
@@ -558,8 +558,8 @@ public class GuiIngameForge extends GuiIngame
int color = (int)(220.0F * opacity) << 24 | 1052704;
drawRect(0, 0, width, height, color);
GlStateManager.enableAlpha();
GlStateManager.enableDepth();
GlStateManager.enableAlphaTest();
GlStateManager.enableDepthTest();
mc.profiler.endSection();
}
}
@@ -568,28 +568,28 @@ public class GuiIngameForge extends GuiIngame
{
bind(ICONS);
if (pre(EXPERIENCE)) return;
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableBlend();
if (mc.playerController.gameIsSurvivalOrAdventure())
{
super.func_194804_b(x);
super.renderExpBar(x);
}
GlStateManager.enableBlend();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
post(EXPERIENCE);
}
@Override
public void func_194803_a(int x)
public void renderHorseJumpBar(int x)
{
bind(ICONS);
if (pre(JUMPBAR)) return;
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableBlend();
super.func_194803_a(x);
super.renderHorseJumpBar(x);
GlStateManager.enableBlend();
mc.profiler.endSection();
@@ -601,13 +601,13 @@ public class GuiIngameForge extends GuiIngame
protected void renderHUDText(int width, int height)
{
mc.profiler.startSection("forgeHudText");
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
OpenGlHelper.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
ArrayList<String> listL = new ArrayList<String>();
ArrayList<String> listR = new ArrayList<String>();
if (mc.isDemo())
{
long time = mc.world.getTotalWorldTime();
long time = mc.world.getGameTime();
if (time >= 120500L)
{
listR.add(I18n.format("demo.demoExpired"));
@@ -674,9 +674,9 @@ public class GuiIngameForge extends GuiIngame
if (opacity > 0)
{
GlStateManager.pushMatrix();
GlStateManager.translate((float)(width / 2), (float)(height - 68), 0.0F);
GlStateManager.translatef((float)(width / 2), (float)(height - 68), 0.0F);
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
int color = (animateOverlayMessageColor ? Color.HSBtoRGB(hue / 50.0F, 0.7F, 0.6F) & WHITE : WHITE);
fontrenderer.drawStringWithShadow(overlayMessage, -fontrenderer.getStringWidth(overlayMessage) / 2, -4, color | (opacity << 24));
GlStateManager.disableBlend();
@@ -707,16 +707,16 @@ public class GuiIngameForge extends GuiIngame
if (opacity > 8)
{
GlStateManager.pushMatrix();
GlStateManager.translate((float)(width / 2), (float)(height / 2), 0.0F);
GlStateManager.translatef((float)(width / 2), (float)(height / 2), 0.0F);
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.pushMatrix();
GlStateManager.scale(4.0F, 4.0F, 4.0F);
GlStateManager.scalef(4.0F, 4.0F, 4.0F);
int l = opacity << 24 & -16777216;
this.getFontRenderer().drawStringWithShadow(this.displayedTitle, (float)(-this.getFontRenderer().getStringWidth(this.displayedTitle) / 2), -10.0F, 16777215 | l);
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.scale(2.0F, 2.0F, 2.0F);
GlStateManager.scalef(2.0F, 2.0F, 2.0F);
this.getFontRenderer().drawStringWithShadow(this.displayedSubTitle, (float)(-this.getFontRenderer().getStringWidth(this.displayedSubTitle) / 2), 5.0F, 16777215 | l);
GlStateManager.popMatrix();
GlStateManager.disableBlend();
@@ -735,8 +735,8 @@ public class GuiIngameForge extends GuiIngame
if (MinecraftForge.EVENT_BUS.post(event)) return;
GlStateManager.pushMatrix();
GlStateManager.translate((float) event.getPosX(), (float) event.getPosY(), 0.0F);
persistantChatGUI.drawChat(updateCounter);
GlStateManager.translatef((float) event.getPosX(), (float) event.getPosY(), 0.0F);
persistantChatGUI.drawChat(ticks);
GlStateManager.popMatrix();
post(CHAT);
@@ -751,14 +751,14 @@ public class GuiIngameForge extends GuiIngame
if (mc.gameSettings.keyBindPlayerList.isKeyDown() && (!mc.isIntegratedServerRunning() || handler.getPlayerInfoMap().size() > 1 || scoreobjective != null))
{
this.overlayPlayerList.updatePlayerList(true);
this.overlayPlayerList.setVisible(true);
if (pre(PLAYER_LIST)) return;
this.overlayPlayerList.renderPlayerlist(width, this.mc.world.getScoreboard(), scoreobjective);
post(PLAYER_LIST);
}
else
{
this.overlayPlayerList.updatePlayerList(false);
this.overlayPlayerList.setVisible(false);
}
}
@@ -836,10 +836,10 @@ public class GuiIngameForge extends GuiIngame
this.mc = mc;
}
@Override protected void renderDebugInfoLeft(){}
@Override protected void func_194819_c(){}
@Override protected void renderDebugInfoRight(){}
private List<String> getLeft()
{
List<String> ret = this.func_209011_c();
List<String> ret = this.call();
ret.add("");
ret.add("Debug: Pie [shift]: " + (this.mc.gameSettings.showDebugProfilerChart ? "visible" : "hidden") + " FPS [alt]: " + (this.mc.gameSettings.showLagometer ? "visible" : "hidden"));
ret.add("For help: press F3 + Q");
@@ -50,13 +50,13 @@ public class ItemModelMesherForge extends ItemModelMesher
@Override
@Nullable
public IBakedModel func_199312_b(Item item)
public IBakedModel getItemModel(Item item)
{
return models.get(item.delegate);
}
@Override
public void func_199311_a(Item item, ModelResourceLocation location)
public void register(Item item, ModelResourceLocation location)
{
IRegistryDelegate<Item> key = item.delegate;
locations.put(key, location);
@@ -53,7 +53,7 @@ public class MinecraftForgeClient
*/
public static Locale getLocale()
{
return Minecraft.getMinecraft().getLanguageManager().getCurrentLanguage().getJavaLocale();
return Minecraft.getInstance().getLanguageManager().getCurrentLanguage().getJavaLocale();
}
private static BitSet stencilBits = new BitSet(8);
@@ -25,6 +25,8 @@ import net.minecraft.entity.Entity;
import net.minecraftforge.eventbus.api.Cancelable;
import net.minecraftforge.eventbus.api.Event;
import net.minecraftforge.eventbus.api.Event.HasResult;
/**
* Event that hooks into EntityRenderer, allowing any feature to customize visual attributes
* the player sees.
@@ -44,4 +44,4 @@ public class PlayerSPPushOutOfBlocksEvent extends PlayerEvent
public AxisAlignedBB getEntityBoundingBox() { return entityBoundingBox; }
public void setEntityBoundingBox(@Nonnull AxisAlignedBB entityBoundingBox) { this.entityBoundingBox = entityBoundingBox; }
}
}
@@ -135,4 +135,4 @@ public abstract class RenderPlayerEvent extends PlayerEvent
return stack;
}
}
}
}
@@ -29,4 +29,4 @@ public class PlaySoundSourceEvent extends SoundSourceEvent
{
super(manager, sound, uuid);
}
}
}
@@ -29,4 +29,4 @@ public class PlayStreamingSourceEvent extends SoundSourceEvent
{
super(manager, sound, uuid);
}
}
}
@@ -18,12 +18,12 @@ public interface IForgeKeybinding
*/
default boolean isActiveAndMatches(InputMappings.Input keyCode)
{
return keyCode.func_197937_c() != 0 && keyCode.equals(getKey()) && getKeyConflictContext().isActive() && getKeyModifier().isActive(getKeyConflictContext());
return keyCode.getKeyCode() != 0 && keyCode.equals(getKey()) && getKeyConflictContext().isActive() && getKeyModifier().isActive(getKeyConflictContext());
}
default void setToDefault()
{
setKeyModifierAndCode(getKeyModifierDefault(), getKeyBinding().func_197977_i());
setKeyModifierAndCode(getKeyModifierDefault(), getKeyBinding().getDefault());
}
void setKeyConflictContext(IKeyConflictContext keyConflictContext);
@@ -61,15 +61,15 @@ public class NotificationModUpdateScreen extends GuiScreen
}
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks)
public void render(int mouseX, int mouseY, float partialTicks)
{
if (showNotification == null || !showNotification.shouldDraw() || ForgeMod.disableVersionCheck)
{
return;
}
Minecraft.getMinecraft().getTextureManager().bindTexture(VERSION_CHECK_ICONS);
GlStateManager.color(1, 1, 1, 1);
Minecraft.getInstance().getTextureManager().bindTexture(VERSION_CHECK_ICONS);
GlStateManager.color4f(1, 1, 1, 1);
GlStateManager.pushMatrix();
int x = modButton.x;
@@ -67,7 +67,7 @@ public class BakedItemModel implements IBakedModel
@Override public ItemOverrideList getOverrides() { return overrides; }
@Override
public List<BakedQuad> func_200117_a(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
{
if (side == null)
{
@@ -105,7 +105,7 @@ public class BakedItemModel implements IBakedModel
}
@Override
public List<BakedQuad> func_200117_a (@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
public List<BakedQuad> getQuads (@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
{
if(side == null)
{
@@ -43,9 +43,9 @@ public abstract class BakedModelWrapper<T extends IBakedModel> implements IBaked
}
@Override
public List<BakedQuad> func_200117_a(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
{
return originalModel.func_200117_a(state, side, rand);
return originalModel.getQuads(state, side, rand);
}
@Override
@@ -68,9 +68,9 @@ final class FancyMissingModel implements IUnbakedModel
m.m33 = 1;
m.setTranslation(new Vector3f(1, 1 + 1f / 0x100, 0));
return new SimpleModelFontRenderer(
Minecraft.getMinecraft().gameSettings,
Minecraft.getInstance().gameSettings,
font,
Minecraft.getMinecraft().getTextureManager(),
Minecraft.getInstance().getTextureManager(),
false,
m,
format
@@ -92,15 +92,15 @@ final class FancyMissingModel implements IUnbakedModel
this.missingModel = missingModel;
this.message = message;
}
@Override
public Collection<ResourceLocation> func_209559_a(Function<ResourceLocation, IUnbakedModel> p_209559_1_, Set<String> p_209559_2_)
public Collection<ResourceLocation> getTextures(Function<ResourceLocation, IUnbakedModel> modelGetter, Set<String> missingTextureErrors)
{
return ImmutableList.of(font2);
}
@Override
public Collection<ResourceLocation> getOverrideLocations()
public Collection<ResourceLocation> getOverrideLocations()
{
return Collections.emptyList();
}
@@ -145,7 +145,7 @@ final class FancyMissingModel implements IUnbakedModel
}
@Override
public List<BakedQuad> func_200117_a(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
{
if (side == null)
{
@@ -161,16 +161,16 @@ final class FancyMissingModel implements IUnbakedModel
}
for (int y = 0; y < splitLines.size(); y++)
{
fontRenderer.func_211126_b(splitLines.get(y), 0, ((y - splitLines.size() / 2f) * fontRenderer.FONT_HEIGHT) + 0x40, 0xFF00FFFF);
fontRenderer.drawString(splitLines.get(y), 0, ((y - splitLines.size() / 2f) * fontRenderer.FONT_HEIGHT) + 0x40, 0xFF00FFFF);
}
ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
builder.addAll(missingModel.func_200117_a (state, side, rand));
builder.addAll(missingModel.getQuads (state, side, rand));
builder.addAll(fontRenderer.build());
quads = builder.build();
}
return quads;
}
return missingModel.func_200117_a (state, side, rand);
return missingModel.getQuads (state, side, rand);
}
@Override
@@ -186,7 +186,7 @@ final class FancyMissingModel implements IUnbakedModel
public TextureAtlasSprite getParticleTexture() { return fontTexture; }
@Override
public ItemOverrideList getOverrides() { return ItemOverrideList.NONE; }
public ItemOverrideList getOverrides() { return ItemOverrideList.EMPTY; }
@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType)
@@ -230,9 +230,9 @@ final class FancyMissingModel implements IUnbakedModel
}
if (big != this.big)
{
return Pair.of(otherModel, transform.getMatrix());
return Pair.of(otherModel, transform.getMatrixVec());
}
return Pair.of(this, transform.getMatrix());
return Pair.of(this, transform.getMatrixVec());
}
}
}
@@ -31,14 +31,14 @@ import net.minecraft.util.ResourceLocation;
public interface ICustomModelLoader extends ISelectiveResourceReloadListener
{
@Override
void func_195410_a(IResourceManager resourceManager);
void onResourceManagerReload(IResourceManager resourceManager);
@Override
default void onResourceManagerReload(IResourceManager resourceManager, Predicate<IResourceType> resourcePredicate)
{
if (resourcePredicate.test(VanillaResourceType.MODELS))
{
func_195410_a(resourceManager);
onResourceManagerReload(resourceManager);
}
}
@@ -43,7 +43,7 @@ import net.minecraftforge.common.model.animation.IClip;
public interface IModel<T extends IModel<T>>
{
@Nullable
IBakedModel bake(Function<ResourceLocation, IUnbakedModel> p_209558_1_, Function<ResourceLocation, TextureAtlasSprite> p_209558_2_, IModelState state, boolean uvlock, VertexFormat format);
IBakedModel bake(Function<ResourceLocation, IUnbakedModel> modelGetter, Function<ResourceLocation, TextureAtlasSprite> spriteGetter, IModelState state, boolean uvlock, VertexFormat format);
/*
* Default state this model will be baked with.
@@ -64,7 +64,7 @@ public final class ItemLayerModel implements IUnbakedModel
public ItemLayerModel(ImmutableList<ResourceLocation> textures)
{
this(textures, ItemOverrideList.NONE);
this(textures, ItemOverrideList.EMPTY);
}
public ItemLayerModel(ImmutableList<ResourceLocation> textures, ItemOverrideList overrides)
@@ -75,7 +75,7 @@ public final class ItemLayerModel implements IUnbakedModel
public ItemLayerModel(ModelBlock model)
{
this(getTextures(model), model.func_209568_a(model, ModelLoader.defaultModelGetter(), ModelLoader.defaultTextureGetter()));
this(getTextures(model), model.getOverrides(model, ModelLoader.defaultModelGetter(), ModelLoader.defaultTextureGetter()));
}
private static ImmutableList<ResourceLocation> getTextures(ModelBlock model)
@@ -87,17 +87,17 @@ public final class ItemLayerModel implements IUnbakedModel
}
return builder.build();
}
@Override
public Collection<ResourceLocation> func_209559_a(Function<ResourceLocation, IUnbakedModel> p_209559_1_, Set<String> p_209559_2_)
public Collection<ResourceLocation> getTextures(Function<ResourceLocation, IUnbakedModel> modelGetter, Set<String> missingTextureErrors)
{
return textures;
}
@Override
public Collection<ResourceLocation> getOverrideLocations()
public Collection<ResourceLocation> getOverrideLocations()
{
return Collections.emptyList();
return Collections.emptyList();
}
@Override
@@ -117,9 +117,9 @@ public final class ItemLayerModel implements IUnbakedModel
}
return new ItemLayerModel(builder.build(), overrides);
}
@Override
public IBakedModel bake(Function<ResourceLocation, IUnbakedModel> p_209558_1_, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter, IModelState state, boolean p_209558_4_, VertexFormat format) {
public IBakedModel bake(Function<ResourceLocation, IUnbakedModel> modelGetter, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter, IModelState state, boolean uvlock, VertexFormat format) {
ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
Optional<TRSRTransformation> transform = state.apply(Optional.empty());
for(int i = 0; i < textures.size(); i++)
@@ -136,8 +136,8 @@ public final class ItemLayerModel implements IUnbakedModel
{
ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
int uMax = sprite.getIconWidth();
int vMax = sprite.getIconHeight();
int uMax = sprite.getWidth();
int vMax = sprite.getHeight();
FaceData faceData = new FaceData(uMax, vMax);
boolean translucent = false;
@@ -343,8 +343,8 @@ public final class ItemLayerModel implements IUnbakedModel
{
final float eps = 1e-2f;
int width = sprite.getIconWidth();
int height = sprite.getIconHeight();
int width = sprite.getWidth();
int height = sprite.getHeight();
float x0 = (float) u / width;
float y0 = (float) v / height;
@@ -424,7 +424,7 @@ public final class ItemLayerModel implements IUnbakedModel
vec.y = y;
vec.z = z;
vec.w = 1;
transform.get().getMatrix().transform(vec);
transform.get().getMatrixVec().transform(vec);
builder.put(e, vec.x, vec.y, vec.z, vec.w);
}
else
@@ -455,7 +455,7 @@ public final class ItemLayerModel implements IUnbakedModel
INSTANCE;
@Override
public void func_195410_a(IResourceManager resourceManager) {}
public void onResourceManagerReload(IResourceManager resourceManager) {}
@Override
public boolean accepts(ResourceLocation modelLocation)
@@ -80,8 +80,8 @@ public final class ItemTextureQuadConverter
*/
public static List<UnpackedBakedQuad> convertTextureHorizontal(VertexFormat format, TRSRTransformation transform, TextureAtlasSprite template, TextureAtlasSprite sprite, float z, EnumFacing facing, int color, int tint)
{
int w = template.getIconWidth();
int h = template.getIconHeight();
int w = template.getWidth();
int h = template.getHeight();
float wScale = 16f / (float)w;
float hScale = 16f / (float)h;
List<UnpackedBakedQuad> quads = Lists.newArrayList();
@@ -93,7 +93,7 @@ public final class ItemTextureQuadConverter
for (int x = 0; x < w; x++)
{
// current pixel
boolean isVisible = !template.func_195662_a(0, x, y);
boolean isVisible = !template.isPixelTransparent(0, x, y);
// no current quad but found a new one
if (start < 0 && isVisible)
@@ -111,7 +111,7 @@ public final class ItemTextureQuadConverter
{
for (int i = 0; i < w; i++)
{
if (template.func_195662_a(0, i, y) != template.func_195662_a(0, i, endY))
if (template.isPixelTransparent(0, i, y) != template.isPixelTransparent(0, i, endY))
{
sameRow = false;
break;
@@ -158,8 +158,8 @@ public final class ItemTextureQuadConverter
*/
public static List<UnpackedBakedQuad> convertTextureVertical(VertexFormat format, TRSRTransformation transform, TextureAtlasSprite template, TextureAtlasSprite sprite, float z, EnumFacing facing, int color, int tint)
{
int w = template.getIconWidth();
int h = template.getIconHeight();
int w = template.getWidth();
int h = template.getHeight();
float wScale = 16f / (float)w;
float hScale = 16f / (float)h;
List<UnpackedBakedQuad> quads = Lists.newArrayList();
@@ -171,7 +171,7 @@ public final class ItemTextureQuadConverter
for (int y = 0; y < h; y++)
{
// current pixel
boolean isVisible = !sprite.func_195662_a(0, x, y);
boolean isVisible = !sprite.isPixelTransparent(0, x, y);
// no current quad but found a new one
if (start < 0 && isVisible)
@@ -189,7 +189,7 @@ public final class ItemTextureQuadConverter
{
for (int i = 0; i < h; i++)
{
if (sprite.func_195662_a(0, x, i) != sprite.func_195662_a(0, endX, i))
if (sprite.isPixelTransparent(0, x, i) != sprite.isPixelTransparent(0, endX, i))
{
sameColumn = false;
break;
@@ -305,7 +305,7 @@ public final class ItemTextureQuadConverter
vec.y = y;
vec.z = z;
vec.w = 1;
transform.getMatrix().transform(vec);
transform.getMatrixVec().transform(vec);
builder.put(e, vec.x, vec.y, vec.z, vec.w);
}
break;
@@ -111,7 +111,7 @@ public final class ModelDynBucket implements IUnbakedModel
}
@Override
public Collection<ResourceLocation> func_209559_a(Function<ResourceLocation, IUnbakedModel> p_209559_1_, Set<String> p_209559_2_)
public Collection<ResourceLocation> getTextures(Function<ResourceLocation, IUnbakedModel> modelGetter, Set<String> missingTextureErrors)
{
ImmutableSet.Builder<ResourceLocation> builder = ImmutableSet.builder();
@@ -160,7 +160,7 @@ public final class ModelDynBucket implements IUnbakedModel
// build base (insidest)
IBakedModel model = (new ItemLayerModel(ImmutableList.of(baseLocation))).bake(modelGetter, bakedTextureGetter, state, uvlock, format);
random.setSeed(42);
builder.addAll(model.func_200117_a(null, null, random));
builder.addAll(model.getQuads(null, null, random));
particleSprite = model.getParticleTexture();
}
if (liquidLocation != null && fluidSprite != null)
@@ -260,7 +260,7 @@ public final class ModelDynBucket implements IUnbakedModel
{
try
{
return Minecraft.getMinecraft().func_195551_G().func_199002_a(resourceLocation);
return Minecraft.getInstance().getResourceManager().getResource(resourceLocation);
}
catch (IOException ignored)
{
@@ -298,7 +298,7 @@ public final class ModelDynBucket implements IUnbakedModel
}
@Override
public void func_195410_a(IResourceManager resourceManager)
public void onResourceManagerReload(IResourceManager resourceManager)
{
// no need to clear cache since we create a new model instance
}
@@ -331,7 +331,7 @@ public final class ModelDynBucket implements IUnbakedModel
private BucketBaseSprite(IResource resource)
{
super(resource.func_199029_a(), getSizeInfo(resource), resource.func_199028_a(AnimationMetadataSection.field_195817_a));
super(resource.getLocation(), getSizeInfo(resource), resource.getMetadata(AnimationMetadataSection.SERIALIZER));
}
/* TODO Custom TAS
@@ -373,7 +373,7 @@ public final class ModelDynBucket implements IUnbakedModel
private BucketCoverSprite(IResource resource)
{
super(resource.func_199029_a(), getSizeInfo(resource), resource.func_199028_a(AnimationMetadataSection.field_195817_a));
super(resource.getLocation(), getSizeInfo(resource), resource.getMetadata(AnimationMetadataSection.SERIALIZER));
}
/* TODO Custom TAS
@@ -404,7 +404,7 @@ public final class ModelDynBucket implements IUnbakedModel
IResource mask = getResource(new ResourceLocation(ForgeVersion.MOD_ID, "textures/items/vanilla_bucket_cover_mask.png"))
) {
// use the alpha mask if it fits, otherwise leave the cover texture blank
if (empty != null && mask != null && Objects.equals(empty.func_199026_d(), mask.func_199026_d()) &&
if (empty != null && mask != null && Objects.equals(empty.getPackName(), mask.getPackName()) &&
alphaMask.getIconWidth() == width && alphaMask.getIconHeight() == height)
{
final int[][] oldPixels = sprite.getFrameTextureData(0);
@@ -437,7 +437,7 @@ public final class ModelDynBucket implements IUnbakedModel
private BakedDynBucketOverrideHandler() {}
@Override
public IBakedModel func_209581_a(IBakedModel originalModel, ItemStack stack, @Nullable World world, @Nullable EntityLivingBase entity)
public IBakedModel getModelWithOverrides(IBakedModel originalModel, ItemStack stack, @Nullable World world, @Nullable EntityLivingBase entity)
{
return FluidUtil.getFluidContained(stack)
.map(fluidStack -> {
@@ -450,7 +450,7 @@ public final class ModelDynBucket implements IUnbakedModel
{
IUnbakedModel parent = model.parent.process(ImmutableMap.of("fluid", name));
Function<ResourceLocation, TextureAtlasSprite> textureGetter;
textureGetter = location -> Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(location.toString());
textureGetter = location -> Minecraft.getInstance().getTextureMap().getAtlasSprite(location.toString());
IBakedModel bakedModel = parent.bake(ModelLoader.defaultModelGetter(), textureGetter, new SimpleModelState(model.transforms), false, model.format);
model.cache.put(name, bakedModel);
@@ -79,13 +79,13 @@ public final class ModelFluid implements IUnbakedModel
}
@Override
public Collection<ResourceLocation> func_209559_a(Function<ResourceLocation, IUnbakedModel> modelGetter, Set<String> p_209559_2_)
public Collection<ResourceLocation> getTextures(Function<ResourceLocation, IUnbakedModel> modelGetter, Set<String> missingTextureErrors)
{
return fluid.getOverlay() != null
? ImmutableSet.of(fluid.getStill(), fluid.getFlowing(), fluid.getOverlay())
: ImmutableSet.of(fluid.getStill(), fluid.getFlowing());
}
@Override
public Collection<ResourceLocation> getOverrideLocations() {
return Collections.emptyList();
@@ -112,7 +112,7 @@ public final class ModelFluid implements IUnbakedModel
INSTANCE;
@Override
public void func_195410_a(IResourceManager resourceManager) {}
public void onResourceManagerReload(IResourceManager resourceManager) {}
@Override
public boolean accepts(ResourceLocation modelLocation)
@@ -229,7 +229,7 @@ public final class ModelFluid implements IUnbakedModel
}
@Override
public List<BakedQuad> func_200117_a(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
{
if (side != null && state instanceof IExtendedBlockState)
{
@@ -255,10 +255,10 @@ public final class ModelFluid implements IUnbakedModel
key <<= 1;
key |= 1;
return modelCache.getUnchecked(key).func_200117_a(state, side, rand);
return modelCache.getUnchecked(key).getQuads(state, side, rand);
}
return super.func_200117_a(state, side, rand);
return super.getQuads(state, side, rand);
}
}
@@ -432,7 +432,7 @@ public final class ModelFluid implements IUnbakedModel
if(transformation.isPresent() && !transformation.get().isIdentity())
{
Vector4f vec = new Vector4f(data);
transformation.get().getMatrix().transform(vec);
transformation.get().getMatrixVec().transform(vec);
vec.get(data);
}
builder.put(e, data);
@@ -484,7 +484,7 @@ public final class ModelFluid implements IUnbakedModel
}
@Override
public List<BakedQuad> func_200117_a(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
{
return side == null ? ImmutableList.of() : faceQuads.get(side);
}
@@ -492,7 +492,7 @@ public final class ModelFluid implements IUnbakedModel
@Override
public ItemOverrideList getOverrides()
{
return ItemOverrideList.NONE;
return ItemOverrideList.EMPTY;
}
@Override
@@ -162,45 +162,45 @@ public final class ModelLoader extends ModelBakery
return bakedRegistry;
isLoading = true;
missingModel = ModelLoaderRegistry.getMissingModel();
stateModels.put(MODEL_MISSING, missingModel);
final Set<ResourceLocation> textures = Sets.newHashSet(ModelLoaderRegistry.getTextures());
textures.remove(MissingTextureSprite.func_195675_b());
textures.remove(MissingTextureSprite.getLocation());
textures.addAll(LOCATIONS_BUILTIN_TEXTURES);
textureMap.func_195426_a(resourceManager, textures);
textureMap.stitch(resourceManager, textures);
field_209607_C.forEach((p_209602_2_, p_209602_3_) -> {
p_209602_3_.getValidStates().forEach((p_209601_3_) -> {
this.func_209594_a(map, BlockModelShapes.func_209553_a(p_209602_2_, p_209601_3_));
this.getUnbakedModel(map, BlockModelShapes.getModelLocation(p_209602_2_, p_209601_3_));
});
});
for(ResourceLocation resourcelocation : Item.REGISTRY.getKeys()) {
this.func_209594_a(map, new ModelResourceLocation(resourcelocation, "inventory"));
this.getUnbakedModel(map, new ModelResourceLocation(resourcelocation, "inventory"));
}
this.func_209594_a(map, new ModelResourceLocation("minecraft:trident_in_hand#inventory"));
this.getUnbakedModel(map, new ModelResourceLocation("minecraft:trident_in_hand#inventory"));
Set<String> set = Sets.<String>newLinkedHashSet();
Set<ResourceLocation> set1 = (Set)map.values().stream().<ResourceLocation>flatMap((p_209595_2_) -> {
return p_209595_2_.func_209559_a(this::func_209597_a, set).stream();
return p_209595_2_.getTextures(this::getUnbakedModel, set).stream();
}).collect(Collectors.toSet());
set1.addAll(LOCATIONS_BUILTIN_TEXTURES);
set.forEach((p_209588_0_) -> {
LOGGER.warn("Unable to resolve texture reference: {}", (Object)p_209588_0_);
});
this.textureMap.func_195426_a(this.resourceManager, set1);
this.textureMap.stitch(this.resourceManager, set1);
map.forEach((p_209599_1_, p_209599_2_) -> {
IBakedModel ibakedmodel = p_209599_2_.func_209558_a(this::func_209597_a, this.textureMap::func_195424_a, ModelRotation.X0_Y0, false);
IBakedModel ibakedmodel = p_209599_2_.bake(this::getUnbakedModel, this.textureMap::getSprite, ModelRotation.X0_Y0, false);
if (ibakedmodel != null) {
this.bakedRegistry.putObject(p_209599_1_, ibakedmodel);
}
});
return this.bakedRegistry;
IBakedModel missingBaked = missingModel.bake(defaultModelGetter(), defaultTextureGetter(), missingModel.getDefaultState(), false, DefaultVertexFormats.ITEM);
Map<IUnbakedModel, IBakedModel> bakedModels = Maps.newHashMap();
HashMultimap<IUnbakedModel, ModelResourceLocation> models = HashMultimap.create();
@@ -356,8 +356,8 @@ public final class ModelLoader extends ModelBakery
private final class VanillaModelWrapper implements IUnbakedModel
{
private final FaceBakery faceBakery = new FaceBakery();
private final FaceBakery faceBakery = new FaceBakery();
private final ResourceLocation location;
private final ModelBlock model;
private final boolean uvlock;
@@ -390,9 +390,9 @@ public final class ModelLoader extends ModelBakery
}
return ImmutableSet.copyOf(set);
}
@Override
public Collection<ResourceLocation> func_209559_a(Function<ResourceLocation, IUnbakedModel> p_209559_1_, Set<String> p_209559_2_)
public Collection<ResourceLocation> getTextures(Function<ResourceLocation, IUnbakedModel> modelGetter, Set<String> missingTextureErrors)
{
// setting parent here to make textures resolve properly
if(model.getParentLocation() != null)
@@ -471,7 +471,7 @@ public final class ModelLoader extends ModelBakery
{
return new ItemLayerModel(model).bake(modelGetter, bakedTextureGetter, perState, uvlock, format);
}
if(model == ModelBakery.MODEL_ENTITY) return new BuiltInModel(transforms, model.func_209568_a(model, modelGetter, bakedTextureGetter));
if(model == ModelBakery.MODEL_ENTITY) return new BuiltInModel(transforms, model.getOverrides(model, modelGetter, bakedTextureGetter));
return bakeNormal(model, perState, state, newTransforms, format, modelGetter, bakedTextureGetter, uvlock);
}
@@ -479,7 +479,7 @@ public final class ModelLoader extends ModelBakery
{
final TRSRTransformation baseState = modelState.apply(Optional.empty()).orElse(TRSRTransformation.identity());
TextureAtlasSprite particle = bakedTextureGetter.apply(new ResourceLocation(model.resolveTextureName("particle")));
SimpleBakedModel.Builder builder = (new SimpleBakedModel.Builder(model, model.func_209568_a(model, modelGetter, bakedTextureGetter))).setTexture(particle);
SimpleBakedModel.Builder builder = (new SimpleBakedModel.Builder(model, model.getOverrides(model, modelGetter, bakedTextureGetter))).setTexture(particle);
for(int i = 0; i < model.getElements().size(); i++)
{
if(modelState.apply(Optional.of(Models.getHiddenModelPart(ImmutableList.of(Integer.toString(i))))).isPresent())
@@ -499,7 +499,7 @@ public final class ModelLoader extends ModelBakery
{
TextureAtlasSprite textureatlassprite1 = bakedTextureGetter.apply(new ResourceLocation(model.resolveTextureName(e.getValue().texture)));
if (e.getValue().cullFace == null || !TRSRTransformation.isInteger(transformation.getMatrix()))
if (e.getValue().cullFace == null || !TRSRTransformation.isInteger(transformation.getMatrixVec()))
{
builder.addGeneralQuad(ModelBlock.makeBakedQuad(part, e.getValue(), textureatlassprite1, e.getKey(), transformation, uvLocked));
}
@@ -510,12 +510,12 @@ public final class ModelLoader extends ModelBakery
}
}
return new PerspectiveMapWrapper(builder.makeBakedModel(), perState)
return new PerspectiveMapWrapper(builder.build(), perState)
{
private final ItemOverrideList overrides = new AnimationItemOverrideList(VanillaModelWrapper.this, modelState, format, bakedTextureGetter, super.getOverrides());
@Override
public List<BakedQuad> func_200117_a(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
{
if(state instanceof IExtendedBlockState)
{
@@ -526,11 +526,11 @@ public final class ModelLoader extends ModelBakery
IExtendedBlockState newExState = (IExtendedBlockState) exState.withProperty(Properties.AnimationProperty, null);
if(newState != null)
{
return VanillaModelWrapper.this.bake(modelGetter, bakedTextureGetter, new ModelStateComposition(modelState, newState), uvlock, format).func_200117_a(newExState, side, rand);
return VanillaModelWrapper.this.bake(modelGetter, bakedTextureGetter, new ModelStateComposition(modelState, newState), uvlock, format).getQuads(newExState, side, rand);
}
}
}
return super.func_200117_a(state, side, rand);
return super.getQuads(state, side, rand);
}
@Override
@@ -675,7 +675,7 @@ public final class ModelLoader extends ModelBakery
ModelLoaderRegistry.getModelOrMissing(location);
}
//FMLLog.getLogger().error("Exception resolving indirect dependencies for model" + loc, e);
textures.addAll(model.func_209559_a(ModelLoader.defaultModelGetter(), new HashSet<>())); // Kick this, just in case.
textures.addAll(model.getTextures(ModelLoader.defaultModelGetter(), new HashSet<>())); // Kick this, just in case.
models.add(model);
@@ -703,15 +703,15 @@ public final class ModelLoader extends ModelBakery
this.models = models;
this.defaultState = defaultState;
}
@Override
public Collection<ResourceLocation> getOverrideLocations()
public Collection<ResourceLocation> getOverrideLocations()
{
return ImmutableList.copyOf(locations);
}
@Override
public Collection<ResourceLocation> func_209559_a(Function<ResourceLocation, IUnbakedModel> p_209559_1_, Set<String> p_209559_2_)
public Collection<ResourceLocation> getTextures(Function<ResourceLocation, IUnbakedModel> modelGetter, Set<String> missingTextureErrors)
{
return ImmutableSet.copyOf(textures);
}
@@ -734,7 +734,7 @@ public final class ModelLoader extends ModelBakery
IUnbakedModel model = models.get(i);
builder.add(model.bake(modelGetter, bakedTextureGetter, MultiModelState.getPartState(state, model, i), uvlock, format), variants.get(i).getWeight());
}
return builder.func_209614_a();
return builder.build();
}
@Override
@@ -757,7 +757,7 @@ public final class ModelLoader extends ModelBakery
for(int i = 0; i < this.variants.size(); i++)
{
IUnbakedModel retextured = this.models.get(i).retexture(textures);
modelTextures.addAll(retextured.func_209559_a(ModelLoader.defaultModelGetter(), new HashSet<>()));
modelTextures.addAll(retextured.getTextures(ModelLoader.defaultModelGetter(), new HashSet<>()));
retexturedModels.add(retextured);
builder.add(Pair.of(retextured, this.variants.get(i).getState()));
}
@@ -850,7 +850,7 @@ public final class ModelLoader extends ModelBakery
// NOOP, handled in loader
@Override
public void func_195410_a(IResourceManager resourceManager) {}
public void onResourceManagerReload(IResourceManager resourceManager) {}
@Override
public boolean accepts(ResourceLocation modelLocation)
@@ -887,17 +887,17 @@ public final class ModelLoader extends ModelBakery
return "VanillaLoader.INSTANCE";
}
}
// Temporary to compile things
public static final class White {
public static final ResourceLocation LOCATION = new ResourceLocation("white");
public static final TextureAtlasSprite INSTANCE = MissingTextureSprite.func_195677_a();
public static final ResourceLocation LOCATION = new ResourceLocation("white");
public static final TextureAtlasSprite INSTANCE = MissingTextureSprite.getSprite();
}
/**
* 16x16 pure white sprite.
*/
/*/ TODO Custom TAS
/*/ TODO Custom TAS
public static final class White extends TextureAtlasSprite
{
public static final ResourceLocation LOCATION = new ResourceLocation("white");
@@ -955,7 +955,7 @@ public final class ModelLoader extends ModelBakery
*/
public void onPostBakeEvent(IRegistry<ModelResourceLocation, IBakedModel> modelRegistry)
{
IBakedModel missingModel = modelRegistry.getObject(MODEL_MISSING);
IBakedModel missingModel = modelRegistry.get(MODEL_MISSING);
for(Map.Entry<ResourceLocation, Exception> entry : loadingExceptions.entrySet())
{
// ignoring pure ResourceLocation arguments, all things we care about pass ModelResourceLocation
@@ -963,23 +963,23 @@ public final class ModelLoader extends ModelBakery
{
LOGGER.debug(MODELLOADING, ()-> new ModelLoaderErrorMessage((ModelResourceLocation)entry.getKey(), entry.getValue()));
final ModelResourceLocation location = (ModelResourceLocation)entry.getKey();
final IBakedModel model = modelRegistry.getObject(location);
final IBakedModel model = modelRegistry.get(location);
if(model == null)
{
modelRegistry.putObject(location, missingModel);
modelRegistry.put(location, missingModel);
}
}
}
for(ModelResourceLocation missing : missingVariants)
{
IBakedModel model = modelRegistry.getObject(missing);
IBakedModel model = modelRegistry.get(missing);
if(model == null || model == missingModel)
{
LOGGER.debug(MODELLOADING, ()-> new ModelLoaderErrorMessage(missing, null));
}
if(model == null)
{
modelRegistry.putObject(missing, missingModel);
modelRegistry.put(missing, missingModel);
}
}
loadingExceptions.clear();
@@ -1047,7 +1047,7 @@ public final class ModelLoader extends ModelBakery
{
for (Entry<Pair<IRegistryDelegate<Item>, Integer>, ModelResourceLocation> e : customModels.entrySet())
{
mesher.func_199311_a(e.getKey().getLeft().get(), e.getValue());
mesher.register(e.getKey().getLeft().get(), e.getValue());
}
}
*/
@@ -1058,10 +1058,10 @@ public final class ModelLoader extends ModelBakery
@Override
public TextureAtlasSprite apply(ResourceLocation location)
{
return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(location.toString());
return Minecraft.getInstance().getTextureMap().getAtlasSprite(location.toString());
}
}
private static final Function<ResourceLocation, IUnbakedModel> DEFAULT_MODEL_GETTER = ModelLoaderRegistry::getModelOrMissing;
/**
@@ -1071,10 +1071,10 @@ public final class ModelLoader extends ModelBakery
{
return DefaultTextureGetter.INSTANCE;
}
public static Function<ResourceLocation, IUnbakedModel> defaultModelGetter()
{
return DEFAULT_MODEL_GETTER;
return DEFAULT_MODEL_GETTER;
}
protected static enum VariantLoader implements ICustomModelLoader
@@ -1090,7 +1090,7 @@ public final class ModelLoader extends ModelBakery
// NOOP, handled in loader
@Override
public void func_195410_a(IResourceManager resourceManager) {}
public void onResourceManagerReload(IResourceManager resourceManager) {}
@Override
public boolean accepts(ResourceLocation modelLocation)
@@ -1101,7 +1101,7 @@ public final class ModelLoader extends ModelBakery
@Override
public IUnbakedModel loadModel(ResourceLocation modelLocation) throws Exception
{
return loader.func_209597_a(modelLocation);
return loader.getUnbakedModel(modelLocation);
}
@Override
@@ -79,7 +79,7 @@ public class ModelLoaderRegistry
public static void registerLoader(ICustomModelLoader loader)
{
loaders.add(loader);
((IReloadableResourceManager) Minecraft.getMinecraft().func_195551_G()).func_199006_a(loader);
((IReloadableResourceManager) Minecraft.getInstance().getResourceManager()).addReloadListener(loader);
}
public static boolean loaded(ResourceLocation location)
@@ -174,7 +174,7 @@ public class ModelLoaderRegistry
{
throw new LoaderException(String.format("Loader %s returned null while loading model %s", accepted, location));
}
textures.addAll(model.func_209559_a(ModelLoader.defaultModelGetter(), new HashSet<>()));
textures.addAll(model.getTextures(ModelLoader.defaultModelGetter(), new HashSet<>()));
}
finally
{
@@ -237,7 +237,7 @@ public class ModelLoaderRegistry
{
//IModel model = new FancyMissingModel(ExceptionUtils.getStackTrace(cause).replaceAll("\\t", " "));
IUnbakedModel model = new FancyMissingModel(getMissingModel(), location.toString());
textures.addAll(model.func_209559_a(null, null));
textures.addAll(model.getTextures(null, null));
return model;
}
@@ -77,7 +77,7 @@ public final class MultiLayerModel implements IUnbakedModel
}
@Override
public Collection<ResourceLocation> func_209559_a(Function<ResourceLocation, IUnbakedModel> p_209559_1_, Set<String> p_209559_2_)
public Collection<ResourceLocation> getTextures(Function<ResourceLocation, IUnbakedModel> modelGetter, Set<String> missingTextureErrors)
{
return Collections.emptyList();
}
@@ -154,7 +154,7 @@ public final class MultiLayerModel implements IUnbakedModel
}
@Override
public List<BakedQuad> func_200117_a(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
{
BlockRenderLayer layer = MinecraftForgeClient.getRenderLayer();
if (layer == null)
@@ -162,12 +162,12 @@ public final class MultiLayerModel implements IUnbakedModel
ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
for (IBakedModel model : models.values())
{
builder.addAll(model.func_200117_a(state, side, rand));
builder.addAll(model.getQuads(state, side, rand));
}
return builder.build();
}
// assumes that child model will handle this state properly. FIXME?
return models.getOrDefault(Optional.of(layer), missing).func_200117_a(state, side, rand);
return models.getOrDefault(Optional.of(layer), missing).getQuads(state, side, rand);
}
@Override
@@ -209,7 +209,7 @@ public final class MultiLayerModel implements IUnbakedModel
@Override
public ItemOverrideList getOverrides()
{
return ItemOverrideList.NONE;
return ItemOverrideList.EMPTY;
}
}
@@ -218,7 +218,7 @@ public final class MultiLayerModel implements IUnbakedModel
INSTANCE;
@Override
public void func_195410_a(IResourceManager resourceManager) {}
public void onResourceManagerReload(IResourceManager resourceManager) {}
@Override
public boolean accepts(ResourceLocation modelLocation)
@@ -63,7 +63,7 @@ import com.google.common.collect.Sets;
public final class MultiModel implements IUnbakedModel
{
private static final Logger LOGGER = LogManager.getLogger();
private static final class Baked implements IBakedModel
{
private final ResourceLocation location;
@@ -76,7 +76,7 @@ public final class MultiModel implements IUnbakedModel
private final ItemOverrideList overrides = new ItemOverrideList()
{
@Override
public IBakedModel func_209581_a(IBakedModel originalModel, ItemStack stack, @Nullable World world, @Nullable EntityLivingBase entity)
public IBakedModel getModelWithOverrides(IBakedModel originalModel, ItemStack stack, @Nullable World world, @Nullable EntityLivingBase entity)
{
if(originalModel != Baked.this)
{
@@ -87,7 +87,7 @@ public final class MultiModel implements IUnbakedModel
if(base != null)
{
newBase = base.getOverrides().func_209581_a(base, stack, world, entity);
newBase = base.getOverrides().getModelWithOverrides(base, stack, world, entity);
if(base != newBase)
{
dirty = true;
@@ -96,7 +96,7 @@ public final class MultiModel implements IUnbakedModel
ImmutableMap.Builder<String, IBakedModel> builder = ImmutableMap.builder();
for(Map.Entry<String, IBakedModel> entry : parts.entrySet())
{
IBakedModel newPart = entry.getValue().getOverrides().func_209581_a(entry.getValue(), stack, world, entity);
IBakedModel newPart = entry.getValue().getOverrides().getModelWithOverrides(entry.getValue(), stack, world, entity);
builder.put(entry.getKey(), newPart);
if(entry.getValue() != newPart)
{
@@ -188,16 +188,16 @@ public final class MultiModel implements IUnbakedModel
}
@Override
public List<BakedQuad> func_200117_a(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
{
ImmutableList.Builder<BakedQuad> quads = ImmutableList.builder();
if (base != null)
{
quads.addAll(base.func_200117_a(state, side, rand));
quads.addAll(base.getQuads(state, side, rand));
}
for (IBakedModel bakedPart : parts.values())
{
quads.addAll(bakedPart.func_200117_a(state, side, rand));
quads.addAll(bakedPart.getQuads(state, side, rand));
}
return quads.build();
}
@@ -207,7 +207,7 @@ public final class MultiModel implements IUnbakedModel
{
Pair<Baked, TRSRTransformation> p = transforms.get(cameraTransformType);
if (p == null) return Pair.of(this, null);
return Pair.of(p.getLeft(), p.getRight().getMatrix());
return Pair.of(p.getLeft(), p.getRight().getMatrixVec());
}
@Override
@@ -247,9 +247,9 @@ public final class MultiModel implements IUnbakedModel
{
this(location, base, ImmutableMap.copyOf(parts));
}
@Override
public Collection<ResourceLocation> getOverrideLocations()
public Collection<ResourceLocation> getOverrideLocations()
{
Set<ResourceLocation> deps = Sets.newHashSet();
@@ -261,17 +261,17 @@ public final class MultiModel implements IUnbakedModel
return deps;
}
@Override
public Collection<ResourceLocation> func_209559_a(Function<ResourceLocation, IUnbakedModel> modelGetter, Set<String> missingTextures)
public Collection<ResourceLocation> getTextures(Function<ResourceLocation, IUnbakedModel> modelGetter, Set<String> missingTextures)
{
Set<ResourceLocation> deps = Sets.newHashSet();
if (base != null)
deps.addAll(base.func_209559_a(modelGetter, missingTextures));
deps.addAll(base.getTextures(modelGetter, missingTextures));
for (Pair<IUnbakedModel, IModelState> pair : parts.values())
deps.addAll(pair.getLeft().func_209559_a(modelGetter, missingTextures));
deps.addAll(pair.getLeft().getTextures(modelGetter, missingTextures));
return deps;
}
@@ -88,7 +88,7 @@ public class PerspectiveMapWrapper implements IBakedModel
TRSRTransformation tr = transforms.getOrDefault(cameraTransformType, TRSRTransformation.identity());
if (!tr.isIdentity())
{
return Pair.of(model, TRSRTransformation.blockCornerToCenter(tr).getMatrix());
return Pair.of(model, TRSRTransformation.blockCornerToCenter(tr).getMatrixVec());
}
return Pair.of(model, null);
}
@@ -98,7 +98,7 @@ public class PerspectiveMapWrapper implements IBakedModel
TRSRTransformation tr = state.apply(Optional.of(cameraTransformType)).orElse(TRSRTransformation.identity());
if (!tr.isIdentity())
{
return Pair.of(model, TRSRTransformation.blockCornerToCenter(tr).getMatrix());
return Pair.of(model, TRSRTransformation.blockCornerToCenter(tr).getMatrixVec());
}
return Pair.of(model, null);
}
@@ -110,7 +110,7 @@ public class PerspectiveMapWrapper implements IBakedModel
@Override public TextureAtlasSprite getParticleTexture() { return parent.getParticleTexture(); }
@SuppressWarnings("deprecation")
@Override public ItemCameraTransforms getItemCameraTransforms() { return parent.getItemCameraTransforms(); }
@Override public List<BakedQuad> func_200117_a(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand) { return parent.func_200117_a(state, side, rand); }
@Override public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand) { return parent.getQuads(state, side, rand); }
@Override public ItemOverrideList getOverrides() { return parent.getOverrides(); }
@Override
@@ -47,10 +47,10 @@ public enum Animation
{
if (worldRef == null || worldRef.get() != world)
{
epochTime = world.getTotalWorldTime();
epochTime = world.getGameTime();
worldRef = new WeakReference<>(world);
}
return (world.getTotalWorldTime() - epochTime + tickProgress) / 20;
return (world.getGameTime() - epochTime + tickProgress) / 20;
}
/**
@@ -65,7 +65,7 @@ public final class AnimationItemOverrideList extends ItemOverrideList
}
@Override
public IBakedModel func_209581_a(IBakedModel originalModel, ItemStack stack, @Nullable World world, @Nullable EntityLivingBase entity)
public IBakedModel getModelWithOverrides(IBakedModel originalModel, ItemStack stack, @Nullable World world, @Nullable EntityLivingBase entity)
{
return stack.getCapability(CapabilityAnimation.ANIMATION_CAPABILITY, null)
.map(asm ->
@@ -78,12 +78,12 @@ public final class AnimationItemOverrideList extends ItemOverrideList
}
if(world == null)
{
w = Minecraft.getMinecraft().world;
w = Minecraft.getInstance().world;
}
return asm.apply(Animation.getWorldTime(world, Animation.getPartialTickTime())).getLeft();
})
// TODO where should uvlock data come from?
.map(state -> model.bake(ModelLoader.defaultModelGetter(), bakedTextureGetter, new ModelStateComposition(state, this.state), false, format))
.orElseGet(() -> super.func_209581_a(originalModel, stack, world, entity));
.orElseGet(() -> super.getModelWithOverrides(originalModel, stack, world, entity));
}
}
@@ -82,7 +82,7 @@ public class AnimationModelBase<T extends Entity> extends ModelBase implements I
RenderHelper.disableStandardItemLighting();
GlStateManager.pushMatrix();
GlStateManager.rotate(180, 0, 0, 1);
GlStateManager.rotatef(180, 0, 0, 1);
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder builder = tessellator.getBuffer();
builder.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
@@ -95,7 +95,7 @@ public class AnimationModelBase<T extends Entity> extends ModelBase implements I
boolean empty = true;
Random random = new Random();
random.setSeed(42);
List<BakedQuad> quads = bakedModel.func_200117_a(null, null, random);
List<BakedQuad> quads = bakedModel.getQuads(null, null, random);
if(!quads.isEmpty())
{
lighter.updateBlockInfo();
@@ -108,7 +108,7 @@ public class AnimationModelBase<T extends Entity> extends ModelBase implements I
for(EnumFacing side : EnumFacing.values())
{
random.setSeed(42);
quads = bakedModel.func_200117_a(null, side, random);
quads = bakedModel.getQuads(null, side, random);
if(!quads.isEmpty())
{
if(empty) lighter.updateBlockInfo();
@@ -56,13 +56,13 @@ public class AnimationTESR<T extends TileEntity> extends FastTESR<T> implements
{
return;
}
if(blockRenderer == null) blockRenderer = Minecraft.getMinecraft().getBlockRendererDispatcher();
if(blockRenderer == null) blockRenderer = Minecraft.getInstance().getBlockRendererDispatcher();
BlockPos pos = te.getPos();
IWorldReader world = MinecraftForgeClient.getRegionRenderCache(te.getWorld(), pos);
IBlockState state = world.getBlockState(pos);
if(state.getBlock().getBlockState().getProperties().contains(Properties.StaticProperty))
if(state.getBlock().getStateContainer().getProperties().contains(Properties.StaticProperty))
{
state = state.func_206870_a(Properties.StaticProperty, false);
state = state.with(Properties.StaticProperty, false);
}
if(state instanceof IExtendedBlockState)
{
@@ -76,12 +76,12 @@ public class AnimationTESR<T extends TileEntity> extends FastTESR<T> implements
handleEvents(te, time, pair.getRight());
// TODO: caching?
IBakedModel model = blockRenderer.getBlockModelShapes().getModelForState(exState.getClean());
IBakedModel model = blockRenderer.getBlockModelShapes().getModel(exState.getClean());
IExtendedBlockState animState = (IExtendedBlockState) exState.withProperty(Properties.AnimationProperty, pair.getLeft());
renderer.setTranslation(x - pos.getX(), y - pos.getY(), z - pos.getZ());
blockRenderer.getBlockModelRenderer().func_199324_a(world, model, animState, pos, renderer, false, new Random(), 42);
blockRenderer.getBlockModelRenderer().renderModel(world, model, animState, pos, renderer, false, new Random(), 42);
});
}
}
@@ -34,7 +34,7 @@ import net.minecraft.tileentity.TileEntity;
public abstract class FastTESR<T extends TileEntity> extends TileEntityRenderer<T>
{
@Override
public final void func_199341_a(T te, double x, double y, double z, float partialTicks, int destroyStage)
public final void render(T te, double x, double y, double z, float partialTicks, int destroyStage)
{
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder buffer = tessellator.getBuffer();
@@ -71,8 +71,8 @@ import com.google.gson.annotations.SerializedName;
public class ModelBlockAnimation
{
private static final Logger LOGGER = LogManager.getLogger();
private static final Logger LOGGER = LogManager.getLogger();
private final ImmutableMap<String, ImmutableMap<String, float[]>> joints;
private final ImmutableMap<String, MBClip> clips;
private transient ImmutableMultimap<Integer, MBJointWeight> jointIndexMap;
@@ -534,7 +534,7 @@ public class ModelBlockAnimation
if(trOp.isPresent() && !trOp.get().isIdentity())
{
float w = info.getWeights().get(i)[0];
tmp = trOp.get().getMatrix();
tmp = trOp.get().getMatrixVec();
tmp.mul(w);
m.add(tmp);
weight += w;
@@ -557,9 +557,9 @@ public class ModelBlockAnimation
{
try
{
try (IResource resource = manager.func_199002_a(armatureLocation))
try (IResource resource = manager.getResource(armatureLocation))
{
ModelBlockAnimation mba = mbaGson.fromJson(new InputStreamReader(resource.func_199027_b(), StandardCharsets.UTF_8), ModelBlockAnimation.class);
ModelBlockAnimation mba = mbaGson.fromJson(new InputStreamReader(resource.getInputStream(), StandardCharsets.UTF_8), ModelBlockAnimation.class);
//String json = mbaGson.toJson(mba);
return mba;
}
@@ -98,8 +98,8 @@ import com.google.gson.JsonParser;
public enum B3DLoader implements ICustomModelLoader
{
INSTANCE;
private static final Logger LOGGER = LogManager.getLogger();
private static final Logger LOGGER = LogManager.getLogger();
private IResourceManager manager;
@@ -112,7 +112,7 @@ public enum B3DLoader implements ICustomModelLoader
}
@Override
public void func_195410_a(IResourceManager manager)
public void onResourceManagerReload(IResourceManager manager)
{
this.manager = manager;
cache.clear();
@@ -136,17 +136,17 @@ public enum B3DLoader implements ICustomModelLoader
{
try
{
resource = manager.func_199002_a(file);
resource = manager.getResource(file);
}
catch(FileNotFoundException e)
{
if(modelLocation.getPath().startsWith("models/block/"))
resource = manager.func_199002_a(new ResourceLocation(file.getNamespace(), "models/item/" + file.getPath().substring("models/block/".length())));
resource = manager.getResource(new ResourceLocation(file.getNamespace(), "models/item/" + file.getPath().substring("models/block/".length())));
else if(modelLocation.getPath().startsWith("models/item/"))
resource = manager.func_199002_a(new ResourceLocation(file.getNamespace(), "models/block/" + file.getPath().substring("models/item/".length())));
resource = manager.getResource(new ResourceLocation(file.getNamespace(), "models/block/" + file.getPath().substring("models/item/".length())));
else throw e;
}
B3DModel.Parser parser = new B3DModel.Parser(resource.func_199027_b());
B3DModel.Parser parser = new B3DModel.Parser(resource.getInputStream());
B3DModel model = parser.parse();
cache.put(file, model);
}
@@ -365,7 +365,7 @@ public enum B3DLoader implements ICustomModelLoader
@Override
public TRSRTransformation getInvBindPose()
{
Matrix4f m = new TRSRTransformation(node.getPos(), node.getRot(), node.getScale(), null).getMatrix();
Matrix4f m = new TRSRTransformation(node.getPos(), node.getRot(), node.getScale(), null).getMatrixVec();
m.invert();
TRSRTransformation pose = new TRSRTransformation(m);
@@ -452,17 +452,17 @@ public enum B3DLoader implements ICustomModelLoader
if(path.endsWith(".png")) path = path.substring(0, path.length() - ".png".length());
return path;
}
@Override
public Collection<ResourceLocation> func_209559_a(Function<ResourceLocation, IUnbakedModel> p_209559_1_, Set<String> p_209559_2_)
public Collection<ResourceLocation> getTextures(Function<ResourceLocation, IUnbakedModel> modelGetter, Set<String> missingTextureErrors)
{
return Collections2.filter(textures.values(), loc -> !loc.getPath().startsWith("#"));
}
@Override
public Collection<ResourceLocation> getOverrideLocations()
public Collection<ResourceLocation> getOverrideLocations()
{
return Collections.emptyList();
return Collections.emptyList();
}
@Override
@@ -647,7 +647,7 @@ public enum B3DLoader implements ICustomModelLoader
}
@Override
public List<BakedQuad> func_200117_a(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
{
if(side != null) return ImmutableList.of();
IModelState modelState = this.state;
@@ -723,7 +723,7 @@ public enum B3DLoader implements ICustomModelLoader
@Override
public Matrix4f apply(Node<?> node)
{
return global.compose(localCache.getUnchecked(node)).getMatrix();
return global.compose(localCache.getUnchecked(node)).getMatrixVec();
}
});
for(Face f : faces)
@@ -834,7 +834,7 @@ public enum B3DLoader implements ICustomModelLoader
public ItemOverrideList getOverrides()
{
// TODO handle items
return ItemOverrideList.NONE;
return ItemOverrideList.EMPTY;
}
}
}
@@ -58,7 +58,7 @@ public enum OBJLoader implements ICustomModelLoader {
}
@Override
public void func_195410_a(IResourceManager resourceManager)
public void onResourceManagerReload(IResourceManager resourceManager)
{
this.manager = resourceManager;
cache.clear();
@@ -82,14 +82,14 @@ public enum OBJLoader implements ICustomModelLoader {
{
try
{
resource = manager.func_199002_a(file);
resource = manager.getResource(file);
}
catch (FileNotFoundException e)
{
if (modelLocation.getPath().startsWith("models/block/"))
resource = manager.func_199002_a(new ResourceLocation(file.getNamespace(), "models/item/" + file.getPath().substring("models/block/".length())));
resource = manager.getResource(new ResourceLocation(file.getNamespace(), "models/item/" + file.getPath().substring("models/block/".length())));
else if (modelLocation.getPath().startsWith("models/item/"))
resource = manager.func_199002_a(new ResourceLocation(file.getNamespace(), "models/block/" + file.getPath().substring("models/item/".length())));
resource = manager.getResource(new ResourceLocation(file.getNamespace(), "models/block/" + file.getPath().substring("models/item/".length())));
else throw e;
}
OBJModel.Parser parser = new OBJModel.Parser(resource, manager);
@@ -83,8 +83,8 @@ import com.google.common.collect.Maps;
public class OBJModel implements IUnbakedModel
{
private static final Logger LOGGER = LogManager.getLogger();
private static final Logger LOGGER = LogManager.getLogger();
//private Gson GSON = new GsonBuilder().create();
private MaterialLibrary matLib;
private final ResourceLocation modelLocation;
@@ -103,7 +103,7 @@ public class OBJModel implements IUnbakedModel
}
@Override
public Collection<ResourceLocation> func_209559_a(Function<ResourceLocation, IUnbakedModel> p_209559_1_, Set<String> p_209559_2_)
public Collection<ResourceLocation> getTextures(Function<ResourceLocation, IUnbakedModel> modelGetter, Set<String> missingTextureErrors)
{
Iterator<Material> materialIterator = this.matLib.materials.values().iterator();
List<ResourceLocation> textures = Lists.newArrayList();
@@ -116,11 +116,11 @@ public class OBJModel implements IUnbakedModel
}
return textures;
}
@Override
public Collection<ResourceLocation> getOverrideLocations()
public Collection<ResourceLocation> getOverrideLocations()
{
return Collections.emptyList();
return Collections.emptyList();
}
@Override
@@ -216,8 +216,8 @@ public class OBJModel implements IUnbakedModel
public Parser(IResource from, IResourceManager manager) throws IOException
{
this.manager = manager;
this.objFrom = from.func_199029_a();
this.objStream = new InputStreamReader(from.func_199027_b(), StandardCharsets.UTF_8);
this.objFrom = from.getLocation();
this.objStream = new InputStreamReader(from.getInputStream(), StandardCharsets.UTF_8);
this.objReader = new BufferedReader(objStream);
}
@@ -517,7 +517,7 @@ public class OBJModel implements IUnbakedModel
String domain = from.getNamespace();
if (!path.contains("/"))
path = from.getPath().substring(0, from.getPath().lastIndexOf("/") + 1) + path;
mtlStream = new InputStreamReader(manager.func_199002_a(new ResourceLocation(domain, path)).func_199027_b(), StandardCharsets.UTF_8);
mtlStream = new InputStreamReader(manager.getResource(new ResourceLocation(domain, path)).getInputStream(), StandardCharsets.UTF_8);
mtlReader = new BufferedReader(mtlStream);
String currentLine = "";
@@ -857,7 +857,7 @@ public class OBJModel implements IUnbakedModel
public Face bake(TRSRTransformation transform)
{
Matrix4f m = transform.getMatrix();
Matrix4f m = transform.getMatrixVec();
Matrix3f mn = null;
Vertex[] vertices = new Vertex[verts.length];
// Normal[] normals = norms != null ? new Normal[norms.length] : null;
@@ -1318,7 +1318,7 @@ public class OBJModel implements IUnbakedModel
// FIXME: merge with getQuads
@Override
public List<BakedQuad> func_200117_a(IBlockState blockState, EnumFacing side, Random rand)
public List<BakedQuad> getQuads(IBlockState blockState, EnumFacing side, Random rand)
{
if (side != null) return ImmutableList.of();
if (quads == null)
@@ -1598,7 +1598,7 @@ public class OBJModel implements IUnbakedModel
@Override
public ItemOverrideList getOverrides()
{
return ItemOverrideList.NONE;
return ItemOverrideList.EMPTY;
}
}
@@ -60,7 +60,7 @@ public class BlockInfo
{
if(cachedTint == tint) return cachedMultiplier;
cachedTint = tint;
cachedMultiplier = colors.colorMultiplier(state, world, blockPos, tint);
cachedMultiplier = colors.getColor(state, world, blockPos, tint);
return cachedMultiplier;
}
@@ -52,7 +52,7 @@ public class ForgeBlockModelRenderer extends BlockModelRenderer
}
@Override
public boolean func_199325_c(IWorldReader world, IBakedModel model, IBlockState state, BlockPos pos, BufferBuilder buffer, boolean checkSides, Random rand, long seed)
public boolean renderModelFlat(IWorldReader world, IBakedModel model, IBlockState state, BlockPos pos, BufferBuilder buffer, boolean checkSides, Random rand, long seed)
{
if(ForgeMod.forgeLightPipelineEnabled)
{
@@ -68,12 +68,12 @@ public class ForgeBlockModelRenderer extends BlockModelRenderer
}
else
{
return super.func_199325_c(world, model, state, pos, buffer, checkSides, rand, seed);
return super.renderModelFlat(world, model, state, pos, buffer, checkSides, rand, seed);
}
}
@Override
public boolean func_199326_b(IWorldReader world, IBakedModel model, IBlockState state, BlockPos pos, BufferBuilder buffer, boolean checkSides, Random rand, long seed)
public boolean renderModelSmooth(IWorldReader world, IBakedModel model, IBlockState state, BlockPos pos, BufferBuilder buffer, boolean checkSides, Random rand, long seed)
{
if(ForgeMod.forgeLightPipelineEnabled)
{
@@ -89,7 +89,7 @@ public class ForgeBlockModelRenderer extends BlockModelRenderer
}
else
{
return super.func_199326_b(world, model, state, pos, buffer, checkSides, rand, seed);
return super.renderModelSmooth(world, model, state, pos, buffer, checkSides, rand, seed);
}
}
@@ -99,7 +99,7 @@ public class ForgeBlockModelRenderer extends BlockModelRenderer
lighter.setState(state);
lighter.setBlockPos(pos);
boolean empty = true;
List<BakedQuad> quads = model.func_200117_a(state, null, rand);
List<BakedQuad> quads = model.getQuads(state, null, rand);
if(!quads.isEmpty())
{
lighter.updateBlockInfo();
@@ -111,7 +111,7 @@ public class ForgeBlockModelRenderer extends BlockModelRenderer
}
for(EnumFacing side : EnumFacing.values())
{
quads = model.func_200117_a(state, side, rand);
quads = model.getQuads(state, side, rand);
if(!quads.isEmpty())
{
if(!checkSides || Block.shouldSideBeRendered(state, world, pos, side))
@@ -43,4 +43,4 @@ public abstract class TransformerConsumer implements IVertexConsumer {
}
protected abstract float[] transform(int element, float... data);
}
}
@@ -180,8 +180,8 @@ public class UnpackedBakedQuad extends BakedQuad
}
if(contractUVs)
{
float tX = texture.getIconWidth() / (texture.getMaxU() - texture.getMinU());
float tY = texture.getIconHeight() / (texture.getMaxV() - texture.getMinV());
float tX = texture.getWidth() / (texture.getMaxU() - texture.getMinU());
float tY = texture.getHeight() / (texture.getMaxV() - texture.getMinV());
float tS = tX > tY ? tX : tY;
float ep = 1f / (tS * 0x100);
int uve = 0;
@@ -235,4 +235,4 @@ public class UnpackedBakedQuad extends BakedQuad
return new UnpackedBakedQuad(unpackedData, tint, orientation, texture, applyDiffuseLighting, format);
}
}
}
}
@@ -109,7 +109,7 @@ public class VertexLighterFlat extends QuadGatheringTransformer
private static VertexFormat withNormal(VertexFormat format)
{
if (format == null || format.func_207751_b()) return format;
if (format == null || format.hasNormal()) return format;
return new VertexFormat(format).addElement(NORMAL_4F);
}
@@ -27,7 +27,7 @@ import net.minecraft.resources.IResourceManagerReloadListener;
public interface ISelectiveResourceReloadListener extends IResourceManagerReloadListener
{
@Override
default void func_195410_a(IResourceManager resourceManager)
default void onResourceManagerReload(IResourceManager resourceManager)
{
// For compatibility, call the selective version from the non-selective function
onResourceManagerReload(resourceManager, SelectiveReloadStateHandler.INSTANCE.get());
@@ -49,7 +49,7 @@ public enum KeyConflictContext implements IKeyConflictContext
@Override
public boolean isActive()
{
return Minecraft.getMinecraft().currentScreen != null;
return Minecraft.getInstance().currentScreen != null;
}
@Override
@@ -33,7 +33,7 @@ public enum KeyModifier {
@Override
public boolean matches(InputMappings.Input key)
{
int keyCode = key.func_197937_c();
int keyCode = key.getKeyCode();
if (Minecraft.IS_RUNNING_ON_MAC)
{
return keyCode == GLFW.GLFW_KEY_LEFT_ALT || keyCode == GLFW.GLFW_KEY_RIGHT_ALT;
@@ -59,7 +59,7 @@ public enum KeyModifier {
@Override
public String getLocalizedComboName(InputMappings.Input key)
{
String keyName = key.func_197936_a();
String keyName = key.getName();
String localizationFormatKey = Minecraft.IS_RUNNING_ON_MAC ? "forge.controlsgui.control.mac" : "forge.controlsgui.control";
return I18n.format(localizationFormatKey, keyName);
}
@@ -68,7 +68,7 @@ public enum KeyModifier {
@Override
public boolean matches(InputMappings.Input key)
{
return key.func_197937_c() == GLFW.GLFW_KEY_LEFT_SHIFT || key.func_197937_c() == GLFW.GLFW_KEY_RIGHT_SHIFT;
return key.getKeyCode() == GLFW.GLFW_KEY_LEFT_SHIFT || key.getKeyCode() == GLFW.GLFW_KEY_RIGHT_SHIFT;
}
@Override
@@ -86,14 +86,14 @@ public enum KeyModifier {
@Override
public String getLocalizedComboName(InputMappings.Input key)
{
return I18n.format("forge.controlsgui.shift", key.func_197936_a());
return I18n.format("forge.controlsgui.shift", key.getName());
}
},
ALT {
@Override
public boolean matches(InputMappings.Input key)
{
return key.func_197937_c() == GLFW.GLFW_KEY_LEFT_ALT || key.func_197937_c() == GLFW.GLFW_KEY_RIGHT_ALT;
return key.getKeyCode() == GLFW.GLFW_KEY_LEFT_ALT || key.getKeyCode() == GLFW.GLFW_KEY_RIGHT_ALT;
}
@Override
@@ -111,7 +111,7 @@ public enum KeyModifier {
@Override
public String getLocalizedComboName(InputMappings.Input keyCode)
{
return I18n.format("forge.controlsgui.alt", keyCode.func_197936_a());
return I18n.format("forge.controlsgui.alt", keyCode.getName());
}
},
NONE {
@@ -146,7 +146,7 @@ public enum KeyModifier {
@Override
public String getLocalizedComboName(InputMappings.Input key)
{
return key.func_197936_a();
return key.getName();
}
};