Java Code Examples for net.minecraft.util.math.BlockPos#ORIGIN

The following examples show how to use net.minecraft.util.math.BlockPos#ORIGIN . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: VoidWorldBiomeProvider.java    From YUNoMakeGoodMap with Apache License 2.0 5 votes vote down vote up
@Override
public BlockPos findBiomePosition(int x, int z, int range, List<Biome> biomes, Random rand)
{
    BlockPos ret = super.findBiomePosition(x, z, range, biomes, rand);
    if (x == 0 && z == 0 && !world.getWorldInfo().isInitialized())
    {
        if (ret == null)
        {
            ret = BlockPos.ORIGIN;
        }

        buildSpawn(world, new BlockPos(ret.getX(), world.provider.getAverageGroundLevel(), ret.getZ()));
    }
    return ret;
}
 
Example 2
Source File: SchematicProject.java    From litematica with GNU Lesser General Public License v3.0 5 votes vote down vote up
public void clear()
{
    this.origin = BlockPos.ORIGIN;
    this.versions.clear();
    this.selection = new AreaSelection();
    this.selectionSimple = new AreaSelectionSimple(true);
    this.lastSeenArea = new AreaSelection();
    this.lastCheckedOutVersion = -1;
    this.currentVersionId = -1;
    this.saveInProgress = false;
}
 
Example 3
Source File: ChestEspHack.java    From Wurst7 with GNU General Public License v3.0 5 votes vote down vote up
private void setupDisplayLists()
{
	Box box = new Box(BlockPos.ORIGIN);
	
	greenBox = GL11.glGenLists(1);
	GL11.glNewList(greenBox, GL11.GL_COMPILE);
	GL11.glColor4f(0, 1, 0, 0.25F);
	RenderUtils.drawSolidBox(box);
	GL11.glColor4f(0, 1, 0, 0.5F);
	RenderUtils.drawOutlinedBox(box);
	GL11.glEndList();
	
	orangeBox = GL11.glGenLists(1);
	GL11.glNewList(orangeBox, GL11.GL_COMPILE);
	GL11.glColor4f(1, 0.5F, 0, 0.25F);
	RenderUtils.drawSolidBox(box);
	GL11.glColor4f(1, 0.5F, 0, 0.5F);
	RenderUtils.drawOutlinedBox(box);
	GL11.glEndList();
	
	cyanBox = GL11.glGenLists(1);
	GL11.glNewList(cyanBox, GL11.GL_COMPILE);
	GL11.glColor4f(0, 1, 1, 0.25F);
	RenderUtils.drawSolidBox(box);
	GL11.glColor4f(0, 1, 1, 0.5F);
	RenderUtils.drawOutlinedBox(box);
	GL11.glEndList();
	
	purpleBox = GL11.glGenLists(1);
	GL11.glNewList(purpleBox, GL11.GL_COMPILE);
	GL11.glColor4f(1, 0, 1, 0.25F);
	RenderUtils.drawSolidBox(box);
	GL11.glColor4f(1, 0, 1, 0.5F);
	RenderUtils.drawOutlinedBox(box);
	GL11.glEndList();
	
	normalChests = GL11.glGenLists(1);
}
 
Example 4
Source File: AreaSelection.java    From litematica with GNU Lesser General Public License v3.0 5 votes vote down vote up
protected void updateCalculatedOrigin()
{
    Pair<BlockPos, BlockPos> pair = PositionUtils.getEnclosingAreaCorners(this.subRegionBoxes.values());

    if (pair != null)
    {
        this.calculatedOrigin = pair.getLeft();
    }
    else
    {
        this.calculatedOrigin = BlockPos.ORIGIN;
    }

    this.calculatedOriginDirty = false;
}
 
Example 5
Source File: TileEntityMultiblockPart.java    From Valkyrien-Skies with Apache License 2.0 5 votes vote down vote up
public TileEntityMultiblockPart() {
    super();
    this.isAssembled = false;
    this.isMaster = false;
    this.offsetPos = BlockPos.ORIGIN;
    this.multiblockSchematic = null;
}
 
