Posted August 25, 20178 yr I'm developing my first mod and it's made mostly by multiblocks. The problem I'm getting is about how they are rendered: the shadow is casted on the wrong side or the faces are too dark. Also, when smooth lighting is turned off, some faces appear black. I've had a problem with normals before, but the consequence was to have transparent faces, not black or dark. It's strange because on Blender it's being rendered correctly, but it isn't on Minecraft. What can be causing this? Spoiler One side is very dark. Both receive light! Spoiler The shadow isn't because of external light (not even the sun) Spoiler When smooth lighting is Off, it looks like this The model is obviously being loaded (both obj and mtl) Spoiler metalMultiblock_biomassGenerator.json (blockstate file) { "forge_marker": 1, "defaults": { "transform": "forge:default-block", "custom": { "flip-v": true }, "textures": { /*"particle": "immersiveengineering:blocks/storage_steel"*/ } }, "variants": { "inventory,type=biomass_generator": [{ "model": "immersivesawmills:metalMultiblock/biomassGenerator.obj", "transform": { "scale": 1, "rotation": [ { "x": 20 }, { "y": -45 } ] } }], "type": { "biomass_generator": { } }, "facing": { "north": { "transform": { "rotation": {"y": 0 }, "translation": [0, 0, 1] }}, "south": { "transform": { "rotation": {"y": 180 }, "translation": [0, 0, -1] }}, "west": { "transform": { "rotation": {"y": 90 }, "translation": [1, 0, 0] }}, "east": { "transform": { "rotation": {"y": -90 }, "translation": [-1, 0, 0] }} }, "_0multiblockslave": { "false":{}, "true":{ "model": "builtin/generated" } }, "_1dynamicrender": { "false":{ }, "true":{ } }, "boolean0": { "false":{"model": "immersivesawmills:metalMultiblock/biomassGenerator.obj"}, "true":{} } } } Spoiler biomassGenerator.mtl newmtl BioGenMat map_Ka immersivesawmills:blocks/metalMultiblock_biomassGenerator Spoiler The TileEntity (not using special renderers or any code at all to change the way it's rendered) package axelmontini.immersivesawmills.common.blocks.metal; import axelmontini.immersivesawmills.api.energy.BiomassHandler; import axelmontini.immersivesawmills.common.Config; import axelmontini.immersivesawmills.common.blocks.multiblock.MultiblockBiomassGenerator; import blusunrize.immersiveengineering.api.crafting.IMultiblockRecipe; import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces; import blusunrize.immersiveengineering.common.blocks.metal.TileEntityMultiblockMetal; import blusunrize.immersiveengineering.common.util.EnergyHelper; import blusunrize.immersiveengineering.common.util.Utils; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemFireball; import net.minecraft.item.ItemFlintAndSteel; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagIntArray; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTank; import net.minecraftforge.fluids.IFluidTank; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.oredict.OreDictionary; import java.util.*; import java.util.stream.Collectors; import java.util.stream.IntStream; import java.util.stream.Stream; import static net.minecraft.util.EnumFacing.UP; /**Note: pos 48 is the hopper*/ public class TileEntityBiomassGenerator extends TileEntityMultiblockMetal<TileEntityBiomassGenerator, IMultiblockRecipe> implements IEBlockInterfaces.IPlayerInteraction/*, IEBlockInterfaces.IAdvancedSelectionBounds, IEBlockInterfaces.IAdvancedCollisionBounds*/ { public TileEntityBiomassGenerator() { super(MultiblockBiomassGenerator.instance, new int[] {3,4,5}, 0, true); } //... Cut off @Override public void readCustomNBT(NBTTagCompound nbt, boolean descPacket) { super.readCustomNBT(nbt, descPacket); active = nbt.getBoolean("active"); tanks[0].readFromNBT(nbt.getCompoundTag("tank_water")); if(isDummy()) return; //Collect fuel into the queue { NBTTagList fuels = nbt.getTagList("fuel", Constants.NBT.TAG_LIST); this.fuel.addAll(IntStream.range(0, fuels.tagCount()).mapToObj(i -> IntStream.of(fuels.getIntArrayAt(i)).boxed().toArray(Integer[]::new)).collect(Collectors.toList())); } //Collect burning { NBTTagList burning = nbt.getTagList("burning", Constants.NBT.TAG_LIST); for(int i=0; i<Math.min(maxParallelFuel, burning.tagCount()); i++) this.burning[i] = burning.getIntArrayAt(i); } } @Override public void writeCustomNBT(NBTTagCompound nbt, boolean descPacket) { super.writeCustomNBT(nbt, descPacket); nbt.setTag("tank_water", tanks[0].writeToNBT(new NBTTagCompound())); nbt.setBoolean("active", active); if(isDummy()) return; //Write out fuel { NBTTagList fuel = new NBTTagList(); this.fuel.stream().forEach( f -> fuel.appendTag( new NBTTagIntArray( new int[]{f[0], f[1]} ) ) ); nbt.setTag("fuel", fuel); } //Write out burning { NBTTagList burning = new NBTTagList(); //Append arrays. Must filter, since the array burning[][] is of fixed size, prevent null entries Stream.of(this.burning).filter(b-> b!=null).forEach(b -> burning.appendTag(new NBTTagIntArray(b))); nbt.setTag("burning", burning); } } //... Cut off some methods (not render related) @Override public float[] getBlockBounds() { return new float[] {0,0,0,1,1,1}; } @Override public ItemStack[] getInventory() { //... Cut off } @Override public boolean isStackValid(int slot, ItemStack stack) { //... Cut off } @Override public int getSlotLimit(int slot) { //... Cut off } @SideOnly(Side.CLIENT) @Override public void doGraphicalUpdates(int slot) { //Empty method } @Override public void disassemble() { //... Cut off } } (Note) The block has no special renderer yet; Only the master block is being rendered with this model; the texture is complete; The other multiblock I've made doesn't have this problem and it have the same superclass.
September 8, 20178 yr Author Found a partial fix. After looking into IE's code I noticed that I've forgot to override both Block#isFullCube(IBlockState). This mostly fixed the issue. The remaining problem consists in a poor lighting strength on a side of the block.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.