Fixed dissolve shader sometimes applying to wrong blocks (server and client are synced now, no more message to render).

Fixed build modes on server clicking twice.
Changing config ingame is now possible.
This commit is contained in:
Christian Knaapen
2019-02-12 16:06:54 +01:00
parent a5e5e7240a
commit e1c23a5bec
12 changed files with 68 additions and 41 deletions

View File

@@ -19,6 +19,7 @@ import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper; import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import nl.requios.effortlessbuilding.buildmode.BuildModes;
import nl.requios.effortlessbuilding.capability.ModeCapabilityManager; import nl.requios.effortlessbuilding.capability.ModeCapabilityManager;
import nl.requios.effortlessbuilding.capability.ModifierCapabilityManager; import nl.requios.effortlessbuilding.capability.ModifierCapabilityManager;
import nl.requios.effortlessbuilding.command.CommandReach; import nl.requios.effortlessbuilding.command.CommandReach;
@@ -101,7 +102,6 @@ public class EffortlessBuilding
EffortlessBuilding.packetHandler.registerMessage(RequestLookAtMessage.MessageHandler.class, RequestLookAtMessage.class, 5, Side.CLIENT); EffortlessBuilding.packetHandler.registerMessage(RequestLookAtMessage.MessageHandler.class, RequestLookAtMessage.class, 5, Side.CLIENT);
proxy.preInit(event); proxy.preInit(event);
CompatHelper.preInit();
} }
@EventHandler @EventHandler
@@ -120,6 +120,7 @@ public class EffortlessBuilding
public void postInit(FMLPostInitializationEvent event) public void postInit(FMLPostInitializationEvent event)
{ {
proxy.postInit(event); proxy.postInit(event);
CompatHelper.postInit();
} }
@EventHandler @EventHandler

View File