Example 6
Source File: TaskMoveArea.java    From enderutilities with GNU Lesser General Public License v3.0 5 votes vote down vote up
public TaskMoveArea(int dimension, BlockPos posSrcStart, BlockPos posSrcEnd, BlockPos posDstStart,
        Rotation rotationDst, Mirror mirrorDst, UUID wandUUID, int blocksPerTick)
{
    this.posSrcStart = posSrcStart;
    this.posDstStart = posDstStart;
    this.rotation = rotationDst;
    this.mirror = mirrorDst;
    this.wandUUID = wandUUID;
    this.dimension = dimension;
    this.blocksPerTick = blocksPerTick;
    this.boxRelative = new BlockPosBox(BlockPos.ORIGIN, posSrcEnd.subtract(posSrcStart));
    this.boxSource = new BlockPosBox(posSrcStart, posSrcEnd);
    this.handledPositions = new HashSet<BlockPos>();
}
 
Example 7
Source File: HopperMinecartEntity_cooldownFixMixin.java    From carpet-extra with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Inject(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/vehicle/HopperMinecartEntity;setTransferCooldown(I)V",ordinal = 0),locals = LocalCapture.CAPTURE_FAILHARD)
private void rememberBlockPos(CallbackInfo ci){
    if(CarpetExtraSettings.hopperMinecart8gtCooldown)
        this.currentBlockPos = this.getBlockPos();
    else
        this.currentBlockPos = BlockPos.ORIGIN;
}
 
Example 8
Source File: ToolJackHammer.java    From GregTech with GNU Lesser General Public License v3.0 5 votes vote down vote up
private static BlockPos rotate(BlockPos origin, int x, int y, EnumFacing sideHit, EnumFacing horizontalFacing) {
    switch (sideHit.getAxis()) {
        case X: return origin.add(0, y, x);
        case Z: return origin.add(x, y, 0);
        case Y: return rotateVertical(origin, x, y, horizontalFacing);
        default: return BlockPos.ORIGIN;
    }
}
 
Example 9
Source File: ToolJackHammer.java    From GregTech with GNU Lesser General Public License v3.0 5 votes vote down vote up
@SuppressWarnings("SuspiciousNameCombination")
private static BlockPos rotateVertical(BlockPos origin, int x, int y, EnumFacing horizontalFacing) {
    switch (horizontalFacing.getAxis()) {
        case X: return origin.add(y, 0, x);
        case Z: return origin.add(x, 0, y);
        default: return BlockPos.ORIGIN;
    }
}
 
Example 10
Source File: Box.java    From litematica with GNU Lesser General Public License v3.0 4 votes vote down vote up
public Box()
{
    this(BlockPos.ORIGIN, BlockPos.ORIGIN);
}
 
Example 11
Source File: KillauraHack.java    From ForgeWurst with GNU General Public License v3.0 4 votes vote down vote up
@SubscribeEvent
public void onRenderWorldLast(RenderWorldLastEvent event)
{
	if(target == null)
		return;
	
	// GL settings
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	GL11.glEnable(GL11.GL_LINE_SMOOTH);
	GL11.glLineWidth(2);
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glEnable(GL11.GL_CULL_FACE);
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	
	GL11.glPushMatrix();
	GL11.glTranslated(-TileEntityRendererDispatcher.staticPlayerX,
		-TileEntityRendererDispatcher.staticPlayerY,
		-TileEntityRendererDispatcher.staticPlayerZ);
	
	AxisAlignedBB box = new AxisAlignedBB(BlockPos.ORIGIN);
	float p = (target.getMaxHealth() - target.getHealth())
		/ target.getMaxHealth();
	float red = p * 2F;
	float green = 2 - red;
	
	GL11.glTranslated(target.posX, target.posY, target.posZ);
	GL11.glTranslated(0, 0.05, 0);
	GL11.glScaled(target.width, target.height, target.width);
	GL11.glTranslated(-0.5, 0, -0.5);
	
	if(p < 1)
	{
		GL11.glTranslated(0.5, 0.5, 0.5);
		GL11.glScaled(p, p, p);
		GL11.glTranslated(-0.5, -0.5, -0.5);
	}
	
	GL11.glColor4f(red, green, 0, 0.25F);
	GL11.glBegin(GL11.GL_QUADS);
	RenderUtils.drawSolidBox(box);
	GL11.glEnd();
	
	GL11.glColor4f(red, green, 0, 0.5F);
	GL11.glBegin(GL11.GL_LINES);
	RenderUtils.drawOutlinedBox(box);
	GL11.glEnd();
	
	GL11.glPopMatrix();
	
	// GL resets
	GL11.glColor4f(1, 1, 1, 1);
	GL11.glEnable(GL11.GL_DEPTH_TEST);
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_BLEND);
	GL11.glDisable(GL11.GL_LINE_SMOOTH);
}
 
