|
24 | 24 | import net.fabricmc.api.EnvType;
|
25 | 25 | import net.fabricmc.api.Environment;
|
26 | 26 | import net.minecraft.client.MinecraftClient;
|
| 27 | +import net.minecraft.client.gui.GuiGraphics; |
27 | 28 | import net.minecraft.client.gui.screen.ingame.HandledScreen;
|
28 | 29 | import net.minecraft.client.gui.screen.ingame.InventoryScreen;
|
29 | 30 | import net.minecraft.client.gui.widget.TexturedButtonWidget;
|
30 | 31 | import net.minecraft.client.render.GameRenderer;
|
31 | 32 | import net.minecraft.client.sound.PositionedSoundInstance;
|
32 | 33 | import net.minecraft.client.sound.SoundManager;
|
33 |
| -import net.minecraft.client.util.math.MatrixStack; |
34 | 34 | import net.minecraft.entity.player.PlayerInventory;
|
35 | 35 | import net.minecraft.inventory.Inventory;
|
36 | 36 | import net.minecraft.inventory.InventoryChangedListener;
|
@@ -137,43 +137,43 @@ public boolean mouseScrolled(double mouseX, double mouseY, double amount) {
|
137 | 137 | /* Rendering */
|
138 | 138 |
|
139 | 139 | @Override
|
140 |
| - protected void drawBackground(MatrixStack matrices, float delta, int mouseX, int mouseY) { |
| 140 | + protected void drawBackground(GuiGraphics graphics, float delta, int mouseX, int mouseY) { |
141 | 141 | RenderSystem.setShader(GameRenderer::getPositionTexShader);
|
142 | 142 | RenderSystem.setShaderColor(1.f, 1.f, 1.f, 1.f);
|
143 |
| - RenderSystem.setShaderTexture(0, TEXTURE); |
144 | 143 | int x = (this.width - this.backgroundWidth) / 2;
|
145 | 144 | int y = (this.height - this.backgroundHeight) / 2;
|
146 |
| - this.drawTexture(matrices, x, y, 0, 0, this.backgroundWidth, this.backgroundHeight); |
| 145 | + graphics.drawTexture(TEXTURE, x, y, 0, 0, this.backgroundWidth, this.backgroundHeight); |
147 | 146 |
|
148 | 147 | if (this.entity.canBeSaddled()) {
|
149 |
| - this.drawTexture(matrices, x + 7 + 18, y + 35 - 18, 18, this.backgroundHeight + 54, 18, 18); |
| 148 | + graphics.drawTexture(TEXTURE, x + 7 + 18, y + 35 - 18, 18, this.backgroundHeight + 54, 18, 18); |
150 | 149 | }
|
151 | 150 |
|
152 |
| - this.drawTexture(matrices, x + 7 + 18, y + 35, 36, this.backgroundHeight + 54, 18, 18); |
| 151 | + graphics.drawTexture(TEXTURE, x + 7 + 18, y + 35, 36, this.backgroundHeight + 54, 18, 18); |
153 | 152 |
|
154 | 153 | if (!this.entity.isBaby()) {
|
155 | 154 | for (int row = y + 17; row <= y + 35 + 18; row += 18) {
|
156 |
| - this.drawTexture(matrices, x + 7, row, 54, this.backgroundHeight + 54, 18, 18); |
| 155 | + graphics.drawTexture(TEXTURE, x + 7, row, 54, this.backgroundHeight + 54, 18, 18); |
157 | 156 | }
|
158 | 157 | }
|
159 | 158 |
|
160 | 159 | if (this.getScreenHandler().hasChests()) {
|
161 |
| - this.drawTexture(matrices, x + 98, y + 17, 0, this.backgroundHeight, 5 * 18, 54); |
| 160 | + graphics.drawTexture(TEXTURE, x + 98, y + 17, 0, this.backgroundHeight, 5 * 18, 54); |
162 | 161 | }
|
163 | 162 |
|
164 |
| - InventoryScreen.drawEntity(x + 70, y + 60, 17, |
165 |
| - (x + 51) - this.mouseX, |
166 |
| - (y + 75 - 50) - this.mouseY, |
167 |
| - this.entity); |
| 163 | + InventoryScreen.drawEntity( |
| 164 | + graphics, x + 70, y + 60, 17, |
| 165 | + (x + 51) - this.mouseX, (y + 75 - 50) - this.mouseY, |
| 166 | + this.entity |
| 167 | + ); |
168 | 168 | }
|
169 | 169 |
|
170 | 170 | @Override
|
171 |
| - public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) { |
172 |
| - this.renderBackground(matrices); |
| 171 | + public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) { |
| 172 | + this.renderBackground(graphics); |
173 | 173 | this.mouseX = mouseX;
|
174 | 174 | this.mouseY = mouseY;
|
175 |
| - super.render(matrices, mouseX, mouseY, delta); |
176 |
| - this.drawMouseoverTooltip(matrices, mouseX, mouseY); |
| 175 | + super.render(graphics, mouseX, mouseY, delta); |
| 176 | + this.drawMouseoverTooltip(graphics, mouseX, mouseY); |
177 | 177 | }
|
178 | 178 |
|
179 | 179 | private class EnderChestButton extends TexturedButtonWidget implements InventoryChangedListener {
|
|
0 commit comments