Carrot is not fruit (#27)

* Carrot is not fruit

* updateBuildScript & spotlessApply
This commit is contained in:
miozune authored and GitHub committed 2022-08-25 14:10:35 +02:00
1 parent 6973dbc80d
commit c5c3aee2fb
1345 files changed
+92079 -90006

No files matched your search

@@ -10,53 +10,119 @@
******************************************************************************/
package forestry.farming.render;
import forestry.core.render.RenderOverlayBlock;
import forestry.farming.blocks.BlockFarm;
import forestry.plugins.PluginFarming;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.world.IBlockAccess;
import forestry.core.render.RenderOverlayBlock;
import forestry.farming.blocks.BlockFarm;
import forestry.plugins.PluginFarming;
public class RenderFarmBlock extends RenderOverlayBlock {
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
}
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {}
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
@Override
public boolean renderWorldBlock(
IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
// Render the plain block.
renderer.renderStandardBlock(block, x, y, z);
renderFarmOverlay(world, PluginFarming.blocks.farm, x, y, z, renderer);
// Render the plain block.
renderer.renderStandardBlock(block, x, y, z);
renderFarmOverlay(world, PluginFarming.blocks.farm, x, y, z, renderer);
return true;
}
return true;
}
private static void renderFarmOverlay(IBlockAccess world, BlockFarm block, int x, int y, int z, RenderBlocks renderer) {
int mixedBrightness = block.getMixedBrightnessForBlock(world, x, y, z);
int metadata = world.getBlockMetadata(x, y, z);
private static void renderFarmOverlay(
IBlockAccess world, BlockFarm block, int x, int y, int z, RenderBlocks renderer) {
int mixedBrightness = block.getMixedBrightnessForBlock(world, x, y, z);
int metadata = world.getBlockMetadata(x, y, z);
float adjR = 0.5f;
float adjG = 0.5f;
float adjB = 0.5f;
float adjR = 0.5f;
float adjG = 0.5f;
float adjB = 0.5f;
renderBottomFace(world, block, x, y, z, renderer, BlockFarm.getOverlayTextureForBlock(0, metadata), mixedBrightness, adjR, adjG, adjB);
renderTopFace(world, block, x, y, z, renderer, BlockFarm.getOverlayTextureForBlock(1, metadata), mixedBrightness, adjR, adjG, adjB);
renderEastFace(world, block, x, y, z, renderer, BlockFarm.getOverlayTextureForBlock(2, metadata), mixedBrightness, adjR, adjG, adjB);
renderWestFace(world, block, x, y, z, renderer, BlockFarm.getOverlayTextureForBlock(3, metadata), mixedBrightness, adjR, adjG, adjB);
renderNorthFace(world, block, x, y, z, renderer, BlockFarm.getOverlayTextureForBlock(4, metadata), mixedBrightness, adjR, adjG, adjB);
renderSouthFace(world, block, x, y, z, renderer, BlockFarm.getOverlayTextureForBlock(5, metadata), mixedBrightness, adjR, adjG, adjB);
}
renderBottomFace(
world,
block,
x,
y,
z,
renderer,
BlockFarm.getOverlayTextureForBlock(0, metadata),
mixedBrightness,
adjR,
adjG,
adjB);
renderTopFace(
world,
block,
x,
y,
z,
renderer,
BlockFarm.getOverlayTextureForBlock(1, metadata),
mixedBrightness,
adjR,
adjG,
adjB);
renderEastFace(
world,
block,
x,
y,
z,
renderer,
BlockFarm.getOverlayTextureForBlock(2, metadata),
mixedBrightness,
adjR,
adjG,
adjB);
renderWestFace(
world,
block,
x,
y,
z,
renderer,
BlockFarm.getOverlayTextureForBlock(3, metadata),
mixedBrightness,
adjR,
adjG,
adjB);
renderNorthFace(
world,
block,
x,
y,
z,
renderer,
BlockFarm.getOverlayTextureForBlock(4, metadata),
mixedBrightness,
adjR,
adjG,
adjB);
renderSouthFace(
world,
block,
x,
y,
z,
renderer,
BlockFarm.getOverlayTextureForBlock(5, metadata),
mixedBrightness,
adjR,
adjG,
adjB);
}
@Override
public boolean shouldRender3DInInventory(int modelId) {
return true;
}
@Override
public boolean shouldRender3DInInventory(int modelId) {
return true;
}
@Override
public int getRenderId() {
return PluginFarming.modelIdFarmBlock;
}
@Override
public int getRenderId() {
return PluginFarming.modelIdFarmBlock;
}
}