Example 12
Source File: ChestEspHack.java    From ForgeWurst with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected void onEnable()
{
	MinecraftForge.EVENT_BUS.register(this);
	AxisAlignedBB bb = new AxisAlignedBB(BlockPos.ORIGIN);
	
	greenBox = GL11.glGenLists(1);
	GL11.glNewList(greenBox, GL11.GL_COMPILE);
	GL11.glColor4f(0, 1, 0, 0.25F);
	GL11.glBegin(GL11.GL_QUADS);
	RenderUtils.drawSolidBox(bb);
	GL11.glEnd();
	GL11.glColor4f(0, 1, 0, 0.5F);
	GL11.glBegin(GL11.GL_LINES);
	RenderUtils.drawOutlinedBox(bb);
	GL11.glEnd();
	GL11.glEndList();
	
	orangeBox = GL11.glGenLists(1);
	GL11.glNewList(orangeBox, GL11.GL_COMPILE);
	GL11.glColor4f(1, 0.5F, 0, 0.25F);
	GL11.glBegin(GL11.GL_QUADS);
	RenderUtils.drawSolidBox(bb);
	GL11.glEnd();
	GL11.glColor4f(1, 0.5F, 0, 0.5F);
	GL11.glBegin(GL11.GL_LINES);
	RenderUtils.drawOutlinedBox(bb);
	GL11.glEnd();
	GL11.glEndList();
	
	cyanBox = GL11.glGenLists(1);
	GL11.glNewList(cyanBox, GL11.GL_COMPILE);
	GL11.glColor4f(0, 1, 1, 0.25F);
	GL11.glBegin(GL11.GL_QUADS);
	RenderUtils.drawSolidBox(bb);
	GL11.glEnd();
	GL11.glColor4f(0, 1, 1, 0.5F);
	GL11.glBegin(GL11.GL_LINES);
	RenderUtils.drawOutlinedBox(bb);
	GL11.glEnd();
	GL11.glEndList();
	
	normalChests = GL11.glGenLists(1);
}
 
Example 13
Source File: TunnellerHack.java    From ForgeWurst with GNU General Public License v3.0 4 votes vote down vote up
@SubscribeEvent
public void onRenderWorldLast(RenderWorldLastEvent event)
{
	// GL settings
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	GL11.glEnable(GL11.GL_LINE_SMOOTH);
	GL11.glLineWidth(2);
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glEnable(GL11.GL_CULL_FACE);
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	
	GL11.glPushMatrix();
	GL11.glTranslated(-TileEntityRendererDispatcher.staticPlayerX,
		-TileEntityRendererDispatcher.staticPlayerY,
		-TileEntityRendererDispatcher.staticPlayerZ);
	
	for(int displayList : displayLists)
		GL11.glCallList(displayList);
	
	if(currentBlock != null)
	{
		float p = prevProgress
			+ (progress - prevProgress) * event.getPartialTicks();
		float red = p * 2F;
		float green = 2 - red;
		
		GL11.glTranslated(currentBlock.getX(), currentBlock.getY(),
			currentBlock.getZ());
		if(p < 1)
		{
			GL11.glTranslated(0.5, 0.5, 0.5);
			GL11.glScaled(p, p, p);
			GL11.glTranslated(-0.5, -0.5, -0.5);
		}
		
		AxisAlignedBB box2 = new AxisAlignedBB(BlockPos.ORIGIN);
		GL11.glColor4f(red, green, 0, 0.25F);
		GL11.glBegin(GL11.GL_QUADS);
		RenderUtils.drawSolidBox(box2);
		GL11.glEnd();
		GL11.glColor4f(red, green, 0, 0.5F);
		GL11.glBegin(GL11.GL_LINES);
		RenderUtils.drawOutlinedBox(box2);
		GL11.glEnd();
	}
	
	GL11.glPopMatrix();
	
	// GL resets
	GL11.glColor4f(1, 1, 1, 1);
	GL11.glEnable(GL11.GL_DEPTH_TEST);
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_BLEND);
	GL11.glDisable(GL11.GL_LINE_SMOOTH);
}
 
