Merge branch 'HbmMods:master' into master

This commit is contained in:
Vaern 2022-01-01 10:31:19 -08:00 committed by GitHub
commit 8de85238ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 107 additions and 36 deletions

View File

@ -21,7 +21,10 @@ public class PylonLarge extends BlockDummyable implements ITooltipProvider {
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntityPylonLarge();
if(meta >= 12)
return new TileEntityPylonLarge();
return null;
}
@Override
@ -33,7 +36,7 @@ public class PylonLarge extends BlockDummyable implements ITooltipProvider {
@Override
public int[] getDimensions() {
return new int[] {9, 0, 1, 1, 1, 1};
return new int[] {0, 0, 1, 1, 1, 1};
}
@Override

View File

@ -77,17 +77,9 @@ import com.hbm.tileentity.bomb.*;
import com.hbm.tileentity.conductor.*;
import com.hbm.tileentity.deco.*;
import com.hbm.tileentity.machine.*;
import com.hbm.tileentity.machine.oil.TileEntityMachineCatalyticCracker;
import com.hbm.tileentity.machine.oil.TileEntityMachineFrackingTower;
import com.hbm.tileentity.machine.oil.TileEntityMachineFractionTower;
import com.hbm.tileentity.machine.oil.TileEntityMachineGasFlare;
import com.hbm.tileentity.machine.oil.TileEntityMachineOilWell;
import com.hbm.tileentity.machine.oil.TileEntityMachinePumpjack;
import com.hbm.tileentity.machine.oil.TileEntityMachineRefinery;
import com.hbm.tileentity.machine.oil.TileEntitySpacer;
import com.hbm.tileentity.machine.oil.*;
import com.hbm.tileentity.machine.rbmk.*;
import com.hbm.tileentity.network.TileEntityConnector;
import com.hbm.tileentity.network.TileEntityPylon;
import com.hbm.tileentity.network.*;
import com.hbm.tileentity.turret.*;
import cpw.mods.fml.client.registry.ClientRegistry;
@ -238,6 +230,7 @@ public class ClientProxy extends ServerProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRFDuct.class, new RenderRFCable());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPylon.class, new RenderPylon());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityConnector.class, new RenderConnector());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPylonLarge.class, new RenderPylonLarge());
//multiblocks
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityStructureMarker.class, new RenderStructureMaker());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMultiblock.class, new RenderMultiblock());

View File

