mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-08-10 17:55:44 +00:00
Spin when me
This commit is contained in:
parent
11d8cc13a6
commit
6f7ba6ddad
@ -1,6 +1,10 @@
|
||||
package com.hbm.blocks.network;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.tileentity.network.TileEntityPylonBase;
|
||||
import com.hbm.tileentity.network.TileEntityPylon;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -10,15 +14,17 @@ import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PylonRedWire extends PylonBase {
|
||||
public class PylonRedWire extends BlockDummyable implements ITooltipProvider {
|
||||
|
||||
public PylonRedWire(Material material) {
|
||||
super(material);
|
||||
public PylonRedWire(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityPylon();
|
||||
|
||||
if(meta >= 12) return new TileEntityPylon();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -26,4 +32,34 @@ public class PylonRedWire extends PylonBase {
|
||||
list.add(EnumChatFormatting.GOLD + "Connection Type: " + EnumChatFormatting.YELLOW + "Single");
|
||||
list.add(EnumChatFormatting.GOLD + "Connection Range: " + EnumChatFormatting.YELLOW + "25m");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {4, 0, 0, 0, 0, 0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block b, int m) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te instanceof TileEntityPylonBase) ((TileEntityPylonBase)te).disconnectAll();
|
||||
super.breakBlock(world, x, y, z, b, m);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(world.isRemote) {
|
||||
return true;
|
||||
} else if(!player.isSneaking()) {
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
TileEntityPylonBase te = (TileEntityPylonBase) world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
return te.setColor(player.getHeldItem());
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,11 +36,12 @@ public class GUIMachineOilWell extends GuiInfoContainer {
|
||||
derrick.tanks[2].renderTankInfo(this, mouseX, mouseY, guiLeft + 54, guiTop + 45, 6, 32);
|
||||
}
|
||||
|
||||
String[] upgradeText = new String[4];
|
||||
String[] upgradeText = new String[5];
|
||||
upgradeText[0] = I18nUtil.resolveKey("desc.gui.upgrade");
|
||||
upgradeText[1] = I18nUtil.resolveKey("desc.gui.upgrade.speed");
|
||||
upgradeText[2] = I18nUtil.resolveKey("desc.gui.upgrade.power");
|
||||
upgradeText[3] = I18nUtil.resolveKey("desc.gui.upgrade.afterburner");
|
||||
upgradeText[4] = I18nUtil.resolveKey("desc.gui.upgrade.overdrive");
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 160, guiTop + 21, 8, 8, mouseX, mouseY, upgradeText);
|
||||
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 22, 16, 34, derrick.power, derrick.getMaxPower());
|
||||
|
||||
@ -241,7 +241,7 @@ public class CraftingManager {
|
||||
addShapelessAuto(new ItemStack(ModBlocks.red_cable_gauge), new Object[] { ModBlocks.red_wire_coated, STEEL.ingot(), DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BASIC) });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.red_connector, 4), new Object[] { "C", "I", "S", 'C', ModItems.coil_copper, 'I', ModItems.plate_polymer, 'S', STEEL.ingot() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.red_connector_super, 2), new Object[] { "CCC", "III", " S ", 'C', ModItems.coil_copper, 'I', ModItems.plate_polymer, 'S', ANY_RESISTANTALLOY.ingot() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.red_pylon, 4), new Object[] { "CWC", "PWP", " T ", 'C', ModItems.coil_copper, 'W', KEY_PLANKS, 'P', ModItems.plate_polymer, 'T', ModBlocks.red_wire_coated });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.red_pylon, 2), new Object[] { " C ", "WPW", " S ", 'C', ModItems.coil_copper, 'W', STEEL.pipe(), 'P', ModItems.plate_polymer, 'S', KEY_COBBLESTONE });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.red_pylon_medium_wood, 2), new Object[] { "CCW", "IIW", " S", 'C', ModItems.coil_copper, 'W', KEY_PLANKS, 'I', ModItems.plate_polymer, 'S', KEY_COBBLESTONE });
|
||||
addShapelessAuto(new ItemStack(ModBlocks.red_pylon_medium_wood_transformer, 1), new Object[] { ModBlocks.red_pylon_medium_wood, ModItems.plate_polymer, ModItems.coil_copper });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.red_pylon_medium_steel, 2), new Object[] { "CCW", "IIW", " S", 'C', ModItems.coil_copper, 'W', STEEL.pipe(), 'I', ModItems.plate_polymer, 'S', KEY_COBBLESTONE });
|
||||
|
||||
@ -407,6 +407,7 @@ public class ResourceManager {
|
||||
//Network
|
||||
public static final IModelCustom connector = new HFRWavefrontObject("models/network/connector.obj").noSmooth().asVBO();
|
||||
public static final IModelCustom connector_super = new HFRWavefrontObject("models/network/connector_super.obj").noSmooth().asVBO();
|
||||
public static final IModelCustom pylon = new HFRWavefrontObject("models/network/pylon.obj").noSmooth().asVBO();
|
||||
public static final IModelCustom pylon_medium = new HFRWavefrontObject("models/network/pylon_medium.obj").noSmooth().asVBO();
|
||||
public static final IModelCustom pylon_large = new HFRWavefrontObject("models/network/pylon_large.obj").noSmooth().asVBO();
|
||||
public static final IModelCustom substation = new HFRWavefrontObject("models/network/substation.obj").asVBO();
|
||||
@ -859,6 +860,7 @@ public class ResourceManager {
|
||||
//Electricity
|
||||
public static final ResourceLocation connector_tex = new ResourceLocation(RefStrings.MODID, "textures/models/network/connector.png");
|
||||
public static final ResourceLocation connector_super_tex = new ResourceLocation(RefStrings.MODID, "textures/models/network/connector_super.png");
|
||||
public static final ResourceLocation pylon_tex = new ResourceLocation(RefStrings.MODID, "textures/models/network/pylon.png");
|
||||
public static final ResourceLocation pylon_medium_tex = new ResourceLocation(RefStrings.MODID, "textures/models/network/pylon_medium.png");
|
||||
public static final ResourceLocation pylon_medium_steel_tex = new ResourceLocation(RefStrings.MODID, "textures/models/network/pylon_medium_steel.png");
|
||||
public static final ResourceLocation pylon_large_tex = new ResourceLocation(RefStrings.MODID, "textures/models/network/pylon_large.png");
|
||||
|
||||
@ -1,63 +0,0 @@
|
||||
//This File was created with the Minecraft-SMP Modelling Toolbox 2.3.0.0
|
||||
// Copyright (C) 2017 Minecraft-SMP.de
|
||||
// This file is for Flan's Flying Mod Version 4.0.x+
|
||||
|
||||
// Model: Pylon
|
||||
// Model Creator:
|
||||
// Created on:13.06.2017 - 11:17:46
|
||||
// Last changed on: 13.06.2017 - 11:17:46
|
||||
|
||||
package com.hbm.render.model;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelPylon extends ModelBase {
|
||||
|
||||
public ModelRenderer[] pylonModel;
|
||||
|
||||
public ModelPylon() {
|
||||
this.textureWidth = 64;
|
||||
this.textureHeight = 128;
|
||||
|
||||
this.pylonModel = new ModelRenderer[4];
|
||||
this.pylonModel[0] = new ModelRenderer(this, 0, 96); // Box 0
|
||||
this.pylonModel[1] = new ModelRenderer(this, 1, 1); // Box 1
|
||||
this.pylonModel[2] = new ModelRenderer(this, 24, 1); // Box 2
|
||||
this.pylonModel[3] = new ModelRenderer(this, 25, 17); // Box 3
|
||||
|
||||
this.pylonModel[0].addBox(0F, 0F, 0F, 16, 16, 16, 0F); // Box 0
|
||||
this.pylonModel[0].setRotationPoint(-8F, -6F, -8F);
|
||||
|
||||
this.pylonModel[1].addBox(0F, 0F, 0F, 4, 73, 4, 0F); // Box 1
|
||||
this.pylonModel[1].setRotationPoint(-2F, -79F, -2F);
|
||||
|
||||
this.pylonModel[2].addBox(0F, 0F, 0F, 6, 4, 6, 0F); // Box 2
|
||||
this.pylonModel[2].setRotationPoint(-3F, -74F, -3F);
|
||||
|
||||
this.pylonModel[3].addBox(0F, 0F, 0F, 6, 2, 6, 0F); // Box 3
|
||||
this.pylonModel[3].setRotationPoint(-3F, -78F, -3F);
|
||||
|
||||
|
||||
for (ModelRenderer modelRenderer : this.pylonModel) {
|
||||
modelRenderer.setTextureSize(this.textureWidth, this.textureHeight);
|
||||
modelRenderer.mirror = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor) {
|
||||
|
||||
for(int i = 0; i < 4; i++) {
|
||||
this.pylonModel[i].render(scaleFactor);
|
||||
}
|
||||
}
|
||||
|
||||
public void renderAll(float scaleFactor) {
|
||||
|
||||
for(int i = 0; i < 4; i++) {
|
||||
this.pylonModel[i].render(scaleFactor);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -17,6 +17,9 @@ import com.hbm.render.util.BeamPronter.EnumWaveType;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityBatterySocket;
|
||||
import com.hbm.util.EnumUtil;
|
||||
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -28,6 +31,8 @@ import net.minecraftforge.client.IItemRenderer;
|
||||
public class RenderBatterySocket extends TileEntitySpecialRenderer implements IItemRendererProvider {
|
||||
|
||||
private static ResourceLocation blorbo = new ResourceLocation(RefStrings.MODID, "textures/models/horse/sunburst.png");
|
||||
|
||||
public static EntityItem dummy;
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float interp) {
|
||||
@ -78,6 +83,34 @@ public class RenderBatterySocket extends TileEntitySpecialRenderer implements II
|
||||
Random rand = new Random(tile.getWorldObj().getTotalWorldTime() / 5);
|
||||
rand.nextBoolean();
|
||||
|
||||
for(int i = -1; i <= 1; i += 2) for(int j = -1; j <= 1; j += 2) if(rand.nextInt(4) == 0) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 0.75, 0);
|
||||
BeamPronter.prontBeam(Vec3.createVectorHelper(0.4375 * i, 1.1875, 0.4375 * j), EnumWaveType.RANDOM, EnumBeamType.SOLID, 0x404040, 0x002040, (int)(System.currentTimeMillis() % 1000) / 50, 15, 0.0625F, 3, 0.025F);
|
||||
BeamPronter.prontBeam(Vec3.createVectorHelper(0.4375 * i, 1.1875, 0.4375 * j), EnumWaveType.RANDOM, EnumBeamType.SOLID, 0x404040, 0x002040, (int)(System.currentTimeMillis() % 1000) / 50, 1, 0, 3, 0.025F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
} else {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 0.5, 0);
|
||||
GL11.glScaled(1.5, 1.5, 1.5);
|
||||
GL11.glRotated((socket.getWorldObj().getTotalWorldTime() % 360 + interp) * 25D, 0, -1, 0);
|
||||
|
||||
if(dummy == null || dummy.worldObj != tile.getWorldObj()) {
|
||||
dummy = new EntityItem(tile.getWorldObj(), 0, 0, 0, render);
|
||||
}
|
||||
dummy.setEntityItemStack(render);
|
||||
dummy.hoverStart = 0.0F;
|
||||
|
||||
RenderItem.renderInFrame = true;
|
||||
RenderManager.instance.renderEntityWithPosYaw(dummy, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
|
||||
RenderItem.renderInFrame = false;
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
Random rand = new Random(tile.getWorldObj().getTotalWorldTime() / 5);
|
||||
rand.nextBoolean();
|
||||
|
||||
for(int i = -1; i <= 1; i += 2) for(int j = -1; j <= 1; j += 2) if(rand.nextInt(4) == 0) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 0.75, 0);
|
||||
|
||||
@ -2,38 +2,56 @@ package com.hbm.render.tileentity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.render.model.ModelPylon;
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.item.ItemRenderBase;
|
||||
import com.hbm.tileentity.network.TileEntityPylon;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class RenderPylon extends RenderPylonBase {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":" + "textures/models/ModelPylon.png");
|
||||
|
||||
private ModelPylon pylon;
|
||||
|
||||
public RenderPylon() {
|
||||
this.pylon = new ModelPylon();
|
||||
}
|
||||
public class RenderPylon extends RenderPylonBase implements IItemRendererProvider {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f) {
|
||||
TileEntityPylon pyl = (TileEntityPylon)te;
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float interp) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F - ((1F / 16F) * 14F), (float) z + 0.5F);
|
||||
GL11.glRotatef(180, 0F, 0F, 1F);
|
||||
bindTexture(texture);
|
||||
this.pylon.renderAll(0.0625F);
|
||||
GL11.glTranslated(x + 0.5, y, z + 0.5);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
|
||||
TileEntityPylon pyl = (TileEntityPylon)tile;
|
||||
|
||||
bindTexture(ResourceManager.pylon_tex);
|
||||
ResourceManager.pylon.renderAll();
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
this.renderLinesGeneric(pyl, x, y, z);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemForRenderer() {
|
||||
return Item.getItemFromBlock(ModBlocks.red_pylon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemRenderer getRenderer() {
|
||||
return new ItemRenderBase() {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -5, 0);
|
||||
GL11.glScaled(2.9, 2.9, 2.9);
|
||||
}
|
||||
public void renderCommon() {
|
||||
GL11.glScaled(1, 1, 1);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.pylon_tex);
|
||||
ResourceManager.pylon.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}};
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,12 +18,17 @@ public class TileEntityPylon extends TileEntityPylonBase {
|
||||
|
||||
@Override
|
||||
public Vec3[] getMountPos() {
|
||||
return new Vec3[] {Vec3.createVectorHelper(0.5, 5.4, 0.5)};
|
||||
return new Vec3[] {Vec3.createVectorHelper(0.5, 5.5D, 0.5)};
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxWireLength() {
|
||||
return 25D;
|
||||
return 25;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(ForgeDirection dir) {
|
||||
return dir != ForgeDirection.DOWN;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -33,8 +38,6 @@ public class TileEntityPylon extends TileEntityPylonBase {
|
||||
new DirPos(xCoord, yCoord, zCoord, ForgeDirection.UNKNOWN),
|
||||
new DirPos(xCoord + 1, yCoord, zCoord, Library.POS_X),
|
||||
new DirPos(xCoord - 1, yCoord, zCoord, Library.NEG_X),
|
||||
new DirPos(xCoord, yCoord + 1, zCoord, Library.POS_Y),
|
||||
new DirPos(xCoord, yCoord - 1, zCoord, Library.NEG_Y),
|
||||
new DirPos(xCoord, yCoord, zCoord + 1, Library.POS_Z),
|
||||
new DirPos(xCoord, yCoord, zCoord - 1, Library.NEG_Z)
|
||||
);
|
||||
|
||||
@ -6219,7 +6219,7 @@ tile.red_cable_paintable.name=Paintable Red Copper Cable
|
||||
tile.red_cable_paintable.desc=Right-click with a solid block to set a paint$Paint can be cleared with a screwdriver$Port texture can be disabled with a defuser$Paints can be copied with the copy tool
|
||||
tile.red_connector.name=Electricity Connector
|
||||
tile.red_connector_super.name=Heavy Duty Electricity Connector
|
||||
tile.red_pylon.name=Electricity Pylon
|
||||
tile.red_pylon.name=Industrial Electricity Pylon
|
||||
tile.red_pylon_large.name=Large Electricity Pylon
|
||||
tile.red_pylon_medium_steel.name=Medium Steel Electricity Pylon
|
||||
tile.red_pylon_medium_steel_transformer.name=Medium Steel Electricity Pylon with Transformer
|
||||
|
||||
1299
src/main/resources/assets/hbm/models/network/pylon.obj
Normal file
1299
src/main/resources/assets/hbm/models/network/pylon.obj
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/main/resources/assets/hbm/textures/models/network/pylon.png
Normal file
BIN
src/main/resources/assets/hbm/textures/models/network/pylon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
Loading…
x
Reference in New Issue
Block a user