Example 14
Source File: AutoFarmHack.java    From ForgeWurst with GNU General Public License v3.0 4 votes vote down vote up
@SubscribeEvent
public void onRenderWorldLast(RenderWorldLastEvent event)
{
	// GL settings
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	GL11.glEnable(GL11.GL_LINE_SMOOTH);
	GL11.glLineWidth(2);
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glEnable(GL11.GL_CULL_FACE);
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	
	GL11.glPushMatrix();
	GL11.glTranslated(-TileEntityRendererDispatcher.staticPlayerX,
		-TileEntityRendererDispatcher.staticPlayerY,
		-TileEntityRendererDispatcher.staticPlayerZ);
	
	GL11.glCallList(displayList);
	
	if(currentBlock != null)
	{
		GL11.glPushMatrix();
		
		AxisAlignedBB box = new AxisAlignedBB(BlockPos.ORIGIN);
		float p = prevProgress
			+ (progress - prevProgress) * event.getPartialTicks();
		float red = p * 2F;
		float green = 2 - red;
		
		GL11.glTranslated(currentBlock.getX(), currentBlock.getY(),
			currentBlock.getZ());
		if(p < 1)
		{
			GL11.glTranslated(0.5, 0.5, 0.5);
			GL11.glScaled(p, p, p);
			GL11.glTranslated(-0.5, -0.5, -0.5);
		}
		
		GL11.glColor4f(red, green, 0, 0.25F);
		GL11.glBegin(GL11.GL_QUADS);
		RenderUtils.drawSolidBox(box);
		GL11.glEnd();
		
		GL11.glColor4f(red, green, 0, 0.5F);
		GL11.glBegin(GL11.GL_LINES);
		RenderUtils.drawOutlinedBox(box);
		GL11.glEnd();
		
		GL11.glPopMatrix();
	}
	
	GL11.glPopMatrix();
	
	// GL resets
	GL11.glColor4f(1, 1, 1, 1);
	GL11.glEnable(GL11.GL_DEPTH_TEST);
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_BLEND);
	GL11.glDisable(GL11.GL_LINE_SMOOTH);
}
 
Example 15
Source File: HopperMinecartEntity_transferItemsOutFeatureMixin.java    From carpet-extra with GNU Lesser General Public License v3.0 4 votes vote down vote up
public HopperMinecartEntity_transferItemsOutFeatureMixin(EntityType<? extends HopperMinecartEntity> entityType_1, World world_1) {
    super(entityType_1, world_1);
    this.currentBlockPos = BlockPos.ORIGIN;
}
 
