capacitor blocks
@ -756,6 +756,9 @@ public class ModBlocks {
|
||||
public static Block machine_dineutronium_battery;
|
||||
public static Block machine_fensu;
|
||||
public static final int guiID_machine_fensu = 99;
|
||||
|
||||
public static Block capacitor_bus;
|
||||
public static Block capacitor_copper;
|
||||
|
||||
public static Block machine_coal_off;
|
||||
public static Block machine_coal_on;
|
||||
@ -1872,13 +1875,16 @@ public class ModBlocks {
|
||||
|
||||
//machine_deuterium = new MachineDeuterium(Material.iron).setBlockName("machine_deuterium").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
|
||||
machine_battery_potato = new MachineBattery(Material.iron, 10000).setBlockName("machine_battery_potato").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_battery = new MachineBattery(Material.iron, 1000000).setBlockName("machine_battery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_lithium_battery = new MachineBattery(Material.iron, 50000000).setBlockName("machine_lithium_battery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_schrabidium_battery = new MachineBattery(Material.iron, 25000000000L).setBlockName("machine_schrabidium_battery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_dineutronium_battery = new MachineBattery(Material.iron, 1000000000000L).setBlockName("machine_dineutronium_battery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_battery_potato = new MachineBattery(Material.iron, 10_000).setBlockName("machine_battery_potato").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_battery = new MachineBattery(Material.iron, 1_000_000).setBlockName("machine_battery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_lithium_battery = new MachineBattery(Material.iron, 50_000_000).setBlockName("machine_lithium_battery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_schrabidium_battery = new MachineBattery(Material.iron, 25_000_000_000L).setBlockName("machine_schrabidium_battery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_dineutronium_battery = new MachineBattery(Material.iron, 1_000_000_000_000L).setBlockName("machine_dineutronium_battery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_fensu = new MachineFENSU(Material.iron).setBlockName("machine_fensu").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_fensu");
|
||||
|
||||
capacitor_bus = new MachineCapacitorBus(Material.iron).setBlockName("capacitor_bus").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
capacitor_copper = new MachineCapacitor(Material.iron, 1_000_000L).setBlockName("capacitor_copper").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_copper");
|
||||
|
||||
machine_coal_off = new MachineCoal(false).setBlockName("machine_coal_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_coal_on = new MachineCoal(true).setBlockName("machine_coal_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F);
|
||||
|
||||
@ -3192,6 +3198,8 @@ public class ModBlocks {
|
||||
register(machine_schrabidium_battery);
|
||||
register(machine_dineutronium_battery);
|
||||
register(machine_fensu);
|
||||
register(capacitor_bus);
|
||||
register(capacitor_copper);
|
||||
GameRegistry.registerBlock(machine_transformer, machine_transformer.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_transformer_20, machine_transformer_20.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_transformer_dnt, machine_transformer_dnt.getUnlocalizedName());
|
||||
|
||||
233
src/main/java/com/hbm/blocks/machine/MachineCapacitor.java
Normal file
@ -0,0 +1,233 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.blocks.IPersistentInfoProvider;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.INBTPacketReceiver;
|
||||
import com.hbm.tileentity.IPersistentNBT;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.stats.StatList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineCapacitor extends BlockContainer implements ILookOverlay, IPersistentInfoProvider {
|
||||
|
||||
@SideOnly(Side.CLIENT) public IIcon iconTop;
|
||||
@SideOnly(Side.CLIENT) public IIcon iconSide;
|
||||
@SideOnly(Side.CLIENT) public IIcon iconBottom;
|
||||
@SideOnly(Side.CLIENT) public IIcon iconInnerTop;
|
||||
@SideOnly(Side.CLIENT) public IIcon iconInnerSide;
|
||||
|
||||
protected long power;
|
||||
|
||||
public MachineCapacitor(Material mat, long power) {
|
||||
super(mat);
|
||||
this.power = power;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
super.registerBlockIcons(iconRegister);
|
||||
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":capacitor_copper_top");
|
||||
this.iconSide = iconRegister.registerIcon(RefStrings.MODID + ":capacitor_copper_side");
|
||||
this.iconBottom = iconRegister.registerIcon(RefStrings.MODID + ":capacitor_copper_bottom");
|
||||
this.iconInnerTop = iconRegister.registerIcon(RefStrings.MODID + ":capacitor_copper_inner_top");
|
||||
this.iconInnerSide = iconRegister.registerIcon(RefStrings.MODID + ":capacitor_copper_inner_side");
|
||||
}
|
||||
|
||||
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@Override public int getRenderType() { return renderID; }
|
||||
@Override public boolean isOpaqueCube() { return false; }
|
||||
@Override public boolean renderAsNormalBlock() { return false; }
|
||||
|
||||
@Override
|
||||
public int onBlockPlaced(World world, int x, int y, int z, int side, float fX, float fY, float fZ, int meta) {
|
||||
return side;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityCapacitor(this.power);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(!(te instanceof TileEntityCapacitor))
|
||||
return;
|
||||
|
||||
TileEntityCapacitor battery = (TileEntityCapacitor) te;
|
||||
List<String> text = new ArrayList();
|
||||
text.add(BobMathUtil.getShortNumber(battery.getPower()) + " / " + BobMathUtil.getShortNumber(battery.getMaxPower()) + "HE");
|
||||
|
||||
double percent = (double) battery.getPower() / (double) battery.getMaxPower();
|
||||
int charge = (int) Math.floor(percent * 10_000D);
|
||||
int color = ((int) (0xFF - 0xFF * percent)) << 16 | ((int)(0xFF * percent) << 8);
|
||||
text.add("&[" + color + "&]" + (charge / 100D) + "%");
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, NBTTagCompound persistentTag, EntityPlayer player, List list, boolean ext) {
|
||||
list.add(EnumChatFormatting.YELLOW + "" + BobMathUtil.getShortNumber(persistentTag.getLong("power")) + "/" + BobMathUtil.getShortNumber(persistentTag.getLong("maxPower")) + "HE");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
return IPersistentNBT.getDrops(world, x, y, z, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player) {
|
||||
|
||||
if(!player.capabilities.isCreativeMode) {
|
||||
harvesters.set(player);
|
||||
this.dropBlockAsItem(world, x, y, z, meta, 0);
|
||||
harvesters.set(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World world, EntityPlayer player, int x, int y, int z, int meta) {
|
||||
player.addStat(StatList.mineBlockStatArray[getIdFromBlock(this)], 1);
|
||||
player.addExhaustion(0.025F);
|
||||
}
|
||||
|
||||
public static class TileEntityCapacitor extends TileEntityLoadedBase implements IEnergyUser, INBTPacketReceiver, IPersistentNBT {
|
||||
|
||||
public long power;
|
||||
protected long maxPower;
|
||||
|
||||
public TileEntityCapacitor() { }
|
||||
|
||||
public TileEntityCapacitor(long maxPower) {
|
||||
this.maxPower = maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
ForgeDirection opp = ForgeDirection.getOrientation(this.getBlockMetadata());
|
||||
ForgeDirection dir = opp.getOpposite();
|
||||
|
||||
BlockPos pos = new BlockPos(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
|
||||
|
||||
boolean didStep = false;
|
||||
ForgeDirection last = null;
|
||||
|
||||
while(worldObj.getBlock(pos.getX(), pos.getY(), pos.getZ()) == ModBlocks.capacitor_bus) {
|
||||
ForgeDirection current = ForgeDirection.getOrientation(worldObj.getBlockMetadata(pos.getX(), pos.getY(), pos.getZ()));
|
||||
if(!didStep) last = current;
|
||||
didStep = true;
|
||||
|
||||
if(last != current) {
|
||||
pos = null;
|
||||
break;
|
||||
}
|
||||
|
||||
pos = pos.offset(current);
|
||||
}
|
||||
|
||||
if(pos != null && last != null) {
|
||||
this.tryUnsubscribe(worldObj, pos.getX(), pos.getY(), pos.getZ());
|
||||
this.sendPower(worldObj, pos.getX(), pos.getY(), pos.getZ(), last);
|
||||
}
|
||||
|
||||
this.trySubscribe(worldObj, xCoord + opp.offsetX, yCoord+ opp.offsetY, zCoord + opp.offsetZ, opp);
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setLong("power", power);
|
||||
data.setLong("maxPower", maxPower);
|
||||
INBTPacketReceiver.networkPack(this, data, 15);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void networkUnpack(NBTTagCompound nbt) {
|
||||
this.power = nbt.getLong("power");
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getPower() {
|
||||
return power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxPower() {
|
||||
return maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConnectionPriority getPriority() {
|
||||
return ConnectionPriority.LOW;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPower(long power) {
|
||||
this.power = power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(ForgeDirection dir) {
|
||||
return dir == ForgeDirection.getOrientation(this.getBlockMetadata());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeNBT(NBTTagCompound nbt) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setLong("power", power);
|
||||
data.setLong("maxPower", maxPower);
|
||||
nbt.setTag(NBT_PERSISTENT_KEY, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readNBT(NBTTagCompound nbt) {
|
||||
NBTTagCompound data = nbt.getCompoundTag(NBT_PERSISTENT_KEY);
|
||||
this.power = data.getLong("power");
|
||||
this.maxPower = data.getLong("maxPower");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
this.power = nbt.getLong("power");
|
||||
this.maxPower = nbt.getLong("maxPower");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setLong("power", power);
|
||||
nbt.setLong("maxPower", maxPower);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,50 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import api.hbm.energy.IEnergyConnectorBlock;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockPistonBase;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineCapacitorBus extends Block implements IEnergyConnectorBlock {
|
||||
|
||||
@SideOnly(Side.CLIENT) private IIcon topIcon;
|
||||
|
||||
public MachineCapacitorBus(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister p_149651_1_) {
|
||||
this.blockIcon = p_149651_1_.registerIcon(RefStrings.MODID + ":capacitor_bus_side");
|
||||
this.topIcon = p_149651_1_.registerIcon(RefStrings.MODID + ":capacitor_bus_out");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return side == meta ? topIcon : blockIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) {
|
||||
int l = BlockPistonBase.determineOrientation(world, x, y, z, player);
|
||||
world.setBlockMetadataWithNotify(x, y, z, l, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(IBlockAccess world, int x, int y, int z, ForgeDirection dir) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
ForgeDirection busDir = ForgeDirection.getOrientation(meta);
|
||||
return dir == busDir;
|
||||
}
|
||||
}
|
||||
@ -777,6 +777,7 @@ public class ClientProxy extends ServerProxy {
|
||||
RenderingRegistry.registerBlockHandler(new RenderRTTY());
|
||||
RenderingRegistry.registerBlockHandler(new RenderDiFurnaceExtension());
|
||||
RenderingRegistry.registerBlockHandler(new RenderSplitter());
|
||||
RenderingRegistry.registerBlockHandler(new RenderCapacitor());
|
||||
|
||||
RenderingRegistry.registerBlockHandler(new RenderFoundryBasin());
|
||||
RenderingRegistry.registerBlockHandler(new RenderFoundryMold());
|
||||
|
||||
@ -1334,6 +1334,7 @@ public class ResourceManager {
|
||||
public static final IModelCustom rail_standard_straight = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/rail_standard.obj"));
|
||||
public static final IModelCustom rail_standard_curve = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/rail_standard_bend.obj"));
|
||||
public static final IModelCustom rail_standard_ramp = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/rail_standard_ramp.obj"));
|
||||
public static final IModelCustom capacitor = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/capacitor.obj"));
|
||||
|
||||
public static final IModelCustom charge_dynamite = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/charge_dynamite.obj"));
|
||||
public static final IModelCustom charge_c4 = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/charge_c4.obj"));
|
||||
|
||||
89
src/main/java/com/hbm/render/block/RenderCapacitor.java
Normal file
@ -0,0 +1,89 @@
|
||||
package com.hbm.render.block;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.machine.MachineCapacitor;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.util.ObjUtil;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.client.model.obj.WavefrontObject;
|
||||
|
||||
public class RenderCapacitor implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.setColorOpaque_F(1, 1, 1);
|
||||
|
||||
MachineCapacitor capacitor = (MachineCapacitor) block;
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.capacitor, "Top", capacitor.iconTop, tessellator, 0, false);
|
||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.capacitor, "Side", capacitor.iconSide, tessellator, 0, false);
|
||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.capacitor, "Bottom", capacitor.iconBottom, tessellator, 0, false);
|
||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.capacitor, "InnerTop", capacitor.iconInnerTop, tessellator, 0, false);
|
||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.capacitor, "InnerSide", capacitor.iconInnerSide, tessellator, 0, false);
|
||||
tessellator.draw();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
MachineCapacitor capacitor = (MachineCapacitor) block;
|
||||
|
||||
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
|
||||
tessellator.setColorOpaque_F(1, 1, 1);
|
||||
|
||||
float flip = 0;
|
||||
float rotation = 0;
|
||||
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if(meta == 0)
|
||||
flip = (float)Math.PI;
|
||||
|
||||
if(meta == 2)
|
||||
rotation = 90F / 180F * (float) Math.PI;
|
||||
|
||||
if(meta == 3)
|
||||
rotation = 270F / 180F * (float) Math.PI;
|
||||
|
||||
if(meta == 4)
|
||||
rotation = 180F / 180F * (float)Math.PI;
|
||||
|
||||
if(rotation != 0F || meta == 5)
|
||||
flip = (float)Math.PI * 0.5F;
|
||||
|
||||
tessellator.addTranslation(x + 0.5F, y + 0.5F, z + 0.5F);
|
||||
|
||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.capacitor, "Top", capacitor.iconTop, tessellator, rotation, flip, true);
|
||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.capacitor, "Side", capacitor.iconSide, tessellator, rotation, flip, true);
|
||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.capacitor, "Bottom", capacitor.iconBottom, tessellator, rotation, flip, true);
|
||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.capacitor, "InnerTop", capacitor.iconInnerTop, tessellator, rotation, flip, true);
|
||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.capacitor, "InnerSide", capacitor.iconInnerSide, tessellator, rotation, flip, true);
|
||||
|
||||
tessellator.addTranslation(-x - 0.5F, -y - 0.5F, -z - 0.5F);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return MachineCapacitor.renderID;
|
||||
}
|
||||
}
|
||||
128
src/main/resources/assets/hbm/models/blocks/capacitor.obj
Normal file
@ -0,0 +1,128 @@
|
||||
# Blender v2.79 (sub 0) OBJ File: 'capacitor.blend'
|
||||
# www.blender.org
|
||||
o InnerSide
|
||||
v -0.437500 -0.250000 0.437500
|
||||
v -0.437500 -0.250000 -0.437500
|
||||
v 0.437500 -0.250000 0.437500
|
||||
v 0.437500 -0.250000 -0.437500
|
||||
v -0.437500 0.437500 0.437500
|
||||
v -0.437500 0.437500 -0.437500
|
||||
v 0.437500 0.437500 -0.437500
|
||||
v 0.437500 0.437500 0.437500
|
||||
vt 0.937500 0.250000
|
||||
vt 0.062500 0.937500
|
||||
vt 0.062500 0.250000
|
||||
vt 0.062500 0.937500
|
||||
vt 0.937500 0.250000
|
||||
vt 0.937500 0.937500
|
||||
vt 0.937500 0.250000
|
||||
vt 0.062500 0.937500
|
||||
vt 0.062500 0.250000
|
||||
vt 0.062500 0.937500
|
||||
vt 0.937500 0.250000
|
||||
vt 0.937500 0.937500
|
||||
vt 0.937500 0.937500
|
||||
vt 0.062500 0.250000
|
||||
vt 0.937500 0.937500
|
||||
vt 0.062500 0.250000
|
||||
vn 0.0000 0.0000 1.0000
|
||||
vn 0.0000 0.0000 -1.0000
|
||||
vn 1.0000 0.0000 0.0000
|
||||
vn -1.0000 0.0000 0.0000
|
||||
s off
|
||||
f 3/1/1 5/2/1 1/3/1
|
||||
f 2/4/2 7/5/2 4/6/2
|
||||
f 4/7/3 8/8/3 3/9/3
|
||||
f 1/10/4 6/11/4 2/12/4
|
||||
f 3/1/1 8/13/1 5/2/1
|
||||
f 2/4/2 6/14/2 7/5/2
|
||||
f 4/7/3 7/15/3 8/8/3
|
||||
f 1/10/4 5/16/4 6/11/4
|
||||
o InnerTop
|
||||
v -0.437500 0.437500 0.437500
|
||||
v -0.437500 0.437500 -0.437500
|
||||
v 0.437500 0.437500 -0.437500
|
||||
v 0.437500 0.437500 0.437500
|
||||
vt 0.937500 0.937500
|
||||
vt 0.062500 0.062500
|
||||
vt 0.937500 0.062500
|
||||
vt 0.062500 0.937500
|
||||
vn 0.0000 1.0000 0.0000
|
||||
s off
|
||||
f 10/17/5 12/18/5 11/19/5
|
||||
f 10/17/5 9/20/5 12/18/5
|
||||
o Side
|
||||
v -0.500000 -0.500000 0.500000
|
||||
v -0.500000 0.500000 0.500000
|
||||
v -0.500000 -0.500000 -0.500000
|
||||
v -0.500000 0.500000 -0.500000
|
||||
v 0.500000 -0.500000 0.500000
|
||||
v 0.500000 0.500000 0.500000
|
||||
v 0.500000 -0.500000 -0.500000
|
||||
v 0.500000 0.500000 -0.500000
|
||||
vt 1.000000 1.000000
|
||||
vt 0.000000 0.000000
|
||||
vt 1.000000 0.000000
|
||||
vt 1.000000 1.000000
|
||||
vt 0.000000 0.000000
|
||||
vt 1.000000 0.000000
|
||||
vt 1.000000 1.000000
|
||||
vt 0.000000 0.000000
|
||||
vt 1.000000 0.000000
|
||||
vt 1.000000 1.000000
|
||||
vt 0.000000 0.000000
|
||||
vt 1.000000 0.000000
|
||||
vt 0.000000 1.000000
|
||||
vt 0.000000 1.000000
|
||||
vt 0.000000 1.000000
|
||||
vt 0.000000 1.000000
|
||||
vn -1.0000 0.0000 0.0000
|
||||
vn 0.0000 0.0000 -1.0000
|
||||
vn 1.0000 0.0000 0.0000
|
||||
vn 0.0000 0.0000 1.0000
|
||||
s off
|
||||
f 14/21/6 15/22/6 13/23/6
|
||||
f 16/24/7 19/25/7 15/26/7
|
||||
f 20/27/8 17/28/8 19/29/8
|
||||
f 18/30/9 13/31/9 17/32/9
|
||||
f 14/21/6 16/33/6 15/22/6
|
||||
f 16/24/7 20/34/7 19/25/7
|
||||
f 20/27/8 18/35/8 17/28/8
|
||||
f 18/30/9 14/36/9 13/31/9
|
||||
o Top
|
||||
v -0.500000 0.500000 0.500000
|
||||
v -0.500000 0.500000 -0.500000
|
||||
v 0.500000 0.500000 0.500000
|
||||
v 0.500000 0.500000 -0.500000
|
||||
vt 1.000000 1.000000
|
||||
vt 0.000000 0.000000
|
||||
vt 1.000000 0.000000
|
||||
vt 0.000000 1.000000
|
||||
vn 0.0000 1.0000 0.0000
|
||||
s off
|
||||
f 22/37/10 23/38/10 24/39/10
|
||||
f 22/37/10 21/40/10 23/38/10
|
||||
o Bottom
|
||||
v -0.500000 -0.500000 0.500000
|
||||
v -0.500000 -0.500000 -0.500000
|
||||
v 0.500000 -0.500000 0.500000
|
||||
v 0.500000 -0.500000 -0.500000
|
||||
v -0.500000 -0.250000 0.500000
|
||||
v -0.500000 -0.250000 -0.500000
|
||||
v 0.500000 -0.250000 0.500000
|
||||
v 0.500000 -0.250000 -0.500000
|
||||
vt 1.000000 1.000000
|
||||
vt 0.000000 0.000000
|
||||
vt 1.000000 0.000000
|
||||
vt 0.000000 0.000000
|
||||
vt 1.000000 1.000000
|
||||
vt 0.000000 1.000000
|
||||
vt 0.000000 1.000000
|
||||
vt 1.000000 0.000000
|
||||
vn 0.0000 -1.0000 0.0000
|
||||
vn 0.0000 1.0000 0.0000
|
||||
s off
|
||||
f 28/41/11 25/42/11 26/43/11
|
||||
f 30/44/12 31/45/12 32/46/12
|
||||
f 28/41/11 27/47/11 25/42/11
|
||||
f 30/44/12 29/48/12 31/45/12
|
||||
|
After Width: | Height: | Size: 195 B |
|
After Width: | Height: | Size: 187 B |
|
After Width: | Height: | Size: 612 B |
|
After Width: | Height: | Size: 177 B |
|
After Width: | Height: | Size: 276 B |
|
After Width: | Height: | Size: 379 B |
|
After Width: | Height: | Size: 228 B |