feat: WE LOVE DOORS
@ -606,7 +606,15 @@ public class ModBlocks {
|
||||
public static Block sliding_blast_door;
|
||||
public static Block fire_door;
|
||||
public static Block transition_seal;
|
||||
|
||||
// 1.12.2 Doors
|
||||
public static Block secure_access_door;
|
||||
public static Block large_vehicle_door;
|
||||
public static Block qe_containment;
|
||||
public static Block qe_sliding_door;
|
||||
public static Block round_airlock_door;
|
||||
public static Block sliding_seal_door;
|
||||
public static Block water_door;
|
||||
|
||||
public static Block door_metal;
|
||||
public static Block door_office;
|
||||
@ -2144,6 +2152,12 @@ public class ModBlocks {
|
||||
fire_door = new BlockDoorGeneric(Material.iron, DoorDecl.FIRE_DOOR).setBlockName("fire_door").setHardness(10.0F).setResistance(10000.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(10000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":transition_seal");
|
||||
secure_access_door = new BlockDoorGeneric(Material.iron, DoorDecl.SECURE_ACCESS_DOOR).setBlockName("secure_access_door").setHardness(200.0F).setResistance(20000.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
large_vehicle_door = new BlockDoorGeneric(Material.iron, DoorDecl.LARGE_VEHICLE_DOOR).setBlockName("large_vehicle_door").setHardness(100.0F).setResistance(10000.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
qe_containment = new BlockDoorGeneric(Material.iron, DoorDecl.QE_CONTAINMENT).setBlockName("qe_containment").setHardness(100.0F).setResistance(10000.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
qe_sliding_door = new BlockDoorGeneric(Material.iron, DoorDecl.QE_SLIDING).setBlockName("qe_sliding_door").setHardness(100.0F).setResistance(10000.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
round_airlock_door = new BlockDoorGeneric(Material.iron, DoorDecl.ROUND_AIRLOCK_DOOR).setBlockName("round_airlock_door").setHardness(100.0F).setResistance(10000.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
sliding_seal_door = new BlockDoorGeneric(Material.iron, DoorDecl.SLIDING_SEAL_DOOR).setBlockName("sliding_seal_door").setHardness(10.0F).setResistance(10000.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
water_door = new BlockDoorGeneric(Material.iron, DoorDecl.WATER_DOOR).setBlockName("water_door").setHardness(50.0F).setResistance(500.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
|
||||
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");
|
||||
@ -3078,6 +3092,12 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(door_office, door_office.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(door_bunker, door_bunker.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(secure_access_door, secure_access_door.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(large_vehicle_door, large_vehicle_door.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(qe_containment, qe_containment.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(qe_sliding_door, qe_sliding_door.getUnlocalizedName());
|
||||
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());
|
||||
|
||||
//Crates
|
||||
register(crate_iron);
|
||||
|
||||
@ -33,6 +33,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@ -528,7 +529,18 @@ public class Library {
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
|
||||
// Added for sake of doors
|
||||
// Original: Drillgon200: https://thebookofshaders.com/glossary/?search=smoothstep
|
||||
public static double smoothstep(double t, double edge0, double edge1){
|
||||
t = MathHelper.clamp_double((t - edge0) / (edge1 - edge0), 0.0, 1.0);
|
||||
return t * t * (3.0 - 2.0 * t);
|
||||
}
|
||||
public static float smoothstep(float t, float edge0, float edge1){
|
||||
t = MathHelper.clamp_float((t - edge0) / (edge1 - edge0), 0.0F, 1.0F);
|
||||
return t * t * (3.0F - 2.0F * t);
|
||||
}
|
||||
|
||||
public static boolean isObstructed(World world, double x, double y, double z, double a, double b, double c) {
|
||||
MovingObjectPosition pos = world.rayTraceBlocks(Vec3.createVectorHelper(x, y, z), Vec3.createVectorHelper(a, b, c));
|
||||
return pos != null;
|
||||
|
||||
@ -323,6 +323,25 @@ public class ResourceManager {
|
||||
public static final ResourceLocation secure_access_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/secure_access_door.png");
|
||||
public static WavefrontObjDisplayList secure_access_door = new WavefrontObjDisplayList(new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/doors/secure_access_door.obj")));
|
||||
|
||||
public static final ResourceLocation water_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/water_door.png");
|
||||
public static WavefrontObjDisplayList water_door = new WavefrontObjDisplayList(new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/doors/water_door.obj")));
|
||||
|
||||
public static final ResourceLocation sliding_seal_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/sliding_seal_door.png");
|
||||
public static WavefrontObjDisplayList sliding_seal_door = new WavefrontObjDisplayList(new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/doors/sliding_seal_door.obj")));
|
||||
|
||||
public static final ResourceLocation round_airlock_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/round_airlock_door.png");
|
||||
public static WavefrontObjDisplayList round_airlock_door = new WavefrontObjDisplayList(new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/doors/round_airlock_door.obj")));
|
||||
|
||||
public static final ResourceLocation qe_sliding_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/qe_sliding_door.png");
|
||||
public static WavefrontObjDisplayList qe_sliding_door = new WavefrontObjDisplayList(new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/doors/qe_sliding_door.obj")));
|
||||
|
||||
public static final ResourceLocation qe_containment_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/qe_containment.png");
|
||||
public static WavefrontObjDisplayList qe_containment = new WavefrontObjDisplayList(new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/doors/qe_containment.obj")));
|
||||
|
||||
public static final ResourceLocation large_vehicle_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/large_vehicle_door.png");
|
||||
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");
|
||||
|
||||
|
||||
//Lantern
|
||||
public static final IModelCustom lantern = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/trinkets/lantern.obj"));
|
||||
|
||||
@ -739,6 +739,83 @@ public class ItemRenderLibrary {
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
});
|
||||
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.large_vehicle_door), new ItemRenderBase(){
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -4, 0);
|
||||
GL11.glScaled(1.8, 1.8, 1.8);
|
||||
}
|
||||
public void renderCommon() {
|
||||
bindTexture(ResourceManager.large_vehicle_door_tex);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.large_vehicle_door.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
});
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.water_door), new ItemRenderBase(){
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -4, 0);
|
||||
GL11.glScaled(4, 4, 4);
|
||||
}
|
||||
public void renderCommon() {
|
||||
bindTexture(ResourceManager.water_door_tex);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.water_door.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
});
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.qe_containment), new ItemRenderBase(){
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -3.5, 0);
|
||||
GL11.glScaled(3.8, 3.8, 3.8);
|
||||
}
|
||||
public void renderCommon() {
|
||||
bindTexture(ResourceManager.qe_containment_tex);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.qe_containment.renderAllExcept("decal");
|
||||
bindTexture(ResourceManager.qe_containment_decal);
|
||||
ResourceManager.qe_containment.renderPart("decal");
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
});
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.qe_sliding_door), new ItemRenderBase(){
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -3.5, 0);
|
||||
GL11.glScaled(6, 6, 6);
|
||||
}
|
||||
public void renderCommon() {
|
||||
bindTexture(ResourceManager.qe_sliding_door_tex);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.qe_sliding_door.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
});
|
||||
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.round_airlock_door), new ItemRenderBase(){
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -4, 0);
|
||||
GL11.glScaled(3, 3, 3);
|
||||
}
|
||||
public void renderCommon() {
|
||||
bindTexture(ResourceManager.round_airlock_door_tex);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.round_airlock_door.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
});
|
||||
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.sliding_seal_door), new ItemRenderBase(){
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -5, 0);
|
||||
GL11.glScaled(7, 7, 7);
|
||||
}
|
||||
public void renderCommon() {
|
||||
bindTexture(ResourceManager.sliding_seal_door_tex);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.sliding_seal_door.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
});
|
||||
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.blast_door), new ItemRenderBase() {
|
||||
public void renderInventory() {
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.tileentity;
|
||||
|
||||
import com.hbm.animloader.AnimatedModel;
|
||||
import com.hbm.animloader.Animation;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.loader.WavefrontObjDisplayList;
|
||||
import com.hbm.sound.MovingSoundPlayerLoop;
|
||||
@ -289,6 +290,88 @@ public abstract class DoorDecl {
|
||||
}
|
||||
};
|
||||
|
||||
public static final DoorDecl SLIDING_SEAL_DOOR = new DoorDecl(){
|
||||
|
||||
@Override
|
||||
public String getOpenSoundEnd() {
|
||||
return "hbm:door.sliding_seal_stop";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOpenSoundStart() {
|
||||
return "hbm:door.sliding_seal_open";
|
||||
}
|
||||
|
||||
public float getSoundVolume(){
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getTranslation(String partName, float openTicks, boolean child, float[] trans) {
|
||||
if(partName.startsWith("door")){
|
||||
set(trans, 0, 0, Library.smoothstep(getNormTime(openTicks), 0, 1));
|
||||
} else {
|
||||
set(trans, 0, 0, 0);
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double[][] getClippingPlanes() {
|
||||
return new double[][]{{0, 0, -1, 0.5001}};
|
||||
};
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void doOffsetTransform() {
|
||||
GL11.glTranslated(0.375, 0, 0);
|
||||
};
|
||||
|
||||
@Override
|
||||
public int timeToOpen() {
|
||||
return 20;
|
||||
};
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBlockBound(int x, int y, int z, boolean open) {
|
||||
if(open){
|
||||
if(y == 0)
|
||||
return AxisAlignedBB.getBoundingBox(0, 0, 1-0.25, 1, 0.125, 1);
|
||||
return super.getBlockBound(x, y, z, open);
|
||||
} else {
|
||||
return AxisAlignedBB.getBoundingBox(0, 0, 1-0.25, 1, 1, 1);
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public int[][] getDoorOpenRanges(){
|
||||
return new int[][]{{0, 0, 0, 1, 2, 2}};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions(){
|
||||
return new int[]{1, 0, 0, 0, 0, 0};
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ResourceLocation getTextureForPart(String partName){
|
||||
return ResourceManager.sliding_seal_door_tex;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getTextureForPart(int skinIndex, String partName) {
|
||||
return ResourceManager.sliding_seal_door_tex;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public WavefrontObjDisplayList getModel(){
|
||||
return ResourceManager.sliding_seal_door;
|
||||
}
|
||||
};
|
||||
|
||||
public static final DoorDecl SECURE_ACCESS_DOOR = new DoorDecl(){
|
||||
|
||||
@Override
|
||||
@ -388,6 +471,479 @@ public abstract class DoorDecl {
|
||||
}
|
||||
};
|
||||
|
||||
public static final DoorDecl ROUND_AIRLOCK_DOOR = new DoorDecl(){
|
||||
|
||||
@Override
|
||||
public String getOpenSoundEnd() {
|
||||
return "hbm:door.garage_stop";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOpenSoundLoop() {
|
||||
return "hbm:door.garage_move";
|
||||
}
|
||||
|
||||
public float getSoundVolume(){
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getTranslation(String partName, float openTicks, boolean child, float[] trans) {
|
||||
if("doorLeft".equals(partName)){
|
||||
set(trans, 0, 0, 1.5F*getNormTime(openTicks));
|
||||
} else if("doorRight".equals(partName)){
|
||||
set(trans, 0, 0, -1.5F*getNormTime(openTicks));
|
||||
} else {
|
||||
super.getTranslation(partName, openTicks, child, trans);
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void doOffsetTransform() {
|
||||
GL11.glTranslated(0, 0, 0.5);
|
||||
};
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double[][] getClippingPlanes() {
|
||||
return new double[][]{{0.0, 0.0, 1.0, 2.0001}, {0.0, 0.0, -1.0, 2.0001}};
|
||||
};
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBlockBound(int x, int y, int z, boolean open) {
|
||||
if(!open)
|
||||
return super.getBlockBound(x, y, z, open);
|
||||
if(z == 1){
|
||||
return AxisAlignedBB.getBoundingBox(0.4, 0, 0, 1, 1, 1);
|
||||
} else if(z == -2){
|
||||
return AxisAlignedBB.getBoundingBox(0, 0, 0, 0.6, 1, 1);
|
||||
} else if(y == 3){
|
||||
return AxisAlignedBB.getBoundingBox(0, 0.5, 0, 1, 1, 1);
|
||||
} else if(y == 0){
|
||||
return AxisAlignedBB.getBoundingBox(0, 0, 0, 1, 0.0625, 1);
|
||||
}
|
||||
return super.getBlockBound(x, y, z, open);
|
||||
};
|
||||
|
||||
@Override
|
||||
public int timeToOpen() {
|
||||
return 60;
|
||||
};
|
||||
|
||||
@Override
|
||||
public int[][] getDoorOpenRanges(){
|
||||
return new int[][]{{0, 0, 0, -2, 4, 2}, {0, 0, 0, 3, 4, 2}};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[]{3, 0, 0, 0, 2, 1};
|
||||
};
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ResourceLocation getTextureForPart(String partName){
|
||||
return ResourceManager.round_airlock_door_tex;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getTextureForPart(int skinIndex, String partName) {
|
||||
return ResourceManager.round_airlock_door_tex;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public WavefrontObjDisplayList getModel(){
|
||||
return ResourceManager.round_airlock_door;
|
||||
}
|
||||
};
|
||||
|
||||
public static final DoorDecl QE_SLIDING = new DoorDecl(){
|
||||
|
||||
@Override
|
||||
public String getOpenSoundEnd() {
|
||||
return "hbm:door.qe_sliding_opened";
|
||||
};
|
||||
@Override
|
||||
public String getCloseSoundEnd() {
|
||||
return "hbmsound:door.qe_sliding_shut";
|
||||
};
|
||||
@Override
|
||||
public String getOpenSoundLoop() {
|
||||
return "hbm:door.qe_sliding_opening";
|
||||
};
|
||||
|
||||
public float getSoundVolume(){
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getTranslation(String partName, float openTicks, boolean child, float[] trans) {
|
||||
if(partName.startsWith("left")){
|
||||
set(trans, 0, 0, 1*getNormTime(openTicks));
|
||||
} else {
|
||||
set(trans, 0, 0, -1*getNormTime(openTicks));
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void doOffsetTransform() {
|
||||
GL11.glTranslated(0.4375, 0, 0.5);
|
||||
};
|
||||
|
||||
@Override
|
||||
public int timeToOpen() {
|
||||
return 10;
|
||||
};
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBlockBound(int x, int y, int z, boolean open) {
|
||||
if(open){
|
||||
if(z == 0){
|
||||
return AxisAlignedBB.getBoundingBox(1-0.125, 0, 1-0.125, 1, 1, 1);
|
||||
} else {
|
||||
return AxisAlignedBB.getBoundingBox(0, 0, 1-0.125, 0.125, 1, 1);
|
||||
}
|
||||
} else {
|
||||
return AxisAlignedBB.getBoundingBox(0, 0, 1-0.125, 1, 1, 1);
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public int[][] getDoorOpenRanges(){
|
||||
return new int[][]{{0, 0, 0, 2, 2, 2}};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions(){
|
||||
return new int[]{1, 0, 0, 0, 1, 0};
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ResourceLocation getTextureForPart(String partName){
|
||||
return ResourceManager.qe_sliding_door_tex;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getTextureForPart(int skinIndex, String partName) {
|
||||
return getTextureForPart(partName);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public WavefrontObjDisplayList getModel(){
|
||||
return ResourceManager.qe_sliding_door;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
public static final DoorDecl QE_CONTAINMENT = new DoorDecl(){
|
||||
|
||||
@Override
|
||||
public String getOpenSoundEnd() {
|
||||
return "hbm:door.wgh_stop";
|
||||
};
|
||||
@Override
|
||||
public String getOpenSoundLoop() {
|
||||
return "hbm:door.wgh_start";
|
||||
};
|
||||
|
||||
@Override
|
||||
public float getSoundVolume(){
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getTranslation(String partName, float openTicks, boolean child, float[] trans) {
|
||||
if(!partName.equals("frame")){
|
||||
set(trans, 0, 3*getNormTime(openTicks), 0);
|
||||
} else {
|
||||
super.getTranslation(partName, openTicks, child, trans);
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void doOffsetTransform() {
|
||||
GL11.glTranslated(0.25, 0, 0);
|
||||
};
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double[][] getClippingPlanes() {
|
||||
return new double[][]{{0, -1, 0, 3.0001}};
|
||||
};
|
||||
|
||||
@Override
|
||||
public int timeToOpen() {
|
||||
return 160;
|
||||
};
|
||||
|
||||
@Override
|
||||
public int[][] getDoorOpenRanges(){
|
||||
return new int[][]{{-1, 0, 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) {
|
||||
if(!open)
|
||||
return AxisAlignedBB.getBoundingBox(0, 0, 0.5, 1, 1, 1);
|
||||
if(y > 1)
|
||||
return AxisAlignedBB.getBoundingBox(0, 0.5, 0.5, 1, 1, 1);
|
||||
else if(y == 0)
|
||||
return AxisAlignedBB.getBoundingBox(0, 0, 0.5, 1, 0.1, 1);
|
||||
return super.getBlockBound(x, y, z, open);
|
||||
};
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ResourceLocation getTextureForPart(String partName){
|
||||
if(partName.equals("decal"))
|
||||
return ResourceManager.qe_containment_decal;
|
||||
return ResourceManager.qe_containment_tex;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getTextureForPart(int skinIndex, String partName) {
|
||||
return getTextureForPart(partName);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public WavefrontObjDisplayList getModel(){
|
||||
return ResourceManager.qe_containment;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
public static final DoorDecl WATER_DOOR = 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 "hbm:door.door.lever";
|
||||
};
|
||||
@Override
|
||||
public String getCloseSoundStart() {
|
||||
return null;
|
||||
};
|
||||
@Override
|
||||
public String getCloseSoundEnd() {
|
||||
return "hbm:door.door.lever";
|
||||
};
|
||||
|
||||
@Override
|
||||
public float getSoundVolume(){
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getTranslation(String partName, float openTicks, boolean child, float[] trans) {
|
||||
if("bolt".equals(partName)){
|
||||
set(trans, 0, 0, 0.4F*Library.smoothstep(getNormTime(openTicks, 0, 30), 0, 1));
|
||||
} else {
|
||||
set(trans, 0, 0, 0);
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void doOffsetTransform(){
|
||||
GL11.glTranslated(0.375, 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getOrigin(String partName, float[] orig) {
|
||||
if("door".equals(partName) || "bolt".equals(partName)){
|
||||
set(orig, 0.125F, 1.5F, 1.18F);
|
||||
return;
|
||||
} else if("spinny_upper".equals(partName)){
|
||||
set(orig, 0.041499F, 2.43569F, -0.587849F);
|
||||
return;
|
||||
} else if("spinny_lower".equals(partName)){
|
||||
set(orig, 0.041499F, 0.571054F, -0.587849F);
|
||||
return;
|
||||
}
|
||||
super.getOrigin(partName, orig);
|
||||
};
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getRotation(String partName, float openTicks, float[] rot) {
|
||||
if(partName.startsWith("spinny")){
|
||||
set(rot, Library.smoothstep(getNormTime(openTicks, 0, 30), 0, 1)*360, 0, 0);
|
||||
return;
|
||||
} else if("door".equals(partName) || "bolt".equals(partName)){
|
||||
set(rot, 0, Library.smoothstep(getNormTime(openTicks, 30, 60), 0, 1)*-134, 0);
|
||||
return;
|
||||
}
|
||||
super.getRotation(partName, openTicks, rot);
|
||||
};
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean doesRender(String partName, boolean child) {
|
||||
return child || !partName.startsWith("spinny");
|
||||
};
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String[] getChildren(String partName) {
|
||||
if("door".equals(partName))
|
||||
return new String[]{"spinny_lower", "spinny_upper"};
|
||||
return super.getChildren(partName);
|
||||
};
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBlockBound(int x, int y, int z, boolean open) {
|
||||
if(!open){
|
||||
return AxisAlignedBB.getBoundingBox(0, 0, 0.75, 1, 1, 1);
|
||||
} else if(y > 1) {
|
||||
return AxisAlignedBB.getBoundingBox(0, 0.85, 0.75, 1, 1, 1);
|
||||
} else if(y == 0){
|
||||
return AxisAlignedBB.getBoundingBox(0, 0, 0.75, 1, 0.15, 1);
|
||||
}
|
||||
return super.getBlockBound(x, y, z, open);
|
||||
};
|
||||
|
||||
@Override
|
||||
public int timeToOpen() {
|
||||
return 60;
|
||||
};
|
||||
|
||||
@Override
|
||||
public int[][] getDoorOpenRanges(){
|
||||
return new int[][]{{1, 0, 0, -3, 3, 2}};
|
||||
}
|
||||
|
||||
public float getDoorRangeOpenTime(int ticks, int idx) {
|
||||
return getNormTime(ticks, 35, 40);
|
||||
};
|
||||
|
||||
@Override
|
||||
public int[] getDimensions(){
|
||||
return new int[]{2, 0, 0, 0, 1, 1};
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ResourceLocation getTextureForPart(String partName){
|
||||
return ResourceManager.water_door_tex;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getTextureForPart(int skinIndex, String partName) {
|
||||
return ResourceManager.water_door_tex;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public WavefrontObjDisplayList getModel(){
|
||||
return ResourceManager.water_door;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
public static final DoorDecl LARGE_VEHICLE_DOOR = new DoorDecl(){
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getTranslation(String partName, float openTicks, boolean child, float[] trans) {
|
||||
if("doorLeft".equals(partName)){
|
||||
set(trans, 0, 0, 3*getNormTime(openTicks));
|
||||
} else if("doorRight".equals(partName)){
|
||||
set(trans, 0, 0, -3*getNormTime(openTicks));
|
||||
} else {
|
||||
super.getTranslation(partName, openTicks, child, trans);
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public String getOpenSoundEnd() {
|
||||
return "hbm:door.garage_stop";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOpenSoundLoop() {
|
||||
return "hbm:door.garage_move";
|
||||
};
|
||||
|
||||
public float getSoundVolume(){
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double[][] getClippingPlanes() {
|
||||
return new double[][]{{0.0, 0.0, 1.0, 3.50001}, {0.0, 0.0, -1.0, 3.50001}};
|
||||
};
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBlockBound(int x, int y, int z, boolean open) {
|
||||
if(!open)
|
||||
return super.getBlockBound(x, y, z, open);
|
||||
if(z == 3){
|
||||
return AxisAlignedBB.getBoundingBox(0.4, 0, 0, 1, 1, 1);
|
||||
} else if(z == -3){
|
||||
return AxisAlignedBB.getBoundingBox(0, 0, 0, 0.6, 1, 1);
|
||||
}
|
||||
return super.getBlockBound(x, y, z, open);
|
||||
};
|
||||
|
||||
@Override
|
||||
public int timeToOpen() {
|
||||
return 60;
|
||||
};
|
||||
|
||||
@Override
|
||||
public int[][] getDoorOpenRanges(){
|
||||
return new int[][]{{0, 0, 0, -4, 6, 2}, {0, 0, 0, 4, 6, 2}};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[]{5, 0, 0, 0, 3, 3};
|
||||
};
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ResourceLocation getTextureForPart(String partName){
|
||||
return ResourceManager.large_vehicle_door_tex;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getTextureForPart(int skinIndex, String partName) {
|
||||
return ResourceManager.large_vehicle_door_tex;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public WavefrontObjDisplayList getModel(){
|
||||
return ResourceManager.large_vehicle_door;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
//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, 1-y, 2-z)
|
||||
public abstract int[][] getDoorOpenRanges();
|
||||
|
||||
|
||||
6312
src/main/resources/assets/hbm/models/doors/large_vehicle_door.obj
Normal file
1601
src/main/resources/assets/hbm/models/doors/qe_containment.obj
Normal file
2312
src/main/resources/assets/hbm/models/doors/qe_sliding_door.obj
Normal file
3160
src/main/resources/assets/hbm/models/doors/round_airlock_door.obj
Normal file
2522
src/main/resources/assets/hbm/models/doors/sliding_seal_door.obj
Normal file
7570
src/main/resources/assets/hbm/models/doors/water_door.obj
Normal file
@ -70,6 +70,14 @@
|
||||
|
||||
"door.garage_move": { "category": "block", "sounds": [{"name": "block/door/garage_move", "stream": false}] },
|
||||
"door.garage_stop": { "category": "block", "sounds": [{"name": "block/door/garage_stop", "stream": false}] },
|
||||
"block.door.lever": {"category": "player", "sounds": [{"name": "hbm:block/doors/lever1", "stream": false}]},
|
||||
"block.door.wgh_big_start": {"category": "player", "sounds": [{"name": "hbm:block/doors/door_wgh_big_start", "stream": false}]},
|
||||
"block.door.wgh_big_stop": {"category": "player", "sounds": [{"name": "hbm:block/doors/door_wgh_big_stop", "stream": false}]},
|
||||
"block.door.qe_sliding_shut": {"category": "player", "sounds": [{"name": "hbm:block/doors/doorshut_1", "stream": false}]},
|
||||
"block.door.qe_sliding_opened": {"category": "player", "sounds": [{"name": "hbm:block/doors/doorslide_opened1", "stream": false}]},
|
||||
"block.door.qe_sliding_opening": {"category": "player", "sounds": [{"name": "hbm:block/doors/doorslide_opening1", "stream": false}]},
|
||||
"block.door.sliding_seal_open": {"category": "player", "sounds": [{"name": "hbm:block/doors/doormove2", "stream": false}]},
|
||||
"block.door.sliding_seal_stop": {"category": "player", "sounds": [{"name": "hbm:block/doors/metal_stop1", "stream": false}]},
|
||||
|
||||
"item.techBleep": {"category": "player", "sounds": [{"name": "tool/techBleep", "stream": false}]},
|
||||
"item.techBoop": {"category": "player", "sounds": [{"name": "tool/techBoop", "stream": false}]},
|
||||
|
||||
BIN
src/main/resources/assets/hbm/sounds/block/door/doormove2.ogg
Normal file
BIN
src/main/resources/assets/hbm/sounds/block/door/doorshut_1.ogg
Normal file
BIN
src/main/resources/assets/hbm/sounds/block/door/lever1.ogg
Normal file
BIN
src/main/resources/assets/hbm/sounds/block/door/metal_stop1.ogg
Normal file
|
After Width: | Height: | Size: 86 KiB |
|
After Width: | Height: | Size: 128 KiB |
|
After Width: | Height: | Size: 314 B |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 133 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 104 KiB |