Skip to content

Commit 8b8ae06

Browse files
author
eaglercraft
committed
u43
1 parent fef7def commit 8b8ae06

30 files changed

Lines changed: 169 additions & 198 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
u42
1+
u43
6 Bytes
Binary file not shown.

src/game/java/net/minecraft/client/gui/GuiScreen.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,10 +600,11 @@ public void handleTouchInput() throws IOException {
600600
}
601601
i = applyEaglerScale(scaleFac, i * this.width / this.mc.displayWidth, this.width);
602602
j = applyEaglerScale(scaleFac, this.height - j * this.height / this.mc.displayHeight - 1, this.height);
603-
float si = Touch.getEventTouchRadiusX(t) * this.width / this.mc.displayWidth / scaleFac;
603+
float rad = Touch.getEventTouchRadiusMixed(t);
604+
float si = rad * this.width / this.mc.displayWidth / scaleFac;
604605
if (si < 1.0f)
605606
si = 1.0f;
606-
float sj = Touch.getEventTouchRadiusY(t) * this.height / this.mc.displayHeight / scaleFac;
607+
float sj = rad * this.height / this.mc.displayHeight / scaleFac;
607608
if (sj < 1.0f)
608609
sj = 1.0f;
609610
int[] ck = touchStarts.remove(u);

src/game/java/net/minecraft/client/renderer/chunk/ChunkRenderWorker.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ protected void processTask(final ChunkCompileTaskGenerator generator) throws Int
9292
this.chunkRenderDispatcher.uploadChunk(enumworldblocklayer,
9393
generator.getRegionRenderCacheBuilder().getWorldRendererByLayer(enumworldblocklayer),
9494
generator.getRenderChunk(), compiledchunk);
95-
generator.getRenderChunk().setCompiledChunk(compiledchunk);
9695
generator.setStatus(ChunkCompileTaskGenerator.Status.DONE);
9796
}
9897
}
@@ -107,7 +106,6 @@ protected void processTask(final ChunkCompileTaskGenerator generator) throws Int
107106
.getWorldRendererByLayer(EnumWorldBlockLayer.REALISTIC_WATER),
108107
generator.getRenderChunk(), compiledchunk);
109108
}
110-
generator.getRenderChunk().setCompiledChunk(compiledchunk);
111109
generator.setStatus(ChunkCompileTaskGenerator.Status.DONE);
112110
}
113111

src/game/java/net/minecraft/client/renderer/chunk/CompiledChunk.java

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package net.minecraft.client.renderer.chunk;
22

3+
import java.util.Arrays;
34
import java.util.List;
45

