mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-21 12:42:53 +00:00
Clean Up and remove BlockFence
This commit is contained in:
1 parent
fa67089c77
commit
c949131976
5 files changed
+171
-225
No files matched your search
@@ -210,15 +210,15 @@ public class AABBModelBaker implements IModelBaker {
|
||||
|
||||
for (BoundModelBakerFace face : faces) {
|
||||
final AxisAlignedBB modelBounds = face.modelBounds;
|
||||
final Vector3f to = new Vector3f((float) modelBounds.minX * 16.0f, (float) modelBounds.minY * 16.0f, (float) modelBounds.minZ * 16.0f);
|
||||
final Vector3f from = new Vector3f((float) modelBounds.maxX * 16.0f, (float) modelBounds.maxY * 16.0f, (float) modelBounds.maxZ * 16.0f);
|
||||
final Vector3f from = new Vector3f((float) modelBounds.minX * 16.0f, (float) modelBounds.minY * 16.0f, (float) modelBounds.minZ * 16.0f);
|
||||
final Vector3f to = new Vector3f((float) modelBounds.maxX * 16.0f, (float) modelBounds.maxY * 16.0f, (float) modelBounds.maxZ * 16.0f);
|
||||
final EnumFacing myFace = face.face;
|
||||
final float[] uvs = getFaceUvs(myFace, from, to);
|
||||
final float[] uvs = getFaceUvs(myFace, to, from);
|
||||
|
||||
final BlockFaceUV uv = new BlockFaceUV(uvs, 0);
|
||||
final BlockPartFace bpf = new BlockPartFace(myFace, face.colorIndex, "", uv);
|
||||
|
||||
BakedQuad bf = faceBakery.makeBakedQuad(to, from, bpf, face.spite, myFace, mr, null, true, true);
|
||||
BakedQuad bf = faceBakery.makeBakedQuad(from, to, bpf, face.spite, myFace, mr, null, true, true);
|
||||
|
||||
currentModel.addQuad(myFace, bf);
|
||||
}
|
||||
|
||||
@@ -1,178 +0,0 @@
|
||||
package binnie.extratrees.block.decor;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.block.BlockMetadata;
|
||||
import binnie.core.block.IBlockMetadata;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.block.IFenceProvider;
|
||||
import binnie.extratrees.block.PlankType;
|
||||
import binnie.extratrees.block.WoodManager;
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.arboriculture.PluginArboriculture;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFenceGate;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockFence extends net.minecraft.block.BlockFence implements IBlockMetadata, IBlockFence {
|
||||
public BlockFence(String name) {
|
||||
super(Material.WOOD, MapColor.WOOD);
|
||||
this.setCreativeTab(Tabs.tabArboriculture);
|
||||
this.setRegistryName(name);
|
||||
this.setResistance(5.0f);
|
||||
this.setHardness(2.0f);
|
||||
this.setSoundType(SoundType.WOOD);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(final Item itemIn, final CreativeTabs par2CreativeTabs, final NonNullList<ItemStack> itemList) {
|
||||
for (final IFenceProvider type : PlankType.ExtraTreePlanks.values()) {
|
||||
itemList.add(type.getFence());
|
||||
}
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public IIcon getIcon(final IBlockAccess world, final int x, final int y, final int z, final int side) {
|
||||
// final TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
// if (tile != null) {
|
||||
// return this.getIcon(side, tile.getTileMetadata());
|
||||
// }
|
||||
// return super.getIcon(world, x, y, z, side);
|
||||
// }
|
||||
|
||||
public FenceDescription getDescription(final int meta) {
|
||||
return WoodManager.getFenceDescription(meta);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public IIcon getIcon(final int side, final int meta) {
|
||||
// return this.getDescription(meta).getPlankType().getIcon();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getRenderType() {
|
||||
// return ExtraTrees.fenceID;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean eventReceived(IBlockState state, World world, BlockPos pos, int id, int param) {
|
||||
TileEntity tileentity = world.getTileEntity(pos);
|
||||
return tileentity != null && tileentity.receiveClientEvent(id, param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||
return BlockMetadata.getBlockDroppedAsList(this, world, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest) {
|
||||
return BlockMetadata.breakBlock(this, player, world, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(final World var1, final int i) {
|
||||
return new TileEntityMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(IBlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlacedMeta(final ItemStack stack, final World world, final BlockPos pos, final EnumFacing clickedBlock) {
|
||||
return TileEntityMetadata.getItemDamage(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDroppedMeta(IBlockState state, final int tileMeta) {
|
||||
return tileMeta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName(final ItemStack par1ItemStack) {
|
||||
final int meta = TileEntityMetadata.getItemDamage(par1ItemStack);
|
||||
return Binnie.LANGUAGE.localise(ExtraTrees.instance, "block.woodfence.name", this.getDescription(meta).getPlankType().getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceTorchOnTop(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectTo(IBlockAccess worldIn, BlockPos pos) {
|
||||
IBlockState state = worldIn.getBlockState(pos);
|
||||
Block block = state.getBlock();
|
||||
if (PluginArboriculture.validFences.contains(block)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (block != Blocks.BARRIER) {
|
||||
Material blockMaterial = block.getMaterial(state);
|
||||
if (block instanceof BlockFence || block instanceof BlockFenceGate || block instanceof IBlockFence) {
|
||||
return blockMaterial == this.blockMaterial;
|
||||
}
|
||||
if (blockMaterial.isOpaque() && state.isFullCube() && blockMaterial != Material.GOURD) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState state) {
|
||||
super.breakBlock(world, pos, state);
|
||||
world.removeTileEntity(pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWood(final IBlockAccess world, final BlockPos pos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlammability(final IBlockAccess world, final BlockPos pos, final EnumFacing face) {
|
||||
return 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFlammable(final IBlockAccess world, final BlockPos pos, final EnumFacing face) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed(final IBlockAccess world, final BlockPos pos, final EnumFacing face) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public void registerBlockIcons(final IIconRegister p_149651_1_) {
|
||||
// }
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
|
||||
return BlockMetadata.getPickBlock(world, pos);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import forestry.api.core.Tabs;
|
||||
import forestry.arboriculture.PluginArboriculture;
|
||||
import forestry.core.blocks.IColoredBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFence;
|
||||
import net.minecraft.block.BlockFenceGate;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package binnie.extratrees.block.decor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.block.BlockMetadata;
|
||||
import binnie.core.block.IBlockMetadata;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.core.models.DefaultStateMapper;
|
||||
@@ -14,9 +17,17 @@ import binnie.extratrees.block.WoodManager;
|
||||
import forestry.api.core.IItemModelRegister;
|
||||
import forestry.api.core.IModelManager;
|
||||
import forestry.api.core.IStateMapperRegister;
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.arboriculture.PluginArboriculture;
|
||||
import forestry.core.blocks.properties.UnlistedBlockAccess;
|
||||
import forestry.core.blocks.properties.UnlistedBlockPos;
|
||||
import forestry.core.models.BlockModelEntry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFence;
|
||||
import net.minecraft.block.BlockFenceGate;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -24,12 +35,18 @@ import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.common.property.ExtendedBlockState;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
@@ -37,9 +54,110 @@ import net.minecraftforge.common.property.IUnlistedProperty;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockMultiFence extends BlockFence implements IBlockMetadata, IStateMapperRegister, IItemModelRegister {
|
||||
public class BlockMultiFence extends BlockFence implements IBlockMetadata, IStateMapperRegister, IItemModelRegister, IBlockFence {
|
||||
public BlockMultiFence() {
|
||||
super("multifence");
|
||||
super(Material.WOOD, MapColor.WOOD);
|
||||
this.setCreativeTab(Tabs.tabArboriculture);
|
||||
this.setRegistryName("multifence");
|
||||
this.setResistance(5.0f);
|
||||
this.setHardness(2.0f);
|
||||
this.setSoundType(SoundType.WOOD);
|
||||
}
|
||||
|
||||
public FenceDescription getDescription(final int meta) {
|
||||
return WoodManager.getFenceDescription(meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean eventReceived(IBlockState state, World world, BlockPos pos, int id, int param) {
|
||||
TileEntity tileentity = world.getTileEntity(pos);
|
||||
return tileentity != null && tileentity.receiveClientEvent(id, param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||
return BlockMetadata.getBlockDroppedAsList(this, world, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest) {
|
||||
return BlockMetadata.breakBlock(this, player, world, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(final World var1, final int i) {
|
||||
return new TileEntityMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(IBlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlacedMeta(final ItemStack stack, final World world, final BlockPos pos, final EnumFacing clickedBlock) {
|
||||
return TileEntityMetadata.getItemDamage(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDroppedMeta(IBlockState state, final int tileMeta) {
|
||||
return tileMeta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceTorchOnTop(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectTo(IBlockAccess worldIn, BlockPos pos) {
|
||||
IBlockState state = worldIn.getBlockState(pos);
|
||||
Block block = state.getBlock();
|
||||
if (PluginArboriculture.validFences.contains(block)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (block != Blocks.BARRIER) {
|
||||
Material blockMaterial = block.getMaterial(state);
|
||||
if (block instanceof BlockFence || block instanceof BlockFenceGate || block instanceof IBlockFence) {
|
||||
return blockMaterial == this.blockMaterial;
|
||||
}
|
||||
if (blockMaterial.isOpaque() && state.isFullCube() && blockMaterial != Material.GOURD) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState state) {
|
||||
super.breakBlock(world, pos, state);
|
||||
world.removeTileEntity(pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWood(final IBlockAccess world, final BlockPos pos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlammability(final IBlockAccess world, final BlockPos pos, final EnumFacing face) {
|
||||
return 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFlammable(final IBlockAccess world, final BlockPos pos, final EnumFacing face) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed(final IBlockAccess world, final BlockPos pos, final EnumFacing face) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
|
||||
return BlockMetadata.getPickBlock(world, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -52,9 +170,10 @@ public class BlockMultiFence extends BlockFence implements IBlockMetadata, IStat
|
||||
return ((IExtendedBlockState) state).withProperty(UnlistedBlockPos.POS, pos).withProperty(UnlistedBlockAccess.BLOCKACCESS, world);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(final Item itemIn, final CreativeTabs par2CreativeTabs, final NonNullList<ItemStack> itemList) {
|
||||
for (final FenceType type : FenceType.values()) {
|
||||
for (FenceType type : FenceType.values()) {
|
||||
itemList.add(WoodManager.getFence(PlankType.VanillaPlanks.SPRUCE, PlankType.VanillaPlanks.BIRCH, type, 1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,10 @@ import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
|
||||
public class ModelMultiFence extends ModelBlockDefault<BlockMultiFence, ModelMultiFence.Key> {
|
||||
|
||||
public static final float POST_WIDGTH = 0.25F;
|
||||
public static final float POST_HEIGHT = 1F;
|
||||
public static final float SCALE = 0.0625f;
|
||||
|
||||
public static class Key{
|
||||
private int meta;
|
||||
private FenceType type;
|
||||
@@ -94,48 +98,47 @@ public class ModelMultiFence extends ModelBlockDefault<BlockMultiFence, ModelMul
|
||||
@Override
|
||||
protected void bakeBlock(BlockMultiFence block, Key key, IModelBaker baker, boolean inventory) {
|
||||
AABBModelBaker modelBaker = (AABBModelBaker) baker;
|
||||
final float scale = 0.0625f;
|
||||
float minPostPos = 0.5f - POST_WIDGTH / 2.0f;
|
||||
float maxPostPos = 0.5f + POST_WIDGTH / 2.0f;
|
||||
IBlockState state = key.state;
|
||||
int meta = key.meta;
|
||||
FenceType fenceType = key.type;
|
||||
final float postWidth = 0.25f;
|
||||
final float postHeight = 1.0f;
|
||||
float minPostPos = 0.5f - postWidth / 2.0f;
|
||||
float maxPostPos = 0.5f + postWidth / 2.0f;
|
||||
modelBaker.setModelBounds(new AxisAlignedBB(minPostPos, 0.0, minPostPos, maxPostPos, postHeight, maxPostPos));
|
||||
|
||||
modelBaker.setModelBounds(new AxisAlignedBB(minPostPos, 0.0, minPostPos, maxPostPos, POST_HEIGHT, maxPostPos));
|
||||
modelBaker.addBlockModel(null, block.getSprite(meta, false), 0);
|
||||
final boolean connectNegX = state.getValue(net.minecraft.block.BlockFence.WEST);
|
||||
final boolean connectPosX = state.getValue(net.minecraft.block.BlockFence.EAST);
|
||||
final boolean connectNegZ = state.getValue(net.minecraft.block.BlockFence.NORTH);
|
||||
final boolean connectPosZ = state.getValue(net.minecraft.block.BlockFence.SOUTH);
|
||||
|
||||
boolean connectNegX = state.getValue(net.minecraft.block.BlockFence.WEST);
|
||||
boolean connectPosX = state.getValue(net.minecraft.block.BlockFence.EAST);
|
||||
boolean connectNegZ = state.getValue(net.minecraft.block.BlockFence.NORTH);
|
||||
boolean connectPosZ = state.getValue(net.minecraft.block.BlockFence.SOUTH);
|
||||
boolean connectAnyX = connectNegX || connectPosX;
|
||||
boolean connectAnyZ = connectNegZ || connectPosZ;
|
||||
if (!connectAnyX && !connectAnyZ) {
|
||||
connectAnyX = true;
|
||||
}
|
||||
minPostPos = 7.0f * scale;
|
||||
maxPostPos = 9.0f * scale;
|
||||
float barMinY = 12.0f * scale;
|
||||
float barMaxY = 15.0f * scale;
|
||||
final float minX = connectNegX ? 0.0f : minPostPos;
|
||||
final float maxX = connectPosX ? 1.0f : maxPostPos;
|
||||
final float minZ = connectNegZ ? 0.0f : minPostPos;
|
||||
final float maxZ = connectPosZ ? 1.0f : maxPostPos;
|
||||
minPostPos = 7.0f * SCALE;
|
||||
maxPostPos = 9.0f * SCALE;
|
||||
float barMinY = 12.0f * SCALE;
|
||||
float barMaxY = 15.0f * SCALE;
|
||||
float minX = connectNegX ? 0.0f : minPostPos;
|
||||
float maxX = connectPosX ? 1.0f : maxPostPos;
|
||||
float minZ = connectNegZ ? 0.0f : minPostPos;
|
||||
float maxZ = connectPosZ ? 1.0f : maxPostPos;
|
||||
boolean renderBottom = true;
|
||||
if (fenceType.size == 2) {
|
||||
barMaxY -= 5.0f * scale;
|
||||
barMinY -= 5.0f * scale;
|
||||
barMaxY -= 5.0f * SCALE;
|
||||
barMinY -= 5.0f * SCALE;
|
||||
}
|
||||
if (fenceType.solid) {
|
||||
renderBottom = false;
|
||||
if (fenceType.size == 0) {
|
||||
barMinY = 6.0f * scale;
|
||||
barMinY = 6.0f * SCALE;
|
||||
}
|
||||
else {
|
||||
barMinY = scale;
|
||||
barMinY = SCALE;
|
||||
}
|
||||
}
|
||||
final float totalMaxY = barMaxY;
|
||||
float totalMaxY = barMaxY;
|
||||
if (connectAnyX) {
|
||||
modelBaker.setModelBounds(new AxisAlignedBB(minX, barMinY, minPostPos, maxX, barMaxY, maxPostPos));
|
||||
modelBaker.addBlockModel(null, block.getSprite(meta, true), 0);
|
||||
@@ -145,10 +148,10 @@ public class ModelMultiFence extends ModelBlockDefault<BlockMultiFence, ModelMul
|
||||
modelBaker.addBlockModel(null, block.getSprite(meta, true), 0);
|
||||
}
|
||||
if (renderBottom) {
|
||||
barMinY -= 6.0f * scale;
|
||||
barMaxY -= 6.0f * scale;
|
||||
barMinY -= 6.0f * SCALE;
|
||||
barMaxY -= 6.0f * SCALE;
|
||||
if (fenceType.size == 1) {
|
||||
barMinY += scale;
|
||||
barMinY += SCALE;
|
||||
}
|
||||
if (connectAnyX) {
|
||||
modelBaker.setModelBounds(new AxisAlignedBB(minX, barMinY, minPostPos, maxX, barMaxY, maxPostPos));
|
||||
@@ -160,9 +163,9 @@ public class ModelMultiFence extends ModelBlockDefault<BlockMultiFence, ModelMul
|
||||
}
|
||||
}
|
||||
if (renderBottom && fenceType.size == 1) {
|
||||
barMinY -= 6.0f * scale;
|
||||
barMaxY -= 6.0f * scale;
|
||||
barMaxY += scale;
|
||||
barMinY -= 6.0f * SCALE;
|
||||
barMaxY -= 6.0f * SCALE;
|
||||
barMaxY += SCALE;
|
||||
if (connectAnyX) {
|
||||
modelBaker.setModelBounds(new AxisAlignedBB(minX, barMinY, minPostPos, maxX, barMaxY, maxPostPos));
|
||||
modelBaker.addBlockModel(null, block.getSprite(meta, true), 0);
|
||||
@@ -172,23 +175,23 @@ public class ModelMultiFence extends ModelBlockDefault<BlockMultiFence, ModelMul
|
||||
modelBaker.addBlockModel(null, block.getSprite(meta, true), 0);
|
||||
}
|
||||
}
|
||||
final float totalMinY = barMinY;
|
||||
float totalMinY = barMinY;
|
||||
if (fenceType.embossed) {
|
||||
minPostPos -= (float) (scale - 0.25 * scale);
|
||||
maxPostPos += (float) (scale - 0.25 * scale);
|
||||
float minY = totalMinY + 2.0f * scale;
|
||||
float maxY = totalMaxY - 2.0f * scale;
|
||||
minPostPos -= (float) (SCALE - 0.25 * SCALE);
|
||||
maxPostPos += (float) (SCALE - 0.25 * SCALE);
|
||||
float minY = totalMinY + 2.0f * SCALE;
|
||||
float maxY = totalMaxY - 2.0f * SCALE;
|
||||
if (fenceType.size == 1 && !fenceType.solid) {
|
||||
minY = 6.0f * scale;
|
||||
maxY = 10.0f * scale;
|
||||
minY = 6.0f * SCALE;
|
||||
maxY = 10.0f * SCALE;
|
||||
}
|
||||
else if (fenceType.size == 0 && fenceType.solid) {
|
||||
minY -= 4.0f * scale;
|
||||
maxY -= 4.0f * scale;
|
||||
minY -= 4.0f * SCALE;
|
||||
maxY -= 4.0f * SCALE;
|
||||
}
|
||||
else if (fenceType.size == 2 && fenceType.solid) {
|
||||
minY += 4.0f * scale;
|
||||
maxY += 4.0f * scale;
|
||||
minY += 4.0f * SCALE;
|
||||
maxY += 4.0f * SCALE;
|
||||
}
|
||||
if (connectAnyX) {
|
||||
modelBaker.setModelBounds(new AxisAlignedBB(minX, minY, minPostPos, maxX, maxY, maxPostPos));
|
||||
@@ -199,6 +202,7 @@ public class ModelMultiFence extends ModelBlockDefault<BlockMultiFence, ModelMul
|
||||
modelBaker.addBlockModel(null, block.getSprite(meta, false), 0);
|
||||
}
|
||||
}
|
||||
modelBaker.setParticleSprite(block.getSprite(meta, false));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user