Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public TileEntity getTileEntity(int x, int y, int z) {
}

@Override
public int getLightBrightnessForSkyBlocks(int x, int y, int z, int p_72802_4_) {
public int getLightBrightnessForSkyBlocks(int x, int y, int z, int lightValue) {
if(hasBlockAccess)
return originalBlockAccess.getLightBrightnessForSkyBlocks(x,y,z,p_72802_4_);
return originalBlockAccess.getLightBrightnessForSkyBlocks(x, y, z, lightValue);
return 15728640;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@

public final class FontHelper {

public static boolean isFormatColor(char par0) {
return par0 >= 48 && par0 <= 57 || par0 >= 97 && par0 <= 102 || par0 >= 65 && par0 <= 70;
public static boolean isFormatColor(char letter) {
return letter >= 48 && letter <= 57 || letter >= 97 && letter <= 102 || letter >= 65 && letter <= 70;
}

public static boolean isFormatSpecial(char par0) {
return par0 >= 107 && par0 <= 111 || par0 >= 75 && par0 <= 79 || par0 == 114 || par0 == 82;
public static boolean isFormatSpecial(char letter) {
return letter >= 107 && letter <= 111 || letter >= 75 && letter <= 79 || letter == 114 || letter == 82;
}

public static String getFormatFromString(String par0Str) {
Expand Down
56 changes: 34 additions & 22 deletions src/main/java/vazkii/botania/client/core/helper/RenderHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.minecraft.client.settings.GameSettings;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;

import org.lwjgl.opengl.GL11;
Expand Down Expand Up @@ -97,46 +98,46 @@ public static void renderTooltip(int x, int y, List<String> tooltipData, int col
GL11.glColor4f(1F, 1F, 1F, 1F);
}

public static void drawGradientRect(int par1, int par2, float z, int par3, int par4, int par5, int par6) {
float var7 = (par5 >> 24 & 255) / 255F;
float var8 = (par5 >> 16 & 255) / 255F;
float var9 = (par5 >> 8 & 255) / 255F;
float var10 = (par5 & 255) / 255F;
float var11 = (par6 >> 24 & 255) / 255F;
float var12 = (par6 >> 16 & 255) / 255F;
float var13 = (par6 >> 8 & 255) / 255F;
float var14 = (par6 & 255) / 255F;
public static void drawGradientRect(int left, int top, float z, int right, int bottom, int topColor, int bottomColor) {
float topA = (topColor >> 24 & 255) / 255F;
float topR = (topColor >> 16 & 255) / 255F;
float topG = (topColor >> 8 & 255) / 255F;
float topB = (topColor & 255) / 255F;
float bottomA = (bottomColor >> 24 & 255) / 255F;
float bottomR = (bottomColor >> 16 & 255) / 255F;
float bottomG = (bottomColor >> 8 & 255) / 255F;
float bottomB = (bottomColor & 255) / 255F;
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_ALPHA_TEST);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glShadeModel(GL11.GL_SMOOTH);
Tessellator var15 = Tessellator.instance;
var15.startDrawingQuads();
var15.setColorRGBA_F(var8, var9, var10, var7);
var15.addVertex(par3, par2, z);
var15.addVertex(par1, par2, z);
var15.setColorRGBA_F(var12, var13, var14, var11);
var15.addVertex(par1, par4, z);
var15.addVertex(par3, par4, z);
var15.setColorRGBA_F(topR, topG, topB, topA);
var15.addVertex(right, top, z);
var15.addVertex(left, top, z);
var15.setColorRGBA_F(bottomR, bottomG, bottomB, bottomA);
var15.addVertex(left, bottom, z);
var15.addVertex(right, bottom, z);
var15.draw();
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glEnable(GL11.GL_TEXTURE_2D);
}

public static void drawTexturedModalRect(int par1, int par2, float z, int par3, int par4, int par5, int par6) {
drawTexturedModalRect(par1, par2, z, par3, par4, par5, par6, 0.00390625F, 0.00390625F);
public static void drawTexturedModalRect(int x, int y, float z, int textureX, int textureY, int width, int height) {
drawTexturedModalRect(x, y, z, textureX, textureY, width, height, 0.00390625F, 0.00390625F);
}

public static void drawTexturedModalRect(int par1, int par2, float z, int par3, int par4, int par5, int par6, float f, float f1) {
public static void drawTexturedModalRect(int x, int y, float z, int textureX, int textureY, int width, int height, float f, float f1) {
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.addVertexWithUV(par1 + 0, par2 + par6, z, (par3 + 0) * f, (par4 + par6) * f1);
tessellator.addVertexWithUV(par1 + par5, par2 + par6, z, (par3 + par5) * f, (par4 + par6) * f1);
tessellator.addVertexWithUV(par1 + par5, par2 + 0, z, (par3 + par5) * f, (par4 + 0) * f1);
tessellator.addVertexWithUV(par1 + 0, par2 + 0, z, (par3 + 0) * f, (par4 + 0) * f1);
tessellator.addVertexWithUV(x + 0, y + height, z, (textureX + 0) * f, (textureY + height) * f1);
tessellator.addVertexWithUV(x + width, y + height, z, (textureX + width) * f, (textureY + height) * f1);
tessellator.addVertexWithUV(x + width, y + 0, z, (textureX + width) * f, (textureY + 0) * f1);
tessellator.addVertexWithUV(x + 0, y + 0, z, (textureX + 0) * f, (textureY + 0) * f1);
tessellator.draw();
}

Expand Down Expand Up @@ -249,4 +250,15 @@ public static String getKeyDisplayString(String keyName) {

return key;
}

public static void renderIcon(int x, int y, IIcon icon, int width, int height, int brightness) {
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.setBrightness(brightness);
tessellator.addVertexWithUV(x, y + height, 0, icon.getMinU(), icon.getMaxV());
tessellator.addVertexWithUV(x + width, y + height, 0, icon.getMaxU(), icon.getMaxV());
tessellator.addVertexWithUV(x + width, y, 0, icon.getMaxU(), icon.getMinV());
tessellator.addVertexWithUV(x, y, 0, icon.getMinU(), icon.getMinV());
tessellator.draw();
}
}
145 changes: 78 additions & 67 deletions src/main/java/vazkii/botania/client/fx/FXSparkle.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,85 +162,96 @@ public void setGravity(float value) {
particleGravity = value;
}

protected boolean pushOutOfBlocks(double par1, double par3, double par5) {
int var7 = MathHelper.floor_double(par1);
int var8 = MathHelper.floor_double(par3);
int var9 = MathHelper.floor_double(par5);
double var10 = par1 - var7;
double var12 = par3 - var8;
double var14 = par5 - var9;

if (!worldObj.isAirBlock(var7, var8, var9)) {
boolean var16 = !worldObj.isBlockNormalCubeDefault(var7 - 1, var8, var9, false);
boolean var17 = !worldObj.isBlockNormalCubeDefault(var7 + 1, var8, var9, false);
boolean var18 = !worldObj.isBlockNormalCubeDefault(var7, var8 - 1, var9, false);
boolean var19 = !worldObj.isBlockNormalCubeDefault(var7, var8 + 1, var9, false);
boolean var20 = !worldObj.isBlockNormalCubeDefault(var7, var8, var9 - 1, false);
boolean var21 = !worldObj.isBlockNormalCubeDefault(var7, var8, var9 + 1, false);
byte var22 = -1;
double var23 = 9999.0D;

if (var16 && var10 < var23) {
var23 = var10;
var22 = 0;
protected boolean pushOutOfBlocks(double x, double y, double z) {
int blockX = MathHelper.floor_double(x);
int blockY = MathHelper.floor_double(y);
int blockZ = MathHelper.floor_double(z);
double dx = x - blockX;
double dy = y - blockY;
double dz = z - blockZ;

if (!worldObj.isAirBlock(blockX, blockY, blockZ)) {
boolean westFree = !worldObj.isBlockNormalCubeDefault(blockX - 1, blockY, blockZ, false);
boolean eastFree = !worldObj.isBlockNormalCubeDefault(blockX + 1, blockY, blockZ, false);
boolean downFree = !worldObj.isBlockNormalCubeDefault(blockX, blockY - 1, blockZ, false);
boolean upFree = !worldObj.isBlockNormalCubeDefault(blockX, blockY + 1, blockZ, false);
boolean northFree = !worldObj.isBlockNormalCubeDefault(blockX, blockY, blockZ - 1, false);
boolean southFree = !worldObj.isBlockNormalCubeDefault(blockX, blockY, blockZ + 1, false);
byte direction = -1;
double minDist = 9999.0D;

if (westFree && dx < minDist) {
minDist = dx;
direction = 0;
}

if (var17 && 1.0D - var10 < var23) {
var23 = 1.0D - var10;
var22 = 1;
if (eastFree && (1.0D - dx) < minDist) {
minDist = 1.0D - dx;
direction = 1;
}

if (var18 && var12 < var23) {
var23 = var12;
var22 = 2;
if (downFree && dy < minDist) {
minDist = dy;
direction = 2;
}

if (var19 && 1.0D - var12 < var23) {
var23 = 1.0D - var12;
var22 = 3;
if (upFree && (1.0D - dy) < minDist) {
minDist = 1.0D - dy;
direction = 3;
}

if (var20 && var14 < var23) {
var23 = var14;
var22 = 4;
if (northFree && dz < minDist) {
minDist = dz;
direction = 4;
}

if (var21 && 1.0D - var14 < var23) {
var23 = 1.0D - var14;
var22 = 5;
if (southFree && (1.0D - dz) < minDist) {
minDist = 1.0D - dz;
direction = 5;
}

float var25 = rand.nextFloat() * 0.05F + 0.025F;
float var26 = (rand.nextFloat() - rand.nextFloat()) * 0.1F;

if (var22 == 0) {
motionX = -var25;
motionY=motionZ=var26;
}

if (var22 == 1) {
motionX = var25;
motionY=motionZ=var26;
}

if (var22 == 2) {
motionY = -var25;
motionX=motionZ=var26;
}

if (var22 == 3) {
motionY = var25;
motionX=motionZ=var26;
}

if (var22 == 4) {
motionZ = -var25;
motionY=motionX=var26;
}

if (var22 == 5) {
motionZ = var25;
motionY=motionX=var26;
float mainVel = rand.nextFloat() * 0.05F + 0.025F;
float sideVel1 = (rand.nextFloat() - rand.nextFloat()) * 0.1F;
float sideVel2 = (rand.nextFloat() - rand.nextFloat()) * 0.1F;

switch(direction) {
case 0 -> {
motionX = -mainVel;
motionY = sideVel1;
motionZ = sideVel2;
}

case 1 -> {
motionX = mainVel;
motionY = sideVel1;
motionZ = sideVel2;
}

case 2 -> {
motionY = -mainVel;
motionX = sideVel1;
motionZ = sideVel2;
}

case 3 -> {
motionY = mainVel;
motionX = sideVel1;
motionZ = sideVel2;
}

case 4 -> {
motionZ = -mainVel;
motionY = sideVel1;
motionX = sideVel2;
}

case 5 -> {
motionZ = mainVel;
motionY = sideVel1;
motionX = sideVel2;
}

default -> {}
}

return true;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/vazkii/botania/client/gui/SlotLocked.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

public class SlotLocked extends Slot {

public SlotLocked(IInventory p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_) {
super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_);
public SlotLocked(IInventory inventory, int slotIndex, int xPos, int yPos) {
super(inventory, slotIndex, xPos, yPos);
}

@Override
public boolean canTakeStack(EntityPlayer p_82869_1_) {
public boolean canTakeStack(EntityPlayer player) {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ public void onContainerClosed(EntityPlayer player) {
}

@Override
public void putStacksInSlots(ItemStack[] p_75131_1_) {
public void putStacksInSlots(ItemStack[] stacks) {
baubles.blockEvents = true;
super.putStacksInSlots(p_75131_1_);
super.putStacksInSlots(stacks);
}

@Override
Expand Down
Loading