Some reformat code for 1.11.2 source (#84)

* Optimized imports

* Some code reformat

* Some refactoring and code reformat

* Some code reformat
This commit is contained in:
Alexander Kornilov authored and mezz committed 2017-06-01 00:48:08 -07:00
1 parent 886c36a308
commit c3809fbc27
508 files changed
+6677 -6238

No files matched your search

@@ -7,83 +7,82 @@ import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class MachineRendererKitchen {
static int level = 0;
public static MachineRendererKitchen instance = new MachineRendererKitchen();
static int level = 0;
;
BinnieResource texture;
public void renderMachine(final Machine machine, final BinnieResource texture, final double x, final double y, final double z, final float var8) {
// if (renderer != null && renderer.blockAccess != null) {
// final Block block = machine.getPackage().getGroup().getBlock();
// final float i = 0.0625f;
// renderer.setRenderBounds(2.0f * i, 0.0, 2.0f * i, 14.0f * i, 14.0f * i, 14.0f * i);
// renderer.renderStandardBlock(block, (int) x, (int) y, (int) z);
// MachineRendererKitchen.level = 1;
// renderer.setRenderBounds(0.0, 14.0f * i, 0.0, 1.0, 1.0, 1.0);
// renderer.renderStandardBlock(block, (int) x, (int) y, (int) z);
// MachineRendererKitchen.level = 0;
// renderer.setRenderBounds(0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
// if (RenderManager.instance == null || RenderManager.instance.renderEngine == null) {
// return;
// }
// final IIcon icon = Blocks.dirt.getIcon(0, 0);
// final Tessellator tess = Tessellator.instance;
// boolean wasTessellating = true;
// try {
// tess.draw();
// } catch (Exception e) {
// wasTessellating = false;
// }
// tess.startDrawingQuads();
// tess.draw();
// GlStateManager.pushMatrix();
// GlStateManager.translate(x + 0.5, y + 1.0, z + 0.5);
// RenderManager.instance.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
// final float ux = icon.getMinU();
// final float uy = icon.getMinV();
// final float uw = icon.getMaxU();
// final float uh = icon.getMaxV();
// final int[] widths = { 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 5, 6, 6, 6, 5, 4 };
// for (int h = 0; h < 15; ++h) {
// final float h2 = h * i;
// final float h3 = h2 + i;
// final float d1 = widths[h] * i;
// final float d2 = widths[h + 1] * i;
// float ang = 0.707f;
// final float half = 8.0f * i;
// if (h < 13) {
// ang -= 0.05f;
// for (int angle = 0; angle < 360; angle += 90) {
// }
// if (h == 12) {
// }
// ang += 0.05f;
// }
// for (int angle = 0; angle < 360; angle += 90) {
// GlStateManager.pushMatrix();
// GlStateManager.rotate(angle, 0.0f, 1.0f, 0.0f);
// GlStateManager.translate(-0.5f, 0.0f, 0.0f);
// tess.startDrawingQuads();
// tess.setColorRGBA(255, 255, 255, 150);
// tess.addVertexWithUV(half - d1 * ang, h2, -d1 * ang, 0.0, 0.0);
// tess.addVertexWithUV(half - d2 * ang, h3, -d2 * ang, 0.0, 0.0);
// tess.addVertexWithUV(half + d2 * ang, h3, -d2 * ang, 0.0, 0.0);
// tess.addVertexWithUV(half + d1 * ang, h2, -d1 * ang, 0.0, 0.0);
// tess.draw();
// tess.startDrawingQuads();
// tess.addVertexWithUV(half + d1 * ang, h2, -d1 * ang, 0.0, 0.0);
// tess.addVertexWithUV(half + d2 * ang, h3, -d2 * ang, 0.0, 0.0);
// tess.addVertexWithUV(half - d2 * ang, h3, -d2 * ang, 0.0, 0.0);
// tess.addVertexWithUV(half - d1 * ang, h2, -d1 * ang, 0.0, 0.0);
// tess.draw();
// GlStateManager.popMatrix();
// }
// }
// GlStateManager.popMatrix();
// if (wasTessellating) {
// tess.startDrawingQuads();
// }
// }
/*if (renderer != null && renderer.blockAccess != null) {
final Block block = machine.getPackage().getGroup().getBlock();
final float i = 0.0625f;
renderer.setRenderBounds(2.0f * i, 0.0, 2.0f * i, 14.0f * i, 14.0f * i, 14.0f * i);
renderer.renderStandardBlock(block, (int) x, (int) y, (int) z);
MachineRendererKitchen.level = 1;
renderer.setRenderBounds(0.0, 14.0f * i, 0.0, 1.0, 1.0, 1.0);
renderer.renderStandardBlock(block, (int) x, (int) y, (int) z);
MachineRendererKitchen.level = 0;
renderer.setRenderBounds(0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
if (RenderManager.instance == null || RenderManager.instance.renderEngine == null) {
return;
}
final IIcon icon = Blocks.dirt.getIcon(0, 0);
final Tessellator tess = Tessellator.instance;
boolean wasTessellating = true;
try {
tess.draw();
} catch (Exception e) {
wasTessellating = false;
}
tess.startDrawingQuads();
tess.draw();
GlStateManager.pushMatrix();
GlStateManager.translate(x + 0.5, y + 1.0, z + 0.5);
RenderManager.instance.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
final float ux = icon.getMinU();
final float uy = icon.getMinV();
final float uw = icon.getMaxU();
final float uh = icon.getMaxV();
final int[] widths = { 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 5, 6, 6, 6, 5, 4 };
for (int h = 0; h < 15; ++h) {
final float h2 = h * i;
final float h3 = h2 + i;
final float d1 = widths[h] * i;
final float d2 = widths[h + 1] * i;
float ang = 0.707f;
final float half = 8.0f * i;
if (h < 13) {
ang -= 0.05f;
for (int angle = 0; angle < 360; angle += 90) {
}
if (h == 12) {
}
ang += 0.05f;
}
for (int angle = 0; angle < 360; angle += 90) {
GlStateManager.pushMatrix();
GlStateManager.rotate(angle, 0.0f, 1.0f, 0.0f);
GlStateManager.translate(-0.5f, 0.0f, 0.0f);
tess.startDrawingQuads();
tess.setColorRGBA(255, 255, 255, 150);
tess.addVertexWithUV(half - d1 * ang, h2, -d1 * ang, 0.0, 0.0);
tess.addVertexWithUV(half - d2 * ang, h3, -d2 * ang, 0.0, 0.0);
tess.addVertexWithUV(half + d2 * ang, h3, -d2 * ang, 0.0, 0.0);
tess.addVertexWithUV(half + d1 * ang, h2, -d1 * ang, 0.0, 0.0);
tess.draw();
tess.startDrawingQuads();
tess.addVertexWithUV(half + d1 * ang, h2, -d1 * ang, 0.0, 0.0);
tess.addVertexWithUV(half + d2 * ang, h3, -d2 * ang, 0.0, 0.0);
tess.addVertexWithUV(half - d2 * ang, h3, -d2 * ang, 0.0, 0.0);
tess.addVertexWithUV(half - d1 * ang, h2, -d1 * ang, 0.0, 0.0);
tess.draw();
GlStateManager.popMatrix();
}
}
GlStateManager.popMatrix();
if (wasTessellating) {
tess.startDrawingQuads();
}
}*/
}
}
@@ -11,10 +11,10 @@ public class ModuleKitchen implements IInitializable {
@Override
public void preInit() {
// TODO implement kitchen
// final MachineGroup machineGroup = new MachineGroup(ExtraTrees.instance, "kitchen", "kitchen", KitchenMachine.values());
// machineGroup.setCreativeTab(Tabs.tabArboriculture);
// machineGroup.customRenderer = false;
// blockKitchen = machineGroup.getBlock();
/*final MachineGroup machineGroup = new MachineGroup(ExtraTrees.instance, "kitchen", "kitchen", KitchenMachine.values());
machineGroup.setCreativeTab(Tabs.tabArboriculture);
machineGroup.customRenderer = false;
blockKitchen = machineGroup.getBlock();*/
}
@Override
@@ -24,11 +24,6 @@ public class ControlFluidDisplay extends Control implements ITooltip {
private FluidStack fluidStack;
private boolean hastooltip;
public void setTooltip() {
this.hastooltip = true;
this.addAttribute(Attribute.MouseOver);
}
public ControlFluidDisplay(final IWidget parent, final int x, final int y) {
this(parent, x, y, 16);
}
@@ -47,6 +42,11 @@ public class ControlFluidDisplay extends Control implements ITooltip {
this.hastooltip = false;
}
public void setTooltip() {
this.hastooltip = true;
this.addAttribute(Attribute.MouseOver);
}
@Override
@SideOnly(Side.CLIENT)
public void onRenderForeground(int guiWidth, int guiHeight) {
@@ -1,6 +1,10 @@
package binnie.extratrees.kitchen.craftgui;
import binnie.core.craftgui.*;
import binnie.core.craftgui.Attribute;
import binnie.core.craftgui.CraftGUI;
import binnie.core.craftgui.ITooltip;
import binnie.core.craftgui.IWidget;
import binnie.core.craftgui.Tooltip;
import binnie.core.craftgui.controls.core.Control;
import binnie.core.craftgui.events.EventWidget;
import binnie.core.craftgui.geometry.Area;