silo hatch

This commit is contained in:
Bob 2024-01-18 21:37:22 +01:00
parent 2d80856d5f
commit aa6d0708cd
6 changed files with 423 additions and 3 deletions

View File

@ -602,6 +602,7 @@ public class ModBlocks {
public static Block sliding_blast_door;
public static Block fire_door;
public static Block transition_seal;
public static Block silo_hatch;
// 1.12.2 Doors
public static Block secure_access_door;
@ -2115,6 +2116,7 @@ public class ModBlocks {
sliding_blast_door = new BlockDoorGeneric(Material.iron, DoorDecl.SLIDE_DOOR).setBlockName("sliding_blast_door").setHardness(10.0F).setResistance(750.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":sliding_blast_door");
fire_door = new BlockDoorGeneric(Material.iron, DoorDecl.FIRE_DOOR).setBlockName("fire_door").setHardness(10.0F).setResistance(1_000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fire_door");
transition_seal = new BlockDoorGeneric(Material.iron, DoorDecl.TRANSITION_SEAL).setBlockName("transition_seal").setHardness(10.0F).setResistance(1_000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":transition_seal");
silo_hatch = new BlockDoorGeneric(Material.iron, DoorDecl.SILO_HATCH).setBlockName("silo_hatch").setHardness(10.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
secure_access_door = new BlockDoorGeneric(Material.iron, DoorDecl.SECURE_ACCESS_DOOR).setBlockName("secure_access_door").setHardness(20.0F).setResistance(2_000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
large_vehicle_door = new BlockDoorGeneric(Material.iron, DoorDecl.LARGE_VEHICLE_DOOR).setBlockName("large_vehicle_door").setHardness(10.0F).setResistance(1_000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
qe_containment = new BlockDoorGeneric(Material.iron, DoorDecl.QE_CONTAINMENT).setBlockName("qe_containment").setHardness(10.0F).setResistance(1_000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
@ -3052,6 +3054,7 @@ public class ModBlocks {
GameRegistry.registerBlock(blast_door, blast_door.getUnlocalizedName());
GameRegistry.registerBlock(fire_door, fire_door.getUnlocalizedName());
GameRegistry.registerBlock(transition_seal, transition_seal.getUnlocalizedName());
GameRegistry.registerBlock(silo_hatch, silo_hatch.getUnlocalizedName());
GameRegistry.registerBlock(sliding_blast_door, sliding_blast_door.getUnlocalizedName());
//Doors

View File

@ -43,7 +43,7 @@ public class BlockDoorGeneric extends BlockDummyable {
@Override
public int getOffset(){
return 0;
return type.getBlockOffset();
}
@Override
@ -80,8 +80,8 @@ public class BlockDoorGeneric extends BlockDummyable {
Math.min(box.minX, box.maxX), Math.min(box.minY, box.maxY), Math.min(box.minZ, box.maxZ),
Math.max(box.minX, box.maxX), Math.max(box.minY, box.maxY), Math.max(box.minZ, box.maxZ));
if(box.minY == y && box.maxY == y)
return;
if(box.minY == y && box.maxY == y) return;
if(box.minX == box.maxX && box.minY == box.maxY && box.minZ == box.maxZ) return;
if(box != null && box.intersectsWith(entityBox)) {
collidingBoxes.add(box);
@ -91,6 +91,13 @@ public class BlockDoorGeneric extends BlockDummyable {
// return;
//super.addCollisionBoxesToList(worldIn, x, y, z, entityBox, collidingBoxes, entityIn);
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
AxisAlignedBB aabb = this.getBoundingBox(world, x, y, z);
if(aabb.minX == aabb.maxX && aabb.minY == aabb.maxY && aabb.minZ == aabb.maxZ) return null;
return aabb;
}
@Override //should fix AI pathfinding
public boolean getBlocksMovement(IBlockAccess world, int x, int y, int z) { //btw the method name is the exact opposite of that it's doing, check net.minecraft.pathfinding.PathNavigate#512

View File

@ -349,6 +349,9 @@ public class ResourceManager {
public static WavefrontObjDisplayList large_vehicle_door = new WavefrontObjDisplayList(new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/doors/large_vehicle_door.obj")));
public static final ResourceLocation qe_containment_decal = new ResourceLocation(RefStrings.MODID, "textures/models/doors/qe_containment_decal.png");
public static final ResourceLocation silo_hatch_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/silo_hatch.png");
public static WavefrontObjDisplayList silo_hatch = new WavefrontObjDisplayList(new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/doors/silo_hatch.obj")));
//Lantern
public static final IModelCustom lantern = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/trinkets/lantern.obj"));

View File

@ -862,6 +862,65 @@ public abstract class DoorDecl {
};
public static final DoorDecl SILO_HATCH = new DoorDecl() {
@Override public String getOpenSoundEnd() { return "hbm:door.wgh_big_stop"; };
@Override public String getOpenSoundLoop() { return "hbm:door.wgh_big_start"; };
@Override public String getOpenSoundStart() { return null; };
@Override public String getCloseSoundStart() { return null; };
@Override public String getCloseSoundEnd() { return "hbm:door.wgh_big_stop"; };
@Override public float getSoundVolume() { return 2; }
@Override
@SideOnly(Side.CLIENT)
public void getTranslation(String partName, float openTicks, boolean child, float[] trans) {
if("Hatch".equals(partName)) {
set(trans, 0, 0.25F * Library.smoothstep(getNormTime(openTicks, 0, 10), 0, 1), 0);
} else {
set(trans, 0, 0, 0);
}
};
@Override
@SideOnly(Side.CLIENT)
public void getOrigin(String partName, float[] orig) {
if("Hatch".equals(partName)) {
set(orig, 0F, 0.875F, -1.875F);
return;
}
set(orig, 0, 0, 0);
super.getOrigin(partName, orig);
};
@Override
@SideOnly(Side.CLIENT)
public void getRotation(String partName, float openTicks, float[] rot) {
if("Hatch".equals(partName)) {
set(rot, Library.smoothstep(getNormTime(openTicks, 20, 100), 0, 1) * -240, 0, 0);
return;
}
super.getRotation(partName, openTicks, rot);
};
@Override
@SideOnly(Side.CLIENT)
public boolean doesRender(String partName, boolean child) {
return true;
};
@Override public int timeToOpen() { return 60; };
@Override public int[][] getDoorOpenRanges() { return new int[][] { { 1, 0, 1, -3, 3, 0 }, { 0, 0, 1, -3, 3, 0 }, { -1, 0, 1, -3, 3, 0 } }; }
@Override public float getDoorRangeOpenTime(int ticks, int idx) { return getNormTime(ticks, 20, 20); };
@Override public int getBlockOffset() { return 2; }
@Override public int[] getDimensions() { return new int[] { 0, 0, 2, 2, 2, 2 }; }
@Override @SideOnly(Side.CLIENT) public ResourceLocation getTextureForPart(String partName) { return ResourceManager.silo_hatch_tex; }
@Override public ResourceLocation getTextureForPart(int skinIndex, String partName) { return ResourceManager.silo_hatch_tex; }
@Override @SideOnly(Side.CLIENT) public WavefrontObjDisplayList getModel() { return ResourceManager.silo_hatch; }
};
public static final DoorDecl LARGE_VEHICLE_DOOR = new DoorDecl() {
@Override
@ -948,6 +1007,10 @@ public abstract class DoorDecl {
public abstract int[][] getDoorOpenRanges();
public abstract int[] getDimensions();
public int getBlockOffset() {
return 0;
}
public float getDoorRangeOpenTime(int ticks, int idx) {
return getNormTime(ticks);

View File

@ -0,0 +1,344 @@
# Blender v2.79 (sub 0) OBJ File: 'silo_hatch.blend'
# www.blender.org
o Hatch
v -1.750000 0.750000 1.750000
v 1.750000 0.750000 1.750000
v -1.750000 0.750000 -1.750000
v 1.750000 0.750000 -1.750000
v -1.750000 1.000000 -1.750000
v -1.750000 1.000000 1.750000
v 1.750000 1.000000 1.750000
v 1.750000 1.000000 -1.750000
v -1.500000 0.750000 -1.500000
v -1.500000 0.750000 1.500000
v 1.500000 0.750000 1.500000
v 1.500000 0.750000 -1.500000
v -1.500000 0.500000 -1.500000
v -1.500000 0.500000 1.500000
v 1.500000 0.500000 1.500000
v 1.500000 0.500000 -1.500000
v -1.000000 0.750000 -1.500000
v 1.000000 0.750000 -1.500000
v -1.000000 0.750000 -2.000000
v 1.000000 0.750000 -2.000000
v -1.000000 0.500000 -2.000000
v -1.000000 0.500000 -1.500000
v 1.000000 0.500000 -1.500000
v 1.000000 0.500000 -2.000000
vt 0.588235 0.333333
vt 0.970588 0.309524
vt 1.000000 0.333333
vt 1.000000 0.357143
vt 0.588235 0.690476
vt 0.588235 0.357143
vt 1.000000 0.333333
vt 0.588235 0.357143
vt 0.588235 0.333333
vt 1.000000 0.333333
vt 0.588235 0.357143
vt 0.588235 0.333333
vt 1.000000 0.333333
vt 0.588235 0.357143
vt 0.588235 0.333333
vt 0.970588 0.309524
vt 0.970588 0.309524
vt 0.970588 0.309524
vt 0.617647 0.309524
vt 0.970588 0.285714
vt 0.617647 0.309524
vt 0.970588 0.285714
vt 0.617647 0.309524
vt 0.970588 0.285714
vt 0.617647 0.309524
vt 0.970588 0.285714
vt 0.970588 0.000000
vt 0.617647 0.285714
vt 0.617647 -0.000000
vt 0.852941 0.809524
vt 0.617647 0.761905
vt 0.852941 0.761905
vt 0.617647 0.738095
vt 0.852941 0.690476
vt 0.852941 0.738095
vt 0.558824 0.761905
vt 0.911765 0.738095
vt 0.911765 0.761905
vt 1.000000 0.690476
vt 1.000000 0.357143
vt 1.000000 0.357143
vt 1.000000 0.357143
vt 0.617647 0.285714
vt 0.617647 0.285714
vt 0.617647 0.285714
vt 0.617647 0.809524
vt 0.617647 0.690476
vt 0.558824 0.738095
vn 0.0000 -1.0000 0.0000
vn 0.0000 1.0000 0.0000
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 1/1/1 11/2/1 2/3/1
f 7/4/2 5/5/2 6/6/2
f 3/7/3 8/8/3 4/9/3
f 2/3/4 6/6/4 1/1/4
f 4/10/5 7/11/5 2/12/5
f 1/13/6 5/14/6 3/15/6
f 2/12/1 12/16/1 4/10/1
f 4/9/1 9/17/1 3/7/1
f 3/15/1 10/18/1 1/13/1
f 11/19/5 16/20/5 12/16/5
f 9/21/6 14/22/6 10/18/6
f 12/23/3 13/24/3 9/17/3
f 10/25/4 15/26/4 11/2/4
f 16/27/1 14/28/1 13/29/1
f 17/30/2 20/31/2 19/32/2
f 24/33/1 22/34/1 21/35/1
f 18/36/5 24/33/5 20/31/5
f 20/31/3 21/35/3 19/32/3
f 19/32/6 22/37/6 17/38/6
f 1/1/1 10/25/1 11/2/1
f 7/4/2 8/39/2 5/5/2
f 3/7/3 5/40/3 8/8/3
f 2/3/4 7/4/4 6/6/4
f 4/10/5 8/41/5 7/11/5
f 1/13/6 6/42/6 5/14/6
f 2/12/1 11/19/1 12/16/1
f 4/9/1 12/23/1 9/17/1
f 3/15/1 9/21/1 10/18/1
f 11/19/5 15/43/5 16/20/5
f 9/21/6 13/44/6 14/22/6
f 12/23/3 16/45/3 13/24/3
f 10/25/4 14/28/4 15/26/4
f 16/27/1 15/26/1 14/28/1
f 17/30/2 18/46/2 20/31/2
f 24/33/1 23/47/1 22/34/1
f 18/36/5 23/48/5 24/33/5
f 20/31/3 24/33/3 21/35/3
f 19/32/6 21/35/6 22/37/6
o Frame
v -2.500000 0.000000 2.500000
v 2.500000 0.000000 2.500000
v -2.500000 0.000000 -2.500000
v 2.500000 0.000000 -2.500000
v -2.500000 0.250000 2.500000
v 2.500000 0.250000 2.500000
v -2.500000 0.250000 -2.500000
v 2.500000 0.250000 -2.500000
v -2.250000 1.000000 2.250000
v 2.250000 1.000000 2.250000
v -2.250000 1.000000 -2.250000
v 2.250000 1.000000 -2.250000
v -1.500000 0.000000 1.500000
v 1.500000 0.000000 1.500000
v -1.500000 0.000000 -1.500000
v 1.500000 0.000000 -1.500000
v -1.500000 0.750000 -1.500000
v -1.500000 0.750000 1.500000
v 1.500000 0.750000 1.500000
v 1.500000 0.750000 -1.500000
v -1.750000 0.750000 1.750000
v 1.750000 0.750000 1.750000
v -1.750000 0.750000 -1.750000
v 1.750000 0.750000 -1.750000
v -1.750000 1.000000 1.750000
v 1.750000 1.000000 1.750000
v -1.750000 1.000000 -1.750000
v 1.750000 1.000000 -1.750000
v -1.000000 0.750000 -1.750000
v 1.000000 0.750000 -1.750000
v 1.000000 0.500000 -1.500000
v -1.000000 0.500000 -1.500000
v -1.000000 1.000000 -1.750000
v 1.000000 1.000000 -1.750000
v -1.000000 1.000000 -2.000000
v 1.000000 1.000000 -2.000000
v -1.000000 0.500000 -2.000000
v 1.000000 0.500000 -2.000000
v -1.000000 0.750000 -1.500000
v 1.000000 0.750000 -1.500000
vt 0.117647 0.761905
vt 0.470588 0.761905
vt 0.176471 0.809524
vt 0.588235 0.500000
vt 0.029412 0.571429
vt -0.000000 0.500000
vt 0.588235 0.476190
vt 0.000000 0.500000
vt 0.000000 0.476190
vt 0.588235 0.476190
vt -0.000000 0.476190
vt 0.588235 0.476190
vt -0.000000 0.500000
vt -0.000000 0.476190
vt 0.588235 0.476190
vt -0.000000 0.500000
vt -0.000000 0.476190
vt 0.470588 0.380952
vt 0.588235 0.500000
vt 0.029412 0.571429
vt 0.588235 0.500000
vt 0.029412 0.571429
vt 0.588235 0.500000
vt 0.029412 0.571429
vt 0.000000 0.000000
vt 0.117647 0.380952
vt 0.470588 0.833333
vt 0.117647 0.761905
vt 0.470588 0.761905
vt 0.470588 0.833333
vt 0.117647 0.761905
vt 0.470588 0.761905
vt 0.470588 0.833333
vt 0.117647 0.761905
vt 0.470588 0.761905
vt 0.470588 0.095238
vt 0.588235 0.000000
vt 0.117647 0.095238
vt 0.088235 0.857143
vt 0.117647 0.833333
vt 0.088235 0.857143
vt 0.117647 0.833333
vt 0.176471 0.857143
vt 0.117647 0.833333
vt 0.176471 0.833333
vt 0.088235 0.857143
vt 0.117647 0.833333
vt 0.500000 0.857143
vt 0.088235 0.880952
vt 0.500000 0.857143
vt 0.088235 0.880952
vt 0.500000 0.857143
vt 0.088235 0.880952
vt 0.500000 0.619048
vt 0.558824 0.571429
vt 0.500000 0.952381
vt 0.558824 1.000000
vt 0.176471 0.928571
vt 0.411765 0.976190
vt 0.176471 0.976190
vt 0.088235 0.619048
vt 0.029412 1.000000
vt 0.176471 0.880952
vt 0.411765 0.928571
vt 0.117647 0.928571
vt 0.117647 0.904762
vt 0.147059 0.904762
vt 0.176471 0.880952
vt 0.088235 0.857143
vt 0.500000 0.857143
vt 0.411765 0.880952
vt 0.411765 0.857143
vt 0.470588 0.833333
vt 0.411765 0.833333
vt 0.441176 0.904762
vt 0.470588 0.928571
vt 0.411765 0.809524
vt 0.558824 0.571429
vt 0.558824 0.571429
vt 0.558824 0.571429
vt 0.500000 0.880952
vt 0.500000 0.880952
vt 0.500000 0.880952
vt 0.088235 0.952381
vt 0.411765 0.880952
vt 0.147059 0.880952
vt 0.088235 0.880952
vt 0.500000 0.880952
vt 0.176471 0.952381
vt 0.411765 0.952381
vt 0.441176 0.880952
vt 0.470588 0.904762
vn 0.0000 0.0000 1.0000
vn 0.9487 0.3162 0.0000
vn 1.0000 0.0000 0.0000
vn -1.0000 0.0000 0.0000
vn 0.0000 0.0000 -1.0000
vn 0.0000 -1.0000 0.0000
vn -0.9487 0.3162 0.0000
vn 0.0000 0.3162 -0.9487
vn 0.0000 0.3162 0.9487
vn 0.0000 1.0000 0.0000
s off
f 39/49/7 40/50/7 56/51/7
f 32/52/8 34/53/8 30/54/8
f 26/55/7 29/56/7 25/57/7
f 28/58/9 30/54/9 26/59/9
f 25/60/10 31/61/10 27/62/10
f 27/63/11 32/64/11 28/65/11
f 25/57/12 38/66/12 26/55/12
f 29/67/13 35/68/13 31/61/13
f 31/69/14 36/70/14 32/64/14
f 30/71/15 33/72/15 29/56/15
f 27/73/12 37/74/12 25/57/12
f 42/75/11 38/76/11 37/77/11
f 43/78/10 40/79/10 38/80/10
f 41/81/9 37/82/9 39/83/9
f 26/55/12 40/84/12 28/85/12
f 28/85/12 39/86/12 27/73/12
f 42/75/16 46/87/16 43/88/16
f 43/78/16 48/89/16 44/90/16
f 53/91/16 41/92/16 63/93/16
f 41/81/16 45/94/16 42/95/16
f 45/96/11 50/97/11 46/87/11
f 46/98/10 52/99/10 48/89/10
f 47/100/9 49/101/9 45/94/9
f 50/102/16 33/72/16 34/103/16
f 52/104/16 34/103/16 36/105/16
f 61/106/7 60/107/7 59/108/7
f 49/109/16 35/110/16 33/72/16
f 56/111/16 62/112/16 61/106/16
f 59/113/9 57/114/9 53/115/9
f 57/116/7 47/117/7 53/91/7
f 48/118/7 58/119/7 54/120/7
f 35/110/16 60/107/16 36/105/16
f 44/121/16 54/120/16 64/122/16
f 54/123/10 60/124/10 62/112/10
f 63/93/7 41/92/7 56/51/7
f 41/92/7 39/49/7 56/51/7
f 40/50/7 44/121/7 55/125/7
f 44/121/7 64/122/7 55/125/7
f 40/50/7 55/125/7 56/51/7
f 32/52/8 36/126/8 34/53/8
f 26/55/7 30/71/7 29/56/7
f 28/58/9 32/52/9 30/54/9
f 25/60/10 29/67/10 31/61/10
f 27/63/11 31/69/11 32/64/11
f 25/57/12 37/74/12 38/66/12
f 29/67/13 33/127/13 35/68/13
f 31/69/14 35/128/14 36/70/14
f 30/71/15 34/103/15 33/72/15
f 27/73/12 39/86/12 37/74/12
f 42/75/11 43/88/11 38/76/11
f 43/78/10 44/90/10 40/79/10
f 41/81/9 42/95/9 37/82/9
f 26/55/12 38/66/12 40/84/12
f 28/85/12 40/84/12 39/86/12
f 42/75/16 45/96/16 46/87/16
f 43/78/16 46/98/16 48/89/16
f 53/91/16 47/117/16 41/92/16
f 41/81/16 47/100/16 45/94/16
f 45/96/11 49/129/11 50/97/11
f 46/98/10 50/130/10 52/99/10
f 47/100/9 51/131/9 49/101/9
f 50/102/16 49/109/16 33/72/16
f 52/104/16 50/102/16 34/103/16
f 61/106/7 62/112/7 60/107/7
f 49/109/16 51/132/16 35/110/16
f 56/111/16 55/133/16 62/112/16
f 63/134/9 56/111/9 53/115/9
f 56/111/9 61/106/9 53/115/9
f 61/106/9 59/113/9 53/115/9
f 57/116/7 51/135/7 47/117/7
f 48/118/7 52/136/7 58/119/7
f 35/110/16 51/132/16 59/108/16
f 51/132/16 57/137/16 59/108/16
f 58/138/16 52/104/16 60/107/16
f 52/104/16 36/105/16 60/107/16
f 35/110/16 59/108/16 60/107/16
f 44/121/16 48/118/16 54/120/16
f 55/133/10 64/139/10 54/123/10
f 54/123/10 58/140/10 60/124/10
f 62/112/10 55/133/10 54/123/10

Binary file not shown.

After

Width:  |  Height:  |  Size: 851 B