-
Notifications
You must be signed in to change notification settings - Fork 4
/
patch.patch
378 lines (348 loc) · 20.2 KB
/
patch.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
diff --git a/src/minecraft/net/minecraft/client/Minecraft.java b/src2/minecraft/net/minecraft/client/Minecraft.java
index 2dea5d6..1ebd760 100644
--- a/src/minecraft/net/minecraft/client/Minecraft.java
+++ b/src2/minecraft/net/minecraft/client/Minecraft.java
@@ -633,6 +633,7 @@ public class Minecraft implements IThreadListener, ISnooperInfo
}
this.renderGlobal.makeEntityOutlineShader();
+ new es.blueberrypancak.Client(this);
}
private void func_193986_ar()
@@ -1199,6 +1200,8 @@ public class Minecraft implements IThreadListener, ISnooperInfo
this.field_193034_aS.func_191783_a(new ScaledResolution(this));
this.mcProfiler.endSection();
}
+
+ es.blueberrypancak.event.EventManager.fire(new es.blueberrypancak.event.EventRender());
this.mcProfiler.endSection();
@@ -1897,6 +1900,8 @@ public class Minecraft implements IThreadListener, ISnooperInfo
}
}
+ es.blueberrypancak.event.EventManager.fire(new es.blueberrypancak.event.EventTick());
+
if (this.currentScreen == null || this.currentScreen.allowUserInput)
{
this.mcProfiler.endStartSection("mouse");
diff --git a/src/minecraft/net/minecraft/client/entity/EntityPlayerSP.java b/src2/minecraft/net/minecraft/client/entity/EntityPlayerSP.java
index 990f31d..29ec724 100644
--- a/src/minecraft/net/minecraft/client/entity/EntityPlayerSP.java
+++ b/src2/minecraft/net/minecraft/client/entity/EntityPlayerSP.java
@@ -967,8 +967,8 @@ public class EntityPlayerSP extends AbstractClientPlayer
if (this.isHandActive() && !this.isRiding())
{
- this.movementInput.moveStrafe *= 0.2F;
- this.movementInput.field_192832_b *= 0.2F;
+ /*this.movementInput.moveStrafe *= 0.2F;
+ this.movementInput.field_192832_b *= 0.2F;*/
this.sprintToggleTimer = 0;
}
diff --git a/src/minecraft/net/minecraft/client/gui/GuiIngame.java b/src2/minecraft/net/minecraft/client/gui/GuiIngame.java
index 05a9237..4d9dab6 100644
--- a/src/minecraft/net/minecraft/client/gui/GuiIngame.java
+++ b/src2/minecraft/net/minecraft/client/gui/GuiIngame.java
@@ -125,7 +125,7 @@ public class GuiIngame extends Gui
this.itemRenderer = mcIn.getRenderItem();
this.overlayDebug = new GuiOverlayDebug(mcIn);
this.spectatorGui = new GuiSpectator(mcIn);
- this.persistantChatGUI = new GuiNewChat(mcIn);
+ this.persistantChatGUI = new es.blueberrypancak.hook.GuiNewChatHook(mcIn);
this.overlayPlayerList = new GuiPlayerTabOverlay(mcIn, this);
this.overlayBoss = new GuiBossOverlay(mcIn);
this.overlaySubtitle = new GuiSubtitleOverlay(mcIn);
diff --git a/src/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java b/src2/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java
index 3f7ffde..a5d5f5a 100644
--- a/src/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java
+++ b/src2/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java
@@ -105,7 +105,7 @@ public class NetHandlerLoginClient implements INetHandlerLoginClient
{
this.gameProfile = packetIn.getProfile();
this.networkManager.setConnectionState(EnumConnectionState.PLAY);
- this.networkManager.setNetHandler(new NetHandlerPlayClient(this.mc, this.previousGuiScreen, this.networkManager, this.gameProfile));
+ this.networkManager.setNetHandler(new es.blueberrypancak.hook.NetHandlerPlayClientHook(this.mc, this.previousGuiScreen, this.networkManager, this.gameProfile));
}
/**
diff --git a/src/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java b/src2/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java
index 7e62acd..e809abb 100644
--- a/src/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java
+++ b/src2/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java
@@ -324,7 +324,7 @@ public class NetHandlerPlayClient implements INetHandlerPlayClient
public void handleJoinGame(SPacketJoinGame packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
- this.gameController.playerController = new PlayerControllerMP(this.gameController, this);
+ this.gameController.playerController = new es.blueberrypancak.hook.PlayerControllerMPHook(this.gameController, this);
this.clientWorldController = new WorldClient(this, new WorldSettings(0L, packetIn.getGameType(), false, packetIn.isHardcoreMode(), packetIn.getWorldType()), packetIn.getDimension(), packetIn.getDifficulty(), this.gameController.mcProfiler);
this.gameController.gameSettings.difficulty = packetIn.getDifficulty();
this.gameController.loadWorld(this.clientWorldController);
diff --git a/src/minecraft/net/minecraft/client/renderer/EntityRenderer.java b/src2/minecraft/net/minecraft/client/renderer/EntityRenderer.java
index 438b8aa..2edd216 100644
--- a/src/minecraft/net/minecraft/client/renderer/EntityRenderer.java
+++ b/src2/minecraft/net/minecraft/client/renderer/EntityRenderer.java
@@ -539,7 +539,7 @@ public class EntityRenderer implements IResourceManagerReloadListener
/**
* Changes the field of view of the player depending on if they are underwater or not
*/
- private float getFOVModifier(float partialTicks, boolean useFOVSetting)
+ protected float getFOVModifier(float partialTicks, boolean useFOVSetting)
{
if (this.debugView)
{
@@ -1476,6 +1476,8 @@ public class EntityRenderer implements IResourceManagerReloadListener
GlStateManager.enableCull();
GlStateManager.disableBlend();
GlStateManager.disableFog();
+
+ es.blueberrypancak.event.EventManager.fire(new es.blueberrypancak.event.EventEntityRender(partialTicks));
if (entity.posY + (double)entity.getEyeHeight() >= 128.0D)
{
@@ -2084,14 +2086,16 @@ public class EntityRenderer implements IResourceManagerReloadListener
GlStateManager.glNormal3f(0.0F, 1.0F, 0.0F);
GlStateManager.rotate(-viewerYaw, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate((float)(isThirdPersonFrontal ? -1 : 1) * viewerPitch, 1.0F, 0.0F, 0.0F);
- GlStateManager.scale(-0.025F, -0.025F, 0.025F);
+ GlStateManager.scale(-0.025F*2, -0.025F*2, 0.025F*2);
GlStateManager.disableLighting();
- GlStateManager.depthMask(false);
+ /*GlStateManager.depthMask(false);
if (!isSneaking)
{
GlStateManager.disableDepth();
- }
+ }*/
+
+ GlStateManager.disableDepth();
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
@@ -2107,16 +2111,17 @@ public class EntityRenderer implements IResourceManagerReloadListener
tessellator.draw();
GlStateManager.enableTexture2D();
- if (!isSneaking)
+ /*if (!isSneaking)
{
fontRendererIn.drawString(str, -fontRendererIn.getStringWidth(str) / 2, verticalShift, 553648127);
GlStateManager.enableDepth();
- }
+ }*/
- GlStateManager.depthMask(true);
fontRendererIn.drawString(str, -fontRendererIn.getStringWidth(str) / 2, verticalShift, isSneaking ? 553648127 : -1);
GlStateManager.enableLighting();
+ GlStateManager.depthMask(true);
GlStateManager.disableBlend();
+ GlStateManager.enableDepth();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.popMatrix();
}
diff --git a/src/minecraft/net/minecraft/client/renderer/ItemRenderer.java b/src2/minecraft/net/minecraft/client/renderer/ItemRenderer.java
index 46fdf71..42de96d 100644
--- a/src/minecraft/net/minecraft/client/renderer/ItemRenderer.java
+++ b/src2/minecraft/net/minecraft/client/renderer/ItemRenderer.java
@@ -478,11 +478,6 @@ public class ItemRenderer
if (!this.mc.player.isSpectator())
{
- if (this.mc.player.isInsideOfMaterial(Material.WATER))
- {
- this.renderWaterOverlayTexture(partialTicks);
- }
-
if (this.mc.player.isBurning())
{
this.renderFireInFirstPerson();
@@ -562,7 +557,7 @@ public class ItemRenderer
{
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder bufferbuilder = tessellator.getBuffer();
- GlStateManager.color(1.0F, 1.0F, 1.0F, 0.9F);
+ GlStateManager.color(1.0F, 1.0F, 1.0F, 1F);
GlStateManager.depthFunc(519);
GlStateManager.depthMask(false);
GlStateManager.enableBlend();
@@ -586,10 +581,11 @@ public class ItemRenderer
GlStateManager.translate((float)(-(i * 2 - 1)) * 0.24F, -0.3F, 0.0F);
GlStateManager.rotate((float)(i * 2 - 1) * 10.0F, 0.0F, 1.0F, 0.0F);
bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX);
- bufferbuilder.pos(-0.5D, -0.5D, -0.5D).tex((double)f2, (double)f4).endVertex();
- bufferbuilder.pos(0.5D, -0.5D, -0.5D).tex((double)f1, (double)f4).endVertex();
- bufferbuilder.pos(0.5D, 0.5D, -0.5D).tex((double)f1, (double)f3).endVertex();
- bufferbuilder.pos(-0.5D, 0.5D, -0.5D).tex((double)f2, (double)f3).endVertex();
+ float scale = 0.4F;
+ bufferbuilder.pos(-0.5D*scale, -0.5D*scale, -0.5D*scale).tex((double)f2, (double)f4).endVertex();
+ bufferbuilder.pos(0.5D*scale, -0.5D*scale*0.5, -0.5D*scale).tex((double)f1, (double)f4).endVertex();
+ bufferbuilder.pos(0.5D*scale, 0.5D*scale, -0.5D*scale).tex((double)f1, (double)f3).endVertex();
+ bufferbuilder.pos(-0.5D*scale, 0.5D*scale, -0.5D*scale).tex((double)f2, (double)f3).endVertex();
tessellator.draw();
GlStateManager.popMatrix();
}
diff --git a/src/minecraft/net/minecraft/client/renderer/RenderItem.java b/src2/minecraft/net/minecraft/client/renderer/RenderItem.java
index 4db2364..2f82f89 100644
--- a/src/minecraft/net/minecraft/client/renderer/RenderItem.java
+++ b/src2/minecraft/net/minecraft/client/renderer/RenderItem.java
@@ -426,23 +426,19 @@ public class RenderItem implements IResourceManagerReloadListener
{
GlStateManager.disableLighting();
GlStateManager.disableDepth();
- GlStateManager.disableTexture2D();
GlStateManager.disableAlpha();
GlStateManager.disableBlend();
- Tessellator tessellator = Tessellator.getInstance();
- BufferBuilder bufferbuilder = tessellator.getBuffer();
- float f = (float)stack.getItemDamage();
- float f1 = (float)stack.getMaxDamage();
- float f2 = Math.max(0.0F, (f1 - f) / f1);
- int i = Math.round(13.0F - f * 13.0F / f1);
- int j = MathHelper.hsvToRGB(f2 / 3.0F, 1.0F, 1.0F);
- this.draw(bufferbuilder, xPosition + 2, yPosition + 13, 13, 2, 0, 0, 0, 255);
- this.draw(bufferbuilder, xPosition + 2, yPosition + 13, i, 1, j >> 16 & 255, j >> 8 & 255, j & 255, 255);
- GlStateManager.enableBlend();
- GlStateManager.enableAlpha();
- GlStateManager.enableTexture2D();
+ int i = (int)Math.round(255.0D - (double)stack.getItemDamage() * 255.0D / (double)stack.getMaxDamage());
+ String s = ""+100*(stack.getMaxDamage()-stack.getItemDamage())/stack.getMaxDamage();
+ if(stack.getItemDamage() != stack.getMaxDamage()) {
+ fr.drawStringWithShadow(s, (float)(xPosition + 19 - 2 - fr.getStringWidth(s)), (float)(yPosition + 6 + 3), ((255-i)<<16)|(i<<8));
+ GlStateManager.color(1, 1, 1, 1);
+ }
+
GlStateManager.enableLighting();
GlStateManager.enableDepth();
+ GlStateManager.enableAlpha();
+ GlStateManager.enableBlend();
}
EntityPlayerSP entityplayersp = Minecraft.getMinecraft().player;
diff --git a/src/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java b/src2/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java
index ef332b5..480a8c4 100644
--- a/src/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java
+++ b/src2/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java
@@ -181,6 +181,10 @@ public class RenderChunk
}
}
}
+
+ if(iblockstate.getMaterial() != net.minecraft.block.material.Material.AIR) {
+ es.blueberrypancak.event.EventManager.fire(new es.blueberrypancak.event.EventLoadBlock(new es.blueberrypancak.Location(blockpos$mutableblockpos.getX(), blockpos$mutableblockpos.getY(), blockpos$mutableblockpos.getZ(), Block.getIdFromBlock(block))));
+ }
BlockRenderLayer blockrenderlayer1 = block.getBlockLayer();
int j = blockrenderlayer1.ordinal();
diff --git a/src/minecraft/net/minecraft/client/renderer/entity/Render.java b/src2/minecraft/net/minecraft/client/renderer/entity/Render.java
index 1149867..b03e617 100644
--- a/src/minecraft/net/minecraft/client/renderer/entity/Render.java
+++ b/src2/minecraft/net/minecraft/client/renderer/entity/Render.java
@@ -101,7 +101,7 @@ public abstract class Render<T extends Entity>
protected void renderEntityName(T entityIn, double x, double y, double z, String name, double distanceSq)
{
- this.renderLivingLabel(entityIn, name, x, y, z, 64);
+ //this.renderLivingLabel(entityIn, name, x, y, z, 64);
}
@Nullable
@@ -365,16 +365,13 @@ public abstract class Render<T extends Entity>
{
double d0 = entityIn.getDistanceSqToEntity(this.renderManager.renderViewEntity);
- if (d0 <= (double)(maxDistance * maxDistance))
- {
- boolean flag = entityIn.isSneaking();
- float f = this.renderManager.playerViewY;
- float f1 = this.renderManager.playerViewX;
- boolean flag1 = this.renderManager.options.thirdPersonView == 2;
- float f2 = entityIn.height + 0.5F - (flag ? 0.25F : 0.0F);
- int i = "deadmau5".equals(str) ? -10 : 0;
- EntityRenderer.drawNameplate(this.getFontRendererFromRenderManager(), str, (float)x, (float)y + f2, (float)z, i, f, f1, flag1, flag);
- }
+ boolean flag = entityIn.isSneaking();
+ float f = this.renderManager.playerViewY;
+ float f1 = this.renderManager.playerViewX;
+ boolean flag1 = this.renderManager.options.thirdPersonView == 2;
+ float f2 = entityIn.height + 0.5F - (flag ? 0.25F : 0.0F);
+ int i = "deadmau5".equals(str) ? -10 : 0;
+ EntityRenderer.drawNameplate(this.getFontRendererFromRenderManager(), str, (float)x, (float)y + f2, (float)z, i, f, f1, flag1, flag);
}
public RenderManager getRenderManager()
diff --git a/src/minecraft/net/minecraft/client/renderer/entity/RenderManager.java b/src2/minecraft/net/minecraft/client/renderer/entity/RenderManager.java
index cabc9c3..b0c92af 100644
--- a/src/minecraft/net/minecraft/client/renderer/entity/RenderManager.java
+++ b/src2/minecraft/net/minecraft/client/renderer/entity/RenderManager.java
@@ -121,9 +121,9 @@ public class RenderManager
/** Renders fonts */
private FontRenderer textRenderer;
- private double renderPosX;
- private double renderPosY;
- private double renderPosZ;
+ public double renderPosX;
+ public double renderPosY;
+ public double renderPosZ;
public TextureManager renderEngine;
/** Reference to the World object. */
diff --git a/src/minecraft/net/minecraft/entity/EntityLivingBase.java b/src2/minecraft/net/minecraft/entity/EntityLivingBase.java
index 3e6bec2..ee51d71 100644
--- a/src/minecraft/net/minecraft/entity/EntityLivingBase.java
+++ b/src2/minecraft/net/minecraft/entity/EntityLivingBase.java
@@ -2151,12 +2151,12 @@ public abstract class EntityLivingBase extends Entity
this.motionY = -0.15D;
}
- boolean flag = this.isSneaking() && this instanceof EntityPlayer;
+ /*boolean flag = this.isSneaking() && this instanceof EntityPlayer;
if (flag && this.motionY < 0.0D)
{
this.motionY = 0.0D;
- }
+ }*/
}
this.moveEntity(MoverType.SELF, this.motionX, this.motionY, this.motionZ);
diff --git a/src/minecraft/net/minecraft/entity/player/EntityPlayer.java b/src2/minecraft/net/minecraft/entity/player/EntityPlayer.java
index c9f07d5..7166dd8 100644
--- a/src/minecraft/net/minecraft/entity/player/EntityPlayer.java
+++ b/src2/minecraft/net/minecraft/entity/player/EntityPlayer.java
@@ -102,7 +102,7 @@ public abstract class EntityPlayer extends EntityLivingBase
protected static final DataParameter<NBTTagCompound> field_192033_bu = EntityDataManager.<NBTTagCompound>createKey(EntityPlayer.class, DataSerializers.field_192734_n);
/** Inventory of the player */
- public InventoryPlayer inventory = new InventoryPlayer(this);
+ public InventoryPlayer inventory = new es.blueberrypancak.hook.InventoryPlayerHook(this);
protected InventoryEnderChest theInventoryEnderChest = new InventoryEnderChest();
/**
@@ -2623,7 +2623,9 @@ public abstract class EntityPlayer extends EntityLivingBase
public float getCooldownPeriod()
{
- return (float)(1.0D / this.getEntityAttribute(SharedMonsterAttributes.ATTACK_SPEED).getAttributeValue() * 20.0D);
+ es.blueberrypancak.event.EventCooldown e = new es.blueberrypancak.event.EventCooldown((float)(1.0D / this.getEntityAttribute(SharedMonsterAttributes.ATTACK_SPEED).getAttributeValue() * 20.0D));
+ es.blueberrypancak.event.EventManager.fire(e);
+ return e.getValue();
}
/**
diff --git a/src/minecraft/net/minecraft/entity/projectile/EntityFishHook.java b/src2/minecraft/net/minecraft/entity/projectile/EntityFishHook.java
index fceef29..a79168b 100644
--- a/src/minecraft/net/minecraft/entity/projectile/EntityFishHook.java
+++ b/src2/minecraft/net/minecraft/entity/projectile/EntityFishHook.java
@@ -36,7 +36,7 @@ public class EntityFishHook extends Entity
private static final DataParameter<Integer> DATA_HOOKED_ENTITY = EntityDataManager.<Integer>createKey(EntityFishHook.class, DataSerializers.VARINT);
private boolean inGround;
private int ticksInGround;
- private EntityPlayer angler;
+ public EntityPlayer angler;
private int ticksInAir;
private int ticksCatchable;
private int ticksCaughtDelay;
diff --git a/src/minecraft/net/minecraft/network/NetworkManager.java b/src2/minecraft/net/minecraft/network/NetworkManager.java
index 2de7347..3b2c9bf 100644
--- a/src/minecraft/net/minecraft/network/NetworkManager.java
+++ b/src2/minecraft/net/minecraft/network/NetworkManager.java
@@ -148,7 +148,9 @@ public class NetworkManager extends SimpleChannelInboundHandler < Packet<? >>
{
try
{
- ((Packet<INetHandler>)p_channelRead0_2_).processPacket(this.packetListener);
+ es.blueberrypancak.event.EventRecPacket e = new es.blueberrypancak.event.EventRecPacket(p_channelRead0_2_);
+ es.blueberrypancak.event.EventManager.fire(e);
+ if(!e.isCancelled()) ((Packet<INetHandler>)e.getValue()).processPacket(this.packetListener);
}
catch (ThreadQuickExitException var4)
{
diff --git a/src/minecraft/net/minecraft/network/play/client/CPacketPlayer.java b/src2/minecraft/net/minecraft/network/play/client/CPacketPlayer.java
index d66f3d0..d117d02 100644
--- a/src/minecraft/net/minecraft/network/play/client/CPacketPlayer.java
+++ b/src2/minecraft/net/minecraft/network/play/client/CPacketPlayer.java
@@ -12,7 +12,7 @@ public class CPacketPlayer implements Packet<INetHandlerPlayServer>
protected double z;
protected float yaw;
protected float pitch;
- protected boolean onGround;
+ public boolean onGround;
protected boolean moving;
protected boolean rotating;