Skip to content

Commit b1154ea

Browse files
Fix all broken patches in client package
1 parent 41600e6 commit b1154ea

31 files changed

+426
-406
lines changed

patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -99,33 +99,24 @@
9999
this.mc.getTutorial().handleMovement(this.movementInput);
100100

101101
if (this.isHandActive() && !this.isRiding())
102-
@@ -912,18 +932,13 @@
102+
@@ -912,6 +932,8 @@
103103
}
104104

105105
AxisAlignedBB axisalignedbb = this.getEntityBoundingBox();
106-
- this.pushOutOfBlocks(
107-
- this.posX - (double)this.width * 0.35, axisalignedbb.minY + 0.5, this.posZ + (double)this.width * 0.35
108-
- );
109-
- this.pushOutOfBlocks(
110-
- this.posX - (double)this.width * 0.35, axisalignedbb.minY + 0.5, this.posZ - (double)this.width * 0.35
111-
- );
112-
- this.pushOutOfBlocks(
113-
- this.posX + (double)this.width * 0.35, axisalignedbb.minY + 0.5, this.posZ - (double)this.width * 0.35
114-
- );
115-
- this.pushOutOfBlocks(
116-
- this.posX + (double)this.width * 0.35, axisalignedbb.minY + 0.5, this.posZ + (double)this.width * 0.35
117-
- );
118106
+ net.minecraftforge.client.event.PlayerSPPushOutOfBlocksEvent event = new net.minecraftforge.client.event.PlayerSPPushOutOfBlocksEvent(this, axisalignedbb);
119107
+ if(!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) { axisalignedbb = event.getEntityBoundingBox();
120-
+ this.pushOutOfBlocks(this.posX - (double)this.width * 0.35D, axisalignedbb.minY + 0.5D, this.posZ + (double)this.width * 0.35D);
121-
+ this.pushOutOfBlocks(this.posX - (double)this.width * 0.35D, axisalignedbb.minY + 0.5D, this.posZ - (double)this.width * 0.35D);
122-
+ this.pushOutOfBlocks(this.posX + (double)this.width * 0.35D, axisalignedbb.minY + 0.5D, this.posZ - (double)this.width * 0.35D);
123-
+ this.pushOutOfBlocks(this.posX + (double)this.width * 0.35D, axisalignedbb.minY + 0.5D, this.posZ + (double)this.width * 0.35D);
108+
this.pushOutOfBlocks(
109+
this.posX - (double)this.width * 0.35, axisalignedbb.minY + 0.5, this.posZ + (double)this.width * 0.35
110+
);
111+
@@ -924,6 +946,7 @@
112+
this.pushOutOfBlocks(
113+
this.posX + (double)this.width * 0.35, axisalignedbb.minY + 0.5, this.posZ + (double)this.width * 0.35
114+
);
124115
+ }
125116
boolean flag4 = (float)this.getFoodStats().getFoodLevel() > 6.0F || this.capabilities.allowFlying;
126117

127118
if (this.onGround
128-
@@ -1252,5 +1267,18 @@
119+
@@ -1252,5 +1275,18 @@
129120
}
130121
}
131122
}

patches/minecraft/net/minecraft/client/gui/FontRenderer.java.patch

Lines changed: 24 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,6 @@
11
--- before/net/minecraft/client/gui/FontRenderer.java
22
+++ after/net/minecraft/client/gui/FontRenderer.java
3-
@@ -1,5 +1,6 @@
4-
package net.minecraft.client.gui;
5-
6-
+import com.cleanroommc.client.BreakIteratorHolder;
7-
import com.ibm.icu.text.ArabicShaping;
8-
import com.ibm.icu.text.ArabicShapingException;
9-
import com.ibm.icu.text.Bidi;
10-
@@ -24,6 +25,7 @@
11-
import net.minecraftforge.fml.relauncher.Side;
12-
import net.minecraftforge.fml.relauncher.SideOnly;
13-
import org.apache.commons.io.IOUtils;
14-
+import java.util.*;
15-
16-
@SideOnly(Side.CLIENT)
17-
public class FontRenderer implements IResourceManagerReloadListener
18-
@@ -56,7 +58,7 @@
3+
@@ -56,7 +56,7 @@
194
this.locationFontTexture = location;
205
this.renderEngine = textureManagerIn;
216
this.unicodeFlag = unicode;
@@ -24,7 +9,7 @@
249