@@ -54,7 +54,6 @@ public class EventHandler
@SubscribeEvent @SubscribeEvent
public static void registerSounds(RegistryEvent.Register<SoundEvent> event) { public static void registerSounds(RegistryEvent.Register<SoundEvent> event) {
EffortlessBuilding.log("testing");
event.getRegistry().registerAll(EffortlessBuilding.SOUND_EVENTS); event.getRegistry().registerAll(EffortlessBuilding.SOUND_EVENTS);
} }
@@ -67,7 +66,7 @@ public class EventHandler
} }
@SubscribeEvent @SubscribeEvent
public void onConfigChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event) public static void onConfigChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event)
{ {
if (event.getModID().equals(EffortlessBuilding.MODID)) if (event.getModID().equals(EffortlessBuilding.MODID))
{ {

View File

@@ -7,6 +7,8 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.event.world.BlockEvent;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.relauncher.Side;
import nl.requios.effortlessbuilding.EffortlessBuilding; import nl.requios.effortlessbuilding.EffortlessBuilding;
import nl.requios.effortlessbuilding.buildmodifier.*; import nl.requios.effortlessbuilding.buildmodifier.*;
import nl.requios.effortlessbuilding.compatibility.CompatHelper; import nl.requios.effortlessbuilding.compatibility.CompatHelper;
@@ -32,7 +34,7 @@ public class BuildModes {
Cube ("Cube", new Cube()); Cube ("Cube", new Cube());
public String name; public String name;
public final IBuildMode instance; public IBuildMode instance;
BuildModeEnum(String name, IBuildMode instance) { BuildModeEnum(String name, IBuildMode instance) {
this.name = name; this.name = name;

View File

@@ -10,14 +10,18 @@ import nl.requios.effortlessbuilding.helper.ReachHelper;
import java.util.*; import java.util.*;
public class Floor implements IBuildMode { public class Floor implements IBuildMode {
Dictionary<UUID, Integer> rightClickNrTable = new Hashtable<>(); //In singleplayer client and server variables are shared
//Split everything that needs separate values and may not be called twice in one click
Dictionary<UUID, Integer> rightClickClientTable = new Hashtable<>();
Dictionary<UUID, Integer> rightClickServerTable = new Hashtable<>();
Dictionary<UUID, BlockPos> firstPosTable = new Hashtable<>(); Dictionary<UUID, BlockPos> firstPosTable = new Hashtable<>();
Dictionary<UUID, EnumFacing> sideHitTable = new Hashtable<>(); Dictionary<UUID, EnumFacing> sideHitTable = new Hashtable<>();
Dictionary<UUID, Vec3d> hitVecTable = new Hashtable<>(); Dictionary<UUID, Vec3d> hitVecTable = new Hashtable<>();
@Override @Override
public void initialize(EntityPlayer player) { public void initialize(EntityPlayer player) {
rightClickNrTable.put(player.getUniqueID(), 0); rightClickClientTable.put(player.getUniqueID(), 0);
rightClickServerTable.put(player.getUniqueID(), 0);
firstPosTable.put(player.getUniqueID(), BlockPos.ORIGIN); firstPosTable.put(player.getUniqueID(), BlockPos.ORIGIN);
sideHitTable.put(player.getUniqueID(), EnumFacing.UP); sideHitTable.put(player.getUniqueID(), EnumFacing.UP);
hitVecTable.put(player.getUniqueID(), Vec3d.ZERO); hitVecTable.put(player.getUniqueID(), Vec3d.ZERO);
@@ -27,14 +31,15 @@ public class Floor implements IBuildMode {
public List<BlockPos> onRightClick(EntityPlayer player, BlockPos blockPos, EnumFacing sideHit, Vec3d hitVec) { public List<BlockPos> onRightClick(EntityPlayer player, BlockPos blockPos, EnumFacing sideHit, Vec3d hitVec) {
List<BlockPos> list = new ArrayList<>(); List<BlockPos> list = new ArrayList<>();
int rightClickNr = rightClickNrTable.get(player.getUniqueID()); Dictionary<UUID, Integer> rightClickTable = player.world.isRemote ? rightClickClientTable : rightClickServerTable;
int rightClickNr = rightClickTable.get(player.getUniqueID());
rightClickNr++; rightClickNr++;
rightClickNrTable.put(player.getUniqueID(), rightClickNr); rightClickTable.put(player.getUniqueID(), rightClickNr);
if (rightClickNr == 1) { if (rightClickNr == 1) {
//If clicking in air, reset and try again //If clicking in air, reset and try again
if (blockPos == null) { if (blockPos == null) {
rightClickNrTable.put(player.getUniqueID(), 0); rightClickTable.put(player.getUniqueID(), 0);
return list; return list;
} }
@@ -47,7 +52,7 @@ public class Floor implements IBuildMode {
//Second click, place wall //Second click, place wall
list = findCoordinates(player, blockPos); list = findCoordinates(player, blockPos);
rightClickNrTable.put(player.getUniqueID(), 0); rightClickTable.put(player.getUniqueID(), 0);
} }
return list; return list;
@@ -56,7 +61,8 @@ public class Floor implements IBuildMode {
@Override @Override
public List<BlockPos> findCoordinates(EntityPlayer player, BlockPos blockPos) { public List<BlockPos> findCoordinates(EntityPlayer player, BlockPos blockPos) {
List<BlockPos> list = new ArrayList<>(); List<BlockPos> list = new ArrayList<>();
int rightClickNr = rightClickNrTable.get(player.getUniqueID()); Dictionary<UUID, Integer> rightClickTable = player.world.isRemote ? rightClickClientTable : rightClickServerTable;
int rightClickNr = rightClickTable.get(player.getUniqueID());
BlockPos firstPos = firstPosTable.get(player.getUniqueID()); BlockPos firstPos = firstPosTable.get(player.getUniqueID());
if (rightClickNr == 0) { if (rightClickNr == 0) {
@@ -92,8 +98,8 @@ public class Floor implements IBuildMode {
if (selected == null) return list; if (selected == null) return list;
//check if it doesnt go through blocks //check if it doesnt go through blocks
RayTraceResult rayTraceResult = player.world.rayTraceBlocks(start, selected, false, false, false); RayTraceResult rayTraceResult = player.world.rayTraceBlocks(start, selected, false, true, false);
if (rayTraceResult != null && rayTraceResult.typeOfHit != RayTraceResult.Type.BLOCK) { if (rayTraceResult != null && rayTraceResult.typeOfHit == RayTraceResult.Type.BLOCK) {
//return empty list //return empty list
return list; return list;
} }

View File

@@ -5,20 +5,23 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vec3i;
import nl.requios.effortlessbuilding.helper.ReachHelper; import nl.requios.effortlessbuilding.helper.ReachHelper;
import java.util.*; import java.util.*;
public class Line implements IBuildMode { public class Line implements IBuildMode {
Dictionary<UUID, Integer> rightClickNrTable = new Hashtable<>(); //In singleplayer client and server variables are shared
//Split everything that needs separate values and may not be called twice in one click
Dictionary<UUID, Integer> rightClickClientTable = new Hashtable<>();
Dictionary<UUID, Integer> rightClickServerTable = new Hashtable<>();
Dictionary<UUID, BlockPos> firstPosTable = new Hashtable<>(); Dictionary<UUID, BlockPos> firstPosTable = new Hashtable<>();
Dictionary<UUID, EnumFacing> sideHitTable = new Hashtable<>(); Dictionary<UUID, EnumFacing> sideHitTable = new Hashtable<>();
Dictionary<UUID, Vec3d> hitVecTable = new Hashtable<>(); Dictionary<UUID, Vec3d> hitVecTable = new Hashtable<>();
@Override @Override
public void initialize(EntityPlayer player) { public void initialize(EntityPlayer player) {
rightClickNrTable.put(player.getUniqueID(), 0); rightClickClientTable.put(player.getUniqueID(), 0);
rightClickServerTable.put(player.getUniqueID(), 0);
firstPosTable.put(player.getUniqueID(), BlockPos.ORIGIN); firstPosTable.put(player.getUniqueID(), BlockPos.ORIGIN);
sideHitTable.put(player.getUniqueID(), EnumFacing.UP); sideHitTable.put(player.getUniqueID(), EnumFacing.UP);
hitVecTable.put(player.getUniqueID(), Vec3d.ZERO); hitVecTable.put(player.getUniqueID(), Vec3d.ZERO);
@@ -28,14 +31,15 @@ public class Line implements IBuildMode {
public List<BlockPos> onRightClick(EntityPlayer player, BlockPos blockPos, EnumFacing sideHit, Vec3d hitVec) { public List<BlockPos> onRightClick(EntityPlayer player, BlockPos blockPos, EnumFacing sideHit, Vec3d hitVec) {
List<BlockPos> list = new ArrayList<>(); List<BlockPos> list = new ArrayList<>();
int rightClickNr = rightClickNrTable.get(player.getUniqueID()); Dictionary<UUID, Integer> rightClickTable = player.world.isRemote ? rightClickClientTable : rightClickServerTable;
int rightClickNr = rightClickTable.get(player.getUniqueID());
rightClickNr++; rightClickNr++;
rightClickNrTable.put(player.getUniqueID(), rightClickNr); rightClickTable.put(player.getUniqueID(), rightClickNr);
if (rightClickNr == 1) { if (rightClickNr == 1) {
//If clicking in air, reset and try again //If clicking in air, reset and try again
if (blockPos == null) { if (blockPos == null) {
rightClickNrTable.put(player.getUniqueID(), 0); rightClickTable.put(player.getUniqueID(), 0);
return list; return list;
} }
@@ -48,7 +52,7 @@ public class Line implements IBuildMode {
//Second click, place wall //Second click, place wall
list = findCoordinates(player, blockPos); list = findCoordinates(player, blockPos);
rightClickNrTable.put(player.getUniqueID(), 0); rightClickTable.put(player.getUniqueID(), 0);
} }
return list; return list;
@@ -57,7 +61,8 @@ public class Line implements IBuildMode {
@Override @Override
public List<BlockPos> findCoordinates(EntityPlayer player, BlockPos blockPos) { public List<BlockPos> findCoordinates(EntityPlayer player, BlockPos blockPos) {
List<BlockPos> list = new ArrayList<>(); List<BlockPos> list = new ArrayList<>();
int rightClickNr = rightClickNrTable.get(player.getUniqueID()); Dictionary<UUID, Integer> rightClickTable = player.world.isRemote ? rightClickClientTable : rightClickServerTable;
int rightClickNr = rightClickTable.get(player.getUniqueID());
BlockPos firstPos = firstPosTable.get(player.getUniqueID()); BlockPos firstPos = firstPosTable.get(player.getUniqueID());
if (rightClickNr == 0) { if (rightClickNr == 0) {
@@ -149,9 +154,9 @@ public class Line implements IBuildMode {
if (selected == null) return list; if (selected == null) return list;
//TODO check if it doesnt go through blocks //check if it doesnt go through blocks
RayTraceResult rayTraceResult = player.world.rayTraceBlocks(start, selected, false, false, false); RayTraceResult rayTraceResult = player.world.rayTraceBlocks(start, selected, false, true, false);
if (rayTraceResult != null && rayTraceResult.typeOfHit != RayTraceResult.Type.BLOCK) { if (rayTraceResult != null && rayTraceResult.typeOfHit == RayTraceResult.Type.BLOCK) {
//return empty list //return empty list
return list; return list;
} }

View File

@@ -5,19 +5,24 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
import nl.requios.effortlessbuilding.EffortlessBuilding;
import nl.requios.effortlessbuilding.helper.ReachHelper; import nl.requios.effortlessbuilding.helper.ReachHelper;
import java.util.*; import java.util.*;
public class Wall implements IBuildMode { public class Wall implements IBuildMode {
Dictionary<UUID, Integer> rightClickNrTable = new Hashtable<>(); //In singleplayer client and server variables are shared
//Split everything that needs separate values and may not be called twice in one click
Dictionary<UUID, Integer> rightClickClientTable = new Hashtable<>();
Dictionary<UUID, Integer> rightClickServerTable = new Hashtable<>();
Dictionary<UUID, BlockPos> firstPosTable = new Hashtable<>(); Dictionary<UUID, BlockPos> firstPosTable = new Hashtable<>();
Dictionary<UUID, EnumFacing> sideHitTable = new Hashtable<>(); Dictionary<UUID, EnumFacing> sideHitTable = new Hashtable<>();
Dictionary<UUID, Vec3d> hitVecTable = new Hashtable<>(); Dictionary<UUID, Vec3d> hitVecTable = new Hashtable<>();
@Override @Override
public void initialize(EntityPlayer player) { public void initialize(EntityPlayer player) {
rightClickNrTable.put(player.getUniqueID(), 0); rightClickClientTable.put(player.getUniqueID(), 0);
rightClickServerTable.put(player.getUniqueID(), 0);
firstPosTable.put(player.getUniqueID(), BlockPos.ORIGIN); firstPosTable.put(player.getUniqueID(), BlockPos.ORIGIN);
sideHitTable.put(player.getUniqueID(), EnumFacing.UP); sideHitTable.put(player.getUniqueID(), EnumFacing.UP);
hitVecTable.put(player.getUniqueID(), Vec3d.ZERO); hitVecTable.put(player.getUniqueID(), Vec3d.ZERO);
@@ -27,14 +32,15 @@ public class Wall implements IBuildMode {
public List<BlockPos> onRightClick(EntityPlayer player, BlockPos blockPos, EnumFacing sideHit, Vec3d hitVec) { public List<BlockPos> onRightClick(EntityPlayer player, BlockPos blockPos, EnumFacing sideHit, Vec3d hitVec) {
List<BlockPos> list = new ArrayList<>(); List<BlockPos> list = new ArrayList<>();
int rightClickNr = rightClickNrTable.get(player.getUniqueID()); Dictionary<UUID, Integer> rightClickTable = player.world.isRemote ? rightClickClientTable : rightClickServerTable;
int rightClickNr = rightClickTable.get(player.getUniqueID());
rightClickNr++; rightClickNr++;
rightClickNrTable.put(player.getUniqueID(), rightClickNr); rightClickTable.put(player.getUniqueID(), rightClickNr);
if (rightClickNr == 1) { if (rightClickNr == 1) {
//If clicking in air, reset and try again //If clicking in air, reset and try again
if (blockPos == null) { if (blockPos == null) {
rightClickNrTable.put(player.getUniqueID(), 0); rightClickTable.put(player.getUniqueID(), 0);
return list; return list;
} }
@@ -47,7 +53,7 @@ public class Wall implements IBuildMode {
//Second click, place wall //Second click, place wall
list = findCoordinates(player, blockPos); list = findCoordinates(player, blockPos);
rightClickNrTable.put(player.getUniqueID(), 0); rightClickTable.put(player.getUniqueID(), 0);
} }
return list; return list;
@@ -56,7 +62,8 @@ public class Wall implements IBuildMode {
@Override @Override
public List<BlockPos> findCoordinates(EntityPlayer player, BlockPos blockPos) { public List<BlockPos> findCoordinates(EntityPlayer player, BlockPos blockPos) {
List<BlockPos> list = new ArrayList<>(); List<BlockPos> list = new ArrayList<>();
int rightClickNr = rightClickNrTable.get(player.getUniqueID()); Dictionary<UUID, Integer> rightClickTable = player.world.isRemote ? rightClickClientTable : rightClickServerTable;
int rightClickNr = rightClickTable.get(player.getUniqueID());
BlockPos firstPos = firstPosTable.get(player.getUniqueID()); BlockPos firstPos = firstPosTable.get(player.getUniqueID());
if (rightClickNr == 0) { if (rightClickNr == 0) {
@@ -116,8 +123,8 @@ public class Wall implements IBuildMode {
if (selected == null) return list; if (selected == null) return list;
//check if it doesnt go through blocks //check if it doesnt go through blocks
RayTraceResult rayTraceResult = player.world.rayTraceBlocks(start, selected, false, false, false); RayTraceResult rayTraceResult = player.world.rayTraceBlocks(start, selected, false, true, false);
if (rayTraceResult != null && rayTraceResult.typeOfHit != RayTraceResult.Type.BLOCK) { if (rayTraceResult != null && rayTraceResult.typeOfHit == RayTraceResult.Type.BLOCK) {
//return empty list //return empty list
return list; return list;
} }

View File

@@ -16,6 +16,7 @@ import nl.requios.effortlessbuilding.compatibility.CompatHelper;
import nl.requios.effortlessbuilding.helper.SurvivalHelper; import nl.requios.effortlessbuilding.helper.SurvivalHelper;
import nl.requios.effortlessbuilding.item.ItemRandomizerBag; import nl.requios.effortlessbuilding.item.ItemRandomizerBag;
import nl.requios.effortlessbuilding.network.BlockPlacedMessage; import nl.requios.effortlessbuilding.network.BlockPlacedMessage;
import nl.requios.effortlessbuilding.render.BlockPreviewRenderer;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
@@ -39,6 +40,11 @@ public class BuildModifiers {
//check if valid blockstates //check if valid blockstates
if (blockStates.size() == 0 || coordinates.size() != blockStates.size()) return; if (blockStates.size() == 0 || coordinates.size() != blockStates.size()) return;
if (world.isRemote) {
BlockPreviewRenderer.onBlocksPlaced();
return;
}
//place blocks //place blocks
for (int i = 0; i < coordinates.size(); i++) { for (int i = 0; i < coordinates.size(); i++) {
BlockPos blockPos = coordinates.get(i); BlockPos blockPos = coordinates.get(i);
@@ -52,8 +58,6 @@ public class BuildModifiers {
} }
} }
EffortlessBuilding.packetHandler.sendTo(new BlockPlacedMessage(), ((EntityPlayerMP) player));
} }
public static void onBlockBroken(EntityPlayer player, List<BlockPos> posList) { public static void onBlockBroken(EntityPlayer player, List<BlockPos> posList) {

View File

@@ -18,7 +18,7 @@ public class CompatHelper {
public static IChiselsAndBitsProxy chiselsAndBitsProxy; public static IChiselsAndBitsProxy chiselsAndBitsProxy;
public static void preInit() { public static void postInit() {
if (Loader.isModLoaded("chiselsandbits")) { if (Loader.isModLoaded("chiselsandbits")) {
// reflection to avoid hard dependency // reflection to avoid hard dependency
try { try {

View File

@@ -161,6 +161,7 @@ public class ClientProxy implements IProxy {
//find position in distance //find position in distance
RayTraceResult lookingAt = getLookingAt(player); RayTraceResult lookingAt = getLookingAt(player);
BuildModes.onBlockPlacedMessage(player, new BlockPlacedMessage(lookingAt));
EffortlessBuilding.packetHandler.sendToServer(new BlockPlacedMessage(lookingAt)); EffortlessBuilding.packetHandler.sendToServer(new BlockPlacedMessage(lookingAt));
//play sound if further than normal //play sound if further than normal
@@ -186,6 +187,7 @@ public class ClientProxy implements IProxy {
breakCooldown = 6; breakCooldown = 6;
RayTraceResult lookingAt = getLookingAt(player); RayTraceResult lookingAt = getLookingAt(player);
if (lookingAt != null && lookingAt.typeOfHit == RayTraceResult.Type.BLOCK) { if (lookingAt != null && lookingAt.typeOfHit == RayTraceResult.Type.BLOCK) {
BuildModes.onBlockBrokenMessage(player, new BlockBrokenMessage(lookingAt));
EffortlessBuilding.packetHandler.sendToServer(new BlockBrokenMessage(lookingAt)); EffortlessBuilding.packetHandler.sendToServer(new BlockBrokenMessage(lookingAt));
//play sound //play sound
@@ -251,7 +253,7 @@ public class ClientProxy implements IProxy {
ShaderHandler.init(); ShaderHandler.init();
EffortlessBuilding.log(player, "Reloaded shaders"); EffortlessBuilding.log(player, "Reloaded shaders");
//player.playSound(SoundEvents.UI_BUTTON_CLICK, 1f, 1f); //player.playSound(SoundEvents.UI_BUTTON_CLICK, 1f, 1f);
player.playSound(EffortlessBuilding.SOUND_BUILD_CLICK, 1f, 1f); //player.playSound(EffortlessBuilding.SOUND_BUILD_CLICK, 1f, 1f);
} }
} }

View File

@@ -194,8 +194,8 @@ public class RenderHandler implements IWorldEventListener {
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
GlStateManager.translate(blockPos.getX(), blockPos.getY(), blockPos.getZ()); GlStateManager.translate(blockPos.getX(), blockPos.getY(), blockPos.getZ());
GlStateManager.rotate(-90.0F, 0.0F, 1.0F, 0.0F); GlStateManager.rotate(-90.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(-0.005f, -0.005f, 0.005f); GlStateManager.translate(-0.01f, -0.01f, 0.01f);
GlStateManager.scale(1.01f, 1.01f, 1.01f); GlStateManager.scale(1.02f, 1.02f, 1.02f);
dispatcher.renderBlockBrightness(blockState, 0.85f); dispatcher.renderBlockBrightness(blockState, 0.85f);
GlStateManager.popMatrix(); GlStateManager.popMatrix();
} }

View File

@@ -15,7 +15,8 @@ varying vec3 normal;
void main() { void main() {
vec3 worldpos = blockpos + position.xyz; vec3 pixelposition = floor(position.xyz * 8.0) / 8.0;
vec3 worldpos = blockpos + pixelposition.xyz;
vec2 texcoord = vec2(gl_TexCoord[0]); vec2 texcoord = vec2(gl_TexCoord[0]);
vec4 texcolor = texture2D(image, texcoord); vec4 texcolor = texture2D(image, texcoord);
vec4 color = texcolor; vec4 color = texcolor;

View File

@@ -16,7 +16,7 @@ void main() {
gl_Position = ftransform();//gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex; gl_Position = ftransform();//gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex;
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
gl_FrontColor = gl_Color; gl_FrontColor = gl_Color;
gl_BackColor = gl_Color; //gl_BackColor = gl_Color;
position = gl_Vertex; position = gl_Vertex;
normal = gl_Normal; normal = gl_Normal;