mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-28 07:56:01 +00:00
[ci skip] spotlessApply with the new settings
This commit is contained in:
1 parent
83698cb73c
commit
84c2239244
561 files changed
+8872
-9300
No files matched your search
@@ -1,19 +1,22 @@
|
||||
package tconstruct.smeltery.model;
|
||||
|
||||
import cpw.mods.fml.client.registry.*;
|
||||
import mantle.world.CoordTuple;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.fluids.*;
|
||||
|
||||
import tconstruct.client.BlockSkinRenderHelper;
|
||||
import tconstruct.library.crafting.Smeltery;
|
||||
import tconstruct.smeltery.logic.SmelteryLogic;
|
||||
import tconstruct.util.ItemHelper;
|
||||
import cpw.mods.fml.client.registry.*;
|
||||
|
||||
public class SmelteryRender implements ISimpleBlockRenderingHandler {
|
||||
|
||||
public static int smelteryModel = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@Override
|
||||
@@ -24,8 +27,8 @@ public class SmelteryRender implements ISimpleBlockRenderingHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(
|
||||
IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) {
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelID,
|
||||
RenderBlocks renderer) {
|
||||
if (modelID == smelteryModel) {
|
||||
if (world.getBlockMetadata(x, y, z) == 0) return renderSmeltery(world, x, y, z, block, modelID, renderer);
|
||||
else renderer.renderStandardBlock(block, x, y, z);
|
||||
@@ -33,8 +36,8 @@ public class SmelteryRender implements ISimpleBlockRenderingHandler {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean renderSmeltery(
|
||||
IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) {
|
||||
public boolean renderSmeltery(IBlockAccess world, int x, int y, int z, Block block, int modelID,
|
||||
RenderBlocks renderer) {
|
||||
boolean ret = renderer.renderStandardBlock(block, x, y, z);
|
||||
SmelteryLogic logic = (SmelteryLogic) world.getTileEntity(x, y, z);
|
||||
if (logic.validStructure) {
|
||||
@@ -70,28 +73,25 @@ public class SmelteryRender implements ISimpleBlockRenderingHandler {
|
||||
|
||||
renderer.setRenderBounds(0, renderBase, 0, 1, renderHeight, 1);
|
||||
Fluid fluid = liquid.getFluid();
|
||||
for (int xi = from.x; xi <= to.x; xi++)
|
||||
for (int zi = from.z; zi <= to.z; zi++) {
|
||||
float minX = xi == from.x ? -0.001F : 0F;
|
||||
float minZ = zi == from.z ? -0.001F : 0F;
|
||||
float maxX = xi == to.x ? 1.001F : 1F;
|
||||
float maxZ = zi == to.z ? 1.001F : 1F;
|
||||
renderer.setRenderBounds(minX, renderBase, minZ, maxX, renderHeight, maxZ);
|
||||
if (fluid.canBePlacedInWorld())
|
||||
BlockSkinRenderHelper.renderMetadataBlock(
|
||||
fluid.getBlock(), 0, xi, from.y + yBase, zi, renderer, world);
|
||||
else
|
||||
BlockSkinRenderHelper.renderLiquidBlock(
|
||||
fluid.getStillIcon(),
|
||||
fluid.getFlowingIcon(),
|
||||
xi,
|
||||
from.y + yBase,
|
||||
zi,
|
||||
renderer,
|
||||
world,
|
||||
false,
|
||||
fluid.getColor(liquid));
|
||||
}
|
||||
for (int xi = from.x; xi <= to.x; xi++) for (int zi = from.z; zi <= to.z; zi++) {
|
||||
float minX = xi == from.x ? -0.001F : 0F;
|
||||
float minZ = zi == from.z ? -0.001F : 0F;
|
||||
float maxX = xi == to.x ? 1.001F : 1F;
|
||||
float maxZ = zi == to.z ? 1.001F : 1F;
|
||||
renderer.setRenderBounds(minX, renderBase, minZ, maxX, renderHeight, maxZ);
|
||||
if (fluid.canBePlacedInWorld()) BlockSkinRenderHelper
|
||||
.renderMetadataBlock(fluid.getBlock(), 0, xi, from.y + yBase, zi, renderer, world);
|
||||
else BlockSkinRenderHelper.renderLiquidBlock(
|
||||
fluid.getStillIcon(),
|
||||
fluid.getFlowingIcon(),
|
||||
xi,
|
||||
from.y + yBase,
|
||||
zi,
|
||||
renderer,
|
||||
world,
|
||||
false,
|
||||
fluid.getColor(liquid));
|
||||
}
|
||||
|
||||
if (countSize == room) {
|
||||
base = 0F;
|
||||
@@ -105,35 +105,39 @@ public class SmelteryRender implements ISimpleBlockRenderingHandler {
|
||||
return ret;
|
||||
}
|
||||
|
||||
void renderLayer(
|
||||
SmelteryLogic logic,
|
||||
int start,
|
||||
CoordTuple from,
|
||||
CoordTuple to,
|
||||
int posY,
|
||||
RenderBlocks renderer,
|
||||
void renderLayer(SmelteryLogic logic, int start, CoordTuple from, CoordTuple to, int posY, RenderBlocks renderer,
|
||||
IBlockAccess world) {
|
||||
renderer.setRenderBounds(-0.001F, -0.001F, -0.001F, 1.001F, 1.001F, 1.001F);
|
||||
int i = start;
|
||||
for (int x = from.x; x <= to.x; x++)
|
||||
for (int z = from.z; z <= to.z; z++) {
|
||||
// safety because of changes.
|
||||
if (i > logic.getSizeInventory()) return;
|
||||
ItemStack input = logic.getStackInSlot(i);
|
||||
if (input != null && logic.getTempForSlot(i) > 20) {
|
||||
ItemStack blockToRender = Smeltery.getRenderIndex(input);
|
||||
if (blockToRender != null) {
|
||||
float blockHeight = input.stackSize / (float) blockToRender.stackSize;
|
||||
renderer.setRenderBounds(
|
||||
0.0F, 0.0F, 0.0F, 1.0F, MathHelper.clamp_float(blockHeight, 0.01F, 1.0F), 1.0F);
|
||||
for (int x = from.x; x <= to.x; x++) for (int z = from.z; z <= to.z; z++) {
|
||||
// safety because of changes.
|
||||
if (i > logic.getSizeInventory()) return;
|
||||
ItemStack input = logic.getStackInSlot(i);
|
||||
if (input != null && logic.getTempForSlot(i) > 20) {
|
||||
ItemStack blockToRender = Smeltery.getRenderIndex(input);
|
||||
if (blockToRender != null) {
|
||||
float blockHeight = input.stackSize / (float) blockToRender.stackSize;
|
||||
renderer.setRenderBounds(
|
||||
0.0F,
|
||||
0.0F,
|
||||
0.0F,
|
||||
1.0F,
|
||||
MathHelper.clamp_float(blockHeight, 0.01F, 1.0F),
|
||||
1.0F);
|
||||
|
||||
Block liquidBlock = Block.getBlockFromItem(blockToRender.getItem());
|
||||
BlockSkinRenderHelper.renderMetadataBlock(
|
||||
liquidBlock, blockToRender.getItemDamage(), x, posY, z, renderer, world);
|
||||
}
|
||||
Block liquidBlock = Block.getBlockFromItem(blockToRender.getItem());
|
||||
BlockSkinRenderHelper.renderMetadataBlock(
|
||||
liquidBlock,
|
||||
blockToRender.getItemDamage(),
|
||||
x,
|
||||
posY,
|
||||
z,
|
||||
renderer,
|
||||
world);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user