cargo door addition

This commit is contained in:
FluffsADev 2026-06-14 20:16:23 -04:00
parent f4a509dd9d
commit 298b0beb33
7 changed files with 5882 additions and 16 deletions

View File

@ -578,7 +578,7 @@ public class ModBlocks {
public static Block seal_hatch;
public static Block cargo_elevator;
public static Block vault_door;
public static Block blast_door;
public static Block sliding_blast_door;
@ -595,6 +595,7 @@ public class ModBlocks {
public static Block round_airlock_door;
public static Block sliding_seal_door;
public static Block water_door;
public static Block cargo_door;
public static Block door_metal;
public static Block door_office;
@ -2019,7 +2020,7 @@ public class ModBlocks {
seal_hatch = new BlockHatch(Material.iron).setBlockName("seal_hatch").setHardness(Float.POSITIVE_INFINITY).setResistance(Float.POSITIVE_INFINITY).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":seal_hatch_3");
cargo_elevator = new BlockCargoElevator().setBlockName("cargo_elevator").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
vault_door = new BlockDoorGeneric(Material.iron, DoorDecl.VAULT_DOOR).setBlockName("vault_door").setHardness(10.0F).setResistance(1_000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":concrete");
blast_door = new BlastDoor(Material.iron).setBlockName("blast_door").setHardness(10.0F).setResistance(1_000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":blast_door");
@ -2035,6 +2036,7 @@ public class ModBlocks {
round_airlock_door = new BlockDoorGeneric(Material.iron, DoorDecl.ROUND_AIRLOCK_DOOR).setBlockName("round_airlock_door").setHardness(10.0F).setResistance(1_000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
sliding_seal_door = new BlockDoorGeneric(Material.iron, DoorDecl.SLIDING_SEAL_DOOR).setBlockName("sliding_seal_door").setHardness(10.0F).setResistance(1_000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
water_door = new BlockDoorGeneric(Material.iron, DoorDecl.WATER_DOOR).setBlockName("water_door").setHardness(5.0F).setResistance(50.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
cargo_door = new BlockDoorGeneric(Material.iron, DoorDecl.CARGO_DOOR).setBlockName("cargo_door").setHardness(20.0F).setResistance(2_000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
door_metal = new BlockModDoor(Material.iron).setBlockName("door_metal").setHardness(5.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":door_metal");
door_office = new BlockModDoor(Material.iron).setBlockName("door_office").setHardness(10.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":door_office");
@ -2943,7 +2945,7 @@ public class ModBlocks {
//Hooh
GameRegistry.registerBlock(cargo_elevator, cargo_elevator.getUnlocalizedName());
//Vault Door
GameRegistry.registerBlock(vault_door, vault_door.getUnlocalizedName());
GameRegistry.registerBlock(blast_door, blast_door.getUnlocalizedName());
@ -2965,6 +2967,7 @@ public class ModBlocks {
GameRegistry.registerBlock(round_airlock_door, round_airlock_door.getUnlocalizedName());
GameRegistry.registerBlock(sliding_seal_door, sliding_seal_door.getUnlocalizedName());
GameRegistry.registerBlock(water_door, water_door.getUnlocalizedName());
GameRegistry.registerBlock(cargo_door, cargo_door.getUnlocalizedName());
//Crates
register(crate_iron, ItemBlockStorageCrate.class);

View File

@ -362,13 +362,15 @@ public class ResourceManager {
public static final ResourceLocation pheo_label_106 = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/vault/label_106.png");
public static final ResourceLocation pheo_label_111 = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/vault/label_111.png");
public static IModelCustomNamed pheo_vault_door = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/pheodoors/vault_door.obj")).asVBO();
public static IModelCustomNamed pheo_cargo_door = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/pheodoors/cargo_door.obj")).asVBO();
public static final ResourceLocation pheo_cargo_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/cargo_door.png");
//Doors
public static final ResourceLocation silo_hatch_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/silo_hatch.png");
public static IModelCustomNamed silo_hatch = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/doors/silo_hatch.obj")).asVBO();
public static final ResourceLocation silo_hatch_large_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/silo_hatch_large.png");
public static IModelCustomNamed silo_hatch_large = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/doors/silo_hatch_large.obj")).asVBO();
//Vending Machine
public static final IModelCustom vending_machine = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/vending_machine.obj")).noSmooth().asVBO();
@ -784,7 +786,7 @@ public class ResourceManager {
//Elevator
public static final ResourceLocation cargo_elevator_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/elevator.png");
//Vault Door
public static final ResourceLocation vault_cog_tex = new ResourceLocation(RefStrings.MODID, "textures/models/vault_cog.png");
public static final ResourceLocation vault_frame_tex = new ResourceLocation(RefStrings.MODID, "textures/models/vault_frame.png");
@ -859,7 +861,7 @@ public class ResourceManager {
//Pipes
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");
//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");

View File

@ -33,7 +33,7 @@ public class ItemRenderLibraryDoors {
ResourceLocation doorTex = ResourceManager.pheo_vault_door_3;
ResourceLocation labelTex = ResourceManager.pheo_label_101;
switch(index) {
case 1: labelTex = ResourceManager.pheo_label_87; break;
case 2: labelTex = ResourceManager.pheo_label_106; break;
@ -42,14 +42,14 @@ public class ItemRenderLibraryDoors {
case 5: doorTex = ResourceManager.pheo_vault_door_s; labelTex = ResourceManager.pheo_label_2; break;
case 6: doorTex = ResourceManager.pheo_vault_door_s; labelTex = ResourceManager.pheo_label_99; break;
}
bindTexture(doorTex);
ResourceManager.pheo_vault_door.renderPart("Door");
bindTexture(labelTex);
ResourceManager.pheo_vault_door.renderPart("Label");
}
});
ItemRenderLibrary.renderers.put(Item.getItemFromBlock(ModBlocks.secure_access_door), new ItemRenderBase(){
public void renderInventory() {
GL11.glTranslated(0, -3.75, 0);
@ -63,7 +63,7 @@ public class ItemRenderLibraryDoors {
GL11.glShadeModel(GL11.GL_FLAT);
}
});
ItemRenderLibrary.renderers.put(Item.getItemFromBlock(ModBlocks.fire_door), new ItemRenderBase(){
public void renderInventory() {
GL11.glTranslated(0, -3, 0);
@ -77,7 +77,7 @@ public class ItemRenderLibraryDoors {
GL11.glShadeModel(GL11.GL_FLAT);
}
});
ItemRenderLibrary.renderers.put(Item.getItemFromBlock(ModBlocks.sliding_blast_door), new ItemRenderBase(){
public void renderInventory() {
GL11.glTranslated(0, -2.75, 0);
@ -104,7 +104,7 @@ public class ItemRenderLibraryDoors {
GL11.glShadeModel(GL11.GL_FLAT);
}
});
ItemRenderLibrary.renderers.put(Item.getItemFromBlock(ModBlocks.water_door), new ItemRenderBase(){
public void renderInventory() {
GL11.glTranslated(0, -4, 0);
@ -118,7 +118,7 @@ public class ItemRenderLibraryDoors {
GL11.glShadeModel(GL11.GL_FLAT);
}
});
ItemRenderLibrary.renderers.put(Item.getItemFromBlock(ModBlocks.silo_hatch), new ItemRenderBase(){
public void renderInventory() {
GL11.glTranslated(0, -2, 0);
@ -137,7 +137,7 @@ public class ItemRenderLibraryDoors {
GL11.glShadeModel(GL11.GL_FLAT);
}
});
ItemRenderLibrary.renderers.put(Item.getItemFromBlock(ModBlocks.silo_hatch_large), new ItemRenderBase(){
public void renderInventory() {
GL11.glTranslated(0, -2, 0);
@ -157,7 +157,7 @@ public class ItemRenderLibraryDoors {
GL11.glShadeModel(GL11.GL_FLAT);
}
});
ItemRenderLibrary.renderers.put(Item.getItemFromBlock(ModBlocks.qe_containment), new ItemRenderBase(){
public void renderInventory() {
GL11.glTranslated(0, -3.5, 0);
@ -170,7 +170,7 @@ public class ItemRenderLibraryDoors {
GL11.glShadeModel(GL11.GL_FLAT);
}
});
ItemRenderLibrary.renderers.put(Item.getItemFromBlock(ModBlocks.qe_sliding_door), new ItemRenderBase(){
public void renderInventory() {
GL11.glTranslated(0, -3, 0);
@ -221,6 +221,21 @@ public class ItemRenderLibraryDoors {
bindTexture(ResourceManager.blast_door_slider_tex); ResourceManager.blast_door_slider.renderAll();
bindTexture(ResourceManager.blast_door_block_tex); ResourceManager.blast_door_block.renderAll();
}});
ItemRenderLibrary.renderers.put(Item.getItemFromBlock(ModBlocks.cargo_door), new ItemRenderBase(){
public void renderInventory() {
GL11.glTranslated(0, -3.75, 0);
GL11.glScaled(2.4, 2.4, 2.4);
}
public void renderCommon() {
bindTexture(ResourceManager.pheo_cargo_door_tex);
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glTranslated(0, 1, 0);
ResourceManager.pheo_cargo_door.renderPart("Frame");
ResourceManager.pheo_cargo_door.renderPart("DoorTop");
ResourceManager.pheo_cargo_door.renderPart("DoorBot");
GL11.glShadeModel(GL11.GL_FLAT);
}
});
}
private static void bindTexture(ResourceLocation res) {

View File

@ -0,0 +1,55 @@
package com.hbm.render.tileentity.door;
import java.nio.DoubleBuffer;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import com.hbm.tileentity.DoorDecl;
import com.hbm.tileentity.TileEntityDoorGeneric;
import net.minecraft.client.Minecraft;
import net.minecraft.util.MathHelper;
public class RenderCargoDoor implements IRenderDoors {
public static final RenderCargoDoor INSTANCE = new RenderCargoDoor();
@Override
public void render(TileEntityDoorGeneric door, DoubleBuffer buf) {
Minecraft.getMinecraft().getTextureManager().bindTexture(DoorDecl.CARGO_DOOR.getSkinFromIndex(door.getSkinIndex()));
double botMove = 0;
double topMove = 0;
if (door.state == door.STATE_OPEN) {
botMove = 2.0;
topMove = 1.0;
}
if (door.currentAnimation != null) {
double botProgress = MathHelper.clamp_double(IRenderDoors.getRelevantTransformation("BOT", door.currentAnimation)[1], 0, 1);
double topProgress = MathHelper.clamp_double(IRenderDoors.getRelevantTransformation("TOP", door.currentAnimation)[1], 0, 1);
botMove = botProgress * 2.0;
topMove = topProgress * 1.0;
}
GL11.glPushMatrix();
GL11.glTranslated(0, 0, 0);
ResourceManager.pheo_cargo_door.renderPart("Frame");
GL11.glPushMatrix();
GL11.glTranslated(0, topMove, 0);
ResourceManager.pheo_cargo_door.renderPart("DoorTop");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, botMove, 0);
ResourceManager.pheo_cargo_door.renderPart("DoorBot");
GL11.glPopMatrix();
GL11.glPopMatrix();
}
}

View File

@ -641,6 +641,56 @@ public abstract class DoorDecl {
};
public static final DoorDecl CARGO_DOOR = new DoorDecl() {
@Override public String getCloseSoundLoop() { return "hbm:door.garage_move"; }
@Override public String getCloseSoundEnd() { return "hbm:door.garage_stop"; }
@Override public String getOpenSoundEnd() { return "hbm:door.garage_stop"; }
@Override public String getOpenSoundLoop() { return "hbm:door.garage_move"; }
@Override public float getSoundVolume() { return 2; }
@Override
public IRenderDoors getSEDNARenderer() {
return RenderCargoDoor.INSTANCE;
}
@Override
public BusAnimation getBusAnimation(byte state, byte skinIndex) {
int half = this.timeToOpen() * 25;
if(state == TileEntityDoorGeneric.STATE_OPENING) return new BusAnimation()
.addBus("BOT", new BusAnimationSequence().setPos(0, 0, 0).addPos(0, 1, 0, half * 2))
.addBus("TOP", new BusAnimationSequence().setPos(0, 0, 0).addPos(0, 0, 0, half).addPos(0, 1, 0, half));
if(state == TileEntityDoorGeneric.STATE_CLOSING) return new BusAnimation()
.addBus("BOT", new BusAnimationSequence().setPos(0, 1, 0).addPos(0, 0, 0, half * 2))
.addBus("TOP", new BusAnimationSequence().setPos(0, 1, 0).addPos(0, 1, 0, half).addPos(0, 0, 0, half));
return null;
}
@Override public int timeToOpen() { return 120; }
@Override public int[][] getDoorOpenRanges() { return new int[][] { { -1, -1, 0, 3, 3, 1 } }; }
@Override public int[] getDimensions() { return new int[] { 2, 0, 0, 0, 1, 1 }; }
@Override
public AxisAlignedBB getBlockBound(int x, int y, int z, boolean open, boolean forCollision) {
if(!open) return AxisAlignedBB.getBoundingBox(0, 0, 0.375, 1, 1, 0.625);
if(y > 1) return AxisAlignedBB.getBoundingBox(0, 0.25, 0.375, 1, 1, 0.625);
else if(y == 0) return AxisAlignedBB.getBoundingBox(0, 0, 0.375, 1, forCollision ? 0 : 0.125, 0.625);
return super.getBlockBound(x, y, z, open, forCollision);
}
public ResourceLocation[] skins;
@Override
public ResourceLocation[] getSEDNASkins() {
if(skins == null) skins = new ResourceLocation[] {
ResourceManager.pheo_cargo_door_tex
};
return skins;
}
@Override public int getSkinCount() { return 1; }
};
// TODO: bash drillgon to death for making this method like that, and for fucking up the documentation, like genuinely what the fuck is this
/** Format: x, y, z, tangent amount 1 (how long the door would be if it moved
up), tangent amount 2 (door places blocks in this direction), axis (0-x,

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB