diff --git a/client/src/main/java/client/renderer/Renderer.java b/client/src/main/java/client/renderer/Renderer.java index e16d1529..e5139cb4 100755 --- a/client/src/main/java/client/renderer/Renderer.java +++ b/client/src/main/java/client/renderer/Renderer.java @@ -3874,6 +3874,8 @@ public class Renderer { int i = 0; float f = 0.0F; int n = 0; + int a = 0; + int s = 0; for (int j = 0; j < 4; ++j) { @@ -3893,14 +3895,16 @@ public class Renderer { if (!material.isNonBlock()) // material != block { - if (material == Blocks.air) + if (!material.canConnectNonBlock()) { + ++a; f += 4; ++i; } } else { + ++s; f += 1.0F / 9.0f; i += 10; @@ -3909,6 +3913,6 @@ public class Renderer { } } - return n == 4 ? 1.0f : 1.0F - f / (float)i; + return n == 4 ? 1.0f : (s + a == 4 && a > 1 ? 0.0f : 1.0F - f / (float)i); } } diff --git a/client/src/main/java/client/renderer/Shader.java b/client/src/main/java/client/renderer/Shader.java index 8fed4599..8e69db3a 100644 --- a/client/src/main/java/client/renderer/Shader.java +++ b/client/src/main/java/client/renderer/Shader.java @@ -57,7 +57,7 @@ public enum Shader { context.integer("n_lights", 0); context.color3("specular", Client.CLIENT.specularColors && !Client.CLIENT.setGamma && !Client.CLIENT.xrayActive ? 0xffffff : 0x000000); - context.bool("shade", Client.CLIENT.flatShading); + context.bool("shade", Client.CLIENT.flatShading || Client.CLIENT.setGamma || Client.CLIENT.xrayActive); GlState.setActiveTexture(GL46.GL_TEXTURE0); // glBindBufferBase(GL_UNIFORM_BUFFER, 0, world->light_buf); diff --git a/client/src/main/java/client/renderer/entity/RenderItem.java b/client/src/main/java/client/renderer/entity/RenderItem.java index 08ef7a3a..6e95dd0f 100755 --- a/client/src/main/java/client/renderer/entity/RenderItem.java +++ b/client/src/main/java/client/renderer/entity/RenderItem.java @@ -31,8 +31,6 @@ import common.util.Vec3i; public class RenderItem { - private static final String RES_ITEM_GLINT = "textures/glint.png"; - private final ItemModelMesher mesher; private final TextureManager manager; private final LayerArmor armor = new LayerArmor(null, 12, 12) { @@ -99,11 +97,6 @@ public class RenderItem { GL46.glTranslatef(-0.5F, -0.5F, -0.5F); this.renderModel(model, stack); - - if (stack.getItem().isGleaming(stack)) - { - this.renderEffect(model); - } } GL46.glPopMatrix(); @@ -171,36 +164,6 @@ public class RenderItem } } - private void renderEffect(IBakedModel model) - { - GlState.depthMask(false); - GlState.depthFunc(GL46.GL_EQUAL); - GlState.disableLighting(); - GlState.blendFunc(GL46.GL_SRC_COLOR, GL46.GL_ONE); - this.manager.bindTexture(RES_ITEM_GLINT); - GL46.glMatrixMode(GL46.GL_TEXTURE); - GL46.glPushMatrix(); - GL46.glScalef(8.0F, 8.0F, 8.0F); - float f = (float)(System.currentTimeMillis() % 3000L) / 3000.0F / 8.0F; - GL46.glTranslatef(f, 0.0F, 0.0F); - GL46.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F); - this.renderModel(model, -8372020); - GL46.glPopMatrix(); - GL46.glPushMatrix(); - GL46.glScalef(8.0F, 8.0F, 8.0F); - float f1 = (float)(System.currentTimeMillis() % 4873L) / 4873.0F / 8.0F; - GL46.glTranslatef(-f1, 0.0F, 0.0F); - GL46.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); - this.renderModel(model, -8372020); - GL46.glPopMatrix(); - GL46.glMatrixMode(GL46.GL_MODELVIEW); - GlState.blendFunc(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA); - GlState.enableLighting(); - GlState.depthFunc(GL46.GL_LEQUAL); - GlState.depthMask(true); - this.manager.bindTexture(TextureMap.BLOCKS); - } - private void putQuadNormal(RenderBuffer renderer, BakedQuad quad) { Vec3i vec3i = quad.getFace().getDirectionVec(); diff --git a/client/src/main/resources/shaders/world.vsh b/client/src/main/resources/shaders/world.vsh index 13219afe..3214f45b 100644 --- a/client/src/main/resources/shaders/world.vsh +++ b/client/src/main/resources/shaders/world.vsh @@ -22,7 +22,7 @@ uniform bool shade; void main() { vec3 nvertex = vec3(model * vec4(pos, 1.0)); vertex = vec3(float(chunk_x) + pos.x, float(chunk_y) + pos.y, float(chunk_z) + pos.z); - shading = shade ? (norm.x != 0.0 ? 0.6 : (norm.z != 0.0 ? 0.8 : (norm.y < 0.0 ? 0.5 : 1.0))) : 1.0; + shading = shade ? (norm.x != 0.0 ? 0.6 : (norm.z != 0.0 ? 0.8 : (norm.y > 0.0 ? 0.5 : 1.0))) : 1.0; normal = mat3(transpose(inverse(model))) * norm.xyz; shine = norm.a * 32.0; tex_coord = coord; diff --git a/client/src/main/resources/textures/glint.png b/client/src/main/resources/textures/glint.png deleted file mode 100755 index f9ca97c3..00000000 Binary files a/client/src/main/resources/textures/glint.png and /dev/null differ diff --git a/common/src/main/java/common/block/Block.java b/common/src/main/java/common/block/Block.java index b879242a..c2d814e7 100755 --- a/common/src/main/java/common/block/Block.java +++ b/common/src/main/java/common/block/Block.java @@ -648,10 +648,6 @@ public class Block { return true; } - public boolean isNonBlock() { - return false; - } - public boolean isPassable(IBlockAccess world, BlockPos pos) { return !this.material.blocksMovement(); } @@ -1100,4 +1096,14 @@ public class Block { public String getInfo(World world, BlockPos pos, State state, EntityNPC player) { return null; } + + @Clientside + public boolean isNonBlock() { + return false; + } + + @Clientside + public boolean canConnectNonBlock() { + return true; + } } diff --git a/common/src/main/java/common/block/BlockAir.java b/common/src/main/java/common/block/BlockAir.java index cee20e5d..f56e1084 100755 --- a/common/src/main/java/common/block/BlockAir.java +++ b/common/src/main/java/common/block/BlockAir.java @@ -2,6 +2,7 @@ package common.block; import common.util.BlockPos; import common.util.BoundingBox; +import common.util.Clientside; import common.world.State; import common.world.World; @@ -36,4 +37,9 @@ public final class BlockAir extends Block { protected boolean hasRegisteredItem() { return false; } + + @Clientside + public boolean canConnectNonBlock() { + return false; + } } diff --git a/common/src/main/java/common/block/foliage/BlockBush.java b/common/src/main/java/common/block/foliage/BlockBush.java index 58f1e3a5..6cc65fc9 100755 --- a/common/src/main/java/common/block/foliage/BlockBush.java +++ b/common/src/main/java/common/block/foliage/BlockBush.java @@ -8,6 +8,7 @@ import common.model.Model; import common.rng.Random; import common.util.BlockPos; import common.util.BoundingBox; +import common.util.Clientside; import common.util.Facing; import common.world.State; import common.world.World; @@ -87,6 +88,11 @@ public class BlockBush extends Block { return false; } + + @Clientside + public boolean canConnectNonBlock() { + return false; + } public static Model makeCrossModel(Model model) { return model diff --git a/common/src/main/java/common/init/ItemRegistry.java b/common/src/main/java/common/init/ItemRegistry.java index 54989d1a..97c1d0e3 100755 --- a/common/src/main/java/common/init/ItemRegistry.java +++ b/common/src/main/java/common/init/ItemRegistry.java @@ -283,7 +283,7 @@ public abstract class ItemRegistry { register("melon_seed", new ItemSeeds(Blocks.melon_stem, Blocks.farmland).setDisplay("Melonenkerne").setMaxAmount(StackSize.XL)); register("whip", (new ItemWhip()).setDisplay("Peitsche")); - register("charge_crystal", (new Item()).setDisplay("Energiekristall").setTab(CheatTab.MATERIALS).setColor(Color.DARK_MAGENTA).setGleaming().setFuelAmount(120000)); + register("charge_crystal", (new Item()).setDisplay("Energiekristall").setTab(CheatTab.MATERIALS).setColor(Color.DARK_MAGENTA).setFuelAmount(120000)); for(Enchantment ench : Enchantment.values()) { register("enchanted_book_" + ench.getName(), (new ItemEnchantedBook(ench, 1)).setUnstackable().setDisplay("Verzaubertes Buch mit " + ench.getFormattedName(1)).setTab(CheatTab.ENCHANTMENTS)); int max = ench.getMaxLevel(); diff --git a/common/src/main/java/common/item/Item.java b/common/src/main/java/common/item/Item.java index 332cd1b4..1f25a121 100755 --- a/common/src/main/java/common/item/Item.java +++ b/common/src/main/java/common/item/Item.java @@ -36,7 +36,6 @@ public class Item { private int fuelAmount = 0; private int explosive = 0; private boolean magnetic = false; - private boolean gleaming = false; private boolean fragile = false; public Item() { @@ -108,11 +107,6 @@ public class Item { return this; } - public final Item setGleaming() { - this.gleaming = true; - return this; - } - public final Item setFragile() { this.fragile = true; return this; @@ -181,11 +175,6 @@ public class Item { return this.magnetic; } - @Clientside - public final boolean isGleaming(ItemStack stack) { - return this.gleaming || stack.isItemEnchanted(); - } - public final boolean isFragile() { return this.fragile; } diff --git a/common/src/main/java/common/item/consumable/ItemAppleGold.java b/common/src/main/java/common/item/consumable/ItemAppleGold.java index d5475052..3ad37e6f 100755 --- a/common/src/main/java/common/item/consumable/ItemAppleGold.java +++ b/common/src/main/java/common/item/consumable/ItemAppleGold.java @@ -16,8 +16,6 @@ public class ItemAppleGold extends ItemFood super(amount, false); this.powered = powered; this.setColor(powered ? Color.MAGENTA : Color.NEON); - if(this.powered) - this.setGleaming(); } protected void onFoodEaten(ItemStack stack, World worldIn, EntityNPC player) diff --git a/common/src/main/java/common/item/consumable/ItemPotion.java b/common/src/main/java/common/item/consumable/ItemPotion.java index 75f3643c..bd25cfca 100755 --- a/common/src/main/java/common/item/consumable/ItemPotion.java +++ b/common/src/main/java/common/item/consumable/ItemPotion.java @@ -77,8 +77,6 @@ public class ItemPotion extends Item this.setColor(Color.ORK); this.setDisplay(getDisplay(this)); this.setFragile(); - if(this.effect != null) - this.setGleaming(); POTIONS.add(this); } diff --git a/common/src/main/java/common/item/material/ItemEnchantedBook.java b/common/src/main/java/common/item/material/ItemEnchantedBook.java index 3288384e..ab70cb47 100755 --- a/common/src/main/java/common/item/material/ItemEnchantedBook.java +++ b/common/src/main/java/common/item/material/ItemEnchantedBook.java @@ -26,7 +26,6 @@ public class ItemEnchantedBook extends Item public ItemEnchantedBook(Enchantment enchantment, int level) { this.setColor(Color.YELLOW); - this.setGleaming(); this.setFuelAmount(80); this.enchantment = enchantment; this.level = level; diff --git a/common/src/main/java/common/item/tool/ItemEditor.java b/common/src/main/java/common/item/tool/ItemEditor.java index 9ee0ad51..fb0ef8ca 100755 --- a/common/src/main/java/common/item/tool/ItemEditor.java +++ b/common/src/main/java/common/item/tool/ItemEditor.java @@ -12,7 +12,6 @@ public class ItemEditor extends Item { public ItemEditor() { this.setUnstackable(); this.setTab(CheatTab.TOOLS); - this.setGleaming(); } public boolean onAction(ItemStack stack, EntityNPC player, World world, ItemControl control, BlockPos block) { diff --git a/common/src/main/java/common/item/tool/ItemWand.java b/common/src/main/java/common/item/tool/ItemWand.java index e5876e3f..b128aa12 100755 --- a/common/src/main/java/common/item/tool/ItemWand.java +++ b/common/src/main/java/common/item/tool/ItemWand.java @@ -21,7 +21,6 @@ public abstract class ItemWand extends Item { public ItemWand() { this.setUnstackable(); this.setTab(CheatTab.TOOLS); - this.setGleaming(); } public final boolean onAction(ItemStack stack, EntityNPC player, World world, ItemControl control, BlockPos block) {