56
import com.google.common.collect.Lists;
@@ -30,7 +31,7 @@
3031
*
3132
*/
3233
public class CompiledChunk {
33-
public static final CompiledChunk DUMMY = new CompiledChunk() {
34+
public static final CompiledChunk DUMMY = new CompiledChunk(null) {
3435
protected void setLayerUsed(EnumWorldBlockLayer layer) {
3536
throw new UnsupportedOperationException();
3637
}
@@ -43,6 +44,7 @@ public boolean isVisible(EnumFacing facing, EnumFacing facing2) {
4344
return true;
4445
}
4546
};
47+
private final RenderChunk chunk;
4648
private final boolean[] layersUsed = new boolean[EnumWorldBlockLayer._VALUES.length];
4749
private final boolean[] layersStarted = new boolean[EnumWorldBlockLayer._VALUES.length];
4850
private boolean empty = true;
@@ -51,6 +53,20 @@ public boolean isVisible(EnumFacing facing, EnumFacing facing2) {
5153
private WorldRenderer.State state;
5254
private WorldRenderer.State stateWater;
5355

56+
public CompiledChunk(RenderChunk chunk) {
57+
this.chunk = chunk;
58+
}
59+
60+
public void reset() {
61+
Arrays.fill(layersUsed, false);
62+
Arrays.fill(layersStarted, false);
63+
empty = true;
64+
tileEntities.clear();
65+
setVisibility.setAllVisible(false);
66+
setState(null);
67+
setStateRealisticWater(null);
68+
}
69+
5470
public boolean isEmpty() {
5571
return this.empty;
5672
}
@@ -93,6 +109,9 @@ public WorldRenderer.State getState() {
93109
}
94110

95111
public void setState(WorldRenderer.State stateIn) {
112+
if (this.state != stateIn && this.state != null) {
113+
this.state.release();
114+
}
96115
this.state = stateIn;
97116
}
98117

@@ -101,6 +120,9 @@ public WorldRenderer.State getStateRealisticWater() {
101120
}
102121

103122
public void setStateRealisticWater(WorldRenderer.State stateIn) {
123+
if (this.stateWater != stateIn && this.stateWater != null) {
124+
this.stateWater.release();
125+
}
104126
this.stateWater = stateIn;
105127
}
106128
}

src/game/java/net/minecraft/client/renderer/chunk/RenderChunk.java

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,11 @@ public void resortTransparency(float x, float y, float z, ChunkCompileTaskGenera
131131
}
132132

133133
public void rebuildChunk(float x, float y, float z, ChunkCompileTaskGenerator generator) {
134-
CompiledChunk compiledchunk = new CompiledChunk();
134+
if (compiledChunk == CompiledChunk.DUMMY) {
135+
compiledChunk = new CompiledChunk(this);
136+
} else {
137+
compiledChunk.reset();
138+
}
135139
boolean flag = true;
136140
BlockPos blockpos = this.position;
137141
BlockPos blockpos1 = blockpos.add(15, 15, 15);
@@ -142,7 +146,7 @@ public void rebuildChunk(float x, float y, float z, ChunkCompileTaskGenerator ge
142146
}
143147

144148
regionrendercache = new RegionRenderCache(this.world, blockpos.add(-1, -1, -1), blockpos1.add(1, 1, 1), 1);
145-
generator.setCompiledChunk(compiledchunk);
149+
generator.setCompiledChunk(compiledChunk);
146150

147151
VisGraph visgraph = new VisGraph();
148152
HashSet hashset = Sets.newHashSet();
@@ -163,7 +167,7 @@ public void rebuildChunk(float x, float y, float z, ChunkCompileTaskGenerator ge
163167
TileEntitySpecialRenderer tileentityspecialrenderer = TileEntityRendererDispatcher.instance
164168
.getSpecialRenderer(tileentity);
165169
if (tileentity != null && tileentityspecialrenderer != null) {
166-
compiledchunk.addTileEntity(tileentity);
170+
compiledChunk.addTileEntity(tileentity);
167171
if (tileentityspecialrenderer.func_181055_a()) {
168172
hashset.add(tileentity);
169173
}
@@ -174,8 +178,8 @@ public void rebuildChunk(float x, float y, float z, ChunkCompileTaskGenerator ge
174178
int i = enumworldblocklayer1.ordinal();
175179
if (block.getRenderType() != -1) {
176180
WorldRenderer worldrenderer = generator.getRegionRenderCacheBuilder().getWorldRendererByLayerId(i);
177-
if (!compiledchunk.isLayerStarted(enumworldblocklayer1)) {
178-
compiledchunk.setLayerStarted(enumworldblocklayer1);
181+
if (!compiledChunk.isLayerStarted(enumworldblocklayer1)) {
182+
compiledChunk.setLayerStarted(enumworldblocklayer1);
179183
this.preRenderBlocks(worldrenderer, blockpos);
180184
}
181185

@@ -186,8 +190,8 @@ public void rebuildChunk(float x, float y, float z, ChunkCompileTaskGenerator ge
186190
enumworldblocklayer1 = EnumWorldBlockLayer.GLASS_HIGHLIGHTS;
187191
worldrenderer = generator.getRegionRenderCacheBuilder()
188192
.getWorldRendererByLayerId(enumworldblocklayer1.ordinal());
189-
if (!compiledchunk.isLayerStarted(enumworldblocklayer1)) {
190-
compiledchunk.setLayerStarted(enumworldblocklayer1);
193+
if (!compiledChunk.isLayerStarted(enumworldblocklayer1)) {
194+
compiledChunk.setLayerStarted(enumworldblocklayer1);
191195
this.preRenderBlocks(worldrenderer, blockpos);
192196
}
193197

@@ -201,18 +205,18 @@ public void rebuildChunk(float x, float y, float z, ChunkCompileTaskGenerator ge
201205
for (int i = 0; i < layers.length; ++i) {
202206
EnumWorldBlockLayer enumworldblocklayer = layers[i];
203207
if (aboolean[enumworldblocklayer.ordinal()]) {
204-
compiledchunk.setLayerUsed(enumworldblocklayer);
208+
compiledChunk.setLayerUsed(enumworldblocklayer);
205209
}
206210

207-
if (compiledchunk.isLayerStarted(enumworldblocklayer)) {
211+
if (compiledChunk.isLayerStarted(enumworldblocklayer)) {
208212
this.postRenderBlocks(enumworldblocklayer, x, y, z,
209213
generator.getRegionRenderCacheBuilder().getWorldRendererByLayer(enumworldblocklayer),
210-
compiledchunk);
214+
compiledChunk);
211215
}
212216
}
213217
}
214218

215-
compiledchunk.setVisibility(visgraph.computeVisibility());
219+
compiledChunk.setVisibility(visgraph.computeVisibility());
216220

217221
HashSet hashset1 = Sets.newHashSet(hashset);
218222
HashSet hashset2 = Sets.newHashSet(this.field_181056_j);
@@ -287,13 +291,13 @@ public CompiledChunk getCompiledChunk() {
287291
return this.compiledChunk;
288292
}
289293

290-
public void setCompiledChunk(CompiledChunk compiledChunkIn) {
291-
this.compiledChunk = compiledChunkIn;
292-
}
293-
294294
public void stopCompileTask() {
295295
this.finishCompileTask();
296-
this.compiledChunk = CompiledChunk.DUMMY;
296+
if (this.compiledChunk != CompiledChunk.DUMMY) {
297+
this.compiledChunk.setState(null);
298+
this.compiledChunk.setStateRealisticWater(null);
299+
this.compiledChunk = CompiledChunk.DUMMY;
300+
}
297301
}
298302

299303
public void deleteGlResources() {

src/game/java/net/minecraft/client/settings/GameSettings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ public class GameSettings {
213213
public boolean hasShownProfanityFilter = false;
214214
public float touchControlOpacity = 1.0f;
215215
public boolean hideDefaultUsernameWarning = false;
216-
public boolean hideVideoSettingsWarning = false;
216+
public boolean hideVideoSettingsWarning = EagRuntime.getPlatformType() == EnumPlatformType.DESKTOP;
217217

218218
public int voiceListenRadius = 16;
219219
public float voiceListenVolume = 0.5f;

src/game/java/net/minecraft/tileentity/TileEntity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ public static TileEntity createAndLoadEntity(NBTTagCompound nbt) {
115115
tileentity = (TileEntity) oclass.get();
116116
}
117117
} catch (Exception exception) {
118-
logger.error("Could not create TileEntity", exception);
118+
logger.error("Could not create TileEntity");
119+
logger.error(exception);
119120
}
120121

121122
if (tileentity != null) {

src/game/java/net/minecraft/util/BlockPos.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public BlockPos(Vec3 source) {
6161
}
6262

6363
public BlockPos(Vec3i source) {
64-
this(source.getX(), source.getY(), source.getZ());
64+
this(source.x, source.y, source.z);
6565
}
6666

6767
/**+

src/game/java/net/minecraft/world/World.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1929,7 +1929,7 @@ public TileEntity getTileEntity(BlockPos pos) {
19291929
public void setTileEntity(BlockPos pos, TileEntity tileEntityIn) {
19301930
if (tileEntityIn != null && !tileEntityIn.isInvalid()) {
19311931
if (this.processingLoadedTiles) {
1932-
tileEntityIn.setPos(pos);
1932+
tileEntityIn.setPos(new BlockPos(pos));
19331933
Iterator iterator = this.addedTileEntityList.iterator();
19341934

19351935
while (iterator.hasNext()) {

0 commit comments

Comments
 (0)