2510
for (int i = 0; i < 32; i++)
2611
{
27-
@@ -107,7 +109,7 @@
12+
@@ -107,7 +107,7 @@
2813

2914
try
3015
{
@@ -33,7 +18,7 @@
3318
bufferedimage = TextureUtil.readBufferedImage(iresource.getInputStream());
3419
}
3520
catch (IOException ioexception)
36-
@@ -171,7 +173,7 @@
21+
@@ -171,7 +171,7 @@
3722

3823
try
3924
{
@@ -42,15 +27,15 @@
4227
iresource.getInputStream().read(this.glyphWidth);
4328
}
4429
catch (IOException ioexception)
45-
@@ -186,6 +188,7 @@
30+
@@ -186,6 +186,7 @@
4631

4732
private float renderChar(char ch, boolean italic)
4833
{
4934
+ if (ch == 160) return 4.0F; // forge: display nbsp as space. MC-2595
5035
if (ch == ' ')
5136
{
5237
return 4.0F;
53-
@@ -203,7 +206,7 @@
38+
@@ -203,7 +204,7 @@
5439
int i = ch % 16 * 8;
5540
int j = ch / 16 * 8;
5641
int k = italic ? 1 : 0;
@@ -59,7 +44,7 @@
5944
int l = this.charWidth[ch];
6045
float f = (float)l - 0.01F;
6146
GlStateManager.glBegin(5);
62-
@@ -231,7 +234,7 @@
47+
@@ -231,7 +232,7 @@
6348

6449
private void loadGlyphTexture(int page)
6550
{
@@ -68,7 +53,7 @@
6853
}
6954

7055
protected float renderUnicodeChar(char ch, boolean italic)
71-
@@ -280,7 +283,7 @@
56+
@@ -280,7 +281,7 @@
7257

7358
public int drawString(String text, float x, float y, int color, boolean dropShadow)
7459
{
@@ -77,7 +62,7 @@
7762
this.resetStyles();
7863
int i;
7964

80-
@@ -326,7 +329,7 @@
65+
@@ -326,7 +327,7 @@
8166
{
8267
char c0 = text.charAt(i);
8368

@@ -86,7 +71,7 @@
8671
{
8772
int i1 = "0123456789abcdefklmnor".indexOf(String.valueOf(text.charAt(i + 1)).toLowerCase(Locale.ROOT).charAt(0));
8873

89-
@@ -338,11 +341,6 @@
74+
@@ -338,11 +339,6 @@
9075
this.underlineStyle = false;
9176
this.italicStyle = false;
9277

@@ -98,7 +83,7 @@
9883
if (shadow)
9984
{
10085
i1 += 16;
101-
@@ -350,7 +348,7 @@
86+
@@ -350,7 +346,7 @@
10287

10388
int j1 = this.colorCode[i1];
10489
this.textColor = j1;
@@ -107,7 +92,7 @@
10792
}
10893
else if (i1 == 16)
10994
{
110-
@@ -379,7 +377,7 @@
95+
@@ -379,7 +375,7 @@
11196
this.strikethroughStyle = false;
11297
this.underlineStyle = false;
11398
this.italicStyle = false;
@@ -116,7 +101,7 @@
116101
}
117102

118103
i++;
119-
@@ -409,7 +407,7 @@
104+
@@ -409,7 +405,7 @@
120105
c0 = c1;
121106
}
122107

@@ -125,7 +110,7 @@
125110
boolean flag = (c0 == 0 || j == -1 || this.unicodeFlag) && shadow;
126111

127112
if (flag)
128-
@@ -447,6 +445,15 @@
113+
@@ -447,6 +443,15 @@
129114

130115
f++;
131116
}
@@ -141,7 +126,7 @@
141126

142127
if (this.strikethroughStyle)
143128
{
144-
@@ -526,7 +533,7 @@
129+
@@ -526,7 +531,7 @@
145130
this.blue = (float)(color >> 8 & 0xFF) / 255.0F;
146131
this.green = (float)(color & 0xFF) / 255.0F;
147132
this.alpha = (float)(color >> 24 & 0xFF) / 255.0F;
@@ -150,15 +135,15 @@
150135
this.posX = x;
151136
this.posY = y;
152137
this.renderStringAtPos(text, dropShadow);
153-
@@ -580,6 +587,7 @@
138+
@@ -580,6 +585,7 @@
154139

155140
public int getCharWidth(char character)
156141
{
157142
+ if (character == 160) return 4; // forge: display nbsp as space. MC-2595
158143
if (character == 167)
159144
{
160145
return -1;
161-
@@ -678,7 +686,7 @@
146+
@@ -678,7 +684,7 @@
162147

163148
private String trimStringNewline(String text)
164149
{
@@ -167,16 +152,16 @@
167152
{
168153
text = text.substring(0, text.length() - 1);
169154
}
170-
@@ -725,9 +733,96 @@
155+
@@ -725,9 +731,96 @@
171156

172157
public List<String> listFormattedStringToWidth(String str, int wrapWidth)
173158
{
174159
- return Arrays.asList(this.wrapFormattedStringToWidth(str, wrapWidth).split("\n"));
175160
+ if (str.isEmpty()){
176-
+ return Collections.singletonList("");
161+
+ return java.util.Collections.singletonList("");
177162
+ }
178-
+ BreakIteratorHolder.BREAK_ITERATOR.setText(str);
179-
+ List<String> list = new ArrayList<>();
163+
+ com.cleanroommc.client.BreakIteratorHolder.BREAK_ITERATOR.setText(str);
164+
+ List<String> list = new java.util.ArrayList<>();
180165
+ int lineWidth = 0, fed = 0, icui, d, prevFormat = 0;
181166
+ StringBuilder format = new StringBuilder(); // For next line's format since it should use format of previous line
182167
+ int[] widths = new int[str.length()];
@@ -234,10 +219,10 @@
234219
+ widths[i - fed] = lineWidth;
235220
+ formats[i - fed] = format.toString();
236221
+ if (lineWidth > wrapWidth) {
237-
+ if (BreakIteratorHolder.BREAK_ITERATOR.isBoundary(i)) {
222+
+ if (com.cleanroommc.client.BreakIteratorHolder.BREAK_ITERATOR.isBoundary(i)) {
238223
+ icui = i;
239224
+ } else {
240-
+ icui = BreakIteratorHolder.BREAK_ITERATOR.preceding(i);
225+
+ icui = com.cleanroommc.client.BreakIteratorHolder.BREAK_ITERATOR.preceding(i);
241226
+ }
242227
+ if (icui <= fed + 1 || i == icui) {
243228
+ list.add(line.substring(0,line.length() - 1));
@@ -265,15 +250,15 @@
265250
String wrapFormattedStringToWidth(String str, int wrapWidth)
266251
{
267252
int i = this.sizeStringToWidth(str, wrapWidth);
268-
@@ -746,6 +841,7 @@
253+
@@ -746,6 +839,7 @@
269254
}
270255
}
271256

272257
+ @Deprecated
273258
private int sizeStringToWidth(String str, int wrapWidth)
274259
{
275260
int i = str.length();
276-
@@ -844,6 +940,26 @@
261+
@@ -844,6 +938,26 @@
277262
public boolean getBidiFlag()
278263
{
279264
return this.bidiFlag;

patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,28 +38,20 @@
3838
}
3939

4040
this.updateDisplayState();
41-
@@ -460,6 +451,31 @@
41+
@@ -460,6 +451,23 @@
4242
@Override
4343
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException
4444
{
4545
+ if (this.btnMapType.mousePressed(this.mc, mouseX, mouseY)) {
4646
+ if (mouseButton == 1) {
47-
+ --this.selectedIndex;
4847
+
49-
+ if (this.selectedIndex < 0)
50-
+ {
51-
+ this.selectedIndex = WorldType.WORLD_TYPES.length - 1;
52-
+ }
48+
+ do {
49+
+ this.selectedIndex--;
5350
+
54-
+ while (!this.canSelectCurWorldType())
55-
+ {
56-
+ --this.selectedIndex;
57-
+
58-
+ if (this.selectedIndex < 0)
59-
+ {
51+
+ if (this.selectedIndex < 0) {
6052
+ this.selectedIndex = WorldType.WORLD_TYPES.length - 1;
6153
+ }
62-
+ }
54+
+ } while (!this.canSelectCurWorldType());
6355
+
6456
+ this.chunkProviderSettingsJson = "";
6557
+ this.updateDisplayState();

patches/minecraft/net/minecraft/client/gui/GuiKeyBindingList.java.patch

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
--- before/net/minecraft/client/gui/GuiKeyBindingList.java
22
+++ after/net/minecraft/client/gui/GuiKeyBindingList.java
3+
@@ -65,7 +65,7 @@
4+
@Override
5+
protected int getScrollBarX()
6+
{
7+
- return super.getScrollBarX() + 15;
8+
+ return super.getScrollBarX() + 35;
9+
}
10+
11+
@Override
312
@@ -138,7 +138,7 @@
413
{
514
this.keybinding = name;

patches/minecraft/net/minecraft/client/gui/GuiSlot.java.patch

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
int k = this.left + this.width / 2 - this.getListWidth() / 2 + 2;
3131
int l = this.top + 4 - (int)this.amountScrolled;
3232

33-
@@ -517,5 +498,19 @@
33+
@@ -517,5 +498,31 @@
3434
public int getSlotHeight()
3535
{
3636
return this.slotHeight;
@@ -43,10 +43,22 @@
4343
+ GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
4444
+ float f = 32.0F;
4545
+ buffer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
46-
+ buffer.pos((double)this.left, (double)this.bottom, 0.0D).tex((double)((float)this.left / f), (double)((float)(this.bottom + (int)this.amountScrolled) / f)).color(32, 32, 32, 255).endVertex();
47-
+ buffer.pos((double)this.right, (double)this.bottom, 0.0D).tex((double)((float)this.right / f), (double)((float)(this.bottom + (int)this.amountScrolled) / f)).color(32, 32, 32, 255).endVertex();
48-
+ buffer.pos((double)this.right, (double)this.top, 0.0D).tex((double)((float)this.right / f), (double)((float)(this.top + (int)this.amountScrolled) / f)).color(32, 32, 32, 255).endVertex();
49-
+ buffer.pos((double)this.left, (double)this.top, 0.0D).tex((double)((float)this.left / f), (double)((float)(this.top + (int)this.amountScrolled) / f)).color(32, 32, 32, 255).endVertex();
46+
+ buffer.pos(this.left, this.bottom, 0.0)
47+
+ .tex((float)this.left / f, (float)(this.bottom + (int)this.amountScrolled) / f)
48+
+ .color(32, 32, 32, 255)
49+
+ .endVertex();
50+
+ buffer.pos(this.right, this.bottom, 0.0)
51+
+ .tex((float)this.right / f, (float)(this.bottom + (int)this.amountScrolled) / f)
52+
+ .color(32, 32, 32, 255)
53+
+ .endVertex();
54+
+ buffer.pos(this.right, this.top, 0.0)
55+
+ .tex((float)this.right / f, (float)(this.top + (int)this.amountScrolled) / f)
56+
+ .color(32, 32, 32, 255)
57+
+ .endVertex();
58+
+ buffer.pos(this.left, this.top, 0.0)
59+
+ .tex((float)this.left / f, (float)(this.top + (int)this.amountScrolled) / f)
60+
+ .color(32, 32, 32, 255)
61+
+ .endVertex();
5062
+ tessellator.draw();
5163
}
5264
}

patches/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java.patch

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@
6464
{
6565
this.handleMouseClick(slot, l, mouseButton, ClickType.CLONE);
6666
}
67+
@@ -411,7 +414,7 @@
68+
{
69+
this.dragSplittingLimit = 1;
70+
}
71+
- else if (mouseButton == this.mc.gameSettings.keyBindPickBlock.getKeyCode() + 100)
72+
+ else if (this.mc.gameSettings.keyBindPickBlock.isActiveAndMatches(mouseButton - 100))
73+
{
74+
this.dragSplittingLimit = 2;
75+
}
6776
@@ -489,10 +492,12 @@
6877
@Override
6978
protected void mouseReleased(int mouseX, int mouseY, int state)

0 commit comments

Comments
 (0)