@ -3,6 +3,7 @@ package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.tileentity.network.TileEntityPylonBase;
import com.hbm.tileentity.network.TileEntityPylonBase.ConnectionType;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
@ -59,7 +60,7 @@ public abstract class RenderPylonBase extends TileEntitySpecialRenderer {
int lY = brightness / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)lX / 1.0F, (float)lY / 1.0F);
drawPowerLine(
drawLineSegment(
x + myOffset.xCoord + (wX * j / count),
y + myOffset.yCoord + (wY * j / count) - Math.sin(j / count * Math.PI * 0.5) * hang,
z + myOffset.zCoord + (wZ * j / count),
@ -73,10 +74,42 @@ public abstract class RenderPylonBase extends TileEntitySpecialRenderer {
public void renderLinesGeneric(TileEntityPylonBase pyl, double x, double y, double z) {
for(int i = 0; i < pyl.connected.size(); i++) {
int[] wire = pyl.connected.get(i);
TileEntity tile = pyl.getWorldObj().getTileEntity(wire[0], wire[1], wire[2]);
if(tile instanceof TileEntityPylonBase) {
TileEntityPylonBase pylon = (TileEntityPylonBase) tile;
Vec3[] m1 = pyl.getMountPos();
Vec3[] m2 = pylon.getMountPos();
int lineCount = Math.max(pyl.getConnectionType() == ConnectionType.QUAD ? 4 : 1, pylon.getConnectionType() == ConnectionType.QUAD ? 4 : 1);
for(int line = 0; line < lineCount; line++) {
Vec3 first = m1[line % m1.length];
Vec3 second = m2[line % m2.length];
double sX = second.xCoord + pylon.xCoord - pyl.xCoord;
double sY = second.yCoord + pylon.yCoord - pyl.yCoord;
double sZ = second.zCoord + pylon.zCoord - pyl.zCoord;
renderLine(pyl.getWorldObj(), pyl, x, y, z,
first.xCoord,
first.yCoord,
first.zCoord,
first.xCoord + (sX - first.xCoord) * 0.5,
first.yCoord + (sY - first.yCoord) * 0.5,
first.zCoord + (sZ - first.zCoord) * 0.5);
}
}
}
}
public void renderLine(World world, TileEntityPylonBase pyl, double x, double y, double z, double x0, double y0, double z0, double x1, double y1, double z1) {
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
float count = 10;
@ -98,7 +131,7 @@ public abstract class RenderPylonBase extends TileEntitySpecialRenderer {
int lY = brightness / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)lX / 1.0F, (float)lY / 1.0F);
drawPowerLine(
drawLineSegment(
x0 + (deltaX * j / count),
y0 + (deltaY * j / count) - Math.sin(j / count * Math.PI * 0.5),
z0 + (deltaZ * j / count),
@ -106,9 +139,12 @@ public abstract class RenderPylonBase extends TileEntitySpecialRenderer {
y0 + (deltaY * k / count) - Math.sin(k / count * Math.PI * 0.5),
z0 + (deltaZ * k / count));
}
GL11.glPopMatrix();
}
public void drawPowerLine(double x, double y, double z, double a, double b, double c) {
public void drawLineSegment(double x, double y, double z, double a, double b, double c) {
double girth = 0.03125D;
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_LIGHTING);
@ -116,24 +152,18 @@ public abstract class RenderPylonBase extends TileEntitySpecialRenderer {
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawing(5);
tessellator.setColorOpaque_I(0xBB3311);
tessellator.addVertex(x, y + 0.05F, z);
tessellator.addVertex(x, y - 0.05F, z);
tessellator.addVertex(a, b + 0.05F, c);
tessellator.addVertex(a, b - 0.05F, c);
tessellator.draw();
tessellator.startDrawing(5);
tessellator.setColorOpaque_I(0xBB3311);
tessellator.addVertex(x + 0.05F, y, z);
tessellator.addVertex(x - 0.05F, y, z);
tessellator.addVertex(a + 0.05F, b, c);
tessellator.addVertex(a - 0.05F, b, c);
tessellator.draw();
tessellator.startDrawing(5);
tessellator.setColorOpaque_I(0xBB3311);
tessellator.addVertex(x, y, z + 0.05F);
tessellator.addVertex(x, y, z - 0.05F);
tessellator.addVertex(a, b, c + 0.05F);
tessellator.addVertex(a, b, c - 0.05F);
tessellator.addVertex(x, y + girth, z);
tessellator.addVertex(x, y - girth, z);
tessellator.addVertex(a, b + girth, c);
tessellator.addVertex(a, b - girth, c);
tessellator.addVertex(x + girth, y, z);
tessellator.addVertex(x - girth, y, z);
tessellator.addVertex(a + girth, b, c);
tessellator.addVertex(a - girth, b, c);
tessellator.addVertex(x, y, z + girth);
tessellator.addVertex(x, y, z - girth);
tessellator.addVertex(a, b, c + girth);
tessellator.addVertex(a, b, c - girth);
tessellator.draw();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_TEXTURE_2D);

View File

@ -0,0 +1,38 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.blocks.BlockDummyable;
import com.hbm.main.ResourceManager;
import com.hbm.tileentity.network.TileEntityPylonLarge;
import net.minecraft.tileentity.TileEntity;
public class RenderPylonLarge extends RenderPylonBase {
@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float interp) {
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5, y, z + 0.5);
switch(tile.getBlockMetadata() - BlockDummyable.offset) {
case 2: GL11.glRotatef(90, 0F, 1F, 0F); break;
case 4: GL11.glRotatef(180, 0F, 1F, 0F); break;
case 3: GL11.glRotatef(270, 0F, 1F, 0F); break;
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break;
}
GL11.glDisable(GL11.GL_CULL_FACE);
bindTexture(ResourceManager.pylon_large_tex);
ResourceManager.pylon_large.renderAll();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glPopMatrix();
GL11.glPushMatrix();
TileEntityPylonLarge pyl = (TileEntityPylonLarge)tile;
this.renderLinesGeneric(pyl, x, y, z);
GL11.glPopMatrix();
}
}

View File

@ -116,7 +116,7 @@ public abstract class TileEntityPylonBase extends TileEntityCableBaseNT {
if(mounts == null || mounts.length == 0)
return Vec3.createVectorHelper(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5);
return mounts[0];
return mounts[0].addVector(xCoord, yCoord, zCoord);
}
@Override

View File

@ -11,7 +11,14 @@ public class TileEntityPylonLarge extends TileEntityPylonBase {
@Override
public Vec3[] getMountPos() {
return null;
double topOff = 0.75 + 0.0625;
double sideOff = 3.375;
return new Vec3[] {
Vec3.createVectorHelper(0.5 + sideOff, 11.5 + topOff, 0.5),
Vec3.createVectorHelper(0.5 + sideOff, 11.5 - topOff, 0.5),
Vec3.createVectorHelper(0.5 - sideOff, 11.5 + topOff, 0.5),
Vec3.createVectorHelper(0.5 - sideOff, 11.5 - topOff, 0.5),
};
}
@Override

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 556 B

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -7,7 +7,7 @@
"mcversion": "1.7.10",
"url": "",
"updateUrl": "",
"credits": "HbMinecraft, rodolphito (explosion algorithms), grangerave (explosion algorithms), Hoboy (textures, models), Doctor17 (russian localization), Drillgon200 (effects, models, porting), UFFR (fork with all sorts of features), Pu-238 (Tom impact effects), Bismarck (chinese localization), FirzzleFrazzle (models), Minecreep (models), VT-6/24 (models, textures), PheodoreKaczynski (textures, various machines), Vær (fibrosis code), Adam29 (liquid petroleum, ethanol), Pashtet (russian localization), Sten89 (models), Pixelguru26 (textures), impbk2002 (project settings), OvermindDL1 (project settings), TehTemmie (reacher radiation function)",
"credits": "HbMinecraft, rodolphito (explosion algorithms), grangerave (explosion algorithms), Hoboy (textures, models), Doctor17 (russian localization), Drillgon200 (effects, models, porting), UFFR (fork with all sorts of features), Pu-238 (Tom impact effects), Bismarck (chinese localization), Frooz (models), Minecreep (models), VT-6/24 (models, textures), Pheo (textures, various machines), Vær (fibrosis, gas centrifuges), Adam29 (liquid petroleum, ethanol), Pashtet (russian localization), Sten89 (models), Pixelguru26 (textures), TheBlueHat (textures), impbk2002 (project settings), OvermindDL1 (project settings), TehTemmie (reacher radiation function)",
"logoFile": "",
"screenshots": [],
"dependencies": []