u34
This commit is contained in:
parent
cfab2e85bf
commit
16648bc6c8
94 changed files with 2126 additions and 172 deletions
|
|
@ -750,7 +750,18 @@ public class Minecraft implements IThreadListener {
|
|||
}
|
||||
|
||||
this.mcSoundHandler.unloadSounds();
|
||||
SingleplayerServerController.shutdownEaglercraftServer();
|
||||
if (SingleplayerServerController.isWorldRunning()) {
|
||||
SingleplayerServerController.shutdownEaglercraftServer();
|
||||
while (SingleplayerServerController.getStatusState() == IntegratedServerState.WORLD_UNLOADING) {
|
||||
EagUtils.sleep(50l);
|
||||
SingleplayerServerController.runTick();
|
||||
}
|
||||
}
|
||||
if (SingleplayerServerController.isIntegratedServerWorkerAlive()
|
||||
&& SingleplayerServerController.canKillWorker()) {
|
||||
SingleplayerServerController.killWorker();
|
||||
EagUtils.sleep(50l);
|
||||
}
|
||||
} finally {
|
||||
EagRuntime.destroy();
|
||||
if (!this.hasCrashed) {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import net.lax1dude.eaglercraft.v1_8.HString;
|
|||
import net.lax1dude.eaglercraft.v1_8.internal.EnumPlatformType;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.dynamiclights.DynamicLightsStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
|
|
@ -394,6 +395,9 @@ public class GuiOverlayDebug extends Gui {
|
|||
new Object[] { enumfacing, s,
|
||||
Float.valueOf(MathHelper.wrapAngleTo180_float(entity.rotationYaw)),
|
||||
Float.valueOf(MathHelper.wrapAngleTo180_float(entity.rotationPitch)) }) });
|
||||
if (DynamicLightsStateManager.isDynamicLightsRender()) {
|
||||
arraylist.add(6, DynamicLightsStateManager.getF3String());
|
||||
}
|
||||
if (this.mc.theWorld != null && this.mc.theWorld.isBlockLoaded(blockpos)) {
|
||||
Chunk chunk = this.mc.theWorld.getChunkFromBlockCoords(blockpos);
|
||||
arraylist.add("Biome: " + chunk.getBiome(blockpos, null).biomeName);
|
||||
|
|
|
|||
|
|
@ -42,10 +42,10 @@ public class GuiVideoSettings extends GuiScreen {
|
|||
GameSettings.Options.VIEW_BOBBING, GameSettings.Options.GUI_SCALE, GameSettings.Options.GAMMA,
|
||||
GameSettings.Options.RENDER_CLOUDS, GameSettings.Options.PARTICLES, GameSettings.Options.FXAA,
|
||||
GameSettings.Options.MIPMAP_LEVELS, GameSettings.Options.BLOCK_ALTERNATIVES,
|
||||
GameSettings.Options.ENTITY_SHADOWS, GameSettings.Options.FOG, GameSettings.Options.FULLSCREEN,
|
||||
GameSettings.Options.FNAW_SKINS, GameSettings.Options.HUD_FPS, GameSettings.Options.HUD_COORDS,
|
||||
GameSettings.Options.HUD_PLAYER, GameSettings.Options.HUD_STATS, GameSettings.Options.HUD_WORLD,
|
||||
GameSettings.Options.HUD_24H, GameSettings.Options.CHUNK_FIX };
|
||||
GameSettings.Options.ENTITY_SHADOWS, GameSettings.Options.FOG, GameSettings.Options.EAGLER_DYNAMIC_LIGHTS,
|
||||
GameSettings.Options.FULLSCREEN, GameSettings.Options.FNAW_SKINS, GameSettings.Options.HUD_FPS,
|
||||
GameSettings.Options.HUD_COORDS, GameSettings.Options.HUD_PLAYER, GameSettings.Options.HUD_STATS,
|
||||
GameSettings.Options.HUD_WORLD, GameSettings.Options.HUD_24H, GameSettings.Options.CHUNK_FIX };
|
||||
|
||||
public GuiVideoSettings(GuiScreen parentScreenIn, GameSettings gameSettingsIn) {
|
||||
this.parentGuiScreen = parentScreenIn;
|
||||
|
|
|
|||
|
|
@ -280,4 +280,8 @@ public class EntityFX extends Entity {
|
|||
+ this.particleRed + "," + this.particleGreen + "," + this.particleBlue + "," + this.particleAlpha
|
||||
+ "), Age " + this.particleAge;
|
||||
}
|
||||
|
||||
protected float getEaglerDynamicLightsValueSimple(float partialTicks) {
|
||||
return 0.0f;
|
||||
}
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@ import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerTextureAtlasSprite;
|
|||
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.BlockVertexIDs;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DeferredStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.dynamiclights.DynamicLightsStateManager;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockLiquid;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
|
@ -55,6 +56,7 @@ public class BlockFluidRenderer {
|
|||
WorldRenderer worldRendererIn) {
|
||||
BlockPos tmp = new BlockPos(0, 0, 0);
|
||||
boolean deferred = DeferredStateManager.isDeferredRenderer();
|
||||
boolean isDynamicLights = deferred || DynamicLightsStateManager.isDynamicLightsRender();
|
||||
BlockLiquid blockliquid = (BlockLiquid) blockStateIn.getBlock();
|
||||
boolean lava = blockliquid.getMaterial() == Material.lava;
|
||||
boolean realistic = !lava && DeferredStateManager.isRenderingRealisticWater();
|
||||
|
|
@ -151,7 +153,7 @@ public class BlockFluidRenderer {
|
|||
.tex((double) f15, (double) f19).lightmap(l2, i3).endVertex();
|
||||
worldRendererIn.pos(d0 + 1.0D, d1 + (double) f10, d2 + 0.0D).color(f24, f25, f26, 1.0F)
|
||||
.tex((double) f16, (double) f20).lightmap(l2, i3).endVertex();
|
||||
if (deferred)
|
||||
if (isDynamicLights)
|
||||
worldRendererIn.genNormals(true, f12 <= -999.0F ? BlockVertexIDs.builtin_water_still_vertex_id
|
||||
: BlockVertexIDs.builtin_water_flow_vertex_id);
|
||||
|
||||
|
|
@ -164,7 +166,7 @@ public class BlockFluidRenderer {
|
|||
.tex((double) f15, (double) f19).lightmap(l2, i3).endVertex();
|
||||
worldRendererIn.pos(d0 + 0.0D, d1 + (double) f8, d2 + 1.0D).color(f24, f25, f26, 1.0F)
|
||||
.tex((double) f14, (double) f18).lightmap(l2, i3).endVertex();
|
||||
if (deferred)
|
||||
if (isDynamicLights)
|
||||
worldRendererIn.genNormals(true, f12 <= -999.0F ? BlockVertexIDs.builtin_water_still_vertex_id
|
||||
: BlockVertexIDs.builtin_water_flow_vertex_id);
|
||||
}
|
||||
|
|
@ -186,7 +188,7 @@ public class BlockFluidRenderer {
|
|||
.lightmap(i2, j2).endVertex();
|
||||
worldRendererIn.pos(d0 + 1.0D, d1, d2 + 1.0D).color(f3, f3, f3, 1.0F).tex((double) f36, (double) f38)
|
||||
.lightmap(i2, j2).endVertex();
|
||||
if (deferred)
|
||||
if (isDynamicLights)
|
||||
worldRendererIn.putNormal(0.0f, -1.0f, 0.0f, BlockVertexIDs.builtin_water_still_vertex_id);
|
||||
flag2 = true;
|
||||
}
|
||||
|
|
@ -272,7 +274,7 @@ public class BlockFluidRenderer {
|
|||
.lightmap(k, l).endVertex();
|
||||
worldRendererIn.pos(d3, d1 + 0.0D, d4).color(f32, f33, f34, 1.0F).tex((double) f41, (double) f30)
|
||||
.lightmap(k, l).endVertex();
|
||||
if (deferred)
|
||||
if (isDynamicLights)
|
||||
worldRendererIn.putNormal(j1, 0.0f, k1, BlockVertexIDs.builtin_water_flow_vertex_id);
|
||||
if (!realistic) {
|
||||
worldRendererIn.pos(d3, d1 + 0.0D, d4).color(f32, f33, f34, 1.0F)
|
||||
|
|
@ -283,7 +285,7 @@ public class BlockFluidRenderer {
|
|||
.tex((double) f27, (double) f29).lightmap(k, l).endVertex();
|
||||
worldRendererIn.pos(d3, d1 + (double) f39, d4).color(f32, f33, f34, 1.0F)
|
||||
.tex((double) f41, (double) f28).lightmap(k, l).endVertex();
|
||||
if (deferred)
|
||||
if (isDynamicLights)
|
||||
worldRendererIn.putNormal(-j1, 0.0f, -k1, BlockVertexIDs.builtin_water_flow_vertex_id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
|||
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DeferredStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.VertexMarkerState;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.dynamiclights.DynamicLightsStateManager;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
|
@ -139,6 +140,7 @@ public class BlockModelRenderer {
|
|||
WorldRenderer worldRendererIn, List<BakedQuad> listQuadsIn, float[] quadBounds, BitSet boundsFlags,
|
||||
BlockModelRenderer.AmbientOcclusionFace aoFaceIn) {
|
||||
boolean isDeferred = DeferredStateManager.isDeferredRenderer();
|
||||
boolean isDynamicLights = isDeferred || DynamicLightsStateManager.isDynamicLightsRender();
|
||||
double d0 = (double) blockPosIn.getX();
|
||||
double d1 = (double) blockPosIn.getY();
|
||||
double d2 = (double) blockPosIn.getZ();
|
||||
|
|
@ -154,8 +156,9 @@ public class BlockModelRenderer {
|
|||
|
||||
for (int i = 0, l = listQuadsIn.size(); i < l; ++i) {
|
||||
BakedQuad bakedquad = listQuadsIn.get(i);
|
||||
int[] vertData = isDeferred ? bakedquad.getVertexDataWithNormals() : bakedquad.getVertexData();
|
||||
this.fillQuadBounds(blockIn, vertData, bakedquad.getFace(), quadBounds, boundsFlags, isDeferred ? 8 : 7);
|
||||
int[] vertData = isDynamicLights ? bakedquad.getVertexDataWithNormals() : bakedquad.getVertexData();
|
||||
this.fillQuadBounds(blockIn, vertData, bakedquad.getFace(), quadBounds, boundsFlags,
|
||||
isDynamicLights ? 8 : 7);
|
||||
aoFaceIn.updateVertexBrightness(blockAccessIn, blockIn, blockPosIn, bakedquad.getFace(), quadBounds,
|
||||
boundsFlags);
|
||||
worldRendererIn.addVertexData(vertData);
|
||||
|
|
@ -272,6 +275,7 @@ public class BlockModelRenderer {
|
|||
EnumFacing faceIn, int brightnessIn, boolean ownBrightness, WorldRenderer worldRendererIn,
|
||||
List<BakedQuad> listQuadsIn, BitSet boundsFlags, float[] quadBounds) {
|
||||
boolean isDeferred = DeferredStateManager.isDeferredRenderer();
|
||||
boolean isDynamicLights = isDeferred || DynamicLightsStateManager.isDynamicLightsRender();
|
||||
double d0 = (double) blockPosIn.getX();
|
||||
double d1 = (double) blockPosIn.getY();
|
||||
double d2 = (double) blockPosIn.getZ();
|
||||
|
|
@ -291,9 +295,9 @@ public class BlockModelRenderer {
|
|||
for (int m = 0, n = listQuadsIn.size(); m < n; ++m) {
|
||||
BakedQuad bakedquad = listQuadsIn.get(m);
|
||||
EnumFacing facingIn = bakedquad.getFace();
|
||||
int[] vertData = isDeferred ? bakedquad.getVertexDataWithNormals() : bakedquad.getVertexData();
|
||||
int[] vertData = isDynamicLights ? bakedquad.getVertexDataWithNormals() : bakedquad.getVertexData();
|
||||
blockPosIn.offsetEvenFaster(facingIn, blockpos0);
|
||||
this.fillQuadBounds(blockIn, vertData, facingIn, quadBounds, boundsFlags, isDeferred ? 8 : 7);
|
||||
this.fillQuadBounds(blockIn, vertData, facingIn, quadBounds, boundsFlags, isDynamicLights ? 8 : 7);
|
||||
boolean boundsFlags0 = boundsFlags.get(0);
|
||||
if (ownBrightness) {
|
||||
brightnessIn = boundsFlags0 ? blockIn.getMixedBrightnessForBlock(blockAccessIn, blockpos0)
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.google.common.collect.Lists;
|
|||
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DeferredStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.dynamiclights.DynamicLightsStateManager;
|
||||
import net.minecraft.client.renderer.chunk.RenderChunk;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumWorldBlockLayer;
|
||||
|
|
@ -53,10 +54,15 @@ public abstract class ChunkRenderContainer {
|
|||
float posZ = (float) ((double) blockpos.getZ() - this.viewEntityZ);
|
||||
GlStateManager.translate(posX, posY, posZ);
|
||||
if (DeferredStateManager.isInForwardPass()) {
|
||||
posX = (float) (blockpos.getX() - (MathHelper.floor_double(this.viewEntityX / 16.0) << 4)); // TODO
|
||||
posX = (float) (blockpos.getX() - (MathHelper.floor_double(this.viewEntityX / 16.0) << 4));
|
||||
posY = (float) (blockpos.getY() - (MathHelper.floor_double(this.viewEntityY / 16.0) << 4));
|
||||
posZ = (float) (blockpos.getZ() - (MathHelper.floor_double(this.viewEntityZ / 16.0) << 4));
|
||||
DeferredStateManager.reportForwardRenderObjectPosition((int) posX, (int) posY, (int) posZ);
|
||||
} else if (DynamicLightsStateManager.isInDynamicLightsPass()) {
|
||||
posX = (float) (blockpos.getX() - (MathHelper.floor_double(this.viewEntityX / 16.0) << 4));
|
||||
posY = (float) (blockpos.getY() - (MathHelper.floor_double(this.viewEntityY / 16.0) << 4));
|
||||
posZ = (float) (blockpos.getZ() - (MathHelper.floor_double(this.viewEntityZ / 16.0) << 4));
|
||||
DynamicLightsStateManager.reportForwardRenderObjectPosition((int) posX, (int) posY, (int) posZ);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.NameTagRenderer;
|
|||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.ShadersRenderPassFuture;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.gui.GuiShaderConfig;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.texture.EmissiveItems;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.dynamiclights.DynamicLightsStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.vector.Vector4f;
|
||||
import net.lax1dude.eaglercraft.v1_8.voice.VoiceTagRenderer;
|
||||
import net.lax1dude.eaglercraft.v1_8.vector.Matrix4f;
|
||||
|
|
@ -653,6 +654,9 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
*/
|
||||
private void renderHand(float partialTicks, int xOffset) {
|
||||
if (!this.debugView) {
|
||||
if (DynamicLightsStateManager.isInDynamicLightsPass()) {
|
||||
DynamicLightsStateManager.reportForwardRenderObjectPosition2(0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
GlStateManager.matrixMode(GL_PROJECTION);
|
||||
GlStateManager.loadIdentity();
|
||||
float f = 0.07F;
|
||||
|
|
@ -848,7 +852,8 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
|
||||
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
|
||||
this.mc.getTextureManager().bindTexture(this.locationLightMap);
|
||||
if (mc.gameSettings.fancyGraphics || mc.gameSettings.ambientOcclusion > 0) {
|
||||
if (mc.gameSettings.fancyGraphics || mc.gameSettings.ambientOcclusion > 0
|
||||
|| DynamicLightsStateManager.isDynamicLightsRender()) {
|
||||
EaglercraftGPU.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
EaglercraftGPU.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
} else {
|
||||
|
|
@ -1098,14 +1103,27 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
GlStateManager.enableAlpha();
|
||||
GlStateManager.alphaFunc(GL_GREATER, 0.5F);
|
||||
this.mc.mcProfiler.startSection("center");
|
||||
boolean dlights = DynamicLightsStateManager.isDynamicLightsRender();
|
||||
if (dlights) {
|
||||
updateDynamicLightListEagler(partialTicks);
|
||||
}
|
||||
if (this.mc.gameSettings.anaglyph && !this.mc.gameSettings.shaders) {
|
||||
anaglyphField = 0;
|
||||
GlStateManager.colorMask(false, true, true, false);
|
||||
this.renderWorldPass(0, partialTicks, finishTimeNano);
|
||||
anaglyphField = 1;
|
||||
GlStateManager.colorMask(true, false, false, false);
|
||||
this.renderWorldPass(1, partialTicks, finishTimeNano);
|
||||
GlStateManager.colorMask(true, true, true, false);
|
||||
if (dlights) {
|
||||
GlStateManager.enableExtensionPipeline();
|
||||
}
|
||||
try {
|
||||
anaglyphField = 0;
|
||||
GlStateManager.colorMask(false, true, true, false);
|
||||
this.renderWorldPass(0, partialTicks, finishTimeNano);
|
||||
anaglyphField = 1;
|
||||
GlStateManager.colorMask(true, false, false, false);
|
||||
this.renderWorldPass(1, partialTicks, finishTimeNano);
|
||||
GlStateManager.colorMask(true, true, true, false);
|
||||
} finally {
|
||||
if (dlights) {
|
||||
GlStateManager.disableExtensionPipeline();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (this.mc.gameSettings.shaders) {
|
||||
try {
|
||||
|
|
@ -1121,7 +1139,16 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
mc.effectRenderer.acceleratedParticleRenderer = EffectRenderer.vanillaAcceleratedParticleRenderer;
|
||||
} else {
|
||||
mc.effectRenderer.acceleratedParticleRenderer = EffectRenderer.vanillaAcceleratedParticleRenderer;
|
||||
this.renderWorldPass(2, partialTicks, finishTimeNano);
|
||||
if (dlights) {
|
||||
GlStateManager.enableExtensionPipeline();
|
||||
}
|
||||
try {
|
||||
this.renderWorldPass(2, partialTicks, finishTimeNano);
|
||||
} finally {
|
||||
if (dlights) {
|
||||
GlStateManager.disableExtensionPipeline();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1143,6 +1170,10 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
GlStateManager.clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
this.mc.mcProfiler.endStartSection("camera");
|
||||
this.setupCameraTransform(partialTicks, pass);
|
||||
boolean isDynamicLights = DynamicLightsStateManager.isDynamicLightsRender();
|
||||
if (isDynamicLights) {
|
||||
DynamicLightsStateManager.setupInverseViewMatrix();
|
||||
}
|
||||
ActiveRenderInfo.updateRenderInfo(this.mc.thePlayer, this.mc.gameSettings.thirdPersonView == 2);
|
||||
this.mc.mcProfiler.endStartSection("culling");
|
||||
Frustum frustum = new Frustum();
|
||||
|
|
@ -1150,6 +1181,9 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
double d0 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double) partialTicks;
|
||||
double d1 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double) partialTicks;
|
||||
double d2 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double) partialTicks;
|
||||
TileEntityRendererDispatcher.staticPlayerX = d0; // hack, needed for some eagler stuff
|
||||
TileEntityRendererDispatcher.staticPlayerY = d1;
|
||||
TileEntityRendererDispatcher.staticPlayerZ = d2;
|
||||
frustum.setPosition(d0, d1, d2);
|
||||
if (this.mc.gameSettings.renderDistanceChunks >= 4) {
|
||||
this.setupFog(-1, partialTicks);
|
||||
|
|
@ -1215,8 +1249,14 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
EntityPlayer entityplayer = (EntityPlayer) entity;
|
||||
GlStateManager.disableAlpha();
|
||||
this.mc.mcProfiler.endStartSection("outline");
|
||||
if (isDynamicLights) {
|
||||
GlStateManager.disableExtensionPipeline();
|
||||
}
|
||||
renderglobal.drawSelectionBox(entityplayer, this.mc.objectMouseOver, 0, partialTicks);
|
||||
GlStateManager.enableAlpha();
|
||||
if (isDynamicLights) {
|
||||
GlStateManager.enableExtensionPipeline();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1225,9 +1265,15 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
if (flag && this.mc.objectMouseOver != null && !entity.isInsideOfMaterial(Material.water)) {
|
||||
EntityPlayer entityplayer1 = (EntityPlayer) entity;
|
||||
GlStateManager.disableAlpha();
|
||||
if (isDynamicLights) {
|
||||
GlStateManager.disableExtensionPipeline();
|
||||
}
|
||||
this.mc.mcProfiler.endStartSection("outline");
|
||||
renderglobal.drawSelectionBox(entityplayer1, this.mc.objectMouseOver, 0, partialTicks);
|
||||
GlStateManager.enableAlpha();
|
||||
if (isDynamicLights) {
|
||||
GlStateManager.enableExtensionPipeline();
|
||||
}
|
||||
}
|
||||
|
||||
this.mc.mcProfiler.endStartSection("destroyProgress");
|
||||
|
|
@ -1245,7 +1291,14 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
RenderHelper.disableStandardItemLighting();
|
||||
this.setupFog(0, partialTicks);
|
||||
this.mc.mcProfiler.endStartSection("particles");
|
||||
if (isDynamicLights) {
|
||||
DynamicLightsStateManager.bindAcceleratedEffectRenderer(effectrenderer);
|
||||
DynamicLightsStateManager.reportForwardRenderObjectPosition2(0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
effectrenderer.renderParticles(entity, partialTicks, 2);
|
||||
if (isDynamicLights) {
|
||||
effectrenderer.acceleratedParticleRenderer = null;
|
||||
}
|
||||
this.disableLightmap();
|
||||
}
|
||||
|
||||
|
|
@ -1285,6 +1338,20 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
|
||||
}
|
||||
|
||||
private void updateDynamicLightListEagler(float partialTicks) {
|
||||
DynamicLightsStateManager.clearRenderList();
|
||||
Entity entity = this.mc.getRenderViewEntity();
|
||||
double d0 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double) partialTicks;
|
||||
double d1 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double) partialTicks;
|
||||
double d2 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double) partialTicks;
|
||||
AxisAlignedBB entityAABB = new AxisAlignedBB(d0 - 48.0, d1 - 32.0, d2 - 48.0, d0 + 48.0, d1 + 32.0, d2 + 48.0);
|
||||
List<Entity> entities = this.mc.theWorld.getEntitiesWithinAABB(Entity.class, entityAABB);
|
||||
for (int i = 0, l = entities.size(); i < l; ++i) {
|
||||
entities.get(i).renderDynamicLightsEaglerSimple(partialTicks);
|
||||
}
|
||||
DynamicLightsStateManager.commitLightSourceBuckets(d0, d1, d2);
|
||||
}
|
||||
|
||||
private void renderCloudsCheck(RenderGlobal renderGlobalIn, float partialTicks, int pass) {
|
||||
if (this.mc.gameSettings.func_181147_e() != 0) {
|
||||
this.mc.mcProfiler.endStartSection("clouds");
|
||||
|
|
@ -1398,6 +1465,9 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
GlStateManager.enableBlend();
|
||||
GlStateManager.tryBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
||||
GlStateManager.alphaFunc(GL_GREATER, 0.1F);
|
||||
if (DynamicLightsStateManager.isInDynamicLightsPass()) {
|
||||
DynamicLightsStateManager.reportForwardRenderObjectPosition2(0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
} else {
|
||||
GlStateManager.enableAlpha();
|
||||
DeferredStateManager.setHDRTranslucentPassBlendFunc();
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DynamicLightManager;
|
|||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.EaglerDeferredConfig;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.EaglerDeferredPipeline;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.program.SharedPipelineShaders;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.dynamiclights.DynamicLightsStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.vector.Vector3f;
|
||||
import net.lax1dude.eaglercraft.v1_8.vector.Vector4f;
|
||||
import net.minecraft.block.Block;
|
||||
|
|
@ -466,6 +467,16 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
|
|||
}
|
||||
SharedPipelineShaders.free();
|
||||
}
|
||||
|
||||
if (DeferredStateManager.isDeferredRenderer()) {
|
||||
DynamicLightsStateManager.disableDynamicLightsRender(false);
|
||||
} else {
|
||||
if (mc.gameSettings.enableDynamicLights) {
|
||||
DynamicLightsStateManager.enableDynamicLightsRender();
|
||||
} else {
|
||||
DynamicLightsStateManager.disableDynamicLightsRender(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1948,8 +1959,10 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
|
|||
if (!this.damagedBlocks.isEmpty()) {
|
||||
this.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
this.preRenderDamagedBlocks();
|
||||
worldRendererIn.begin(7, DeferredStateManager.isDeferredRenderer() ? VertexFormat.BLOCK_SHADERS
|
||||
: DefaultVertexFormats.BLOCK);
|
||||
worldRendererIn.begin(7,
|
||||
(DeferredStateManager.isDeferredRenderer() || DynamicLightsStateManager.isDynamicLightsRender())
|
||||
? VertexFormat.BLOCK_SHADERS
|
||||
: DefaultVertexFormats.BLOCK);
|
||||
worldRendererIn.setTranslation(-d0, -d1, -d2);
|
||||
worldRendererIn.markDirty();
|
||||
Iterator iterator = this.damagedBlocks.values().iterator();
|
||||
|
|
@ -1971,6 +1984,10 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
|
|||
int i = destroyblockprogress.getPartialBlockDamage();
|
||||
EaglerTextureAtlasSprite textureatlassprite = this.destroyBlockIcons[i];
|
||||
BlockRendererDispatcher blockrendererdispatcher = this.mc.getBlockRendererDispatcher();
|
||||
if (DynamicLightsStateManager.isInDynamicLightsPass()) {
|
||||
DynamicLightsStateManager.reportForwardRenderObjectPosition2(blockpos.x, blockpos.y,
|
||||
blockpos.z);
|
||||
}
|
||||
blockrendererdispatcher.renderBlockDamage(iblockstate, blockpos, textureatlassprite,
|
||||
this.theWorld);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.VertexMarkerState;
|
|||
import net.lax1dude.eaglercraft.v1_8.vector.Matrix4f;
|
||||
import net.lax1dude.eaglercraft.v1_8.vector.Vector3f;
|
||||
import net.lax1dude.eaglercraft.v1_8.vector.Vector4f;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.EnumFaceDirection;
|
||||
import net.minecraft.client.resources.model.ModelRotation;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
|
@ -119,7 +120,9 @@ public class FaceBakery {
|
|||
float[] sprite, EaglerTextureAtlasSprite modelRotationIn, ModelRotation partRotation,
|
||||
BlockPartRotation uvLocked, boolean shade, boolean parFlag2, Vector3f calcNormal) {
|
||||
EnumFacing enumfacing = partRotation.rotateFace(facing);
|
||||
int i = (parFlag2 && stride != 8) ? this.getFaceShadeColor(enumfacing) : -1;
|
||||
int i = (parFlag2 && (stride != 8 || !Minecraft.getMinecraft().gameSettings.shaders))
|
||||
? this.getFaceShadeColor(enumfacing)
|
||||
: -1;
|
||||
EnumFaceDirection.VertexInformation enumfacedirection$vertexinformation = EnumFaceDirection.getFacing(facing)
|
||||
.func_179025_a(vertexIndex);
|
||||
Vector3f vector3f = new Vector3f(sprite[enumfacedirection$vertexinformation.field_179184_a],
|
||||
|
|
@ -139,9 +142,15 @@ public class FaceBakery {
|
|||
faceData[i + 4 + 1] = Float
|
||||
.floatToRawIntBits(sprite.getInterpolatedV((double) faceUV.func_178346_b(vertexIndex)));
|
||||
if (stride == 8) {
|
||||
faceData[i] = Float.floatToRawIntBits(position.x * VertexMarkerState.localCoordDeriveHackX);
|
||||
faceData[i + 1] = Float.floatToRawIntBits(position.y * VertexMarkerState.localCoordDeriveHackY);
|
||||
faceData[i + 2] = Float.floatToRawIntBits(position.z * VertexMarkerState.localCoordDeriveHackZ);
|
||||
if (!Minecraft.getMinecraft().gameSettings.shaders) {
|
||||
faceData[i] = Float.floatToRawIntBits(position.x);
|
||||
faceData[i + 1] = Float.floatToRawIntBits(position.y);
|
||||
faceData[i + 2] = Float.floatToRawIntBits(position.z);
|
||||
} else {
|
||||
faceData[i] = Float.floatToRawIntBits(position.x * VertexMarkerState.localCoordDeriveHackX);
|
||||
faceData[i + 1] = Float.floatToRawIntBits(position.y * VertexMarkerState.localCoordDeriveHackY);
|
||||
faceData[i + 2] = Float.floatToRawIntBits(position.z * VertexMarkerState.localCoordDeriveHackZ);
|
||||
}
|
||||
if (calcNormal != null) {
|
||||
int x = (byte) ((int) (calcNormal.x * 127.0F)) & 255;
|
||||
int y = (byte) ((int) (calcNormal.y * 127.0F)) & 255;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
|||
import net.lax1dude.eaglercraft.v1_8.opengl.VertexFormat;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DeferredStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.dynamiclights.DynamicLightsStateManager;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
|
@ -246,7 +247,9 @@ public class RenderChunk {
|
|||
|
||||
private void preRenderBlocks(WorldRenderer worldRendererIn, BlockPos pos) {
|
||||
worldRendererIn.begin(7,
|
||||
DeferredStateManager.isDeferredRenderer() ? VertexFormat.BLOCK_SHADERS : DefaultVertexFormats.BLOCK);
|
||||
(DeferredStateManager.isDeferredRenderer() || DynamicLightsStateManager.isDynamicLightsRender())
|
||||
? VertexFormat.BLOCK_SHADERS
|
||||
: DefaultVertexFormats.BLOCK);
|
||||
worldRendererIn.setTranslation((double) (-pos.getX()), (double) (-pos.getY()), (double) (-pos.getZ()));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
|||
import net.lax1dude.eaglercraft.v1_8.opengl.VertexFormat;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DeferredStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.dynamiclights.DynamicLightsStateManager;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
|
@ -66,8 +67,10 @@ public class RenderFallingBlock extends Render<EntityFallingBlock> {
|
|||
GlStateManager.disableLighting();
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
|
||||
worldrenderer.begin(7, DeferredStateManager.isDeferredRenderer() ? VertexFormat.BLOCK_SHADERS
|
||||
: DefaultVertexFormats.BLOCK);
|
||||
worldrenderer.begin(7,
|
||||
(DeferredStateManager.isDeferredRenderer()
|
||||
|| DynamicLightsStateManager.isDynamicLightsRender()) ? VertexFormat.BLOCK_SHADERS
|
||||
: DefaultVertexFormats.BLOCK);
|
||||
int i = blockpos.getX();
|
||||
int j = blockpos.getY();
|
||||
int k = blockpos.getZ();
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
|||
import net.lax1dude.eaglercraft.v1_8.opengl.OpenGlHelper;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DeferredStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.dynamiclights.DynamicLightsStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.profile.RenderHighPoly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockBed;
|
||||
|
|
@ -332,6 +333,10 @@ public class RenderManager {
|
|||
double d0 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double) partialTicks;
|
||||
double d1 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double) partialTicks;
|
||||
double d2 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double) partialTicks;
|
||||
if (DynamicLightsStateManager.isInDynamicLightsPass()) {
|
||||
DynamicLightsStateManager.reportForwardRenderObjectPosition2((float) (d0 - viewerPosX),
|
||||
(float) (d1 - viewerPosY), (float) (d2 - viewerPosZ));
|
||||
}
|
||||
float f = entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks;
|
||||
int i = entity.getBrightnessForRender(partialTicks);
|
||||
if (entity.isBurning()) {
|
||||
|
|
|
|||
|
|
@ -93,6 +93,8 @@ public class LayerSpiderEyes implements LayerRenderer<EntitySpider> {
|
|||
this.spiderRenderer.bindTexture(SPIDER_EYES);
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.disableAlpha();
|
||||
GlStateManager.enablePolygonOffset();
|
||||
GlStateManager.doPolygonOffset(-0.025f, 1.0f);
|
||||
GlStateManager.blendFunc(GL_ONE, GL_ONE);
|
||||
if (entityspider.isInvisible()) {
|
||||
GlStateManager.depthMask(false);
|
||||
|
|
@ -113,6 +115,7 @@ public class LayerSpiderEyes implements LayerRenderer<EntitySpider> {
|
|||
this.spiderRenderer.func_177105_a(entityspider, f2);
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.enableAlpha();
|
||||
GlStateManager.disablePolygonOffset();
|
||||
}
|
||||
|
||||
public boolean shouldCombineTextures() {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.google.common.collect.Maps;
|
|||
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.OpenGlHelper;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.dynamiclights.DynamicLightsStateManager;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.crash.CrashReport;
|
||||
|
|
@ -146,6 +147,9 @@ public class TileEntityRendererDispatcher {
|
|||
TileEntitySpecialRenderer tileentityspecialrenderer = this.getSpecialRenderer(tileEntityIn);
|
||||
if (tileentityspecialrenderer != null) {
|
||||
try {
|
||||
if (DynamicLightsStateManager.isInDynamicLightsPass()) {
|
||||
DynamicLightsStateManager.reportForwardRenderObjectPosition2((float) x, (float) y, (float) z);
|
||||
}
|
||||
tileentityspecialrenderer.renderTileEntityAt(tileEntityIn, x, y, z, partialTicks, destroyStage);
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Rendering Block Entity");
|
||||
|
|
|
|||
|
|
@ -202,6 +202,7 @@ public class GameSettings {
|
|||
public EaglerDeferredConfig deferredShaderConf = new EaglerDeferredConfig();
|
||||
public boolean enableUpdateSvc = true;
|
||||
public boolean enableFNAWSkins = true;
|
||||
public boolean enableDynamicLights = false;
|
||||
|
||||
public int voiceListenRadius = 16;
|
||||
public float voiceListenVolume = 0.5f;
|
||||
|
|
@ -465,6 +466,11 @@ public class GameSettings {
|
|||
this.enableVsync = !this.enableVsync;
|
||||
}
|
||||
|
||||
if (parOptions == GameSettings.Options.EAGLER_DYNAMIC_LIGHTS) {
|
||||
this.enableDynamicLights = !this.enableDynamicLights;
|
||||
this.mc.renderGlobal.loadRenderers();
|
||||
}
|
||||
|
||||
this.saveOptions();
|
||||
}
|
||||
|
||||
|
|
@ -541,6 +547,8 @@ public class GameSettings {
|
|||
return this.enableFNAWSkins;
|
||||
case EAGLER_VSYNC:
|
||||
return this.enableVsync;
|
||||
case EAGLER_DYNAMIC_LIGHTS:
|
||||
return this.enableDynamicLights;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
@ -986,6 +994,10 @@ public class GameSettings {
|
|||
this.enableFNAWSkins = astring[1].equals("true");
|
||||
}
|
||||
|
||||
if (astring[0].equals("enableDynamicLights")) {
|
||||
this.enableDynamicLights = astring[1].equals("true");
|
||||
}
|
||||
|
||||
deferredShaderConf.readOption(astring[0], astring[1]);
|
||||
} catch (Exception var8) {
|
||||
logger.warn("Skipping bad option: " + s);
|
||||
|
|
@ -1104,6 +1116,7 @@ public class GameSettings {
|
|||
printwriter.println("voiceSpeakVolume:" + this.voiceSpeakVolume);
|
||||
printwriter.println("voicePTTKey:" + this.voicePTTKey);
|
||||
printwriter.println("enableFNAWSkins:" + this.enableFNAWSkins);
|
||||
printwriter.println("enableDynamicLights:" + this.enableDynamicLights);
|
||||
|
||||
for (KeyBinding keybinding : this.keyBindings) {
|
||||
printwriter.println("key_" + keybinding.getKeyDescription() + ":" + keybinding.getKeyCode());
|
||||
|
|
@ -1206,7 +1219,7 @@ public class GameSettings {
|
|||
INVERT_MOUSE("options.invertMouse", false, true), SENSITIVITY("options.sensitivity", true, false),
|
||||
FOV("options.fov", true, false, 30.0F, 110.0F, 1.0F), GAMMA("options.gamma", true, false),
|
||||
SATURATION("options.saturation", true, false),
|
||||
RENDER_DISTANCE("options.renderDistance", true, false, 1.0F, 16.0F, 1.0F),
|
||||
RENDER_DISTANCE("options.renderDistance", true, false, 1.0F, 18.0F, 1.0F),
|
||||
VIEW_BOBBING("options.viewBobbing", false, true), ANAGLYPH("options.anaglyph", false, true),
|
||||
FRAMERATE_LIMIT("options.framerateLimit", true, false, 10.0F, 260.0F, 10.0F),
|
||||
FBO_ENABLE("options.fboEnable", false, true), RENDER_CLOUDS("options.renderClouds", false, false),
|
||||
|
|
@ -1238,7 +1251,7 @@ public class GameSettings {
|
|||
FOG("options.fog", false, true), FXAA("options.fxaa", false, false),
|
||||
FULLSCREEN("options.fullscreen", false, true),
|
||||
FNAW_SKINS("options.skinCustomisation.enableFNAWSkins", false, true),
|
||||
EAGLER_VSYNC("options.vsync", false, true);
|
||||
EAGLER_VSYNC("options.vsync", false, true), EAGLER_DYNAMIC_LIGHTS("options.dynamicLights", false, true);
|
||||
|
||||
private final boolean enumFloat;
|
||||
private final boolean enumBoolean;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
|
|||
import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;
|
||||
import net.lax1dude.eaglercraft.v1_8.HString;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DynamicLightManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.dynamiclights.DynamicLightsStateManager;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
|
|
@ -1013,7 +1014,12 @@ public abstract class Entity implements ICommandSender {
|
|||
|
||||
public int getBrightnessForRender(float var1) {
|
||||
BlockPos blockpos = new BlockPos(this.posX, this.posY + (double) this.getEyeHeight(), this.posZ);
|
||||
return this.worldObj.isBlockLoaded(blockpos) ? this.worldObj.getCombinedLight(blockpos, 0) : 0;
|
||||
int i = 0;
|
||||
if (DynamicLightsStateManager.isDynamicLightsRender()) {
|
||||
i += (int) (getEaglerDynamicLightsValueSimple(var1) * 15.0f);
|
||||
}
|
||||
return this.worldObj.isBlockLoaded(blockpos) ? this.worldObj.getCombinedLight(blockpos, -i)
|
||||
: (i > 15 ? 240 : (i << 4));
|
||||
}
|
||||
|
||||
/**+
|
||||
|
|
@ -1021,7 +1027,11 @@ public abstract class Entity implements ICommandSender {
|
|||
*/
|
||||
public float getBrightness(float var1) {
|
||||
BlockPos blockpos = new BlockPos(this.posX, this.posY + (double) this.getEyeHeight(), this.posZ);
|
||||
return this.worldObj.isBlockLoaded(blockpos) ? this.worldObj.getLightBrightness(blockpos) : 0.0F;
|
||||
float f = this.worldObj.isBlockLoaded(blockpos) ? this.worldObj.getLightBrightness(blockpos) : 0.0F;
|
||||
if (DynamicLightsStateManager.isDynamicLightsRender()) {
|
||||
f = Math.min(f + getEaglerDynamicLightsValueSimple(var1), 1.0f);
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
/**+
|
||||
|
|
@ -2380,7 +2390,8 @@ public abstract class Entity implements ICommandSender {
|
|||
double entityX2 = entityX - TileEntityRendererDispatcher.staticPlayerX;
|
||||
double entityY2 = entityY - TileEntityRendererDispatcher.staticPlayerY;
|
||||
double entityZ2 = entityZ - TileEntityRendererDispatcher.staticPlayerZ;
|
||||
if (Math.sqrt(entityX2 * entityX2 + entityY2 * entityY2 + entityZ2 * entityZ2) < 48.0 * 48.0) {
|
||||
if (entityX2 * entityX2 + entityY2 * entityY2
|
||||
+ entityZ2 * entityZ2 < (isInFrustum ? (64.0 * 64.0) : (24.0 * 24.0))) {
|
||||
renderDynamicLightsEaglerAt(entityX, entityY, entityZ, entityX2, entityY2, entityZ2, partialTicks,
|
||||
isInFrustum);
|
||||
}
|
||||
|
|
@ -2388,14 +2399,41 @@ public abstract class Entity implements ICommandSender {
|
|||
|
||||
protected void renderDynamicLightsEaglerAt(double entityX, double entityY, double entityZ, double renderX,
|
||||
double renderY, double renderZ, float partialTicks, boolean isInFrustum) {
|
||||
float size = Math.max(width, height);
|
||||
if (size < 1.0f && !isInFrustum) {
|
||||
return;
|
||||
}
|
||||
if (this.isBurning()) {
|
||||
float size = Math.max(width, height);
|
||||
if (size < 1.0f && !isInFrustum) {
|
||||
return;
|
||||
}
|
||||
float mag = 5.0f * size;
|
||||
DynamicLightManager.renderDynamicLight("entity_" + entityId + "_fire", entityX, entityY + height * 0.75,
|
||||
entityZ, mag, 0.487f * mag, 0.1411f * mag, false);
|
||||
}
|
||||
}
|
||||
|
||||
public void renderDynamicLightsEaglerSimple(float partialTicks) {
|
||||
double entityX = prevPosX + (posX - prevPosX) * (double) partialTicks;
|
||||
double entityY = prevPosY + (posY - prevPosY) * (double) partialTicks;
|
||||
double entityZ = prevPosZ + (posZ - prevPosZ) * (double) partialTicks;
|
||||
renderDynamicLightsEaglerSimpleAt(entityX, entityY, entityZ, partialTicks);
|
||||
}
|
||||
|
||||
protected void renderDynamicLightsEaglerSimpleAt(double entityX, double entityY, double entityZ,
|
||||
float partialTicks) {
|
||||
float renderBrightness = this.getEaglerDynamicLightsValueSimple(partialTicks);
|
||||
if (renderBrightness > 0.1f) {
|
||||
DynamicLightsStateManager.renderDynamicLight("entity_" + entityId + "_lightmap", entityX,
|
||||
entityY + height * 0.85, entityZ, renderBrightness * 13.0f);
|
||||
}
|
||||
}
|
||||
|
||||
protected float getEaglerDynamicLightsValueSimple(float partialTicks) {
|
||||
float size = Math.max(width, height);
|
||||
if (size < 1.0f) {
|
||||
return 0.0f;
|
||||
}
|
||||
if (this.isBurning()) {
|
||||
return size / 2.0f;
|
||||
}
|
||||
return 0.0f;
|
||||
}
|
||||
}
|
||||
|
|
@ -1911,4 +1911,16 @@ public abstract class EntityLivingBase extends Entity {
|
|||
}
|
||||
}
|
||||
|
||||
protected float getEaglerDynamicLightsValueSimple(float partialTicks) {
|
||||
float f = super.getEaglerDynamicLightsValueSimple(partialTicks);
|
||||
ItemStack itm = this.getHeldItem();
|
||||
if (itm != null && itm.stackSize > 0) {
|
||||
Item item = itm.getItem();
|
||||
if (item != null) {
|
||||
float f2 = item.getHeldItemBrightnessEagler();
|
||||
f = Math.min(f + f2 * 0.5f, 1.0f) + f2 * 0.5f;
|
||||
}
|
||||
}
|
||||
return f;
|
||||
}
|
||||
}
|
||||
|
|
@ -520,6 +520,10 @@ public class EntityWither extends EntityMob implements IBossDisplayData, IRanged
|
|||
return 15728880;
|
||||
}
|
||||
|
||||
protected float getEaglerDynamicLightsValueSimple(float partialTicks) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
public void fall(float var1, float var2) {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package net.minecraft.entity.item;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DynamicLightManager;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
|
@ -211,6 +212,21 @@ public class EntityEnderEye extends Entity {
|
|||
return 1.0F;
|
||||
}
|
||||
|
||||
protected float getEaglerDynamicLightsValueSimple(float partialTicks) {
|
||||
return 0.5f;
|
||||
}
|
||||
|
||||
protected void renderDynamicLightsEaglerAt(double entityX, double entityY, double entityZ, double renderX,
|
||||
double renderY, double renderZ, float partialTicks, boolean isInFrustum) {
|
||||
super.renderDynamicLightsEaglerAt(entityX, entityY, entityZ, renderX, renderY, renderZ, partialTicks,
|
||||
isInFrustum);
|
||||
if (isInFrustum && renderX * renderX + renderY * renderY + renderZ * renderZ < 150.0) {
|
||||
float mag = 0.5f;
|
||||
DynamicLightManager.renderDynamicLight("entity_" + getEntityId() + "_endereye", entityX, entityY + 0.2,
|
||||
entityZ, mag * 0.1990f, mag * 0.7750f, mag * 0.4130f, false);
|
||||
}
|
||||
}
|
||||
|
||||
public int getBrightnessForRender(float var1) {
|
||||
return 15728880;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -196,6 +196,10 @@ public class EntityFireworkRocket extends Entity {
|
|||
return super.getBrightness(f);
|
||||
}
|
||||
|
||||
protected float getEaglerDynamicLightsValueSimple(float partialTicks) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
public int getBrightnessForRender(float f) {
|
||||
return super.getBrightnessForRender(f);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -475,4 +475,17 @@ public class EntityItem extends Entity {
|
|||
isInFrustum);
|
||||
eaglerEmissiveFlag = Minecraft.getMinecraft().entityRenderer.renderItemEntityLight(this, 0.1f);
|
||||
}
|
||||
|
||||
protected float getEaglerDynamicLightsValueSimple(float partialTicks) {
|
||||
float f = super.getEaglerDynamicLightsValueSimple(partialTicks);
|
||||
ItemStack itm = this.getEntityItem();
|
||||
if (itm != null && itm.stackSize > 0) {
|
||||
Item item = itm.getItem();
|
||||
if (item != null) {
|
||||
float f2 = item.getHeldItemBrightnessEagler() * 0.75f;
|
||||
f = Math.min(f + f2 * 0.5f, 1.0f) + f2 * 0.5f;
|
||||
}
|
||||
}
|
||||
return f;
|
||||
}
|
||||
}
|
||||
|
|
@ -6,6 +6,7 @@ import net.minecraft.entity.EntityHanging;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemMap;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
|
@ -252,4 +253,17 @@ public class EntityItemFrame extends EntityHanging {
|
|||
isInFrustum);
|
||||
eaglerEmissiveFlag = Minecraft.getMinecraft().entityRenderer.renderItemEntityLight(this, 0.1f);
|
||||
}
|
||||
|
||||
protected float getEaglerDynamicLightsValueSimple(float partialTicks) {
|
||||
float f = super.getEaglerDynamicLightsValueSimple(partialTicks);
|
||||
ItemStack itm = this.getDisplayedItem();
|
||||
if (itm != null && itm.stackSize > 0) {
|
||||
Item item = itm.getItem();
|
||||
if (item != null) {
|
||||
float f2 = item.getHeldItemBrightnessEagler() * 0.75f;
|
||||
f = Math.min(f + f2 * 0.5f, 1.0f) + f2 * 0.5f;
|
||||
}
|
||||
}
|
||||
return f;
|
||||
}
|
||||
}
|
||||
|
|
@ -227,4 +227,12 @@ public class EntityMinecartTNT extends EntityMinecart {
|
|||
entityZ, dynamicLightMag, dynamicLightMag * 0.7792f, dynamicLightMag * 0.618f, false);
|
||||
}
|
||||
}
|
||||
|
||||
protected float getEaglerDynamicLightsValueSimple(float partialTicks) {
|
||||
float f = super.getEaglerDynamicLightsValueSimple(partialTicks);
|
||||
if (minecartTNTFuse > -1 && minecartTNTFuse / 5 % 2 == 0) {
|
||||
f = Math.min(f + 0.75f, 1.25f);
|
||||
}
|
||||
return f;
|
||||
}
|
||||
}
|
||||
|
|
@ -145,4 +145,12 @@ public class EntityTNTPrimed extends Entity {
|
|||
entityZ, dynamicLightMag, dynamicLightMag * 0.7792f, dynamicLightMag * 0.618f, false);
|
||||
}
|
||||
}
|
||||
|
||||
protected float getEaglerDynamicLightsValueSimple(float partialTicks) {
|
||||
float f = super.getEaglerDynamicLightsValueSimple(partialTicks);
|
||||
if (fuse / 5 % 2 == 0) {
|
||||
f = Math.min(f + 0.75f, 1.25f);
|
||||
}
|
||||
return f;
|
||||
}
|
||||
}
|
||||
|
|
@ -84,6 +84,10 @@ public class EntityXPOrb extends Entity {
|
|||
return j | k << 16;
|
||||
}
|
||||
|
||||
protected float getEaglerDynamicLightsValueSimple(float partialTicks) {
|
||||
return 0.25f;
|
||||
}
|
||||
|
||||
/**+
|
||||
* Called to update the entity's position/logic.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -104,6 +104,10 @@ public class EntityBlaze extends EntityMob {
|
|||
return 1.0F;
|
||||
}
|
||||
|
||||
protected float getEaglerDynamicLightsValueSimple(float partialTicks) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
/**+
|
||||
* Called frequently so the entity can update its state every
|
||||
* tick as required. For example, zombies and skeletons use this
|
||||
|
|
|
|||
|
|
@ -306,4 +306,13 @@ public class EntityCreeper extends EntityMob {
|
|||
DeferredStateManager.setEmissionConstant(1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
protected float getEaglerDynamicLightsValueSimple(float partialTicks) {
|
||||
float f = super.getEaglerDynamicLightsValueSimple(partialTicks);
|
||||
float ff = getCreeperFlashIntensity(partialTicks);
|
||||
if ((int) (ff * 10.0F) % 2 != 0) {
|
||||
f = Math.min(f + 0.5f, 1.15f);
|
||||
}
|
||||
return f;
|
||||
}
|
||||
}
|
||||
|
|
@ -75,6 +75,10 @@ public class EntityMagmaCube extends EntitySlime {
|
|||
return 1.0F;
|
||||
}
|
||||
|
||||
protected float getEaglerDynamicLightsValueSimple(float partialTicks) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
protected EnumParticleTypes getParticleType() {
|
||||
return EnumParticleTypes.FLAME;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -331,6 +331,10 @@ public abstract class EntityFireball extends Entity {
|
|||
return 1.0F;
|
||||
}
|
||||
|
||||
protected float getEaglerDynamicLightsValueSimple(float partialTicks) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
public int getBrightnessForRender(float var1) {
|
||||
return 15728880;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1113,4 +1113,8 @@ public class Item {
|
|||
: (this == IRON ? Items.iron_ingot : (this == EMERALD ? Items.diamond : null))));
|
||||
}
|
||||
}
|
||||
|
||||
public float getHeldItemBrightnessEagler() {
|
||||
return 0.0f;
|
||||
}
|
||||
}
|
||||
|
|
@ -167,4 +167,8 @@ public class ItemBlock extends Item {
|
|||
public Block getBlock() {
|
||||
return this.block;
|
||||
}
|
||||
|
||||
public float getHeldItemBrightnessEagler() {
|
||||
return this.block.getLightValue() * 0.06667f;
|
||||
}
|
||||
}
|
||||
|
|
@ -169,6 +169,11 @@ public abstract class MinecraftServer implements Runnable, ICommandSender, IThre
|
|||
worldsettings = new WorldSettings(worldinfo);
|
||||
}
|
||||
|
||||
if (worldinfo.isOldEaglercraftRandom()) {
|
||||
LogManager.getLogger("EaglerMinecraftServer")
|
||||
.info("Detected a pre-u34 world, using old EaglercraftRandom implementation for world generation");
|
||||
}
|
||||
|
||||
for (int j = 0; j < this.worldServers.length; ++j) {
|
||||
byte b0 = 0;
|
||||
if (j == 1) {
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ public class Teleporter {
|
|||
|
||||
public Teleporter(WorldServer worldIn) {
|
||||
this.worldServerInstance = worldIn;
|
||||
this.random = new EaglercraftRandom(worldIn.getSeed());
|
||||
this.random = new EaglercraftRandom(worldIn.getSeed(), !worldIn.getWorldInfo().isOldEaglercraftRandom());
|
||||
}
|
||||
|
||||
public void placeInPortal(Entity entityIn, float rotationYaw) {
|
||||
|
|
|
|||
|
|
@ -681,7 +681,12 @@ public abstract class World implements IBlockAccess {
|
|||
public int getCombinedLight(BlockPos pos, int lightValue) {
|
||||
int i = this.getLightFromNeighborsFor(EnumSkyBlock.SKY, pos);
|
||||
int j = this.getLightFromNeighborsFor(EnumSkyBlock.BLOCK, pos);
|
||||
if (j < lightValue) {
|
||||
if (lightValue < 0) {
|
||||
j += -lightValue;
|
||||
if (j > 15) {
|
||||
j = 15;
|
||||
}
|
||||
} else if (j < lightValue) {
|
||||
j = lightValue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -135,8 +135,9 @@ public abstract class WorldProvider {
|
|||
--f;
|
||||
}
|
||||
|
||||
float f2 = f;
|
||||
f = 1.0F - (float) ((Math.cos((double) f * 3.141592653589793D) + 1.0D) / 2.0D);
|
||||
f = f + (f - f) / 3.0F;
|
||||
f = f2 + (f - f2) / 3.0F;
|
||||
return f;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -84,11 +84,12 @@ public class BiomeGenMesa extends BiomeGenBase {
|
|||
public void genTerrainBlocks(World world, EaglercraftRandom random, ChunkPrimer chunkprimer, int i, int j,
|
||||
double d0) {
|
||||
if (this.field_150621_aC == null || this.field_150622_aD != world.getSeed()) {
|
||||
this.func_150619_a(world.getSeed());
|
||||
this.func_150619_a(world.getSeed(), !world.getWorldInfo().isOldEaglercraftRandom());
|
||||
}
|
||||
|
||||
if (this.field_150623_aE == null || this.field_150624_aF == null || this.field_150622_aD != world.getSeed()) {
|
||||
EaglercraftRandom random1 = new EaglercraftRandom(this.field_150622_aD);
|
||||
EaglercraftRandom random1 = new EaglercraftRandom(this.field_150622_aD,
|
||||
!world.getWorldInfo().isOldEaglercraftRandom());
|
||||
this.field_150623_aE = new NoiseGeneratorPerlin(random1, 4);
|
||||
this.field_150624_aF = new NoiseGeneratorPerlin(random1, 1);
|
||||
}
|
||||
|
|
@ -197,10 +198,10 @@ public class BiomeGenMesa extends BiomeGenBase {
|
|||
|
||||
}
|
||||
|
||||
private void func_150619_a(long parLong1) {
|
||||
private void func_150619_a(long parLong1, boolean scrambleRNG) {
|
||||
this.field_150621_aC = new IBlockState[64];
|
||||
Arrays.fill(this.field_150621_aC, Blocks.hardened_clay.getDefaultState());
|
||||
EaglercraftRandom random = new EaglercraftRandom(parLong1);
|
||||
EaglercraftRandom random = new EaglercraftRandom(parLong1, scrambleRNG);
|
||||
this.field_150625_aG = new NoiseGeneratorPerlin(random, 1);
|
||||
|
||||
for (int l1 = 0; l1 < 64; ++l1) {
|
||||
|
|
|
|||
|
|
@ -927,7 +927,7 @@ public class Chunk {
|
|||
public EaglercraftRandom getRandomWithSeed(long i) {
|
||||
return new EaglercraftRandom(this.worldObj.getSeed() + (long) (this.xPosition * this.xPosition * 4987142)
|
||||
+ (long) (this.xPosition * 5947611) + (long) (this.zPosition * this.zPosition) * 4392871L
|
||||
+ (long) (this.zPosition * 389711) ^ i);
|
||||
+ (long) (this.zPosition * 389711) ^ i, !this.worldObj.getWorldInfo().isOldEaglercraftRandom());
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
|
|
|
|||
|
|
@ -163,9 +163,11 @@ public class EmptyChunk extends Chunk {
|
|||
}
|
||||
|
||||
public EaglercraftRandom getRandomWithSeed(long seed) {
|
||||
return new EaglercraftRandom(this.getWorld().getSeed() + (long) (this.xPosition * this.xPosition * 4987142)
|
||||
+ (long) (this.xPosition * 5947611) + (long) (this.zPosition * this.zPosition) * 4392871L
|
||||
+ (long) (this.zPosition * 389711) ^ seed);
|
||||
return new EaglercraftRandom(
|
||||
this.getWorld().getSeed() + (long) (this.xPosition * this.xPosition * 4987142)
|
||||
+ (long) (this.xPosition * 5947611) + (long) (this.zPosition * this.zPosition) * 4392871L
|
||||
+ (long) (this.zPosition * 389711) ^ seed,
|
||||
!this.getWorld().getWorldInfo().isOldEaglercraftRandom());
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ public class ChunkProviderEnd implements IChunkProvider {
|
|||
|
||||
public ChunkProviderEnd(World worldIn, long parLong1) {
|
||||
this.endWorld = worldIn;
|
||||
this.endRNG = new EaglercraftRandom(parLong1);
|
||||
this.endRNG = new EaglercraftRandom(parLong1, !worldIn.getWorldInfo().isOldEaglercraftRandom());
|
||||
this.noiseGen1 = new NoiseGeneratorOctaves(this.endRNG, 16);
|
||||
this.noiseGen2 = new NoiseGeneratorOctaves(this.endRNG, 16);
|
||||
this.noiseGen3 = new NoiseGeneratorOctaves(this.endRNG, 8);
|
||||
|
|
|
|||
|
|
@ -57,7 +57,8 @@ public class ChunkProviderFlat implements IChunkProvider {
|
|||
|
||||
public ChunkProviderFlat(World worldIn, long seed, boolean generateStructures, String flatGeneratorSettings) {
|
||||
this.worldObj = worldIn;
|
||||
this.random = new EaglercraftRandom(seed);
|
||||
boolean scramble = !worldIn.getWorldInfo().isOldEaglercraftRandom();
|
||||
this.random = new EaglercraftRandom(seed, scramble);
|
||||
this.flatWorldGenInfo = FlatGeneratorInfo.createFlatGeneratorFromString(flatGeneratorSettings);
|
||||
if (generateStructures) {
|
||||
Map map = this.flatWorldGenInfo.getWorldFeatures();
|
||||
|
|
@ -67,23 +68,23 @@ public class ChunkProviderFlat implements IChunkProvider {
|
|||
map1.put("size", "1");
|
||||
}
|
||||
|
||||
this.structureGenerators.add(new MapGenVillage(map1));
|
||||
this.structureGenerators.add(new MapGenVillage(map1, scramble));
|
||||
}
|
||||
|
||||
if (map.containsKey("biome_1")) {
|
||||
this.structureGenerators.add(new MapGenScatteredFeature((Map) map.get("biome_1")));
|
||||
this.structureGenerators.add(new MapGenScatteredFeature((Map) map.get("biome_1"), scramble));
|
||||
}
|
||||
|
||||
if (map.containsKey("mineshaft")) {
|
||||
this.structureGenerators.add(new MapGenMineshaft((Map) map.get("mineshaft")));
|
||||
this.structureGenerators.add(new MapGenMineshaft((Map) map.get("mineshaft"), scramble));
|
||||
}
|
||||
|
||||
if (map.containsKey("stronghold")) {
|
||||
this.structureGenerators.add(new MapGenStronghold((Map) map.get("stronghold")));
|
||||
this.structureGenerators.add(new MapGenStronghold((Map) map.get("stronghold"), scramble));
|
||||
}
|
||||
|
||||
if (map.containsKey("oceanmonument")) {
|
||||
this.structureGenerators.add(new StructureOceanMonument((Map) map.get("oceanmonument")));
|
||||
this.structureGenerators.add(new StructureOceanMonument((Map) map.get("oceanmonument"), scramble));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -62,25 +62,13 @@ public class ChunkProviderGenerate implements IChunkProvider {
|
|||
private ChunkProviderSettings settings;
|
||||
private Block field_177476_s = Blocks.water;
|
||||
private double[] stoneNoise = new double[256];
|
||||
private MapGenBase caveGenerator = new MapGenCaves();
|
||||
/**+
|
||||
* Holds Stronghold Generator
|
||||
*/
|
||||
private MapGenStronghold strongholdGenerator = new MapGenStronghold();
|
||||
/**+
|
||||
* Holds Village Generator
|
||||
*/
|
||||
private MapGenVillage villageGenerator = new MapGenVillage();
|
||||
/**+
|
||||
* Holds Mineshaft Generator
|
||||
*/
|
||||
private MapGenMineshaft mineshaftGenerator = new MapGenMineshaft();
|
||||
private MapGenScatteredFeature scatteredFeatureGenerator = new MapGenScatteredFeature();
|
||||
/**+
|
||||
* Holds ravine generator
|
||||
*/
|
||||
private MapGenBase ravineGenerator = new MapGenRavine();
|
||||
private StructureOceanMonument oceanMonumentGenerator = new StructureOceanMonument();
|
||||
private MapGenBase caveGenerator;
|
||||
private MapGenStronghold strongholdGenerator;
|
||||
private MapGenVillage villageGenerator;
|
||||
private MapGenMineshaft mineshaftGenerator;
|
||||
private MapGenScatteredFeature scatteredFeatureGenerator;
|
||||
private MapGenBase ravineGenerator;
|
||||
private StructureOceanMonument oceanMonumentGenerator;
|
||||
private BiomeGenBase[] biomesForGeneration;
|
||||
double[] field_147427_d;
|
||||
double[] field_147428_e;
|
||||
|
|
@ -91,7 +79,15 @@ public class ChunkProviderGenerate implements IChunkProvider {
|
|||
this.worldObj = worldIn;
|
||||
this.mapFeaturesEnabled = parFlag;
|
||||
this.field_177475_o = worldIn.getWorldInfo().getTerrainType();
|
||||
this.rand = new EaglercraftRandom(parLong1);
|
||||
boolean scramble = !worldIn.getWorldInfo().isOldEaglercraftRandom();
|
||||
this.rand = new EaglercraftRandom(parLong1, scramble);
|
||||
this.caveGenerator = new MapGenCaves(scramble);
|
||||
this.strongholdGenerator = new MapGenStronghold(scramble);
|
||||
this.villageGenerator = new MapGenVillage(scramble);
|
||||
this.mineshaftGenerator = new MapGenMineshaft(scramble);
|
||||
this.scatteredFeatureGenerator = new MapGenScatteredFeature(scramble);
|
||||
this.ravineGenerator = new MapGenRavine(scramble);
|
||||
this.oceanMonumentGenerator = new StructureOceanMonument(scramble);
|
||||
this.field_147431_j = new NoiseGeneratorOctaves(this.rand, 16);
|
||||
this.field_147432_k = new NoiseGeneratorOctaves(this.rand, 16);
|
||||
this.field_147429_l = new NoiseGeneratorOctaves(this.rand, 8);
|
||||
|
|
|
|||
|
|
@ -77,8 +77,8 @@ public class ChunkProviderHell implements IChunkProvider {
|
|||
private final WorldGenHellLava field_177472_y = new WorldGenHellLava(Blocks.flowing_lava, false);
|
||||
private final GeneratorBushFeature field_177471_z = new GeneratorBushFeature(Blocks.brown_mushroom);
|
||||
private final GeneratorBushFeature field_177465_A = new GeneratorBushFeature(Blocks.red_mushroom);
|
||||
private final MapGenNetherBridge genNetherBridge = new MapGenNetherBridge();
|
||||
private final MapGenBase netherCaveGenerator = new MapGenCavesHell();
|
||||
private final MapGenNetherBridge genNetherBridge;
|
||||
private final MapGenBase netherCaveGenerator;
|
||||
double[] noiseData1;
|
||||
double[] noiseData2;
|
||||
double[] noiseData3;
|
||||
|
|
@ -88,7 +88,10 @@ public class ChunkProviderHell implements IChunkProvider {
|
|||
public ChunkProviderHell(World worldIn, boolean parFlag, long parLong1) {
|
||||
this.worldObj = worldIn;
|
||||
this.field_177466_i = parFlag;
|
||||
this.hellRNG = new EaglercraftRandom(parLong1);
|
||||
boolean scramble = !worldIn.getWorldInfo().isOldEaglercraftRandom();
|
||||
this.hellRNG = new EaglercraftRandom(parLong1, scramble);
|
||||
this.genNetherBridge = new MapGenNetherBridge(scramble);
|
||||
this.netherCaveGenerator = new MapGenCavesHell(scramble);
|
||||
this.netherNoiseGen1 = new NoiseGeneratorOctaves(this.hellRNG, 16);
|
||||
this.netherNoiseGen2 = new NoiseGeneratorOctaves(this.hellRNG, 16);
|
||||
this.netherNoiseGen3 = new NoiseGeneratorOctaves(this.hellRNG, 8);
|
||||
|
|
|
|||
|
|
@ -30,12 +30,17 @@ public class MapGenBase {
|
|||
* The number of Chunks to gen-check in any given direction.
|
||||
*/
|
||||
protected int range = 8;
|
||||
/**+
|
||||
* The RNG used by the MapGen classes.
|
||||
*/
|
||||
protected EaglercraftRandom rand = new EaglercraftRandom();
|
||||
protected EaglercraftRandom rand;
|
||||
protected World worldObj;
|
||||
|
||||
public MapGenBase() {
|
||||
this(true);
|
||||
}
|
||||
|
||||
public MapGenBase(boolean scramble) {
|
||||
rand = new EaglercraftRandom(scramble);
|
||||
}
|
||||
|
||||
public void generate(IChunkProvider chunkProviderIn, World worldIn, int x, int z, ChunkPrimer chunkPrimerIn) {
|
||||
int i = this.range;
|
||||
this.worldObj = worldIn;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,11 @@ import net.minecraft.world.chunk.ChunkPrimer;
|
|||
*
|
||||
*/
|
||||
public class MapGenCaves extends MapGenBase {
|
||||
|
||||
public MapGenCaves(boolean scramble) {
|
||||
super(scramble);
|
||||
}
|
||||
|
||||
protected void func_180703_a(long parLong1, int parInt1, int parInt2, ChunkPrimer parChunkPrimer, double parDouble1,
|
||||
double parDouble2, double parDouble3) {
|
||||
this.func_180702_a(parLong1, parInt1, parInt2, parChunkPrimer, parDouble1, parDouble2, parDouble3,
|
||||
|
|
@ -45,7 +50,7 @@ public class MapGenCaves extends MapGenBase {
|
|||
double d1 = (double) (parInt2 * 16 + 8);
|
||||
float f = 0.0F;
|
||||
float f1 = 0.0F;
|
||||
EaglercraftRandom random = new EaglercraftRandom(parLong1);
|
||||
EaglercraftRandom random = new EaglercraftRandom(parLong1, this.rand.isScramble());
|
||||
if (parInt4 <= 0) {
|
||||
int i = this.range * 16 - 16;
|
||||
parInt4 = i - random.nextInt(i / 4);
|
||||
|
|
|
|||
|
|
@ -28,6 +28,11 @@ import net.minecraft.world.chunk.ChunkPrimer;
|
|||
*
|
||||
*/
|
||||
public class MapGenCavesHell extends MapGenBase {
|
||||
|
||||
public MapGenCavesHell(boolean scramble) {
|
||||
super(scramble);
|
||||
}
|
||||
|
||||
protected void func_180705_a(long parLong1, int parInt1, int parInt2, ChunkPrimer parChunkPrimer, double parDouble1,
|
||||
double parDouble2, double parDouble3) {
|
||||
this.func_180704_a(parLong1, parInt1, parInt2, parChunkPrimer, parDouble1, parDouble2, parDouble3,
|
||||
|
|
@ -41,7 +46,7 @@ public class MapGenCavesHell extends MapGenBase {
|
|||
double d1 = (double) (parInt2 * 16 + 8);
|
||||
float f = 0.0F;
|
||||
float f1 = 0.0F;
|
||||
EaglercraftRandom random = new EaglercraftRandom(parLong1);
|
||||
EaglercraftRandom random = new EaglercraftRandom(parLong1, this.rand.isScramble());
|
||||
if (parInt4 <= 0) {
|
||||
int i = this.range * 16 - 16;
|
||||
parInt4 = i - random.nextInt(i / 4);
|
||||
|
|
|
|||
|
|
@ -31,10 +31,14 @@ import net.minecraft.world.chunk.ChunkPrimer;
|
|||
public class MapGenRavine extends MapGenBase {
|
||||
private float[] field_75046_d = new float[1024];
|
||||
|
||||
public MapGenRavine(boolean scramble) {
|
||||
super(scramble);
|
||||
}
|
||||
|
||||
protected void func_180707_a(long parLong1, int parInt1, int parInt2, ChunkPrimer parChunkPrimer, double parDouble1,
|
||||
double parDouble2, double parDouble3, float parFloat1, float parFloat2, float parFloat3, int parInt3,
|
||||
int parInt4, double parDouble4) {
|
||||
EaglercraftRandom random = new EaglercraftRandom(parLong1);
|
||||
EaglercraftRandom random = new EaglercraftRandom(parLong1, this.rand.isScramble());
|
||||
double d0 = (double) (parInt1 * 16 + 8);
|
||||
double d1 = (double) (parInt2 * 16 + 8);
|
||||
float f = 0.0F;
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ public class WorldGenBigTree extends WorldGenAbstractTree {
|
|||
public boolean generate(World worldIn, EaglercraftRandom rand, BlockPos position) {
|
||||
this.world = worldIn;
|
||||
this.basePos = position;
|
||||
this.rand = new EaglercraftRandom(rand.nextLong());
|
||||
this.rand = new EaglercraftRandom(rand.nextLong(), !worldIn.getWorldInfo().isOldEaglercraftRandom());
|
||||
if (this.heightLimit == 0) {
|
||||
this.heightLimit = 5 + this.rand.nextInt(this.heightLimitLimit);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,14 +27,16 @@ import net.minecraft.util.MathHelper;
|
|||
public class MapGenMineshaft extends MapGenStructure {
|
||||
private double field_82673_e = 0.004D;
|
||||
|
||||
public MapGenMineshaft() {
|
||||
public MapGenMineshaft(boolean scramble) {
|
||||
super(scramble);
|
||||
}
|
||||
|
||||
public String getStructureName() {
|
||||
return "Mineshaft";
|
||||
}
|
||||
|
||||
public MapGenMineshaft(Map<String, String> parMap) {
|
||||
public MapGenMineshaft(Map<String, String> parMap, boolean scramble) {
|
||||
super(scramble);
|
||||
for (Entry entry : parMap.entrySet()) {
|
||||
if (((String) entry.getKey()).equals("chance")) {
|
||||
this.field_82673_e = MathHelper.parseDoubleWithDefault((String) entry.getValue(), this.field_82673_e);
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ import net.minecraft.world.biome.BiomeGenBase;
|
|||
public class MapGenNetherBridge extends MapGenStructure {
|
||||
private List<BiomeGenBase.SpawnListEntry> spawnList = Lists.newArrayList();
|
||||
|
||||
public MapGenNetherBridge() {
|
||||
public MapGenNetherBridge(boolean scramble) {
|
||||
super(scramble);
|
||||
this.spawnList.add(new BiomeGenBase.SpawnListEntry(EntityBlaze.class, 10, 2, 3));
|
||||
this.spawnList.add(new BiomeGenBase.SpawnListEntry(EntityPigZombie.class, 5, 4, 4));
|
||||
this.spawnList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 10, 4, 4));
|
||||
|
|
|
|||
|
|
@ -39,15 +39,16 @@ public class MapGenScatteredFeature extends MapGenStructure {
|
|||
private int maxDistanceBetweenScatteredFeatures;
|
||||
private int minDistanceBetweenScatteredFeatures;
|
||||
|
||||
public MapGenScatteredFeature() {
|
||||
public MapGenScatteredFeature(boolean scramble) {
|
||||
super(scramble);
|
||||
this.scatteredFeatureSpawnList = Lists.newArrayList();
|
||||
this.maxDistanceBetweenScatteredFeatures = 32;
|
||||
this.minDistanceBetweenScatteredFeatures = 8;
|
||||
this.scatteredFeatureSpawnList.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 1, 1, 1));
|
||||
}
|
||||
|
||||
public MapGenScatteredFeature(Map<String, String> parMap) {
|
||||
this();
|
||||
public MapGenScatteredFeature(Map<String, String> parMap, boolean scramble) {
|
||||
this(scramble);
|
||||
|
||||
for (Entry entry : parMap.entrySet()) {
|
||||
if (((String) entry.getKey()).equals("distance")) {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,8 @@ public class MapGenStronghold extends MapGenStructure {
|
|||
private double field_82671_h;
|
||||
private int field_82672_i;
|
||||
|
||||
public MapGenStronghold() {
|
||||
public MapGenStronghold(boolean scramble) {
|
||||
super(scramble);
|
||||
this.structureCoords = new ChunkCoordIntPair[3];
|
||||
this.field_82671_h = 32.0D;
|
||||
this.field_82672_i = 3;
|
||||
|
|
@ -55,8 +56,8 @@ public class MapGenStronghold extends MapGenStructure {
|
|||
|
||||
}
|
||||
|
||||
public MapGenStronghold(Map<String, String> parMap) {
|
||||
this();
|
||||
public MapGenStronghold(Map<String, String> parMap, boolean scramble) {
|
||||
this(scramble);
|
||||
|
||||
for (Entry entry : parMap.entrySet()) {
|
||||
if (((String) entry.getKey()).equals("distance")) {
|
||||
|
|
@ -79,7 +80,7 @@ public class MapGenStronghold extends MapGenStructure {
|
|||
|
||||
protected boolean canSpawnStructureAtCoords(int i, int j) {
|
||||
if (!this.ranBiomeCheck) {
|
||||
EaglercraftRandom random = new EaglercraftRandom();
|
||||
EaglercraftRandom random = new EaglercraftRandom(!this.worldObj.getWorldInfo().isOldEaglercraftRandom());
|
||||
random.setSeed(this.worldObj.getSeed());
|
||||
double d0 = random.nextDouble() * 3.141592653589793D * 2.0D;
|
||||
int k = 1;
|
||||
|
|
|
|||
|
|
@ -46,6 +46,14 @@ public abstract class MapGenStructure extends MapGenBase {
|
|||
|
||||
public abstract String getStructureName();
|
||||
|
||||
public MapGenStructure() {
|
||||
super();
|
||||
}
|
||||
|
||||
public MapGenStructure(boolean scramble) {
|
||||
super(scramble);
|
||||
}
|
||||
|
||||
/**+
|
||||
* Recursively called by generate()
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -40,13 +40,14 @@ public class MapGenVillage extends MapGenStructure {
|
|||
private int field_82665_g;
|
||||
private int field_82666_h;
|
||||
|
||||
public MapGenVillage() {
|
||||
public MapGenVillage(boolean scramble) {
|
||||
super(scramble);
|
||||
this.field_82665_g = 32;
|
||||
this.field_82666_h = 8;
|
||||
}
|
||||
|
||||
public MapGenVillage(Map<String, String> parMap) {
|
||||
this();
|
||||
public MapGenVillage(Map<String, String> parMap, boolean scramble) {
|
||||
this(scramble);
|
||||
|
||||
for (Entry entry : parMap.entrySet()) {
|
||||
if (((String) entry.getKey()).equals("size")) {
|
||||
|
|
|
|||
|
|
@ -45,13 +45,14 @@ public class StructureOceanMonument extends MapGenStructure {
|
|||
BiomeGenBase.deepOcean, BiomeGenBase.river, BiomeGenBase.frozenOcean, BiomeGenBase.frozenRiver });
|
||||
private static final List<BiomeGenBase.SpawnListEntry> field_175803_h = Lists.newArrayList();
|
||||
|
||||
public StructureOceanMonument() {
|
||||
public StructureOceanMonument(boolean scramble) {
|
||||
super(scramble);
|
||||
this.field_175800_f = 32;
|
||||
this.field_175801_g = 5;
|
||||
}
|
||||
|
||||
public StructureOceanMonument(Map<String, String> parMap) {
|
||||
this();
|
||||
public StructureOceanMonument(Map<String, String> parMap, boolean scramble) {
|
||||
this(scramble);
|
||||
|
||||
for (Entry entry : parMap.entrySet()) {
|
||||
if (((String) entry.getKey()).equals("spacing")) {
|
||||
|
|
|
|||
|
|
@ -71,6 +71,9 @@ public class WorldInfo {
|
|||
private int borderWarningTime = 15;
|
||||
private GameRules theGameRules = new GameRules();
|
||||
|
||||
public static final int eaglerVersionCurrent = 1;
|
||||
private int eaglerVersion = eaglerVersionCurrent;
|
||||
|
||||
protected WorldInfo() {
|
||||
}
|
||||
|
||||
|
|
@ -187,6 +190,7 @@ public class WorldInfo {
|
|||
this.borderWarningTime = nbt.getInteger("BorderWarningTime");
|
||||
}
|
||||
|
||||
this.eaglerVersion = nbt.getInteger("eaglerVersionSerial");
|
||||
}
|
||||
|
||||
public WorldInfo(WorldSettings settings, String name) {
|
||||
|
|
@ -296,6 +300,7 @@ public class WorldInfo {
|
|||
nbt.setDouble("BorderSizeLerpTarget", this.borderSizeLerpTarget);
|
||||
nbt.setDouble("BorderWarningBlocks", (double) this.borderWarningDistance);
|
||||
nbt.setDouble("BorderWarningTime", (double) this.borderWarningTime);
|
||||
nbt.setInteger("eaglerVersionSerial", this.eaglerVersion);
|
||||
if (this.difficulty != null) {
|
||||
nbt.setByte("Difficulty", (byte) this.difficulty.getDifficultyId());
|
||||
}
|
||||
|
|
@ -712,6 +717,20 @@ public class WorldInfo {
|
|||
this.difficultyLocked = flag;
|
||||
}
|
||||
|
||||
public int getEaglerVersion() {
|
||||
return this.eaglerVersion;
|
||||
}
|
||||
|
||||
public boolean isOldEaglercraftRandom() {
|
||||
return this.eaglerVersion == 0;
|
||||
}
|
||||
|
||||
public static void initEaglerVersion(NBTTagCompound compound) {
|
||||
if (!compound.hasKey("eaglerVersionSerial", 99)) {
|
||||
compound.setInteger("eaglerVersionSerial", eaglerVersionCurrent);
|
||||
}
|
||||
}
|
||||
|
||||
/**+
|
||||
* Adds this WorldInfo instance to the crash report.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue