Merge pull request #2799 from sten104/master

how do you get a cylinder unstuck from a barrel connector
This commit is contained in:
HbmMods 2026-03-25 09:33:47 +01:00 committed by GitHub
commit d157004f03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 139 additions and 32 deletions

View File

@ -863,6 +863,12 @@ public class ResourceManager {
//Pipes //Pipes
public static final ResourceLocation pipe_anchor_tex = new ResourceLocation(RefStrings.MODID, "textures/models/network/pipe_anchor.png"); public static final ResourceLocation pipe_anchor_tex = new ResourceLocation(RefStrings.MODID, "textures/models/network/pipe_anchor.png");
public static final ResourceLocation fluid_pump_tex = new ResourceLocation(RefStrings.MODID, "textures/models/network/fluid_diode.png"); public static final ResourceLocation fluid_pump_tex = new ResourceLocation(RefStrings.MODID, "textures/models/network/fluid_diode.png");
//Barrels
public static ResourceLocation barrel_plastic_tex = new ResourceLocation(RefStrings.MODID, "textures/blocks/barrel_plastic.png");
public static ResourceLocation barrel_steel_tex = new ResourceLocation(RefStrings.MODID, "textures/blocks/barrel_steel.png");
public static ResourceLocation barrel_tcalloy_tex = new ResourceLocation(RefStrings.MODID, "textures/blocks/barrel_tcalloy.png");
public static ResourceLocation barrel_antimatter_tex = new ResourceLocation(RefStrings.MODID, "textures/blocks/barrel_antimatter.png");
//Radiolysis //Radiolysis
public static final ResourceLocation radiolysis_tex = new ResourceLocation(RefStrings.MODID, "textures/models/radiolysis.png"); public static final ResourceLocation radiolysis_tex = new ResourceLocation(RefStrings.MODID, "textures/models/radiolysis.png");

View File

@ -30,7 +30,7 @@ public class RenderBarrel implements ISimpleBlockRenderingHandler {
GL11.glTranslated(0, -0.5, 0); GL11.glTranslated(0, -0.5, 0);
tessellator.startDrawingQuads(); tessellator.startDrawingQuads();
ObjUtil.renderWithIcon((HFRWavefrontObject) ResourceManager.barrel, iicon, tessellator, 0, false); ObjUtil.renderPartWithIcon((HFRWavefrontObject) ResourceManager.barrel, "Barrel", iicon, tessellator, 0, false);
tessellator.draw(); tessellator.draw();
GL11.glPopMatrix(); GL11.glPopMatrix();
@ -50,7 +50,7 @@ public class RenderBarrel implements ISimpleBlockRenderingHandler {
} }
tessellator.addTranslation(x + 0.5F, y, z + 0.5F); tessellator.addTranslation(x + 0.5F, y, z + 0.5F);
ObjUtil.renderWithIcon((HFRWavefrontObject) ResourceManager.barrel, iicon, tessellator, 0, true); ObjUtil.renderPartWithIcon((HFRWavefrontObject) ResourceManager.barrel, "Barrel", iicon, tessellator, 0, true);
tessellator.addTranslation(-x - 0.5F, -y, -z - 0.5F); tessellator.addTranslation(-x - 0.5F, -y, -z - 0.5F);
return true; return true;

View File

@ -2,10 +2,13 @@ package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.fluid.FluidType; import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids; import com.hbm.inventory.fluid.Fluids;
import com.hbm.render.util.DiamondPronter; import com.hbm.render.util.DiamondPronter;
import com.hbm.render.util.EnumSymbol; import com.hbm.render.util.EnumSymbol;
import com.hbm.lib.Library;
import com.hbm.main.ResourceManager;
import com.hbm.tileentity.machine.storage.TileEntityBarrel; import com.hbm.tileentity.machine.storage.TileEntityBarrel;
import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.RenderHelper;
@ -21,6 +24,7 @@ public class RenderFluidBarrel extends TileEntitySpecialRenderer {
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_LIGHTING);
if(te instanceof TileEntityBarrel) { if(te instanceof TileEntityBarrel) {
TileEntityBarrel barrel = (TileEntityBarrel)te; TileEntityBarrel barrel = (TileEntityBarrel)te;
@ -28,7 +32,6 @@ public class RenderFluidBarrel extends TileEntitySpecialRenderer {
if(type != Fluids.NONE) { if(type != Fluids.NONE) {
RenderHelper.disableStandardItemLighting();
GL11.glPushMatrix(); GL11.glPushMatrix();
int poison = type.poison; int poison = type.poison;
@ -36,16 +39,63 @@ public class RenderFluidBarrel extends TileEntitySpecialRenderer {
int reactivity = type.reactivity; int reactivity = type.reactivity;
EnumSymbol symbol = type.symbol; EnumSymbol symbol = type.symbol;
int cx = te.xCoord;
int cy = te.yCoord;
int cz = te.zCoord;
if(te.getBlockType() == ModBlocks.barrel_plastic)
bindTexture(ResourceManager.barrel_plastic_tex);
else if(te.getBlockType() == ModBlocks.barrel_steel)
bindTexture(ResourceManager.barrel_steel_tex);
else if(te.getBlockType() == ModBlocks.barrel_tcalloy)
bindTexture(ResourceManager.barrel_tcalloy_tex);
else if(te.getBlockType() == ModBlocks.barrel_antimatter)
bindTexture(ResourceManager.barrel_antimatter_tex);
if(Library.canConnectFluid(te.getWorldObj(), cx + 1, cy, cz, Library.POS_X, type)) {
GL11.glTranslatef(0.0F, -0.5F, 0.0F);
GL11.glRotatef(0F, 0F, 0F, 0F);
ResourceManager.barrel.renderPart("Connector");
GL11.glTranslatef(0.0F, 0.5F, 0.0F);
}
if(Library.canConnectFluid(te.getWorldObj(), cx - 1, cy, cz, Library.NEG_X, type)) {
GL11.glRotatef(180, 0F, 1F, 0F);
GL11.glTranslatef(0.0F, -0.5F, 0.0F);
ResourceManager.barrel.renderPart("Connector");
GL11.glTranslatef(0.0F, 0.5F, 0.0F);
GL11.glRotatef(-180, 0F, 1F, 0F);
}
if(Library.canConnectFluid(te.getWorldObj(), cx, cy, cz - 1, Library.NEG_Z, type)) {
GL11.glRotatef(90, 0F, 1F, 0F);
GL11.glTranslatef(0.0F, -0.5F, 0.0F);
ResourceManager.barrel.renderPart("Connector");
GL11.glTranslatef(0.0F, 0.5F, 0.0F);
GL11.glRotatef(-90, 0F, 1F, 0F);
}
if(Library.canConnectFluid(te.getWorldObj(), cx, cy, cz + 1, Library.POS_Z, type)) {
GL11.glRotatef(-90, 0F, 1F, 0F);
GL11.glTranslatef(0.0F, -0.5F, 0.0F);
ResourceManager.barrel.renderPart("Connector");
GL11.glTranslatef(0.0F, 0.5F, 0.0F);
GL11.glRotatef(90, 0F, 1F, 0F);
}
RenderHelper.disableStandardItemLighting();
for(int j = 0; j < 4; j++) { for(int j = 0; j < 4; j++) {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(0.4, 0.25, -0.15); GL11.glTranslated(0.4, 0.30, -0.24);
GL11.glScalef(1.0F, 0.35F, 0.35F); GL11.glScalef(1.0F, 0.25F, 0.25F);
DiamondPronter.pront(poison, flammability, reactivity, symbol); DiamondPronter.pront(poison, flammability, reactivity, symbol);
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glRotatef(90, 0, 1, 0); GL11.glRotatef(90, 0, 1, 0);
} }
GL11.glPopMatrix(); GL11.glPopMatrix();
RenderHelper.enableStandardItemLighting(); RenderHelper.enableStandardItemLighting();
} }

View File

@ -1,13 +1,58 @@
# Blender v2.76 (sub 0) OBJ File: 'barrel.blend' # Blender v2.82 (sub 7) OBJ File: 'barrel.blend'
# www.blender.org # www.blender.org
o Cube_Cube.001 mtllib barrel.mtl
v -0.375000 0.000000 0.375000 o Connector
v -0.375000 1.000000 0.375000 v 0.500000 0.687500 0.187500
v -0.375000 0.000000 -0.375000 v 0.500000 0.312500 -0.187500
v -0.375000 1.000000 -0.375000 v 0.500000 0.687500 -0.187500
v 0.375000 0.000000 0.375000 v 0.375000 0.312500 -0.187500
v 0.375000 0.687500 0.187500
v 0.375000 0.687500 -0.187500
v 0.375000 0.312500 0.187500
v 0.500000 0.312500 0.187500
vt 0.145833 0.270833
vt 0.020833 0.395833
vt 0.020833 0.270833
vt 0.020833 0.375000
vt 0.000000 0.250000
vt 0.020833 0.250000
vt 0.166667 0.395833
vt 0.041667 0.416667
vt 0.041667 0.395833
vt 0.145833 0.291667
vt 0.166667 0.416667
vt 0.145833 0.416667
vt 0.000000 0.270833
vt 0.125000 0.250000
vt 0.125000 0.270833
vt 0.145833 0.395833
vt -0.000000 0.375000
vt 0.166667 0.291667
vn 1.0000 0.0000 0.0000
vn 0.0000 0.0000 1.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 -0.0000 -1.0000
vn 0.0000 -1.0000 0.0000
usemtl Default_OBJ
s 1
f 1/1/1 2/2/1 3/3/1
f 1/4/2 7/5/2 8/6/2
f 3/7/3 5/8/3 1/9/3
f 2/10/4 6/11/4 3/12/4
f 8/13/5 4/14/5 2/15/5
f 1/1/1 8/16/1 2/2/1
f 1/4/2 5/17/2 7/5/2
f 3/7/3 6/11/3 5/8/3
f 2/10/4 4/18/4 6/11/4
f 8/13/5 7/5/5 4/14/5
o Barrel
v 0.375000 1.000000 0.375000 v 0.375000 1.000000 0.375000
v 0.375000 0.000000 -0.375000 v 0.375000 0.000000 0.375000
v 0.375000 -0.000000 -0.375000
v -0.375000 1.000000 0.375000
v -0.375000 0.000000 0.375000
v -0.375000 1.000000 -0.375000
v -0.375000 -0.000000 -0.375000
v 0.375000 1.000000 -0.375000 v 0.375000 1.000000 -0.375000
vt 0.000000 0.750000 vt 0.000000 0.750000
vt 0.000000 0.416667 vt 0.000000 0.416667
@ -18,26 +63,32 @@ vt 1.000000 0.416667
vt 0.500000 0.750000 vt 0.500000 0.750000
vt 0.500000 0.416667 vt 0.500000 0.416667
vt 0.250000 0.750000 vt 0.250000 0.750000
vt 0.750000 0.750000
vt 0.750000 1.000000 vt 0.750000 1.000000
vt 0.500000 1.000000 vt 0.500000 1.000000
vt 0.500000 0.750000
vt 0.500000 1.000000
vt 0.250000 1.000000 vt 0.250000 1.000000
vt 1.000000 0.750000 vt 1.000000 0.750000
vn -1.000000 0.000000 0.000000 vt 0.500000 0.750000
vn 0.000000 0.000000 -1.000000 vt 0.250000 0.750000
vn 1.000000 0.000000 0.000000 vn 1.0000 0.0000 0.0000
vn 0.000000 0.000000 1.000000 vn 0.0000 0.0000 1.0000
vn 0.000000 -1.000000 0.000000 vn -1.0000 0.0000 0.0000
vn 0.000000 1.000000 0.000000 vn 0.0000 -0.0000 -1.0000
s off vn 0.0000 -1.0000 0.0000
f 4/1/1 3/2/1 1/3/1 vn 0.0000 1.0000 -0.0000
f 8/4/2 7/5/2 3/6/2 usemtl Default_OBJ
f 6/7/3 5/8/3 7/5/3 s 1
f 2/9/4 1/3/4 5/8/4 f 9/19/6 10/20/6 11/21/6
f 3/4/5 7/10/5 5/11/5 f 12/22/7 13/23/7 10/24/7
f 8/7/6 4/11/6 2/12/6 f 14/25/8 15/26/8 13/23/8
f 2/9/1 4/1/1 1/3/1 f 16/27/9 11/21/9 15/26/9
f 4/13/2 8/4/2 3/6/2 f 10/28/10 13/29/10 15/30/10
f 8/4/3 6/7/3 7/5/3 f 12/31/11 9/32/11 16/33/11
f 6/7/4 2/9/4 5/8/4 f 16/27/6 9/19/6 11/21/6
f 1/7/5 3/4/5 5/11/5 f 9/34/7 12/22/7 10/24/7
f 6/9/6 8/7/6 2/12/6 f 12/22/8 14/25/8 13/23/8
f 14/25/9 16/27/9 15/26/9
f 11/35/10 10/28/10 15/30/10
f 14/36/11 12/31/11 16/33/11

Binary file not shown.

Before

Width:  |  Height:  |  Size: 966 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 926 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 877 B

After

Width:  |  Height:  |  Size: 1.1 KiB