Example 16
Source File: NukerHack.java    From Wurst7 with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onRender(float partialTicks)
{
	if(currentBlock == null)
		return;
	
	// GL settings
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	GL11.glEnable(GL11.GL_LINE_SMOOTH);
	GL11.glLineWidth(2);
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glEnable(GL11.GL_CULL_FACE);
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	GL11.glDisable(GL11.GL_LIGHTING);
	
	GL11.glPushMatrix();
	RenderUtils.applyRenderOffset();
	
	Box box = new Box(BlockPos.ORIGIN);
	float p = prevProgress + (progress - prevProgress) * partialTicks;
	float red = p * 2F;
	float green = 2 - red;
	
	GL11.glTranslated(currentBlock.getX(), currentBlock.getY(),
		currentBlock.getZ());
	if(p < 1)
	{
		GL11.glTranslated(0.5, 0.5, 0.5);
		GL11.glScaled(p, p, p);
		GL11.glTranslated(-0.5, -0.5, -0.5);
	}
	
	GL11.glColor4f(red, green, 0, 0.25F);
	RenderUtils.drawSolidBox(box);
	
	GL11.glColor4f(red, green, 0, 0.5F);
	RenderUtils.drawOutlinedBox(box);
	
	GL11.glPopMatrix();
	
	// GL resets
	GL11.glColor4f(1, 1, 1, 1);
	GL11.glEnable(GL11.GL_DEPTH_TEST);
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_BLEND);
	GL11.glDisable(GL11.GL_LINE_SMOOTH);
}
 
Example 17
Source File: KillauraHack.java    From Wurst7 with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onRender(float partialTicks)
{
	if(renderTarget == null)
		return;
	
	// GL settings
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	GL11.glEnable(GL11.GL_LINE_SMOOTH);
	GL11.glLineWidth(2);
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glEnable(GL11.GL_CULL_FACE);
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	GL11.glDisable(GL11.GL_LIGHTING);
	
	GL11.glPushMatrix();
	RenderUtils.applyRenderOffset();
	
	Box box = new Box(BlockPos.ORIGIN);
	float p = (renderTarget.getMaxHealth() - renderTarget.getHealth())
		/ renderTarget.getMaxHealth();
	float red = p * 2F;
	float green = 2 - red;
	
	GL11.glTranslated(
		renderTarget.prevX
			+ (renderTarget.getX() - renderTarget.prevX) * partialTicks,
		renderTarget.prevY
			+ (renderTarget.getY() - renderTarget.prevY) * partialTicks,
		renderTarget.prevZ
			+ (renderTarget.getZ() - renderTarget.prevZ) * partialTicks);
	GL11.glTranslated(0, 0.05, 0);
	GL11.glScaled(renderTarget.getWidth(), renderTarget.getHeight(),
		renderTarget.getWidth());
	GL11.glTranslated(-0.5, 0, -0.5);
	
	if(p < 1)
	{
		GL11.glTranslated(0.5, 0.5, 0.5);
		GL11.glScaled(p, p, p);
		GL11.glTranslated(-0.5, -0.5, -0.5);
	}
	
	GL11.glColor4f(red, green, 0, 0.25F);
	RenderUtils.drawSolidBox(box);
	
	GL11.glColor4f(red, green, 0, 0.5F);
	RenderUtils.drawOutlinedBox(box);
	
	GL11.glPopMatrix();
	
	// GL resets
	GL11.glColor4f(1, 1, 1, 1);
	GL11.glEnable(GL11.GL_DEPTH_TEST);
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_BLEND);
	GL11.glDisable(GL11.GL_LINE_SMOOTH);
}
 
Example 18
Source File: KillauraLegitHack.java    From Wurst7 with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onRender(float partialTicks)
{
	if(target == null)
		return;
	
	// GL settings
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	GL11.glEnable(GL11.GL_LINE_SMOOTH);
	GL11.glLineWidth(2);
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glEnable(GL11.GL_CULL_FACE);
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	GL11.glDisable(GL11.GL_LIGHTING);
	
	GL11.glPushMatrix();
	RenderUtils.applyRenderOffset();
	
	Box box = new Box(BlockPos.ORIGIN);
	float p = (target.getMaxHealth() - target.getHealth())
		/ target.getMaxHealth();
	float red = p * 2F;
	float green = 2 - red;
	
	GL11.glTranslated(
		target.prevX + (target.getX() - target.prevX) * partialTicks,
		target.prevY + (target.getY() - target.prevY) * partialTicks,
		target.prevZ + (target.getZ() - target.prevZ) * partialTicks);
	GL11.glTranslated(0, 0.05, 0);
	GL11.glScaled(target.getWidth(), target.getHeight(), target.getWidth());
	GL11.glTranslated(-0.5, 0, -0.5);
	
	if(p < 1)
	{
		GL11.glTranslated(0.5, 0.5, 0.5);
		GL11.glScaled(p, p, p);
		GL11.glTranslated(-0.5, -0.5, -0.5);
	}
	
	GL11.glColor4f(red, green, 0, 0.25F);
	RenderUtils.drawSolidBox(box);
	
	GL11.glColor4f(red, green, 0, 0.5F);
	RenderUtils.drawOutlinedBox(box);
	
	GL11.glPopMatrix();
	
	// GL resets
	GL11.glColor4f(1, 1, 1, 1);
	GL11.glEnable(GL11.GL_DEPTH_TEST);
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_BLEND);
	GL11.glDisable(GL11.GL_LINE_SMOOTH);
}
 
