Smart Leaves
This commit is contained in:
parent
4d6c64ade6
commit
ae4a52946d
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
72433
javascript/classes.js
72433
javascript/classes.js
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -19,6 +19,7 @@ import net.minecraft.client.resources.IResource;
|
|||
import net.minecraft.client.resources.IResourceManager;
|
||||
import net.minecraft.client.resources.IResourcePack;
|
||||
import net.minecraft.client.resources.ResourcePackRepository;
|
||||
import net.minecraft.client.resources.model.ModelManager;
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
|
@ -158,6 +159,18 @@ public class Config {
|
|||
return Minecraft.getMinecraft().gameSettings.ofRainSplash;
|
||||
}
|
||||
|
||||
public static boolean isTreesFancy() {
|
||||
return Minecraft.getMinecraft().gameSettings.ofTrees == 0 ? Minecraft.getMinecraft().gameSettings.fancyGraphics : Minecraft.getMinecraft().gameSettings.ofTrees != 1;
|
||||
}
|
||||
|
||||
public static boolean isTreesSmart() {
|
||||
return Minecraft.getMinecraft().gameSettings.ofTrees == 4;
|
||||
}
|
||||
|
||||
public static boolean isCullFacesLeaves() {
|
||||
return Minecraft.getMinecraft().gameSettings.ofTrees == 0 ? !Minecraft.getMinecraft().gameSettings.fancyGraphics : Minecraft.getMinecraft().gameSettings.ofTrees == 4;
|
||||
}
|
||||
|
||||
public static int limit(int p_limit_0_, int p_limit_1_, int p_limit_2_) {
|
||||
return p_limit_0_ < p_limit_1_ ? p_limit_1_ : (p_limit_0_ > p_limit_2_ ? p_limit_2_ : p_limit_0_);
|
||||
}
|
||||
|
@ -441,4 +454,8 @@ public class Config {
|
|||
public static boolean isDynamicHandLight() {
|
||||
return !isDynamicLights() ? false : true;
|
||||
}
|
||||
|
||||
public static ModelManager getModelManager() {
|
||||
return Minecraft.getMinecraft().getRenderItem().modelManager;
|
||||
}
|
||||
}
|
||||
|
|
85
src/main/java/net/PeytonPlayz585/shadow/ModelUtils.java
Normal file
85
src/main/java/net/PeytonPlayz585/shadow/ModelUtils.java
Normal file
|
@ -0,0 +1,85 @@
|
|||
package net.PeytonPlayz585.shadow;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.resources.model.IBakedModel;
|
||||
import net.minecraft.client.resources.model.SimpleBakedModel;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
public class ModelUtils {
|
||||
public static void dbgModel(IBakedModel p_dbgModel_0_) {
|
||||
if (p_dbgModel_0_ != null) {
|
||||
Config.dbg("Model: " + p_dbgModel_0_ + ", ao: " + p_dbgModel_0_.isAmbientOcclusion() + ", gui3d: " + p_dbgModel_0_.isGui3d() + ", builtIn: " + p_dbgModel_0_.isBuiltInRenderer() + ", particle: " + p_dbgModel_0_.getParticleTexture());
|
||||
EnumFacing[] aenumfacing = EnumFacing.VALUES;
|
||||
|
||||
for (int i = 0; i < aenumfacing.length; ++i) {
|
||||
EnumFacing enumfacing = aenumfacing[i];
|
||||
List list = p_dbgModel_0_.getFaceQuads(enumfacing);
|
||||
dbgQuads(enumfacing.getName(), list, " ");
|
||||
}
|
||||
|
||||
List list1 = p_dbgModel_0_.getGeneralQuads();
|
||||
dbgQuads("General", list1, " ");
|
||||
}
|
||||
}
|
||||
|
||||
private static void dbgQuads(String p_dbgQuads_0_, List p_dbgQuads_1_, String p_dbgQuads_2_) {
|
||||
for (Object bakedquad : p_dbgQuads_1_) {
|
||||
dbgQuad(p_dbgQuads_0_, (BakedQuad) bakedquad, p_dbgQuads_2_);
|
||||
}
|
||||
}
|
||||
|
||||
public static void dbgQuad(String p_dbgQuad_0_, BakedQuad p_dbgQuad_1_, String p_dbgQuad_2_) {
|
||||
Config.dbg(p_dbgQuad_2_ + "Quad: " + p_dbgQuad_1_.getClass().getName() + ", type: " + p_dbgQuad_0_ + ", face: " + p_dbgQuad_1_.getFace() + ", tint: " + p_dbgQuad_1_.getTintIndex());
|
||||
dbgVertexData(p_dbgQuad_1_.getVertexData(), " " + p_dbgQuad_2_);
|
||||
}
|
||||
|
||||
public static void dbgVertexData(int[] p_dbgVertexData_0_, String p_dbgVertexData_1_) {
|
||||
int i = p_dbgVertexData_0_.length / 4;
|
||||
Config.dbg(p_dbgVertexData_1_ + "Length: " + p_dbgVertexData_0_.length + ", step: " + i);
|
||||
|
||||
for (int j = 0; j < 4; ++j) {
|
||||
int k = j * i;
|
||||
float f = Float.intBitsToFloat(p_dbgVertexData_0_[k + 0]);
|
||||
float f1 = Float.intBitsToFloat(p_dbgVertexData_0_[k + 1]);
|
||||
float f2 = Float.intBitsToFloat(p_dbgVertexData_0_[k + 2]);
|
||||
int l = p_dbgVertexData_0_[k + 3];
|
||||
float f3 = Float.intBitsToFloat(p_dbgVertexData_0_[k + 4]);
|
||||
float f4 = Float.intBitsToFloat(p_dbgVertexData_0_[k + 5]);
|
||||
Config.dbg(p_dbgVertexData_1_ + j + " xyz: " + f + "," + f1 + "," + f2 + " col: " + l + " u,v: " + f3 + "," + f4);
|
||||
}
|
||||
}
|
||||
|
||||
public static IBakedModel duplicateModel(IBakedModel p_duplicateModel_0_) {
|
||||
List list = duplicateQuadList(p_duplicateModel_0_.getGeneralQuads());
|
||||
EnumFacing[] aenumfacing = EnumFacing.VALUES;
|
||||
List list1 = new ArrayList();
|
||||
|
||||
for (int i = 0; i < aenumfacing.length; ++i) {
|
||||
EnumFacing enumfacing = aenumfacing[i];
|
||||
List list2 = p_duplicateModel_0_.getFaceQuads(enumfacing);
|
||||
List list3 = duplicateQuadList(list2);
|
||||
list1.add(list3);
|
||||
}
|
||||
|
||||
SimpleBakedModel simplebakedmodel = new SimpleBakedModel(list, list1, p_duplicateModel_0_.isAmbientOcclusion(), p_duplicateModel_0_.isGui3d(), p_duplicateModel_0_.getParticleTexture(), p_duplicateModel_0_.getItemCameraTransforms());
|
||||
return simplebakedmodel;
|
||||
}
|
||||
|
||||
public static List duplicateQuadList(List p_duplicateQuadList_0_) {
|
||||
List list = new ArrayList();
|
||||
|
||||
for (Object bakedquad : p_duplicateQuadList_0_) {
|
||||
BakedQuad bakedquad1 = duplicateQuad((BakedQuad) bakedquad);
|
||||
list.add(bakedquad1);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public static BakedQuad duplicateQuad(BakedQuad p_duplicateQuad_0_) {
|
||||
BakedQuad bakedquad = new BakedQuad((int[])p_duplicateQuad_0_.getVertexData().clone(), p_duplicateQuad_0_.getTintIndex(), p_duplicateQuad_0_.getFace());
|
||||
return bakedquad;
|
||||
}
|
||||
}
|
162
src/main/java/net/PeytonPlayz585/shadow/SmartLeaves.java
Normal file
162
src/main/java/net/PeytonPlayz585/shadow/SmartLeaves.java
Normal file
|
@ -0,0 +1,162 @@
|
|||
package net.PeytonPlayz585.shadow;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.resources.model.IBakedModel;
|
||||
import net.minecraft.client.resources.model.ModelManager;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
public class SmartLeaves {
|
||||
|
||||
private static IBakedModel modelLeavesCullAcacia = null;
|
||||
private static IBakedModel modelLeavesCullBirch = null;
|
||||
private static IBakedModel modelLeavesCullDarkOak = null;
|
||||
private static IBakedModel modelLeavesCullJungle = null;
|
||||
private static IBakedModel modelLeavesCullOak = null;
|
||||
private static IBakedModel modelLeavesCullSpruce = null;
|
||||
private static List generalQuadsCullAcacia = null;
|
||||
private static List generalQuadsCullBirch = null;
|
||||
private static List generalQuadsCullDarkOak = null;
|
||||
private static List generalQuadsCullJungle = null;
|
||||
private static List generalQuadsCullOak = null;
|
||||
private static List generalQuadsCullSpruce = null;
|
||||
private static IBakedModel modelLeavesDoubleAcacia = null;
|
||||
private static IBakedModel modelLeavesDoubleBirch = null;
|
||||
private static IBakedModel modelLeavesDoubleDarkOak = null;
|
||||
private static IBakedModel modelLeavesDoubleJungle = null;
|
||||
private static IBakedModel modelLeavesDoubleOak = null;
|
||||
private static IBakedModel modelLeavesDoubleSpruce = null;
|
||||
|
||||
public static IBakedModel getLeavesModel(IBakedModel p_getLeavesModel_0_) {
|
||||
if (!Config.isTreesSmart()) {
|
||||
return p_getLeavesModel_0_;
|
||||
} else {
|
||||
List list = p_getLeavesModel_0_.getGeneralQuads();
|
||||
return list == generalQuadsCullAcacia ? modelLeavesDoubleAcacia : (list == generalQuadsCullBirch ? modelLeavesDoubleBirch : (list == generalQuadsCullDarkOak ? modelLeavesDoubleDarkOak : (list == generalQuadsCullJungle ? modelLeavesDoubleJungle : (list == generalQuadsCullOak ? modelLeavesDoubleOak : (list == generalQuadsCullSpruce ? modelLeavesDoubleSpruce : p_getLeavesModel_0_)))));
|
||||
}
|
||||
}
|
||||
|
||||
public static void updateLeavesModels() {
|
||||
List list = new java.util.ArrayList();
|
||||
modelLeavesCullAcacia = getModelCull("acacia", list);
|
||||
modelLeavesCullBirch = getModelCull("birch", list);
|
||||
modelLeavesCullDarkOak = getModelCull("dark_oak", list);
|
||||
modelLeavesCullJungle = getModelCull("jungle", list);
|
||||
modelLeavesCullOak = getModelCull("oak", list);
|
||||
modelLeavesCullSpruce = getModelCull("spruce", list);
|
||||
generalQuadsCullAcacia = getGeneralQuadsSafe(modelLeavesCullAcacia);
|
||||
generalQuadsCullBirch = getGeneralQuadsSafe(modelLeavesCullBirch);
|
||||
generalQuadsCullDarkOak = getGeneralQuadsSafe(modelLeavesCullDarkOak);
|
||||
generalQuadsCullJungle = getGeneralQuadsSafe(modelLeavesCullJungle);
|
||||
generalQuadsCullOak = getGeneralQuadsSafe(modelLeavesCullOak);
|
||||
generalQuadsCullSpruce = getGeneralQuadsSafe(modelLeavesCullSpruce);
|
||||
modelLeavesDoubleAcacia = getModelDoubleFace(modelLeavesCullAcacia);
|
||||
modelLeavesDoubleBirch = getModelDoubleFace(modelLeavesCullBirch);
|
||||
modelLeavesDoubleDarkOak = getModelDoubleFace(modelLeavesCullDarkOak);
|
||||
modelLeavesDoubleJungle = getModelDoubleFace(modelLeavesCullJungle);
|
||||
modelLeavesDoubleOak = getModelDoubleFace(modelLeavesCullOak);
|
||||
modelLeavesDoubleSpruce = getModelDoubleFace(modelLeavesCullSpruce);
|
||||
|
||||
if (list.size() > 0) {
|
||||
Config.dbg("Enable face culling: " + Config.arrayToString(list.toArray()));
|
||||
}
|
||||
}
|
||||
|
||||
private static List getGeneralQuadsSafe(IBakedModel p_getGeneralQuadsSafe_0_) {
|
||||
return p_getGeneralQuadsSafe_0_ == null ? null : p_getGeneralQuadsSafe_0_.getGeneralQuads();
|
||||
}
|
||||
|
||||
static IBakedModel getModelCull(String p_getModelCull_0_, List p_getModelCull_1_) {
|
||||
ModelManager modelmanager = Config.getModelManager();
|
||||
|
||||
if (modelmanager == null) {
|
||||
return null;
|
||||
} else {
|
||||
ResourceLocation resourcelocation = new ResourceLocation("blockstates/" + p_getModelCull_0_ + "_leaves.json");
|
||||
|
||||
if (Config.getDefiningResourcePack(resourcelocation) != Config.getDefaultResourcePack()) {
|
||||
return null;
|
||||
} else {
|
||||
ResourceLocation resourcelocation1 = new ResourceLocation("models/block/" + p_getModelCull_0_ + "_leaves.json");
|
||||
|
||||
if (Config.getDefiningResourcePack(resourcelocation1) != Config.getDefaultResourcePack()) {
|
||||
return null;
|
||||
} else {
|
||||
ModelResourceLocation modelresourcelocation = new ModelResourceLocation(p_getModelCull_0_ + "_leaves", "normal");
|
||||
IBakedModel ibakedmodel = modelmanager.getModel(modelresourcelocation);
|
||||
|
||||
if (ibakedmodel != null && ibakedmodel != modelmanager.getMissingModel()) {
|
||||
List list = ibakedmodel.getGeneralQuads();
|
||||
|
||||
if (list.size() == 0) {
|
||||
return ibakedmodel;
|
||||
} else if (list.size() != 6) {
|
||||
return null;
|
||||
} else {
|
||||
for (Object bakedquad : list) {
|
||||
List list1 = ibakedmodel.getFaceQuads(((BakedQuad) bakedquad).getFace());
|
||||
|
||||
if (list1.size() > 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
list1.add(bakedquad);
|
||||
}
|
||||
|
||||
list.clear();
|
||||
p_getModelCull_1_.add(p_getModelCull_0_ + "_leaves");
|
||||
return ibakedmodel;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static IBakedModel getModelDoubleFace(IBakedModel p_getModelDoubleFace_0_) {
|
||||
if (p_getModelDoubleFace_0_ == null) {
|
||||
return null;
|
||||
} else if (p_getModelDoubleFace_0_.getGeneralQuads().size() > 0) {
|
||||
Config.warn("SmartLeaves: Model is not cube, general quads: " + p_getModelDoubleFace_0_.getGeneralQuads().size() + ", model: " + p_getModelDoubleFace_0_);
|
||||
return p_getModelDoubleFace_0_;
|
||||
} else {
|
||||
EnumFacing[] aenumfacing = EnumFacing.VALUES;
|
||||
|
||||
for (int i = 0; i < aenumfacing.length; ++i) {
|
||||
EnumFacing enumfacing = aenumfacing[i];
|
||||
List<BakedQuad> list = p_getModelDoubleFace_0_.getFaceQuads(enumfacing);
|
||||
|
||||
if (list.size() != 1) {
|
||||
Config.warn("SmartLeaves: Model is not cube, side: " + enumfacing + ", quads: " + list.size() + ", model: " + p_getModelDoubleFace_0_);
|
||||
return p_getModelDoubleFace_0_;
|
||||
}
|
||||
}
|
||||
|
||||
IBakedModel ibakedmodel = ModelUtils.duplicateModel(p_getModelDoubleFace_0_);
|
||||
List[] alist = new List[aenumfacing.length];
|
||||
|
||||
for (int k = 0; k < aenumfacing.length; ++k) {
|
||||
EnumFacing enumfacing1 = aenumfacing[k];
|
||||
List<BakedQuad> list1 = ibakedmodel.getFaceQuads(enumfacing1);
|
||||
BakedQuad bakedquad = (BakedQuad)list1.get(0);
|
||||
BakedQuad bakedquad1 = new BakedQuad((int[])bakedquad.getVertexData().clone(), bakedquad.getTintIndex(), bakedquad.getFace());
|
||||
int[] aint = bakedquad1.getVertexData();
|
||||
int[] aint1 = (int[])aint.clone();
|
||||
int j = aint.length / 4;
|
||||
System.arraycopy(aint, 0 * j, aint1, 3 * j, j);
|
||||
System.arraycopy(aint, 1 * j, aint1, 2 * j, j);
|
||||
System.arraycopy(aint, 2 * j, aint1, 1 * j, j);
|
||||
System.arraycopy(aint, 3 * j, aint1, 0 * j, j);
|
||||
System.arraycopy(aint1, 0, aint, 0, aint1.length);
|
||||
list1.add(bakedquad1);
|
||||
}
|
||||
|
||||
return ibakedmodel;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,10 +1,13 @@
|
|||
package net.PeytonPlayz585.shadow;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.ITextureObject;
|
||||
import net.minecraft.client.renderer.texture.SimpleTexture;
|
||||
import net.minecraft.client.resources.IResourceManager;
|
||||
import net.minecraft.client.resources.IResourceManagerReloadListener;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class TextureUtils {
|
||||
public class TextureUtils implements IResourceManagerReloadListener {
|
||||
|
||||
static TextureMap texturemap = new TextureMap();
|
||||
public static String s = "minecraft:blocks/";
|
||||
|
@ -63,6 +66,33 @@ public class TextureUtils {
|
|||
}
|
||||
}
|
||||
|
||||
public static void update() {
|
||||
TextureMap texturemap = new TextureMap();
|
||||
|
||||
if (texturemap != null) {
|
||||
String s = "minecraft:blocks/";
|
||||
iconGrassTop = texturemap.getSpriteSafe(s + "grass_top");
|
||||
iconGrassSide = texturemap.getSpriteSafe(s + "grass_side");
|
||||
iconGrassSideOverlay = texturemap.getSpriteSafe(s + "grass_side_overlay");
|
||||
iconSnow = texturemap.getSpriteSafe(s + "snow");
|
||||
iconGrassSideSnowed = texturemap.getSpriteSafe(s + "grass_side_snowed");
|
||||
iconMyceliumSide = texturemap.getSpriteSafe(s + "mycelium_side");
|
||||
iconMyceliumTop = texturemap.getSpriteSafe(s + "mycelium_top");
|
||||
iconWaterStill = texturemap.getSpriteSafe(s + "water_still");
|
||||
iconWaterFlow = texturemap.getSpriteSafe(s + "water_flow");
|
||||
iconLavaStill = texturemap.getSpriteSafe(s + "lava_still");
|
||||
iconLavaFlow = texturemap.getSpriteSafe(s + "lava_flow");
|
||||
iconFireLayer0 = texturemap.getSpriteSafe(s + "fire_layer_0");
|
||||
iconFireLayer1 = texturemap.getSpriteSafe(s + "fire_layer_1");
|
||||
iconPortal = texturemap.getSpriteSafe(s + "portal");
|
||||
iconGlass = texturemap.getSpriteSafe(s + "glass");
|
||||
iconGlassPaneTop = texturemap.getSpriteSafe(s + "glass_pane_top");
|
||||
String s1 = "minecraft:items/";
|
||||
iconCompass = texturemap.getSpriteSafe(s1 + "compass");
|
||||
iconClock = texturemap.getSpriteSafe(s1 + "clock");
|
||||
}
|
||||
}
|
||||
|
||||
public static String getBasePath(String p_getBasePath_0_) {
|
||||
int i = p_getBasePath_0_.lastIndexOf(47);
|
||||
return i < 0 ? "" : p_getBasePath_0_.substring(0, i);
|
||||
|
@ -82,6 +112,22 @@ public class TextureUtils {
|
|||
}
|
||||
}
|
||||
|
||||
public void onResourceManagerReload(IResourceManager p_resourcesReloaded_0_) {
|
||||
if (getTextureMapBlocks() != null) {
|
||||
Config.dbg("*** Reloading custom textures ***");
|
||||
CustomSky.reset();
|
||||
update();
|
||||
BetterGrass.update();
|
||||
CustomSky.update();
|
||||
SmartLeaves.updateLeavesModels();
|
||||
Config.getTextureManager().tick();
|
||||
}
|
||||
}
|
||||
|
||||
public static net.minecraft.client.renderer.texture.TextureMap getTextureMapBlocks() {
|
||||
return Minecraft.getMinecraft().getTextureMapBlocks();
|
||||
}
|
||||
|
||||
static class TextureMap {
|
||||
|
||||
public TextureMap() {
|
||||
|
|
|
@ -13,7 +13,7 @@ public class GuiDetails extends GuiScreen {
|
|||
protected String title;
|
||||
private GameSettings settings;
|
||||
//private static GameSettings.Options[] enumOptions = new GameSettings.Options[] {GameSettings.Options.CLOUDS, GameSettings.Options.CLOUD_HEIGHT, GameSettings.Options.TREES, GameSettings.Options.RAIN, GameSettings.Options.SKY, GameSettings.Options.STARS, GameSettings.Options.SUN_MOON, GameSettings.Options.SHOW_CAPES, GameSettings.Options.TRANSLUCENT_BLOCKS, GameSettings.Options.HELD_ITEM_TOOLTIPS, GameSettings.Options.DROPPED_ITEMS, GameSettings.Options.ENTITY_SHADOWS, GameSettings.Options.VIGNETTE, GameSettings.Options.DYNAMIC_FOV};
|
||||
private static GameSettings.Options[] enumOptions = new GameSettings.Options[] { GameSettings.Options.CLOUDS, GameSettings.Options.CLOUD_HEIGHT, GameSettings.Options.RAIN};
|
||||
private static GameSettings.Options[] enumOptions = new GameSettings.Options[] { GameSettings.Options.CLOUDS, GameSettings.Options.CLOUD_HEIGHT, GameSettings.Options.TREES, GameSettings.Options.RAIN};
|
||||
|
||||
public GuiDetails(GuiScreen p_i47_1_) {
|
||||
this.prevScreen = p_i47_1_;
|
||||
|
|
|
@ -2,6 +2,8 @@ package net.minecraft.block;
|
|||
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.PeytonPlayz585.shadow.Config;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
@ -42,9 +44,8 @@ public class BlockLeavesBase extends Block {
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean shouldSideBeRendered(IBlockAccess iblockaccess, BlockPos blockpos, EnumFacing enumfacing) {
|
||||
return !this.fancyGraphics && iblockaccess.getBlockState(blockpos).getBlock() == this ? false
|
||||
: super.shouldSideBeRendered(iblockaccess, blockpos, enumfacing);
|
||||
public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side) {
|
||||
return Config.isCullFacesLeaves() && worldIn.getBlockState(pos).getBlock() == this ? false : super.shouldSideBeRendered(worldIn, pos, side);
|
||||
}
|
||||
|
||||
public static void setLightOpacity(Block p_setLightOpacity_0_, int p_setLightOpacity_1_) {
|
||||
|
|
|
@ -9,6 +9,7 @@ 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.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockLeavesBase;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
|
@ -64,10 +65,12 @@ public class BlockModelRenderer {
|
|||
|
||||
try {
|
||||
Block block = blockStateIn.getBlock();
|
||||
return flag
|
||||
? this.renderModelAmbientOcclusion(blockAccessIn, modelIn, block, blockPosIn, worldRendererIn,
|
||||
checkSides)
|
||||
: this.renderModelStandard(blockAccessIn, modelIn, block, blockPosIn, worldRendererIn, checkSides);
|
||||
|
||||
if (Config.isTreesSmart() && blockStateIn.getBlock() instanceof BlockLeavesBase) {
|
||||
modelIn = SmartLeaves.getLeavesModel(modelIn);
|
||||
}
|
||||
|
||||
return flag ? this.renderModelAmbientOcclusion(blockAccessIn, modelIn, block, blockPosIn, worldRendererIn, checkSides) : this.renderModelStandard(blockAccessIn, modelIn, block, blockPosIn, worldRendererIn, checkSides);
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Tesselating block model");
|
||||
CrashReportCategory crashreportcategory = crashreport.makeCategory("Block model being tesselated");
|
||||
|
|
|
@ -405,8 +405,8 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
|
|||
}
|
||||
}
|
||||
|
||||
Blocks.leaves.setGraphicsLevel(mc.gameSettings.shaders || mc.gameSettings.fancyGraphics);
|
||||
Blocks.leaves2.setGraphicsLevel(mc.gameSettings.shaders || mc.gameSettings.fancyGraphics);
|
||||
Blocks.leaves.setGraphicsLevel(mc.gameSettings.shaders || Config.isTreesFancy());
|
||||
Blocks.leaves2.setGraphicsLevel(mc.gameSettings.shaders || Config.isTreesFancy());
|
||||
BlockModelRenderer.updateAoLightValue();
|
||||
|
||||
if (Config.isDynamicLights()) {
|
||||
|
|
|
@ -96,6 +96,7 @@ public class RenderItem implements IResourceManagerReloadListener {
|
|||
|
||||
public RenderItem(TextureManager textureManager, ModelManager modelManager) {
|
||||
this.textureManager = textureManager;
|
||||
this.modelManager = modelManager;
|
||||
this.itemModelMesher = new ItemModelMesher(modelManager);
|
||||
this.registerItems();
|
||||
}
|
||||
|
@ -148,6 +149,7 @@ public class RenderItem implements IResourceManagerReloadListener {
|
|||
public static float renderPosX = 0.0f;
|
||||
public static float renderPosY = 0.0f;
|
||||
public static float renderPosZ = 0.0f;
|
||||
public ModelManager modelManager = null;
|
||||
|
||||
public void renderItem(ItemStack stack, IBakedModel model) {
|
||||
if (stack != null) {
|
||||
|
|
|
@ -202,6 +202,7 @@ public class GameSettings {
|
|||
public int clouds = 2;
|
||||
public int ofClouds = 0;
|
||||
public float ofCloudsHeight = 0.0F;
|
||||
public int ofTrees = 0;
|
||||
public int ofRain = 0;
|
||||
|
||||
//Optifine Animations
|
||||
|
@ -238,6 +239,7 @@ public class GameSettings {
|
|||
//Other...
|
||||
private static final int[] OF_DYNAMIC_LIGHTS = new int[] {3, 1, 2};
|
||||
private static final String[] KEYS_DYNAMIC_LIGHTS = new String[] {"options.off", "options.graphics.fast", "options.graphics.fancy"};
|
||||
private static final int[] OF_TREES_VALUES = new int[] {0, 1, 4, 2};
|
||||
|
||||
public GameSettings(Minecraft mcIn) {
|
||||
this.keyBindings = (KeyBinding[]) ArrayUtils.addAll(new KeyBinding[] { this.keyBindAttack, this.keyBindUseItem,
|
||||
|
@ -677,6 +679,11 @@ public class GameSettings {
|
|||
this.ofRainSplash = !this.ofRainSplash;
|
||||
}
|
||||
|
||||
if (parOptions == GameSettings.Options.TREES) {
|
||||
this.ofTrees = nextValue(this.ofTrees, OF_TREES_VALUES);
|
||||
this.mc.renderGlobal.loadRenderers();
|
||||
}
|
||||
|
||||
this.saveOptions();
|
||||
}
|
||||
|
||||
|
@ -958,6 +965,21 @@ public class GameSettings {
|
|||
}
|
||||
} else if (parOptions == GameSettings.Options.RAIN_SPLASH) {
|
||||
return this.ofRainSplash ? s + "ON" : s + "OFF";
|
||||
} else if (parOptions == GameSettings.Options.TREES) {
|
||||
switch (this.ofTrees) {
|
||||
case 1:
|
||||
return s + "Fast";
|
||||
|
||||
case 2:
|
||||
return s + "Fancy";
|
||||
|
||||
case 3:
|
||||
default:
|
||||
return s + "Default";
|
||||
|
||||
case 4:
|
||||
return s + "Smart";
|
||||
}
|
||||
} else {
|
||||
return s;
|
||||
}
|
||||
|
@ -1386,6 +1408,11 @@ public class GameSettings {
|
|||
this.ofRainSplash = Boolean.valueOf(astring[1]).booleanValue();
|
||||
}
|
||||
|
||||
if (astring[0].equals("ofTrees") && astring.length >= 2) {
|
||||
this.ofTrees = Integer.valueOf(astring[1]).intValue();
|
||||
this.ofTrees = limit(this.ofTrees, OF_TREES_VALUES);
|
||||
}
|
||||
|
||||
Keyboard.setFunctionKeyModifier(keyBindFunction.getKeyCode());
|
||||
|
||||
for (SoundCategory soundcategory : SoundCategory.values()) {
|
||||
|
@ -1525,6 +1552,7 @@ public class GameSettings {
|
|||
printwriter.println("ofFastMath:" + ofFastMath);
|
||||
printwriter.println("ofRain:" + this.ofRain);
|
||||
printwriter.println("ofRainSplash:" + this.ofRainSplash);
|
||||
printwriter.println("ofTrees:" + this.ofTrees);
|
||||
|
||||
for (KeyBinding keybinding : this.keyBindings) {
|
||||
printwriter.println("key_" + keybinding.getKeyDescription() + ":" + keybinding.getKeyCode());
|
||||
|
@ -1700,7 +1728,8 @@ public class GameSettings {
|
|||
CLOUDS("Clouds", false, false),
|
||||
CLOUD_HEIGHT("Cloud Height", true, false),
|
||||
DYNAMIC_LIGHTS("Dynamic Lights", false, false),
|
||||
RAIN("Rain & Snow", false, false);
|
||||
RAIN("Rain & Snow", false, false),
|
||||
TREES("Trees", false, false);
|
||||
|
||||
private final boolean enumFloat;
|
||||
private final boolean enumBoolean;
|
||||
|
|
Loading…
Reference in New Issue
Block a user