mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
feat: add secure access doors from 1.12.2 fork
This commit is contained in:
parent
cb0557170c
commit
0f082285cf
@ -606,6 +606,7 @@ public class ModBlocks {
|
||||
public static Block sliding_blast_door;
|
||||
public static Block fire_door;
|
||||
public static Block transition_seal;
|
||||
public static Block secure_access_door;
|
||||
|
||||
public static Block door_metal;
|
||||
public static Block door_office;
|
||||
@ -2142,6 +2143,7 @@ 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);
|
||||
|
||||
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");
|
||||
@ -3075,6 +3077,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(door_metal, door_metal.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(door_office, door_office.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(door_bunker, door_bunker.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(secure_access_door, secure_access_door.getUnlocalizedName());
|
||||
|
||||
//Crates
|
||||
register(crate_iron);
|
||||
|
||||
@ -318,6 +318,11 @@ public class ResourceManager {
|
||||
public static AnimatedModel transition_seal;
|
||||
public static Animation transition_seal_anim;
|
||||
public static final WavefrontObjDisplayList fire_door = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/doors/fire_door.obj")).asDisplayList();
|
||||
|
||||
//Secure Access Door
|
||||
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")));
|
||||
|
||||
|
||||
//Lantern
|
||||
public static final IModelCustom lantern = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/trinkets/lantern.obj"));
|
||||
|
||||
@ -727,6 +727,18 @@ public class ItemRenderLibrary {
|
||||
bindTexture(ResourceManager.vault_cog_tex); ResourceManager.vault_cog.renderAll();
|
||||
bindTexture(ResourceManager.vault_label_101_tex); ResourceManager.vault_label.renderAll();
|
||||
}});
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.secure_access_door), new ItemRenderBase(){
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -4, 0);
|
||||
GL11.glScaled(2.4, 2.4, 2.4);
|
||||
}
|
||||
public void renderCommon() {
|
||||
bindTexture(ResourceManager.secure_access_door_tex);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.secure_access_door.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
});
|
||||
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.blast_door), new ItemRenderBase() {
|
||||
public void renderInventory() {
|
||||
|
||||
@ -4,11 +4,13 @@ import com.hbm.animloader.AnimatedModel;
|
||||
import com.hbm.animloader.Animation;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.loader.WavefrontObjDisplayList;
|
||||
import com.hbm.sound.MovingSoundPlayerLoop;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.event.sound.SoundEvent;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public abstract class DoorDecl {
|
||||
@ -287,6 +289,105 @@ public abstract class DoorDecl {
|
||||
}
|
||||
};
|
||||
|
||||
public static final DoorDecl SECURE_ACCESS_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
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getTranslation(String partName, float openTicks, boolean child, float[] trans) {
|
||||
if(!partName.equals("base")){
|
||||
set(trans, 0, 3.5F*getNormTime(openTicks), 0);
|
||||
} else {
|
||||
super.getTranslation(partName, openTicks, child, trans);
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void doOffsetTransform() {
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
};
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double[][] getClippingPlanes() {
|
||||
return new double[][]{{0, -1, 0, 5}};
|
||||
};
|
||||
|
||||
@Override
|
||||
public int timeToOpen() {
|
||||
return 120;
|
||||
};
|
||||
|
||||
@Override
|
||||
public int[][] getDoorOpenRanges(){
|
||||
return new int[][]{{-2, 1, 0, 4, 5, 1}};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions(){
|
||||
return new int[]{4, 0, 0, 0, 2, 2};
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBlockBound(int x, int y, int z, boolean open) {
|
||||
if(!open){
|
||||
if(y > 0){
|
||||
return AxisAlignedBB.getBoundingBox(0, 0, 0.375, 1, 1, 0.625);
|
||||
}
|
||||
return AxisAlignedBB.getBoundingBox(0, 0, 0, 1, 1, 1);
|
||||
}
|
||||
if(y == 1) {
|
||||
return AxisAlignedBB.getBoundingBox(0, 0, 0, 1, 0.0625, 1);
|
||||
} else if(y == 4){
|
||||
return AxisAlignedBB.getBoundingBox(0, 0.5, 0.15, 1, 1, 0.85);
|
||||
} else {
|
||||
return super.getBlockBound(x, y, z, open);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ResourceLocation getTextureForPart(String partName){
|
||||
return ResourceManager.secure_access_door_tex;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getTextureForPart(int skinIndex, String partName) {
|
||||
return ResourceManager.secure_access_door_tex;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public WavefrontObjDisplayList getModel(){
|
||||
return ResourceManager.secure_access_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();
|
||||
|
||||
|
||||
4364
src/main/resources/assets/hbm/models/doors/secure_access_door.obj
Normal file
4364
src/main/resources/assets/hbm/models/doors/secure_access_door.obj
Normal file
File diff suppressed because it is too large
Load Diff
@ -67,7 +67,10 @@
|
||||
"door.sliding_door_shut": {"category": "block", "sounds": [{"name": "block/door/sliding_door_shut", "stream": false}]},
|
||||
"door.sliding_door_opened": {"category": "block", "sounds": [{"name": "block/door/sliding_door_opened", "stream": false}]},
|
||||
"door.sliding_door_opening": {"category": "block", "sounds": [{"name": "block/door/sliding_door_opening", "stream": false}]},
|
||||
|
||||
|
||||
"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}] },
|
||||
|
||||
"item.techBleep": {"category": "player", "sounds": [{"name": "tool/techBleep", "stream": false}]},
|
||||
"item.techBoop": {"category": "player", "sounds": [{"name": "tool/techBoop", "stream": false}]},
|
||||
"item.geiger1": {"category": "player", "sounds": [{"name": "tool/geiger1", "stream": false}]},
|
||||
|
||||
BIN
src/main/resources/assets/hbm/sounds/block/door/garage_move.ogg
Normal file
BIN
src/main/resources/assets/hbm/sounds/block/door/garage_move.ogg
Normal file
Binary file not shown.
BIN
src/main/resources/assets/hbm/sounds/block/door/garage_stop.ogg
Normal file
BIN
src/main/resources/assets/hbm/sounds/block/door/garage_stop.ogg
Normal file
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 121 KiB |
Loading…
x
Reference in New Issue
Block a user