Example 19
Source File: TunnellerHack.java    From Wurst7 with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onRender(float partialTicks)
{
	// GL settings
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	GL11.glEnable(GL11.GL_LINE_SMOOTH);
	GL11.glLineWidth(2);
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glEnable(GL11.GL_CULL_FACE);
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	GL11.glDisable(GL11.GL_LIGHTING);
	
	GL11.glPushMatrix();
	RenderUtils.applyRenderOffset();
	
	for(int displayList : displayLists)
		GL11.glCallList(displayList);
	
	if(currentBlock != null)
	{
		float p = prevProgress + (progress - prevProgress) * partialTicks;
		float red = p * 2F;
		float green = 2 - red;
		
		GL11.glTranslated(currentBlock.getX(), currentBlock.getY(),
			currentBlock.getZ());
		if(p < 1)
		{
			GL11.glTranslated(0.5, 0.5, 0.5);
			GL11.glScaled(p, p, p);
			GL11.glTranslated(-0.5, -0.5, -0.5);
		}
		
		Box box2 = new Box(BlockPos.ORIGIN);
		GL11.glColor4f(red, green, 0, 0.25F);
		RenderUtils.drawSolidBox(box2);
		GL11.glColor4f(red, green, 0, 0.5F);
		RenderUtils.drawOutlinedBox(box2);
	}
	
	GL11.glPopMatrix();
	
	// GL resets
	GL11.glColor4f(1, 1, 1, 1);
	GL11.glEnable(GL11.GL_DEPTH_TEST);
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_BLEND);
	GL11.glDisable(GL11.GL_LINE_SMOOTH);
}
 
Example 20
Source File: AutoFarmHack.java    From Wurst7 with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onRender(float partialTicks)
{
	// GL settings
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	GL11.glEnable(GL11.GL_LINE_SMOOTH);
	GL11.glLineWidth(2);
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glEnable(GL11.GL_CULL_FACE);
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	GL11.glDisable(GL11.GL_LIGHTING);
	
	GL11.glPushMatrix();
	RenderUtils.applyRenderOffset();
	
	GL11.glCallList(displayList);
	
	if(currentBlock != null)
	{
		GL11.glPushMatrix();
		
		Box box = new Box(BlockPos.ORIGIN);
		float p = prevProgress + (progress - prevProgress) * partialTicks;
		float red = p * 2F;
		float green = 2 - red;
		
		GL11.glTranslated(currentBlock.getX(), currentBlock.getY(),
			currentBlock.getZ());
		if(p < 1)
		{
			GL11.glTranslated(0.5, 0.5, 0.5);
			GL11.glScaled(p, p, p);
			GL11.glTranslated(-0.5, -0.5, -0.5);
		}
		
		GL11.glColor4f(red, green, 0, 0.25F);
		RenderUtils.drawSolidBox(box);
		
		GL11.glColor4f(red, green, 0, 0.5F);
		RenderUtils.drawOutlinedBox(box);
		
		GL11.glPopMatrix();
	}
	
	GL11.glPopMatrix();
	
	// GL resets
	GL11.glColor4f(1, 1, 1, 1);
	GL11.glEnable(GL11.GL_DEPTH_TEST);
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_BLEND);
	GL11.glDisable(GL11.GL_LINE_SMOOTH);
}