├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── LICENSE ├── README.md ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── libs └── GalacticraftCore-Dev-1.12.2-4.0.2.190.jar └── src └── main ├── java └── pcl │ └── opensecurity │ ├── BuildInfo.java │ ├── Config.java │ ├── OpenSecurity.java │ ├── client │ ├── CamouflageBlockModelLoader.java │ ├── ClientProxy.java │ ├── config │ │ └── ConfigGUI.java │ ├── gui │ │ ├── CardWriterGUI.java │ │ ├── ContainerGUI.java │ │ ├── EnergyTurretGUI.java │ │ └── NanoFogTerminalGUI.java │ ├── jei │ │ └── JEI_Plugin.java │ ├── models │ │ ├── CamoModel.java │ │ ├── CamouflageBakedModel.java │ │ ├── ModelCube.java │ │ ├── ModelCubeTESR.java │ │ ├── ModelCubeTexturedTESR.java │ │ ├── ModelEnergyBolt.java │ │ ├── ModelEnergyTurret.java │ │ ├── ModelNanoFogSwarm.java │ │ ├── ModelNanoFogSwarmBuild.java │ │ └── ModelNanoFogSwarmReturn.java │ ├── renderer │ │ ├── EnergyTurretRenderHelper.java │ │ ├── NanoFogSwarmRenderer.java │ │ ├── RenderEnergyTurret.java │ │ ├── RenderEntityEnergyBolt.java │ │ ├── RenderKeypad.java │ │ ├── RenderRolldoorController.java │ │ └── SecurityTerminalRender.java │ └── sounds │ │ ├── AlarmResource.java │ │ └── MachineSound.java │ ├── common │ ├── CommonProxy.java │ ├── ContentRegistry.java │ ├── GuiHandler.java │ ├── OSBreakEvent.java │ ├── SoundHandler.java │ ├── blocks │ │ ├── BlockAlarm.java │ │ ├── BlockBiometricReader.java │ │ ├── BlockCamouflage.java │ │ ├── BlockCardWriter.java │ │ ├── BlockData.java │ │ ├── BlockDoorController.java │ │ ├── BlockEnergyTurret.java │ │ ├── BlockEntityDetector.java │ │ ├── BlockKeypad.java │ │ ├── BlockMagReader.java │ │ ├── BlockMagReaderCamo.java │ │ ├── BlockNanoFog.java │ │ ├── BlockNanoFogTerminal.java │ │ ├── BlockOSBase.java │ │ ├── BlockRFIDReader.java │ │ ├── BlockRolldoor.java │ │ ├── BlockRolldoorController.java │ │ ├── BlockRolldoorElement.java │ │ ├── BlockSecureDoor.java │ │ ├── BlockSecureMagDoor.java │ │ ├── BlockSecurePrivateDoor.java │ │ └── BlockSecurityTerminal.java │ ├── camouflage │ │ ├── CamoBlockId.java │ │ └── CamoProperty.java │ ├── drivers │ │ ├── AlarmDriver.java │ │ ├── DoorControllerDriver.java │ │ ├── EntityDetectorDriver.java │ │ ├── RFIDReaderCardDriver.java │ │ └── RFIDReaderDriver.java │ ├── entity │ │ ├── EntityEnergyBolt.java │ │ └── EntityNanoFogSwarm.java │ ├── interfaces │ │ ├── ICamo.java │ │ ├── IColoredTile.java │ │ ├── IOwner.java │ │ ├── IPasswordProtected.java │ │ └── IVariant.java │ ├── inventory │ │ ├── BasicInventory.java │ │ ├── CardWriterContainer.java │ │ ├── EnergyTurretContainer.java │ │ ├── NanoFogTerminalContainer.java │ │ └── slot │ │ │ ├── BaseSlot.java │ │ │ ├── CardInputSlot.java │ │ │ ├── CardOutputSlot.java │ │ │ ├── CooldownUpgradeSlot.java │ │ │ ├── DamageUpgradeSlot.java │ │ │ ├── EnergyUpgradeSlot.java │ │ │ ├── ISlotTooltip.java │ │ │ ├── MovementUpgradeSlot.java │ │ │ ├── NanoFogTerminalOutputSlot.java │ │ │ └── NanoFogTerminalSlot.java │ ├── items │ │ ├── ItemCard.java │ │ ├── ItemCooldownUpgrade.java │ │ ├── ItemDamageUpgrade.java │ │ ├── ItemEnergyUpgrade.java │ │ ├── ItemMagCard.java │ │ ├── ItemMovementUpgrade.java │ │ ├── ItemNanoDNA.java │ │ ├── ItemOSBase.java │ │ ├── ItemRFIDCard.java │ │ ├── ItemRFIDReaderCard.java │ │ ├── ItemSecureDoor.java │ │ ├── ItemSecureMagDoor.java │ │ └── ItemSecurePrivateDoor.java │ ├── nanofog │ │ └── EntityFilter.java │ ├── protection │ │ ├── IProtection.java │ │ ├── Protection.java │ │ └── ProtectionAreaChunk.java │ └── tileentity │ │ ├── TileEntityAlarm.java │ │ ├── TileEntityBiometricReader.java │ │ ├── TileEntityCardWriter.java │ │ ├── TileEntityDataBlock.java │ │ ├── TileEntityDoorController.java │ │ ├── TileEntityEnergyTurret.java │ │ ├── TileEntityEntityDetector.java │ │ ├── TileEntityKeypad.java │ │ ├── TileEntityMagReader.java │ │ ├── TileEntityNanoFog.java │ │ ├── TileEntityNanoFogTerminal.java │ │ ├── TileEntityOSBase.java │ │ ├── TileEntityOSCamoBase.java │ │ ├── TileEntityOSSound.java │ │ ├── TileEntityRFIDReader.java │ │ ├── TileEntityRolldoor.java │ │ ├── TileEntityRolldoorController.java │ │ ├── TileEntityRolldoorElement.java │ │ ├── TileEntitySecureDoor.java │ │ ├── TileEntitySecurityTerminal.java │ │ └── logic │ │ ├── DoorController.java │ │ ├── EnergyTurret.java │ │ ├── EnergyTurretStats.java │ │ └── RolldoorHelper.java │ ├── lib │ └── easing │ │ └── penner │ │ ├── Back.java │ │ ├── Bounce.java │ │ ├── Circ.java │ │ ├── Cubic.java │ │ ├── Elastic.java │ │ ├── Expo.java │ │ ├── Linear.java │ │ ├── Quad.java │ │ ├── Quart.java │ │ ├── Quint.java │ │ ├── Sine.java │ │ └── easing_terms_of_use.html │ ├── manual │ ├── IBlockWithDocumentation.java │ ├── IItemWithDocumentation.java │ ├── Manual.java │ ├── ManualContentProvider.java │ ├── ManualContentProviderOC.java │ ├── ManualContentProviderRTFM.java │ ├── ManualPathProvider.java │ ├── ManualPathProviderOC.java │ └── ManualPathProviderRTFM.java │ ├── networking │ ├── HandlerKeypadButton.java │ ├── PacketAssetData.java │ ├── PacketKeypadButton.java │ ├── PacketProtectionAdd.java │ ├── PacketProtectionRemove.java │ └── PacketProtectionSync.java │ └── util │ ├── AABBHelper.java │ ├── BlockUtils.java │ ├── ClassHelper.java │ ├── FileUtils.java │ ├── ItemUtils.java │ ├── ServerResourcePackFactory.java │ ├── SoundUnpack.java │ └── UtilityGL11Debug.java └── resources ├── assets └── opensecurity │ ├── blockstates │ ├── alarm.json │ ├── biometric_reader.json │ ├── card_writer.json │ ├── case1.json │ ├── case2.json │ ├── case3.json │ ├── data_block.json │ ├── door_controller.json │ ├── energy_turret.json │ ├── entity_detector.json │ ├── keypad.json │ ├── mag_reader.json │ ├── mag_reader_camo.json │ ├── mag_secure_door.json │ ├── nanofog.json │ ├── nanofog_terminal.json │ ├── private_secure_door.json │ ├── rack.json │ ├── rfid_reader.json │ ├── rolldoor.json │ ├── rolldoor_controller.json │ ├── rolldoor_element.json │ ├── secure_door.json │ └── security_terminal.json │ ├── lang │ ├── en_US.lang │ ├── ru_RU.lang │ └── zh_CN.lang │ ├── lua │ ├── cardwriter │ │ ├── .autorun.lua │ │ └── bin │ │ │ └── cardwriter.lua │ └── datablock │ │ ├── .autorun.lua │ │ ├── bin │ │ ├── os_base64.lua │ │ ├── os_deflate.lua │ │ ├── os_inflate.lua │ │ ├── os_md5sum.lua │ │ ├── os_rot13.lua │ │ └── os_sha256sum.lua │ │ └── lib │ │ └── datablock.lua │ ├── models │ ├── block │ │ ├── case.json │ │ ├── case_running.json │ │ ├── energy_turret.json │ │ ├── nanofog.json │ │ ├── nanofog_empty.json │ │ ├── nanofog_flat.json │ │ ├── rack.json │ │ ├── rolldoor.json │ │ ├── secure_door_bottom.json │ │ ├── secure_door_bottom_rh.json │ │ ├── secure_door_top.json │ │ ├── secure_door_top_rh.json │ │ ├── securepriv_door_bottom.json │ │ ├── securepriv_door_bottom_rh.json │ │ ├── securepriv_door_top.json │ │ └── securepriv_door_top_rh.json │ └── item │ │ ├── cooldown_upgrade.json │ │ ├── damage_upgrade.json │ │ ├── energy_turret.json │ │ ├── energy_upgrade.json │ │ ├── mag_card.json │ │ ├── mag_secure_door.json │ │ ├── manual.json │ │ ├── movement_upgrade.json │ │ ├── nanodna.json │ │ ├── private_secure_door.json │ │ ├── rfid_card.json │ │ ├── rfid_reader_card.json │ │ └── secure_door.json │ ├── recipes │ ├── _constants.json │ ├── blocks │ │ ├── alarm.json │ │ ├── biometric_reader.json │ │ ├── card_writer.json │ │ ├── data_block.json │ │ ├── door_controller.json │ │ ├── energy_turret.json │ │ ├── entity_detector.json │ │ ├── keypad.json │ │ ├── mag_reader.json │ │ ├── mag_secure_door.json │ │ ├── nanofog_terminal.json │ │ ├── private_secure_door.json │ │ ├── rfid_reader.json │ │ ├── rolldoor.json │ │ ├── rolldoor_controller.json │ │ ├── secure_door.json │ │ └── security_terminal.json │ └── items │ │ ├── cooldown_upgrade.json │ │ ├── damage_upgrade.json │ │ ├── energy_upgrade.json │ │ ├── mag_card.json │ │ ├── manual.json │ │ ├── movement_upgrade.json │ │ ├── nanodna.json │ │ ├── rfid_card.json │ │ └── rfid_reader_card.json │ ├── sounds.json │ ├── sounds │ ├── alarms │ │ ├── klaxon1.ogg │ │ └── klaxon2.ogg │ ├── card_swipe.ogg │ ├── keypad_press.ogg │ ├── scanner1.ogg │ ├── scanner2.ogg │ ├── scanner3.ogg │ ├── security_door.ogg │ ├── turretfire.ogg │ └── turretmove.ogg │ └── textures │ ├── blocks │ ├── alarm.png │ ├── biometricreader_front.png │ ├── cardwriter_front.png │ ├── cardwriter_front.png.mcmeta │ ├── case_back.png │ ├── case_back_running.png │ ├── case_front.png │ ├── case_front_activity.png │ ├── case_front_error.png │ ├── case_front_on.png │ ├── case_side.png │ ├── case_side_running.png │ ├── case_top.png │ ├── dataprocblock_front.png │ ├── dataprocblock_front.png.mcmeta │ ├── dataprocblock_side.png │ ├── dataprocblock_side.png.mcmeta │ ├── door_controller.png │ ├── door_secure_lower.png │ ├── door_secure_upper.png │ ├── door_secure_upper_nowindow.png │ ├── empty.png │ ├── encrypter.png │ ├── entitydetector.png │ ├── filing_cabinet.png │ ├── hub_input_connected.png │ ├── hub_input_noconnected.png │ ├── hub_output_connected.png │ ├── hub_output_disabled.png │ ├── hub_output_noconnected.png │ ├── machine_side.png │ ├── mag_reader.png │ ├── magreader_active.png │ ├── magreader_error.png │ ├── magreader_five.png │ ├── magreader_seven.png │ ├── magreader_six.png │ ├── magreader_success.png │ ├── magreader_three.png │ ├── nanofog.png │ ├── nanofog_terminal.png │ ├── rack_front.png │ ├── rack_side.png │ ├── rfid_reader.png │ ├── rfidreader_active.png │ ├── rfidreader_found.png │ ├── rfidreader_nofound.png │ ├── rolldoor.png │ ├── rolldoor_controller.png │ └── security_terminal.png │ ├── gui │ ├── energy_turret.png │ ├── kvm.png │ ├── nanofog_terminal.png │ └── rfidwriter.png │ ├── items │ ├── cooldown_upgrade.png │ ├── damage_upgrade.png │ ├── door_secure.png │ ├── door_secure_nowindow.png │ ├── energy_upgrade.png │ ├── mag_card.png │ ├── mag_card_color.png │ ├── manual.png │ ├── movement_upgrade.png │ ├── nanodna.png │ ├── rfid_card.png │ ├── rfid_card_color.png │ ├── rfid_reader_card.png │ └── secure_network_card.png │ └── model │ ├── nanofogswarm.png │ └── turret.png └── mcmod.info /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "[Bug] " 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **In which environment did the Bug appear?** 14 | Singleplayer, LAN Game, Forge server, SpongeForge server, ... 15 | 16 | **To Reproduce** 17 | Steps to reproduce the behavior: 18 | 1. Go to '...' 19 | 2. Click on '....' 20 | 3. Scroll down to '....' 21 | 4. See error 22 | 23 | **Expected behavior** 24 | A clear and concise description of what you expected to happen. 25 | 26 | **Screenshots / Code Snippet** 27 | If applicable, add the code you used and screenshots of how your setup looks like 28 | ```lua 29 | parse code here 30 | ``` 31 | 32 | **Minecraft:** 33 | - Mod Version (e.g. OpenSecurity-MC1.12.2-1.0-23) 34 | - Minecraft Version (e.g. Minecraft 1.12) 35 | - Forge Version (e.g. Forge 14.23.5.2779) 36 | [ ] Optifine installed (if the issue is render related and you use Shaders add informations about what Shader you are using) 37 | 38 | **Additional context** 39 | Add any other context about the problem here. 40 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: "[Suggestion] " 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | classes/ 2 | ################# 3 | ## Eclipse 4 | ################# 5 | 6 | *.pydevproject 7 | .project 8 | .metadata 9 | *.tmp 10 | *.bak 11 | *.swp 12 | *~.nib 13 | local.properties 14 | .classpath 15 | .settings/ 16 | .loadpath 17 | 18 | # External tool builders 19 | .externalToolBuilders/ 20 | 21 | # Locally stored "Eclipse launch configurations" 22 | *.launch 23 | 24 | # CDT-specific 25 | .cproject 26 | 27 | # PDT-specific 28 | .buildpath 29 | 30 | .idea 31 | *.iml 32 | *.ipl 33 | *.ipr 34 | *.iws 35 | 36 | ############# 37 | ## Windows detritus 38 | ############# 39 | 40 | # Windows image file caches 41 | Thumbs.db 42 | ehthumbs.db 43 | 44 | # Folder config file 45 | Desktop.ini 46 | 47 | # Recycle Bin used on file shares 48 | $RECYCLE.BIN/ 49 | 50 | # Mac crap 51 | .DS_Store 52 | 53 | 54 | ############# 55 | ## Python 56 | ############# 57 | 58 | *.py[co] 59 | 60 | # Packages 61 | *.egg 62 | *.egg-info 63 | dist/ 64 | build/ 65 | eggs/ 66 | parts/ 67 | var/ 68 | sdist/ 69 | develop-eggs/ 70 | .installed.cfg 71 | 72 | # Installer logs 73 | pip-log.txt 74 | 75 | # Unit test / coverage reports 76 | .coverage 77 | .tox 78 | 79 | #Translations 80 | *.mo 81 | 82 | #Mr Developer 83 | .mr.developer.cfg 84 | 85 | # Gradle 86 | /.gradle/ 87 | /build/ 88 | /run/ 89 | /runclient/ 90 | /run_client/ 91 | /run_server/ 92 | /eclipse/ 93 | /runtime/ 94 | /server_runtime/ 95 | /out/ 96 | *~ 97 | *.lnk 98 | output.txt 99 | /bin 100 | out.log 101 | gradle/wrapper/gradle-wrapper.properties -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 PC-Logix 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | OpenSecurity 2 | ============ 3 | [![Wiki](http://img.shields.io/badge/wiki--blue.svg)](https://github.com/PC-Logix/OpenSecurity/wiki) 4 | [![Discord](http://img.shields.io/discord/125649403162656768.svg?label=discord&style=popout)](https://discord.gg/bYqKv7h) 5 | [![curseForge Project](http://cf.way2muchnoise.eu/versions/opensecurity_latest.svg)](https://minecraft.curseforge.com/projects/opensecurity) 6 | [![Download](http://cf.way2muchnoise.eu/full_231687_downloads.svg)](https://minecraft.curseforge.com/projects/opensecurity/files) 7 | 8 | Security addon for OpenComputers 9 | 10 | ## build notes 11 | 12 | before building run the gradle task `syncGitWiki` once to sync the Wiki to your project 13 | 14 | ### how to build 15 | clone the project to your local machine with `git clone https://github.com/PC-Logix/OpenSecurity.git` 16 | 17 | setup workspace with `gradlew setupDecompWorkspace` and build with `gradlew build` 18 | 19 | 20 | ## Credits 21 | 22 | Flawedspirit for the Block Textures (Serisouly the old ones suuuuuucked.) 23 | 24 | gamax92 for the Mag and RFID Card textures, and helping me deal with stupid code. 25 | 26 | Kodos for the Mods Name and some Textures (DataBlock side, Sine panel front) 27 | 28 | AterIgnis For improvements to the Energy Turret and the Keypad 29 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Sets default memory used for gradle commands. Can be overridden by user or command line properties. 2 | # This is required to provide enough memory for the Minecraft decompilation process. 3 | org.gradle.jvmargs=-Xmx3G 4 | 5 | # mod baseinfo 6 | modGroup = pcl.opensecurity 7 | modBaseName = OpenSecurity-1.12.2 8 | modVersion = 1.0 9 | buildNumber = snapshot 10 | 11 | # forge + minecraft 12 | forge_version = 14.23.5.2768 13 | minecraftVersion = 1.12.2 14 | mcp_mappings = snapshot_20180701 15 | 16 | # dependencies 17 | openComputersVersion = MC1.12.2-1.7.+ 18 | jei_version = 1.12.2:4.9.+ 19 | ae2Version = rv6-stable-1 20 | projredVersion = 1.12.2-4.9.0.86 21 | rtfmVersion = MC1.12-1.0.1.4 22 | advancedRocketryVersion = 1.12.2-1.5.0:127 23 | 24 | # curseForge 25 | curseforge_key = 0 26 | curse_changelog = default 27 | curse_projectId = 231687 28 | curse_releaseType = release 29 | promochangelog = changelog 30 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Sep 14 12:28:28 PDT 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-bin.zip 7 | -------------------------------------------------------------------------------- /libs/GalacticraftCore-Dev-1.12.2-4.0.2.190.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/libs/GalacticraftCore-Dev-1.12.2-4.0.2.190.jar -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/BuildInfo.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity; 2 | 3 | /** 4 | * This file is automatically updated by Jenkins as part of the CI build script 5 | * in Ant. Don't put any pre-set values here. 6 | * 7 | * @author AfterLifeLochie, stolen from LanteaCraft, another fine PC-Logix 8 | * Minecraft mod. 9 | */ 10 | public class BuildInfo { 11 | public static final String modName = "OpenSecurity"; 12 | public static final String modID = "opensecurity"; 13 | 14 | public static final String versionNumber = "@VERSION@"; 15 | public static final String buildNumber = "@BUILD@"; 16 | 17 | public static int getBuildNumber() { 18 | if (buildNumber.equals("@" + "BUILD" + "@")) 19 | return 0; 20 | return Integer.parseInt(buildNumber); 21 | } 22 | 23 | public static int getVersionNumber() { 24 | if (versionNumber.equals("@" + "VERSION" + "@")) 25 | return 0; 26 | return Integer.parseInt(versionNumber); 27 | } 28 | 29 | public static boolean isDevelopmentEnvironment() { 30 | return getBuildNumber() == 0; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/client/gui/CardWriterGUI.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.client.gui; 2 | 3 | import net.minecraft.util.ResourceLocation; 4 | import net.minecraft.util.text.TextComponentTranslation; 5 | import pcl.opensecurity.OpenSecurity; 6 | import pcl.opensecurity.common.inventory.CardWriterContainer; 7 | import pcl.opensecurity.common.tileentity.TileEntityCardWriter; 8 | 9 | public class CardWriterGUI extends ContainerGUI { 10 | public static final int WIDTH = 175; 11 | public static final int HEIGHT = 195; 12 | 13 | private static final ResourceLocation background = new ResourceLocation(OpenSecurity.MODID, "textures/gui/rfidwriter.png"); 14 | 15 | public CardWriterGUI(TileEntityCardWriter tileEntity, CardWriterContainer container) { 16 | super(container, WIDTH, HEIGHT); 17 | } 18 | 19 | @Override 20 | protected void drawGuiContainerForegroundLayer(int param1, int param2) { 21 | drawCenteredString(new TextComponentTranslation("opensecurity.gui.string.cardslot").getUnformattedText(), 20, 4210752); 22 | drawCenteredString(new TextComponentTranslation("opensecurity.gui.string.cardwriter").getUnformattedText(), 5, 4210752); 23 | } 24 | 25 | @Override 26 | protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { 27 | mc.getTextureManager().bindTexture(background); 28 | drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); 29 | } 30 | } -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/client/gui/ContainerGUI.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.client.gui; 2 | 3 | import net.minecraft.client.gui.FontRenderer; 4 | import net.minecraft.client.gui.inventory.GuiContainer; 5 | import net.minecraft.inventory.Container; 6 | import net.minecraft.inventory.Slot; 7 | import pcl.opensecurity.common.inventory.slot.ISlotTooltip; 8 | 9 | public abstract class ContainerGUI extends GuiContainer { 10 | private static final int slotSize = 18; 11 | 12 | public ContainerGUI(Container inventorySlotsIn, int width, int height){ 13 | super(inventorySlotsIn); 14 | xSize = width; 15 | ySize = height; 16 | } 17 | 18 | void drawCenteredString(String string, int y, int color){ 19 | FontRenderer fr = mc.fontRenderer; 20 | fr.drawString(string, getXSize()/2 - fr.getStringWidth(string)/2, y, color); 21 | } 22 | 23 | private boolean isSlotHovered(Slot slot, int mouseX, int mouseY){ 24 | return 25 | slot.xPos + guiLeft <= mouseX && 26 | slot.xPos + guiLeft + slotSize > mouseX && 27 | slot.yPos + guiTop <= mouseY && 28 | slot.yPos + guiTop + slotSize > mouseY; 29 | } 30 | 31 | @Override 32 | public void drawScreen(int mouseX, int mouseY, float partialTicks){ 33 | super.drawScreen(mouseX, mouseY, partialTicks); 34 | 35 | for(Slot slot : inventorySlots.inventorySlots){ 36 | if(slot instanceof ISlotTooltip && isSlotHovered(slot, mouseX, mouseY)){ 37 | drawHoveringText(((ISlotTooltip) slot).getTooltip(), mouseX, mouseY); 38 | } 39 | } 40 | 41 | renderHoveredToolTip(mouseX, mouseY); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/client/gui/NanoFogTerminalGUI.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.client.gui; 2 | 3 | import net.minecraft.client.gui.FontRenderer; 4 | import net.minecraft.util.ResourceLocation; 5 | import pcl.opensecurity.OpenSecurity; 6 | import pcl.opensecurity.common.inventory.NanoFogTerminalContainer; 7 | import pcl.opensecurity.common.tileentity.TileEntityNanoFogTerminal; 8 | 9 | public class NanoFogTerminalGUI extends ContainerGUI { 10 | private static final int WIDTH = 175; 11 | private static final int HEIGHT = 195; 12 | 13 | private TileEntityNanoFogTerminal te; 14 | 15 | private static final ResourceLocation background = new ResourceLocation(OpenSecurity.MODID, "textures/gui/nanofog_terminal.png"); 16 | 17 | public NanoFogTerminalGUI(TileEntityNanoFogTerminal tileEntity, NanoFogTerminalContainer container) { 18 | super(container, WIDTH, HEIGHT); 19 | te = tileEntity; 20 | } 21 | 22 | @Override 23 | protected void drawGuiContainerForegroundLayer(int param1, int param2) { 24 | FontRenderer fr = mc.fontRenderer; 25 | 26 | drawCenteredString("NanoFog Terminal", 5, 4210752); 27 | 28 | drawCenteredString("NanoDNA", 40, 4210752); 29 | 30 | fr.drawString("input", 28, 60, 4210752); 31 | fr.drawString("output", 123, 60, 4210752); 32 | 33 | 34 | drawCenteredString("energy usage: "+(TileEntityNanoFogTerminal.FogUpkeepCost * te.getFogBlocks().size())+" units/tick", 95, 4210752); 35 | } 36 | @Override 37 | protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { 38 | mc.getTextureManager().bindTexture(background); 39 | drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/client/jei/JEI_Plugin.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.client.jei; 2 | 3 | import mezz.jei.api.IJeiRuntime; 4 | import mezz.jei.api.IModPlugin; 5 | import mezz.jei.api.IModRegistry; 6 | import mezz.jei.api.ISubtypeRegistry; 7 | import mezz.jei.api.ingredients.IIngredientBlacklist; 8 | import mezz.jei.api.ingredients.IModIngredientRegistration; 9 | import mezz.jei.api.recipe.IRecipeCategoryRegistration; 10 | import net.minecraft.item.Item; 11 | import net.minecraft.item.ItemStack; 12 | import pcl.opensecurity.common.blocks.BlockNanoFog; 13 | import pcl.opensecurity.common.blocks.BlockRolldoorElement; 14 | 15 | @mezz.jei.api.JEIPlugin 16 | public class JEI_Plugin implements IModPlugin { 17 | public @interface JEIPlugin {} 18 | 19 | public JEI_Plugin(){} 20 | 21 | 22 | @Override 23 | public void registerItemSubtypes(ISubtypeRegistry subtypeRegistry) { 24 | 25 | } 26 | 27 | /** 28 | * Register special ingredients, beyond the basic ItemStack and FluidStack. 29 | * 30 | * @since JEI 3.11.0 31 | */ 32 | @Override 33 | public void registerIngredients(IModIngredientRegistration registry) { 34 | 35 | } 36 | 37 | /** 38 | * Register the categories handled by this plugin. 39 | * These are registered before recipes so they can be checked for validity. 40 | * 41 | * @since JEI 4.5.0 42 | */ 43 | @Override 44 | public void registerCategories(IRecipeCategoryRegistration registry) { 45 | } 46 | 47 | /** 48 | * Register this mod plugin with the mod registry. 49 | */ 50 | @Override 51 | public void register(IModRegistry registry) { 52 | IIngredientBlacklist blacklist = registry.getJeiHelpers().getIngredientBlacklist(); 53 | blacklist.addIngredientToBlacklist(new ItemStack(Item.getItemFromBlock(BlockNanoFog.DEFAULTITEM))); 54 | blacklist.addIngredientToBlacklist(new ItemStack(Item.getItemFromBlock(BlockRolldoorElement.DEFAULTITEM))); 55 | } 56 | 57 | /** 58 | * Called when jei's runtime features are available, after all mods have registered. 59 | * 60 | * @since JEI 2.23.0 61 | */ 62 | @Override 63 | public void onRuntimeAvailable(IJeiRuntime jeiRuntime) { 64 | 65 | } 66 | } 67 | 68 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/client/models/CamoModel.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.client.models; 2 | 3 | /* based on McJty's RFTools Shield */ 4 | 5 | import net.minecraft.client.renderer.block.model.IBakedModel; 6 | import net.minecraft.client.renderer.texture.TextureAtlasSprite; 7 | import net.minecraft.client.renderer.vertex.VertexFormat; 8 | import net.minecraft.util.ResourceLocation; 9 | import net.minecraftforge.client.model.IModel; 10 | import net.minecraftforge.common.model.IModelState; 11 | import net.minecraftforge.common.model.TRSRTransformation; 12 | 13 | import java.util.Collection; 14 | import java.util.Collections; 15 | import java.util.function.Function; 16 | 17 | public class CamoModel implements IModel { 18 | @Override 19 | public IBakedModel bake(IModelState state, VertexFormat format, Function bakedTextureGetter) { 20 | return new CamouflageBakedModel(state, format, bakedTextureGetter); 21 | } 22 | 23 | @Override 24 | public Collection getDependencies() { 25 | return Collections.emptySet(); 26 | } 27 | 28 | @Override 29 | public Collection getTextures() { 30 | return Collections.emptyList(); 31 | } 32 | 33 | @Override 34 | public IModelState getDefaultState() { 35 | return TRSRTransformation.identity(); 36 | } 37 | } -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/client/models/ModelEnergyBolt.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.client.models; 2 | 3 | import net.minecraft.client.model.ModelBase; 4 | import net.minecraft.client.model.ModelRenderer; 5 | 6 | public class ModelEnergyBolt extends ModelBase { 7 | private ModelRenderer bolt; 8 | 9 | public ModelEnergyBolt() { 10 | this.textureWidth = 64; 11 | this.textureHeight = 64; 12 | this.bolt = new ModelRenderer(this, 23, 38); 13 | this.bolt.setRotationPoint(0.0F, 0.0F, 0.0F); 14 | this.bolt.addBox(-0.5F, -0.5F, -4.0F, 1, 1, 8, 0.0F); 15 | } 16 | 17 | public void render(float scale) { 18 | bolt.render(scale); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/client/models/ModelNanoFogSwarm.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.client.models; 2 | /** 3 | * @author ben_mkiv 4 | */ 5 | import net.minecraft.client.model.ModelBase; 6 | import net.minecraft.client.renderer.GlStateManager; 7 | import net.minecraftforge.fml.relauncher.Side; 8 | import net.minecraftforge.fml.relauncher.SideOnly; 9 | import pcl.opensecurity.common.entity.EntityNanoFogSwarm; 10 | 11 | 12 | @SideOnly(Side.CLIENT) 13 | public abstract class ModelNanoFogSwarm extends ModelBase { 14 | public static int resolution = 8; 15 | static double resolutionOffset = 1d/resolution/2d; 16 | 17 | 18 | public static void setupResolution(int res){ 19 | resolution = res; 20 | resolutionOffset = 1d/resolution/2d; 21 | } 22 | 23 | static float interpolate(float current, float max){ 24 | return 1f/max * Math.min(current, max); 25 | } 26 | 27 | @SideOnly(Side.CLIENT) 28 | public void render(EntityNanoFogSwarm entity, float partialTicks, float scale) { 29 | 30 | float cubeScaleFactor = getCubeScaleFactor(entity); 31 | float cubeOffsetFactor = getCubeOffsetFactor(entity); 32 | 33 | scale*=getEntityScaleFactor(entity); 34 | 35 | GlStateManager.translate(resolutionOffset, resolutionOffset + 0.5, resolutionOffset); 36 | GlStateManager.color(0, 0, 0, getAlpha(entity)); 37 | GlStateManager.scale(scale, scale, scale); 38 | 39 | for(EntityNanoFogSwarm.Cube cube : entity.cubes) 40 | cube.render(partialTicks, cubeScaleFactor, cubeOffsetFactor); 41 | } 42 | 43 | abstract float getCubeScaleFactor(EntityNanoFogSwarm entity); 44 | abstract float getAlpha(EntityNanoFogSwarm entity); 45 | abstract float getEntityScaleFactor(EntityNanoFogSwarm entity); 46 | 47 | abstract float getCubeOffsetFactor(EntityNanoFogSwarm entity); 48 | 49 | public static void drawCube(float scale){ 50 | scale/=2f; 51 | 52 | ModelCube.drawCube(-scale, -scale, -scale, scale, scale, scale); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/client/models/ModelNanoFogSwarmBuild.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.client.models; 2 | /** 3 | * @author ben_mkiv 4 | */ 5 | import pcl.opensecurity.common.entity.EntityNanoFogSwarm; 6 | 7 | public class ModelNanoFogSwarmBuild extends ModelNanoFogSwarm { 8 | @Override 9 | float getCubeScaleFactor(EntityNanoFogSwarm entity){ 10 | return 0.3f + 0.7f * interpolate(entity.buildProgress, EntityNanoFogSwarm.buildNotifyProgress); 11 | } 12 | 13 | @Override 14 | float getAlpha(EntityNanoFogSwarm entity){ 15 | float alphaBase = 0.3f; 16 | 17 | if(entity.targetReached && entity.buildProgress > 0){ 18 | alphaBase+=0.2f * interpolate(entity.buildProgress, EntityNanoFogSwarm.buildNotifyProgress); 19 | } 20 | 21 | return alphaBase; 22 | } 23 | 24 | @Override 25 | float getEntityScaleFactor(EntityNanoFogSwarm entity){ 26 | float entityScaleFactor = 1.35f; 27 | 28 | if (entity.ticksExisted <= 20) 29 | entityScaleFactor *= interpolate(entity.ticksExisted, 20); 30 | else if (entity.buildProgress > 0) 31 | entityScaleFactor -= 0.2F * (0.05 * entity.buildProgress); 32 | 33 | return entityScaleFactor / resolution; 34 | } 35 | 36 | @Override 37 | float getCubeOffsetFactor(EntityNanoFogSwarm entity){ 38 | if(entity.blockJobDone != 0) 39 | return 0; 40 | 41 | if (entity.targetReached) 42 | return interpolate(EntityNanoFogSwarm.buildNotifyProgress - entity.buildProgress, EntityNanoFogSwarm.buildNotifyProgress); 43 | 44 | return 1f; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/client/models/ModelNanoFogSwarmReturn.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.client.models; 2 | /** 3 | * @author ben_mkiv 4 | */ 5 | import pcl.opensecurity.common.entity.EntityNanoFogSwarm; 6 | 7 | public class ModelNanoFogSwarmReturn extends ModelNanoFogSwarm { 8 | 9 | @Override 10 | float getCubeScaleFactor(EntityNanoFogSwarm entity){ 11 | if(entity.ticksExisted < EntityNanoFogSwarm.buildNotifyProgress) 12 | return 1f - 0.7f * interpolate(entity.ticksExisted, EntityNanoFogSwarm.buildNotifyProgress); 13 | 14 | return 0.3f; 15 | } 16 | 17 | @Override 18 | float getAlpha(EntityNanoFogSwarm entity){ 19 | float alphaBase = 0.3f; 20 | 21 | if(entity.ticksExisted < EntityNanoFogSwarm.buildNotifyProgress){ 22 | alphaBase+=0.2f * interpolate(EntityNanoFogSwarm.buildNotifyProgress-entity.ticksExisted, EntityNanoFogSwarm.buildNotifyProgress); 23 | } 24 | 25 | return alphaBase; 26 | } 27 | 28 | @Override 29 | float getEntityScaleFactor(EntityNanoFogSwarm entity){ 30 | float entityScaleFactor = 1.35f; 31 | 32 | 33 | if (entity.ticksExisted < EntityNanoFogSwarm.buildNotifyProgress) 34 | entityScaleFactor -= (0.2F * (0.05 * (EntityNanoFogSwarm.buildNotifyProgress - entity.ticksExisted))); 35 | else if(entity.buildProgress >= 0) 36 | entityScaleFactor -= 0.37 * interpolate(EntityNanoFogSwarm.buildNotifyProgress - entity.ticksExisted, EntityNanoFogSwarm.buildNotifyProgress); 37 | else 38 | entityScaleFactor-=1f * interpolate(entity.ticksExisted - 10 - EntityNanoFogSwarm.buildNotifyProgress, 10); 39 | 40 | return entityScaleFactor / resolution; 41 | } 42 | 43 | @Override 44 | float getCubeOffsetFactor(EntityNanoFogSwarm entity){ 45 | if (entity.buildProgress > EntityNanoFogSwarm.buildNotifyProgress) 46 | return 0; 47 | 48 | if (entity.buildProgress > 0) 49 | return (interpolate(EntityNanoFogSwarm.buildNotifyProgress - entity.buildProgress, EntityNanoFogSwarm.buildNotifyProgress)); 50 | 51 | return 1; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/client/renderer/EnergyTurretRenderHelper.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.client.renderer; 2 | 3 | import net.minecraft.client.renderer.tileentity.TileEntityItemStackRenderer; 4 | import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; 5 | import net.minecraft.item.ItemStack; 6 | import pcl.opensecurity.common.tileentity.TileEntityEnergyTurret; 7 | 8 | public class EnergyTurretRenderHelper extends TileEntityItemStackRenderer { 9 | private TileEntityEnergyTurret turrettRender = new TileEntityEnergyTurret(); 10 | 11 | @Override 12 | public void renderByItem(ItemStack itemStack) { 13 | TileEntityRendererDispatcher.instance.render(this.turrettRender, 0.0D, 0.0D, 0.0D, 0.0F); 14 | } 15 | } -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/client/renderer/NanoFogSwarmRenderer.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.client.renderer; 2 | /** 3 | * @author ben_mkiv 4 | */ 5 | import net.minecraft.client.renderer.GlStateManager; 6 | import net.minecraft.client.renderer.entity.Render; 7 | import net.minecraft.client.renderer.entity.RenderManager; 8 | import net.minecraft.util.ResourceLocation; 9 | import net.minecraftforge.fml.relauncher.Side; 10 | import net.minecraftforge.fml.relauncher.SideOnly; 11 | import pcl.opensecurity.OpenSecurity; 12 | import pcl.opensecurity.client.models.ModelNanoFogSwarmBuild; 13 | import pcl.opensecurity.client.models.ModelNanoFogSwarmReturn; 14 | import pcl.opensecurity.common.entity.EntityNanoFogSwarm; 15 | import net.minecraftforge.fml.client.registry.IRenderFactory; 16 | 17 | @SideOnly(Side.CLIENT) 18 | public class NanoFogSwarmRenderer extends Render { 19 | public static Factory FACTORY = new Factory(); 20 | 21 | ModelNanoFogSwarmBuild modelBuild; 22 | ModelNanoFogSwarmReturn modelReturn; 23 | 24 | private static final ResourceLocation textureLoc = new ResourceLocation(OpenSecurity.MODID + ":textures/model/nanofogswarm.png"); 25 | 26 | public NanoFogSwarmRenderer(RenderManager manager){ 27 | super(manager); 28 | modelBuild = new ModelNanoFogSwarmBuild(); 29 | modelReturn = new ModelNanoFogSwarmReturn(); 30 | } 31 | 32 | @Override 33 | public void doRender(EntityNanoFogSwarm entity, double x, double y, double z, float entityYaw, float partialTicks){ 34 | GlStateManager.disableTexture2D(); 35 | GlStateManager.pushMatrix(); 36 | GlStateManager.translate(x, y, z); 37 | 38 | if(entity.isBuildTask()) 39 | modelBuild.render(entity, partialTicks, 1); 40 | else if(entity.isReturnTask()) 41 | modelReturn.render(entity, partialTicks, 1); 42 | 43 | GlStateManager.popMatrix(); 44 | GlStateManager.enableTexture2D(); 45 | } 46 | 47 | @Override 48 | protected ResourceLocation getEntityTexture(EntityNanoFogSwarm par1EntityLiving) { 49 | return textureLoc; 50 | } 51 | 52 | public static class Factory implements IRenderFactory { 53 | @Override 54 | public Render createRenderFor(RenderManager manager) { 55 | return new NanoFogSwarmRenderer(manager); 56 | } 57 | } 58 | 59 | } 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/client/renderer/RenderEnergyTurret.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.client.renderer; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.client.renderer.GlStateManager; 5 | import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; 6 | import net.minecraft.util.ResourceLocation; 7 | import pcl.opensecurity.client.models.ModelEnergyTurret; 8 | import pcl.opensecurity.common.tileentity.TileEntityEnergyTurret; 9 | 10 | public class RenderEnergyTurret extends TileEntitySpecialRenderer { 11 | private final ModelEnergyTurret model; 12 | private ResourceLocation textures; 13 | 14 | public RenderEnergyTurret() { 15 | super(); 16 | this.model = new ModelEnergyTurret(); 17 | this.textures = new ResourceLocation("opensecurity:textures/model/turret.png"); 18 | } 19 | 20 | @Override 21 | public void render(TileEntityEnergyTurret te, double x, double y, double z, float partialTicks, int destroyStage, float alpha) { 22 | GlStateManager.pushMatrix(); 23 | GlStateManager.translate(x, y, z); 24 | Minecraft.getMinecraft().renderEngine.bindTexture(this.textures); 25 | GlStateManager.disableBlend(); 26 | 27 | if (te != null && te.getWorld() != null){ 28 | // render in world 29 | this.model.render(0.0625F, te.getEnergyTurret()); 30 | } else { 31 | // probably render in some inventory 32 | GlStateManager.translate(-0.1, 0.1, 0); // align to slot 33 | this.model.render(0.0625F, null); 34 | } 35 | 36 | GlStateManager.enableBlend(); 37 | GlStateManager.popMatrix(); 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/client/renderer/RenderEntityEnergyBolt.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.client.renderer; 2 | 3 | import net.minecraft.client.renderer.GlStateManager; 4 | 5 | import net.minecraft.client.renderer.entity.Render; 6 | import net.minecraft.client.renderer.entity.RenderManager; 7 | import net.minecraft.util.ResourceLocation; 8 | import pcl.opensecurity.client.models.ModelEnergyBolt; 9 | import pcl.opensecurity.common.entity.EntityEnergyBolt; 10 | 11 | public class RenderEntityEnergyBolt extends Render { 12 | private static final ResourceLocation textures = new ResourceLocation("opensecurity:textures/model/turret.png"); 13 | private ModelEnergyBolt model; 14 | 15 | public RenderEntityEnergyBolt(RenderManager renderManager) { 16 | super(renderManager); 17 | this.model = new ModelEnergyBolt(); 18 | } 19 | 20 | @Override 21 | public void doRender(EntityEnergyBolt entity, double x, double y, double z, float p_76986_8_, float p_76986_9_) { 22 | bindEntityTexture(entity); 23 | GlStateManager.pushMatrix(); 24 | GlStateManager.translate(x, y, z); 25 | GlStateManager.rotate(entity.rotationYaw, 0, 1, 0); 26 | GlStateManager.rotate(-entity.rotationPitch, 1, 0, 0); 27 | model.render(0.0625F); 28 | GlStateManager.popMatrix(); 29 | } 30 | 31 | @Override 32 | protected ResourceLocation getEntityTexture(EntityEnergyBolt entity) { 33 | return textures; 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/client/sounds/MachineSound.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.client.sounds; 2 | 3 | import net.minecraft.client.audio.ITickableSound; 4 | import net.minecraft.client.audio.PositionedSound; 5 | import net.minecraft.util.ResourceLocation; 6 | import net.minecraft.util.SoundCategory; 7 | import net.minecraft.util.math.BlockPos; 8 | import net.minecraftforge.fml.client.FMLClientHandler; 9 | import net.minecraftforge.fml.relauncher.Side; 10 | import net.minecraftforge.fml.relauncher.SideOnly; 11 | 12 | public class MachineSound extends PositionedSound implements ITickableSound { 13 | 14 | private boolean donePlaying; 15 | 16 | public MachineSound(ResourceLocation sound, BlockPos pos, float volume, float pitch) { 17 | this(sound, pos, volume, pitch, true); 18 | } 19 | 20 | public MachineSound(ResourceLocation sound, BlockPos pos, float volume, float pitch, boolean repeat) { 21 | super(sound, SoundCategory.BLOCKS); 22 | this.xPosF = pos.getX(); 23 | this.yPosF = pos.getY(); 24 | this.zPosF = pos.getZ(); 25 | this.volume = volume; 26 | this.pitch = pitch; 27 | this.repeat = repeat; 28 | } 29 | 30 | @Override 31 | public void update() { 32 | } 33 | 34 | @SideOnly(Side.CLIENT) 35 | public void endPlaying() { 36 | if(sound != null) 37 | FMLClientHandler.instance().getClient().getSoundHandler().stopSound(this); 38 | 39 | donePlaying = true; 40 | } 41 | 42 | public void startPlaying() { 43 | donePlaying = false; 44 | } 45 | 46 | @Override 47 | public boolean isDonePlaying() { 48 | return donePlaying; 49 | } 50 | } -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/CommonProxy.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common; 2 | 3 | import net.minecraft.world.World; 4 | import net.minecraftforge.fml.common.network.NetworkRegistry; 5 | import pcl.opensecurity.OpenSecurity; 6 | 7 | /** 8 | * @author Caitlyn 9 | */ 10 | public class CommonProxy { 11 | 12 | public World getWorld(int dimId) { 13 | //overridden separately for client and server. 14 | return null; 15 | } 16 | 17 | public void registerSounds() { 18 | // TODO Auto-generated method stub 19 | } 20 | 21 | public void init() { 22 | NetworkRegistry.INSTANCE.registerGuiHandler(OpenSecurity.instance, new GuiHandler()); 23 | } 24 | 25 | public void preinit() {} 26 | 27 | protected void registerRenderers() { 28 | // TODO Auto-generated method stub 29 | 30 | } 31 | public void registerModels() { 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/SoundHandler.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common; 2 | 3 | import net.minecraft.util.ResourceLocation; 4 | import net.minecraft.util.SoundEvent; 5 | import net.minecraftforge.event.RegistryEvent; 6 | import net.minecraftforge.fml.common.Mod; 7 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 8 | import pcl.opensecurity.client.sounds.AlarmResource; 9 | 10 | 11 | public class SoundHandler { 12 | 13 | public static SoundEvent turretMove; 14 | public static SoundEvent turretFire; 15 | public static SoundEvent keypad_press; 16 | public static SoundEvent security_door; 17 | public static SoundEvent scanner1; 18 | public static SoundEvent scanner2; 19 | public static SoundEvent scanner3; 20 | public static SoundEvent card_swipe; 21 | 22 | public static void registerSounds() { 23 | turretMove = registerSound("turretmove"); 24 | turretFire = registerSound("turretfire"); 25 | keypad_press = registerSound("keypad_press"); 26 | security_door = registerSound("security_door"); 27 | scanner1 = registerSound("scanner1"); 28 | scanner2 = registerSound("scanner2"); 29 | scanner3 = registerSound("scanner3"); 30 | card_swipe = registerSound("card_swipe"); 31 | } 32 | 33 | /** 34 | * Register a {@link SoundEvent}. 35 | * 36 | * @param soundName The SoundEvent's name without the testmod3 prefix 37 | * @return The SoundEvent 38 | */ 39 | private static SoundEvent registerSound(String soundName) 40 | { 41 | final ResourceLocation soundID = new ResourceLocation(AlarmResource.PACK_NAME, soundName); 42 | //return GameRegistry.register(new SoundEvent(soundID).setRegistryName(soundID)); 43 | return new SoundEvent(soundID).setRegistryName(soundID); 44 | } 45 | 46 | @Mod.EventBusSubscriber 47 | public static class RegistrationHandler { 48 | @SubscribeEvent 49 | public static void registerSoundEvents(RegistryEvent.Register event) { 50 | event.getRegistry().registerAll( 51 | turretMove, 52 | turretFire, 53 | keypad_press, 54 | security_door, 55 | scanner1, 56 | scanner2, 57 | scanner3, 58 | card_swipe 59 | ); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/blocks/BlockAlarm.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.blocks; 2 | 3 | import net.minecraft.block.Block; 4 | import net.minecraft.block.material.Material; 5 | import net.minecraft.tileentity.TileEntity; 6 | import net.minecraft.world.World; 7 | import pcl.opensecurity.common.tileentity.TileEntityAlarm; 8 | 9 | public class BlockAlarm extends BlockOSBase { 10 | public static final String NAME = "alarm"; 11 | public static Block DEFAULTITEM; 12 | 13 | public BlockAlarm() { 14 | super(NAME, Material.IRON, 0.5f); 15 | } 16 | 17 | @Override 18 | public TileEntity createNewTileEntity(World worldIn, int meta) { 19 | return new TileEntityAlarm(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/blocks/BlockBiometricReader.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.blocks; 2 | 3 | import net.minecraft.block.Block; 4 | import net.minecraft.block.material.Material; 5 | import net.minecraft.block.state.IBlockState; 6 | import net.minecraft.entity.player.EntityPlayer; 7 | import net.minecraft.tileentity.TileEntity; 8 | import net.minecraft.util.EnumFacing; 9 | import net.minecraft.util.EnumHand; 10 | import net.minecraft.util.math.BlockPos; 11 | import net.minecraft.world.World; 12 | import pcl.opensecurity.common.tileentity.TileEntityBiometricReader; 13 | 14 | public class BlockBiometricReader extends BlockOSBase { 15 | public static final String NAME = "biometric_reader"; 16 | public static Block DEFAULTITEM; 17 | 18 | public BlockBiometricReader() { 19 | super(NAME, Material.IRON, 0.5f); 20 | } 21 | 22 | @Override 23 | public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { 24 | if (facing.getOpposite().getHorizontalIndex() == state.getBlock().getMetaFromState(state) && hand.equals(EnumHand.OFF_HAND)) { 25 | if(!worldIn.isRemote){ 26 | TileEntityBiometricReader tile = (TileEntityBiometricReader) worldIn.getTileEntity(pos); 27 | tile.doRead(playerIn, facing); 28 | } 29 | return true; 30 | } 31 | return false; 32 | } 33 | 34 | @Override 35 | public TileEntity createNewTileEntity(World var1, int var2) { 36 | return new TileEntityBiometricReader(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/blocks/BlockCardWriter.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.blocks; 2 | 3 | import net.minecraft.block.Block; 4 | import net.minecraft.block.material.Material; 5 | import net.minecraft.block.state.IBlockState; 6 | import net.minecraft.entity.player.EntityPlayer; 7 | import net.minecraft.inventory.IInventory; 8 | import net.minecraft.inventory.InventoryHelper; 9 | import net.minecraft.tileentity.TileEntity; 10 | import net.minecraft.util.EnumFacing; 11 | import net.minecraft.util.EnumHand; 12 | import net.minecraft.util.math.BlockPos; 13 | import net.minecraft.world.World; 14 | import pcl.opensecurity.OpenSecurity; 15 | import pcl.opensecurity.common.tileentity.TileEntityCardWriter; 16 | 17 | public class BlockCardWriter extends BlockOSBase { 18 | public static final String NAME = "card_writer"; 19 | public static Block DEFAULTITEM; 20 | 21 | public static final int GUI_ID = 1; 22 | 23 | public BlockCardWriter() { 24 | super(NAME, Material.IRON, 0.5f); 25 | } 26 | 27 | @Override 28 | public TileEntity createNewTileEntity(World var1, int var2) { 29 | return new TileEntityCardWriter(); 30 | } 31 | 32 | @Override 33 | public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, 34 | float hitX, float hitY, float hitZ) { 35 | // Only execute on the server 36 | if (world.isRemote) { 37 | return true; 38 | } 39 | TileEntity te = world.getTileEntity(pos); 40 | if (!(te instanceof TileEntityCardWriter)) { 41 | return false; 42 | } 43 | player.openGui(OpenSecurity.instance, GUI_ID, world, pos.getX(), pos.getY(), pos.getZ()); 44 | return true; 45 | } 46 | 47 | /** 48 | * Called serverside after this block is replaced with another in Chunk, but before the Tile Entity is updated 49 | */ 50 | @Override 51 | public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { 52 | TileEntity tileentity = worldIn.getTileEntity(pos); 53 | 54 | if (tileentity instanceof IInventory) { 55 | InventoryHelper.dropInventoryItems(worldIn, pos, (IInventory) tileentity); 56 | worldIn.updateComparatorOutputLevel(pos, this); 57 | } 58 | 59 | super.breakBlock(worldIn, pos, state); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/blocks/BlockData.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.blocks; 2 | 3 | import net.minecraft.block.Block; 4 | import net.minecraft.block.material.Material; 5 | import net.minecraft.tileentity.TileEntity; 6 | import net.minecraft.world.World; 7 | import pcl.opensecurity.common.tileentity.TileEntityDataBlock; 8 | 9 | public class BlockData extends BlockOSBase { 10 | public static final String NAME = "data_block"; 11 | public static Block DEFAULTITEM; 12 | 13 | public BlockData() { 14 | super(NAME, Material.IRON, 0.5f); 15 | } 16 | 17 | @Override 18 | public TileEntity createNewTileEntity(World var1, int var2) { 19 | return new TileEntityDataBlock(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/blocks/BlockEntityDetector.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.blocks; 2 | 3 | import net.minecraft.block.Block; 4 | import net.minecraft.block.material.Material; 5 | import net.minecraft.tileentity.TileEntity; 6 | import net.minecraft.world.World; 7 | import pcl.opensecurity.common.tileentity.TileEntityEntityDetector; 8 | 9 | /** 10 | * Created by Michi on 5/29/2017. 11 | */ 12 | public class BlockEntityDetector extends BlockOSBase { 13 | public static final String NAME = "entity_detector"; 14 | public static Block DEFAULTITEM; 15 | 16 | public BlockEntityDetector() { 17 | super(NAME, Material.IRON, 0.5f); 18 | } 19 | 20 | @Override 21 | public TileEntity createNewTileEntity(World worldIn, int meta) { 22 | return new TileEntityEntityDetector(); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/blocks/BlockNanoFogTerminal.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.blocks; 2 | 3 | import net.minecraft.block.Block; 4 | import net.minecraft.block.material.Material; 5 | import net.minecraft.block.state.IBlockState; 6 | import net.minecraft.entity.player.EntityPlayer; 7 | import net.minecraft.tileentity.TileEntity; 8 | import net.minecraft.util.EnumFacing; 9 | import net.minecraft.util.EnumHand; 10 | import net.minecraft.util.math.BlockPos; 11 | import net.minecraft.world.World; 12 | import pcl.opensecurity.OpenSecurity; 13 | import pcl.opensecurity.common.tileentity.TileEntityNanoFogTerminal; 14 | 15 | public class BlockNanoFogTerminal extends BlockOSBase { 16 | public static final String NAME = "nanofog_terminal"; 17 | public static Block DEFAULTITEM; 18 | 19 | public static final int GUI_ID = 3; 20 | 21 | 22 | public BlockNanoFogTerminal() { 23 | super(NAME, Material.IRON, 1f); 24 | } 25 | 26 | @Override 27 | public TileEntity createNewTileEntity(World worldIn, int meta) { 28 | return new TileEntityNanoFogTerminal(); 29 | } 30 | 31 | 32 | @Override 33 | public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, 34 | float hitX, float hitY, float hitZ) { 35 | // Only execute on the server 36 | if (world.isRemote) { 37 | return true; 38 | } 39 | TileEntity te = world.getTileEntity(pos); 40 | if (!(te instanceof TileEntityNanoFogTerminal)) { 41 | return false; 42 | } 43 | player.openGui(OpenSecurity.instance, GUI_ID, world, pos.getX(), pos.getY(), pos.getZ()); 44 | return true; 45 | } 46 | 47 | public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest){ 48 | if (!world.isRemote) { 49 | TileEntity te = world.getTileEntity(pos); 50 | if (te instanceof TileEntityNanoFogTerminal) { 51 | ((TileEntityNanoFogTerminal) te).removed(); 52 | } 53 | } 54 | 55 | return super.removedByPlayer(state, world, pos, player, willHarvest); 56 | } 57 | 58 | 59 | } 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/blocks/BlockRFIDReader.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.blocks; 2 | 3 | import net.minecraft.block.Block; 4 | import net.minecraft.block.material.Material; 5 | import net.minecraft.tileentity.TileEntity; 6 | import net.minecraft.world.World; 7 | import pcl.opensecurity.common.tileentity.TileEntityRFIDReader; 8 | 9 | public class BlockRFIDReader extends BlockOSBase { 10 | public static final String NAME = "rfid_reader"; 11 | public static Block DEFAULTITEM; 12 | 13 | public BlockRFIDReader() { 14 | super(NAME, Material.IRON, 0.5f); 15 | } 16 | 17 | @Override 18 | public TileEntity createNewTileEntity(World worldIn, int meta) { 19 | return new TileEntityRFIDReader(); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/blocks/BlockSecureMagDoor.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.blocks; 2 | 3 | import net.minecraft.item.Item; 4 | import pcl.opensecurity.common.items.ItemSecureMagDoor; 5 | import pcl.opensecurity.common.items.ItemSecurePrivateDoor; 6 | 7 | public class BlockSecureMagDoor extends BlockSecureDoor { 8 | public static final String NAME = "mag_secure_door"; 9 | public static BlockSecureMagDoor DEFAULTITEM; 10 | 11 | public BlockSecureMagDoor() { 12 | super(NAME); 13 | } 14 | 15 | @Override 16 | protected Item getItem() { 17 | return ItemSecureMagDoor.DEFAULTSTACK.getItem(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/blocks/BlockSecurePrivateDoor.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.blocks; 2 | 3 | import net.minecraft.item.Item; 4 | import pcl.opensecurity.common.items.ItemSecurePrivateDoor; 5 | 6 | public class BlockSecurePrivateDoor extends BlockSecureDoor { 7 | public static final String NAME = "private_secure_door"; 8 | public static BlockSecurePrivateDoor DEFAULTITEM; 9 | 10 | public BlockSecurePrivateDoor() { 11 | super(NAME); 12 | } 13 | 14 | @Override 15 | protected Item getItem() { 16 | return ItemSecurePrivateDoor.DEFAULTSTACK.getItem(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/blocks/BlockSecurityTerminal.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.blocks; 2 | 3 | import net.minecraft.block.Block; 4 | import net.minecraft.block.material.Material; 5 | import net.minecraft.block.state.IBlockState; 6 | import net.minecraft.entity.EntityLivingBase; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.tileentity.TileEntity; 9 | import net.minecraft.util.math.BlockPos; 10 | import net.minecraft.world.World; 11 | import pcl.opensecurity.common.tileentity.TileEntitySecurityTerminal; 12 | 13 | public class BlockSecurityTerminal extends BlockOSBase { 14 | public static final String NAME = "security_terminal"; 15 | public static Block DEFAULTITEM; 16 | 17 | public BlockSecurityTerminal() { 18 | super(NAME, Material.IRON, 1f); 19 | } 20 | 21 | /** 22 | * Called by ItemBlocks after a block is set in the world, to allow post-place logic 23 | */ 24 | public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { 25 | TileEntity te = worldIn.getTileEntity(pos); 26 | ((TileEntitySecurityTerminal) te).setOwner(placer.getUniqueID()); 27 | } 28 | 29 | @Override 30 | public TileEntity createNewTileEntity(World worldIn, int meta) { 31 | return new TileEntitySecurityTerminal(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/camouflage/CamoBlockId.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.camouflage; 2 | 3 | /* based on McJty's RFTools Shield */ 4 | 5 | /** 6 | * @author ben_mkiv 7 | */ 8 | 9 | import net.minecraft.block.Block; 10 | import net.minecraft.block.state.IBlockState; 11 | import net.minecraft.util.ResourceLocation; 12 | import net.minecraftforge.fml.common.registry.ForgeRegistries; 13 | 14 | public class CamoBlockId { 15 | private final String registryName; 16 | private final int meta; 17 | 18 | public CamoBlockId(IBlockState mimicBlock) { 19 | Block block = mimicBlock.getBlock(); 20 | this.registryName = block.getRegistryName().toString(); 21 | this.meta = block.getMetaFromState(mimicBlock); 22 | } 23 | 24 | public IBlockState getBlockState() { 25 | return ForgeRegistries.BLOCKS.getValue(new ResourceLocation(registryName)).getStateFromMeta(meta); 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return registryName + '@' + meta; 31 | } 32 | } -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/camouflage/CamoProperty.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.camouflage; 2 | 3 | import net.minecraftforge.common.property.IUnlistedProperty; 4 | 5 | public class CamoProperty implements IUnlistedProperty { 6 | 7 | private final String name; 8 | 9 | public CamoProperty(String name) { 10 | this.name = name; 11 | } 12 | 13 | @Override 14 | public String getName() { 15 | return name; 16 | } 17 | 18 | @Override 19 | public boolean isValid(CamoBlockId value) { 20 | return true; 21 | } 22 | 23 | @Override 24 | public Class getType() { 25 | return CamoBlockId.class; 26 | } 27 | 28 | @Override 29 | public String valueToString(CamoBlockId value) { 30 | return value.toString(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/drivers/AlarmDriver.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.drivers; 2 | 3 | import li.cil.oc.api.driver.DriverItem; 4 | import li.cil.oc.api.driver.EnvironmentProvider; 5 | import li.cil.oc.api.driver.item.HostAware; 6 | import li.cil.oc.api.driver.item.Slot; 7 | import li.cil.oc.api.network.Environment; 8 | import li.cil.oc.api.network.EnvironmentHost; 9 | import li.cil.oc.api.network.ManagedEnvironment; 10 | import li.cil.oc.common.Tier; 11 | import net.minecraft.item.Item; 12 | import net.minecraft.item.ItemStack; 13 | import net.minecraft.nbt.NBTTagCompound; 14 | import pcl.opensecurity.common.blocks.BlockAlarm; 15 | import pcl.opensecurity.common.tileentity.TileEntityAlarm; 16 | 17 | public class AlarmDriver extends BlockAlarm implements DriverItem, EnvironmentProvider, HostAware { 18 | public static AlarmDriver driver = new AlarmDriver(); 19 | 20 | @Override 21 | public boolean worksWith(ItemStack stack) { 22 | return stack.getItem().equals(Item.getItemFromBlock(BlockAlarm.DEFAULTITEM)); 23 | } 24 | 25 | @Override 26 | public boolean worksWith(ItemStack stack, Class host) { 27 | if(!worksWith(stack)) 28 | return false; 29 | 30 | return true; 31 | } 32 | 33 | @Override 34 | public Class getEnvironment(ItemStack stack) { 35 | return worksWith(stack) ? TileEntityAlarm.class : null; 36 | } 37 | 38 | @Override 39 | public ManagedEnvironment createEnvironment(ItemStack stack, EnvironmentHost container) { 40 | return new TileEntityAlarm(container); 41 | } 42 | 43 | @Override 44 | public String slot(ItemStack stack){ 45 | return Slot.Upgrade; 46 | } 47 | 48 | @Override 49 | public int tier(ItemStack stack) { 50 | return Tier.One(); 51 | } 52 | 53 | @Override 54 | public NBTTagCompound dataTag(ItemStack stack) { 55 | if(!stack.hasTagCompound()) { 56 | stack.setTagCompound(new NBTTagCompound()); 57 | } 58 | final NBTTagCompound nbt = stack.getTagCompound(); 59 | // This is the suggested key under which to store item component data. 60 | // You are free to change this as you please. 61 | if(!nbt.hasKey("oc:data")) { 62 | nbt.setTag("oc:data", new NBTTagCompound()); 63 | } 64 | return nbt.getCompoundTag("oc:data"); 65 | } 66 | } -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/drivers/RFIDReaderCardDriver.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.drivers; 2 | 3 | import li.cil.oc.api.driver.item.Slot; 4 | import li.cil.oc.api.network.EnvironmentHost; 5 | import li.cil.oc.api.network.ManagedEnvironment; 6 | import li.cil.oc.api.prefab.DriverItem; 7 | import net.minecraft.item.ItemStack; 8 | import pcl.opensecurity.common.items.ItemRFIDReaderCard; 9 | import pcl.opensecurity.common.tileentity.TileEntityRFIDReader; 10 | 11 | public class RFIDReaderCardDriver extends DriverItem { 12 | public static RFIDReaderCardDriver driver = new RFIDReaderCardDriver(); 13 | 14 | public RFIDReaderCardDriver() { 15 | super(ItemRFIDReaderCard.DEFAULTSTACK); 16 | } 17 | 18 | @Override 19 | public ManagedEnvironment createEnvironment(ItemStack stack, EnvironmentHost container) { 20 | return new TileEntityRFIDReader(container); 21 | } 22 | 23 | @Override 24 | public String slot(ItemStack stack) { 25 | return Slot.Card; 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/drivers/RFIDReaderDriver.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.drivers; 2 | 3 | import li.cil.oc.api.driver.DriverItem; 4 | import li.cil.oc.api.driver.EnvironmentProvider; 5 | import li.cil.oc.api.driver.item.HostAware; 6 | import li.cil.oc.api.driver.item.Slot; 7 | import li.cil.oc.api.network.Environment; 8 | import li.cil.oc.api.network.EnvironmentHost; 9 | import li.cil.oc.api.network.ManagedEnvironment; 10 | import li.cil.oc.common.Tier; 11 | import net.minecraft.item.Item; 12 | import net.minecraft.item.ItemStack; 13 | import net.minecraft.nbt.NBTTagCompound; 14 | import pcl.opensecurity.common.blocks.BlockRFIDReader; 15 | import pcl.opensecurity.common.tileentity.TileEntityRFIDReader; 16 | 17 | public class RFIDReaderDriver extends BlockRFIDReader implements DriverItem, EnvironmentProvider, HostAware { 18 | public static RFIDReaderDriver driver = new RFIDReaderDriver(); 19 | 20 | @Override 21 | public boolean worksWith(ItemStack stack) { 22 | return stack.getItem().equals(Item.getItemFromBlock(BlockRFIDReader.DEFAULTITEM)); 23 | } 24 | 25 | @Override 26 | public boolean worksWith(ItemStack stack, Class host) { 27 | if(!worksWith(stack)) 28 | return false; 29 | 30 | return true; 31 | } 32 | 33 | @Override 34 | public Class getEnvironment(ItemStack stack) { 35 | return worksWith(stack) ? TileEntityRFIDReader.class : null; 36 | } 37 | 38 | @Override 39 | public ManagedEnvironment createEnvironment(ItemStack stack, EnvironmentHost container) { 40 | return new TileEntityRFIDReader(container); 41 | } 42 | 43 | @Override 44 | public String slot(ItemStack stack){ 45 | return Slot.Upgrade; 46 | } 47 | 48 | @Override 49 | public int tier(ItemStack stack) { 50 | return Tier.One(); 51 | } 52 | 53 | @Override 54 | public NBTTagCompound dataTag(ItemStack stack) { 55 | if(!stack.hasTagCompound()) { 56 | stack.setTagCompound(new NBTTagCompound()); 57 | } 58 | final NBTTagCompound nbt = stack.getTagCompound(); 59 | // This is the suggested key under which to store item component data. 60 | // You are free to change this as you please. 61 | if(!nbt.hasKey("oc:data")) { 62 | nbt.setTag("oc:data", new NBTTagCompound()); 63 | } 64 | return nbt.getCompoundTag("oc:data"); 65 | } 66 | } -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/interfaces/IColoredTile.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.interfaces; 2 | 3 | import net.minecraft.item.ItemDye; 4 | import net.minecraft.item.ItemStack; 5 | 6 | import java.awt.*; 7 | 8 | public interface IColoredTile { 9 | int getColor(); 10 | void setColor(int color); 11 | void onColorChanged(); 12 | 13 | default boolean isColoringItem(ItemStack stack) { 14 | return stack.getItem() instanceof ItemDye; 15 | } 16 | 17 | default int getColorFromStack(ItemStack stack){ 18 | float[] vals = li.cil.oc.util.Color.dyeColor(stack).getColorComponentValues(); 19 | return new Color(vals[0], vals[1], vals[2]).getRGB(); 20 | } 21 | 22 | default boolean setColor(ItemStack stack){ 23 | if(!isColoringItem(stack)) 24 | return false; 25 | 26 | setColor(getColorFromStack(stack)); 27 | return true; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/interfaces/IOwner.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.interfaces; 2 | 3 | import java.util.UUID; 4 | 5 | public interface IOwner { 6 | void setOwner(UUID uuid); 7 | UUID getOwner(); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/interfaces/IPasswordProtected.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.interfaces; 2 | 3 | public interface IPasswordProtected { 4 | void setPassword(String pass); 5 | String getPass(); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/interfaces/IVariant.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.interfaces; 2 | 3 | 4 | import net.minecraft.util.IStringSerializable; 5 | 6 | /** 7 | * An interface representing a block or item variant. 8 | * 9 | * @author Choonster 10 | */ 11 | public interface IVariant extends IStringSerializable { 12 | 13 | /** 14 | * Get the metadata value of this variant. 15 | * 16 | * @return The metadata value 17 | */ 18 | int getMeta(); 19 | } -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/inventory/slot/BaseSlot.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.inventory.slot; 2 | 3 | import net.minecraft.tileentity.TileEntity; 4 | import net.minecraftforge.items.IItemHandler; 5 | import net.minecraftforge.items.SlotItemHandler; 6 | 7 | public class BaseSlot extends SlotItemHandler { 8 | 9 | protected T tileEntity; 10 | 11 | BaseSlot(T tileEntity, IItemHandler itemHandler, int index, int xPosition, int yPosition) { 12 | super(itemHandler, index, xPosition, yPosition); 13 | this.tileEntity = tileEntity; 14 | } 15 | 16 | @Override 17 | public void onSlotChanged() { 18 | super.onSlotChanged(); 19 | tileEntity.markDirty(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/inventory/slot/CardInputSlot.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.inventory.slot; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import net.minecraftforge.items.IItemHandler; 5 | import pcl.opensecurity.common.items.ItemCard; 6 | import pcl.opensecurity.common.tileentity.TileEntityCardWriter; 7 | 8 | import javax.annotation.Nonnull; 9 | import java.util.ArrayList; 10 | import java.util.Arrays; 11 | import java.util.List; 12 | 13 | public class CardInputSlot extends BaseSlot implements ISlotTooltip { 14 | 15 | public CardInputSlot(TileEntityCardWriter tileEntity, IItemHandler itemHandler, int index, int xPosition, int yPosition) { 16 | super(tileEntity, itemHandler, index, xPosition, yPosition); 17 | } 18 | 19 | @Override 20 | public boolean isItemValid(@Nonnull ItemStack stack) { 21 | return (stack.getItem() instanceof ItemCard || stack.getItem().equals(li.cil.oc.api.Items.get("eeprom").item())); 22 | } 23 | 24 | @Override 25 | public List getTooltip(){ 26 | return new ArrayList<>(Arrays.asList("Accepted Items:", "EEPROM", "Magnetic Card", "RFID Card")); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/inventory/slot/CardOutputSlot.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.inventory.slot; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import net.minecraftforge.items.IItemHandler; 5 | import pcl.opensecurity.common.tileentity.TileEntityCardWriter; 6 | 7 | import javax.annotation.Nonnull; 8 | 9 | public class CardOutputSlot extends BaseSlot { 10 | 11 | public CardOutputSlot(TileEntityCardWriter tileEntity, IItemHandler itemHandler, int index, int xPosition, int yPosition) { 12 | super(tileEntity, itemHandler, index, xPosition, yPosition); 13 | } 14 | 15 | @Override 16 | public boolean isItemValid(@Nonnull ItemStack stack) { 17 | return false; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/inventory/slot/CooldownUpgradeSlot.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.inventory.slot; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import net.minecraftforge.items.IItemHandler; 5 | import pcl.opensecurity.common.items.ItemCooldownUpgrade; 6 | import pcl.opensecurity.common.tileentity.TileEntityEnergyTurret; 7 | import java.util.Arrays; 8 | 9 | import javax.annotation.Nonnull; 10 | import java.util.ArrayList; 11 | import java.util.List; 12 | 13 | public class CooldownUpgradeSlot extends BaseSlot implements ISlotTooltip { 14 | 15 | public CooldownUpgradeSlot(TileEntityEnergyTurret tileEntity, IItemHandler itemHandler, int index, int xPosition, int yPosition) { 16 | super(tileEntity, itemHandler, index, xPosition, yPosition); 17 | } 18 | 19 | @Override 20 | public boolean isItemValid(@Nonnull ItemStack stack) { 21 | return stack.getItem() instanceof ItemCooldownUpgrade; 22 | } 23 | 24 | @Override 25 | public List getTooltip(){ 26 | return new ArrayList<>(Arrays.asList("Accepted Items:", "Cooldown Upgrade")); 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/inventory/slot/DamageUpgradeSlot.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.inventory.slot; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import net.minecraftforge.items.IItemHandler; 5 | import pcl.opensecurity.common.items.ItemDamageUpgrade; 6 | import pcl.opensecurity.common.tileentity.TileEntityEnergyTurret; 7 | import java.util.Arrays; 8 | 9 | import javax.annotation.Nonnull; 10 | import java.util.ArrayList; 11 | import java.util.List; 12 | 13 | public class DamageUpgradeSlot extends BaseSlot implements ISlotTooltip { 14 | 15 | public DamageUpgradeSlot(TileEntityEnergyTurret tileEntity, IItemHandler itemHandler, int index, int xPosition, int yPosition) { 16 | super(tileEntity, itemHandler, index, xPosition, yPosition); 17 | } 18 | 19 | @Override 20 | public boolean isItemValid(@Nonnull ItemStack stack) { 21 | return stack.getItem() instanceof ItemDamageUpgrade; 22 | } 23 | 24 | @Override 25 | public List getTooltip(){ 26 | return new ArrayList<>(Arrays.asList("Accepted Items:", "Damage Upgrade")); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/inventory/slot/EnergyUpgradeSlot.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.inventory.slot; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import net.minecraftforge.items.IItemHandler; 5 | import pcl.opensecurity.common.items.ItemEnergyUpgrade; 6 | import pcl.opensecurity.common.tileentity.TileEntityEnergyTurret; 7 | import java.util.Arrays; 8 | 9 | import javax.annotation.Nonnull; 10 | import java.util.ArrayList; 11 | import java.util.List; 12 | 13 | public class EnergyUpgradeSlot extends BaseSlot implements ISlotTooltip { 14 | 15 | public EnergyUpgradeSlot(TileEntityEnergyTurret tileEntity, IItemHandler itemHandler, int index, int xPosition, int yPosition) { 16 | super(tileEntity, itemHandler, index, xPosition, yPosition); 17 | } 18 | 19 | @Override 20 | public boolean isItemValid(@Nonnull ItemStack stack) { 21 | return stack.getItem() instanceof ItemEnergyUpgrade; 22 | } 23 | 24 | @Override 25 | public List getTooltip(){ 26 | return new ArrayList<>(Arrays.asList("Accepted Items:", "Energy Upgrade")); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/inventory/slot/ISlotTooltip.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.inventory.slot; 2 | 3 | import java.util.List; 4 | 5 | public interface ISlotTooltip { 6 | List getTooltip(); 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/inventory/slot/MovementUpgradeSlot.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.inventory.slot; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import net.minecraftforge.items.IItemHandler; 5 | import pcl.opensecurity.common.items.ItemMovementUpgrade; 6 | import pcl.opensecurity.common.tileentity.TileEntityEnergyTurret; 7 | import java.util.Arrays; 8 | 9 | import javax.annotation.Nonnull; 10 | import java.util.ArrayList; 11 | import java.util.List; 12 | 13 | public class MovementUpgradeSlot extends BaseSlot implements ISlotTooltip { 14 | 15 | public MovementUpgradeSlot(TileEntityEnergyTurret tileEntity, IItemHandler itemHandler, int index, int xPosition, int yPosition) { 16 | super(tileEntity, itemHandler, index, xPosition, yPosition); 17 | } 18 | 19 | @Override 20 | public boolean isItemValid(@Nonnull ItemStack stack) { 21 | return stack.getItem() instanceof ItemMovementUpgrade; 22 | } 23 | 24 | @Override 25 | public List getTooltip(){ 26 | return new ArrayList<>(Arrays.asList("Accepted Items:", "Movement Upgrade")); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/inventory/slot/NanoFogTerminalOutputSlot.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.inventory.slot; 2 | 3 | import net.minecraftforge.items.IItemHandler; 4 | import pcl.opensecurity.common.tileentity.TileEntityNanoFogTerminal; 5 | import java.util.Arrays; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | public class NanoFogTerminalOutputSlot extends NanoFogTerminalSlot { 11 | public NanoFogTerminalOutputSlot(TileEntityNanoFogTerminal tileEntity, IItemHandler itemHandler, int index, int xPosition, int yPosition) { 12 | super(tileEntity, itemHandler, index, xPosition, yPosition); 13 | validItems.clear(); 14 | } 15 | 16 | @Override 17 | public List getTooltip(){ 18 | return new ArrayList<>(Arrays.asList("ejects:", "NanoDNA")); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/inventory/slot/NanoFogTerminalSlot.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.inventory.slot; 2 | 3 | import net.minecraft.item.Item; 4 | import net.minecraft.item.ItemStack; 5 | import net.minecraftforge.items.IItemHandler; 6 | import pcl.opensecurity.common.items.ItemNanoDNA; 7 | import pcl.opensecurity.common.tileentity.TileEntityNanoFogTerminal; 8 | 9 | import javax.annotation.Nonnull; 10 | import java.util.ArrayList; 11 | import java.util.Arrays; 12 | import java.util.List; 13 | 14 | public class NanoFogTerminalSlot extends BaseSlot implements ISlotTooltip { 15 | 16 | ArrayList validItems = new ArrayList<>(); 17 | 18 | public NanoFogTerminalSlot(TileEntityNanoFogTerminal tileEntity, IItemHandler itemHandler, int index, int xPosition, int yPosition) { 19 | super(tileEntity, itemHandler, index, xPosition, yPosition); 20 | 21 | validItems.add(ItemNanoDNA.DEFAULTSTACK.getItem()); 22 | } 23 | 24 | @Override 25 | public boolean isItemValid(@Nonnull ItemStack stack) { 26 | return validItems.contains(stack.getItem()); 27 | } 28 | 29 | @Override 30 | public void onSlotChanged(){ 31 | super.onSlotChanged(); 32 | } 33 | 34 | @Override 35 | public List getTooltip(){ 36 | return new ArrayList<>(Arrays.asList("Accepted Items:", "NanoDNA")); 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/items/ItemCard.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.items; 2 | 3 | import net.minecraft.entity.player.EntityPlayer; 4 | import net.minecraft.item.ItemStack; 5 | import net.minecraft.nbt.NBTTagCompound; 6 | import net.minecraft.util.EnumActionResult; 7 | import net.minecraft.util.EnumFacing; 8 | import net.minecraft.util.EnumHand; 9 | import net.minecraft.util.math.BlockPos; 10 | import net.minecraft.world.World; 11 | import pcl.opensecurity.OpenSecurity; 12 | 13 | import java.util.UUID; 14 | 15 | public abstract class ItemCard extends ItemOSBase { 16 | 17 | ItemCard(String name) { 18 | super(name); 19 | } 20 | 21 | @Override 22 | public EnumActionResult onItemUse(EntityPlayer player, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { 23 | return EnumActionResult.SUCCESS; 24 | } 25 | 26 | public static class CardTag{ 27 | public boolean locked = false; 28 | public String localUUID = UUID.randomUUID().toString(); 29 | public String dataTag = ""; 30 | public int color = 0xFFFFFF; 31 | 32 | public boolean isValid; 33 | 34 | public CardTag(ItemStack stack){ 35 | if(stack.getItem() instanceof ItemCard) 36 | readFromNBT(stack.getTagCompound()); 37 | } 38 | 39 | public CardTag(NBTTagCompound nbt){ 40 | readFromNBT(nbt); 41 | } 42 | 43 | public void readFromNBT(NBTTagCompound nbt){ 44 | if(nbt != null) { 45 | if (nbt.hasKey("uuid")) 46 | localUUID = OpenSecurity.ignoreUUIDs ? "-1" : nbt.getString("uuid"); 47 | 48 | if (nbt.hasKey("data")) 49 | dataTag = nbt.getString("data"); 50 | 51 | if (nbt.hasKey("locked")) 52 | locked = nbt.getBoolean("locked"); 53 | 54 | if (nbt.hasKey("display", 10)) { 55 | NBTTagCompound displayTag = nbt.getCompoundTag("display"); 56 | if (displayTag.hasKey("color", 3)) { 57 | color = displayTag.getInteger("color"); 58 | } 59 | } 60 | } 61 | 62 | isValid = dataTag.length() > 0; 63 | } 64 | 65 | public NBTTagCompound writeToNBT(NBTTagCompound nbt){ 66 | nbt.setString("data", dataTag); 67 | nbt.setString("uuid", localUUID); 68 | nbt.setBoolean("locked", locked); 69 | 70 | NBTTagCompound displayTag = new NBTTagCompound(); 71 | displayTag.setInteger("color", color); 72 | 73 | nbt.setTag("display", displayTag); 74 | 75 | return nbt; 76 | } 77 | 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/items/ItemCooldownUpgrade.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.items; 2 | 3 | import net.minecraft.item.ItemStack; 4 | 5 | public class ItemCooldownUpgrade extends ItemOSBase { 6 | public static final String NAME = "cooldown_upgrade"; 7 | public static ItemStack DEFAULTSTACK; 8 | 9 | public ItemCooldownUpgrade() { 10 | super(NAME); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/items/ItemDamageUpgrade.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.items; 2 | 3 | import net.minecraft.entity.player.EntityPlayer; 4 | import net.minecraft.item.ItemStack; 5 | import net.minecraft.nbt.NBTTagCompound; 6 | import net.minecraft.util.EnumActionResult; 7 | import net.minecraft.util.EnumFacing; 8 | import net.minecraft.util.EnumHand; 9 | import net.minecraft.util.math.BlockPos; 10 | import net.minecraft.world.World; 11 | 12 | public class ItemDamageUpgrade extends ItemOSBase { 13 | public static final String NAME = "damage_upgrade"; 14 | public static ItemStack DEFAULTSTACK; 15 | 16 | public ItemDamageUpgrade() { 17 | super(NAME); 18 | } 19 | 20 | public boolean hasOverlay(ItemStack stack) { 21 | return getColor(stack) != 0x00FFFFFF; 22 | } 23 | 24 | /** 25 | * Return whether the specified card ItemStack has a color. 26 | */ 27 | public boolean hasColor(ItemStack stack) { 28 | NBTTagCompound nbttagcompound = stack.getTagCompound(); 29 | return (nbttagcompound != null && nbttagcompound.hasKey("display", 10)) && nbttagcompound.getCompoundTag("display").hasKey("color", 3); 30 | } 31 | 32 | /** 33 | * Return the color for the specified card ItemStack. 34 | */ 35 | public int getColor(ItemStack stack) { 36 | NBTTagCompound nbttagcompound = stack.getTagCompound(); 37 | 38 | if (nbttagcompound != null) 39 | { 40 | NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display"); 41 | 42 | if (nbttagcompound1.hasKey("color", 3)) 43 | { 44 | return nbttagcompound1.getInteger("color"); 45 | } 46 | } 47 | 48 | return 0xFFFFFF; 49 | 50 | } 51 | 52 | public void setColor(ItemStack stack, int color) { 53 | NBTTagCompound nbttagcompound = stack.getTagCompound(); 54 | 55 | if (nbttagcompound == null) 56 | { 57 | nbttagcompound = new NBTTagCompound(); 58 | stack.setTagCompound(nbttagcompound); 59 | } 60 | 61 | NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display"); 62 | 63 | if (!nbttagcompound.hasKey("display", 10)) 64 | { 65 | nbttagcompound.setTag("display", nbttagcompound1); 66 | } 67 | 68 | nbttagcompound1.setInteger("color", color); 69 | } 70 | 71 | @Override 72 | public EnumActionResult onItemUse(EntityPlayer player, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { 73 | return EnumActionResult.SUCCESS; 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/items/ItemEnergyUpgrade.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.items; 2 | 3 | import net.minecraft.entity.player.EntityPlayer; 4 | import net.minecraft.item.ItemStack; 5 | import net.minecraft.nbt.NBTTagCompound; 6 | import net.minecraft.util.EnumActionResult; 7 | import net.minecraft.util.EnumFacing; 8 | import net.minecraft.util.EnumHand; 9 | import net.minecraft.util.math.BlockPos; 10 | import net.minecraft.world.World; 11 | 12 | public class ItemEnergyUpgrade extends ItemOSBase { 13 | public static final String NAME = "energy_upgrade"; 14 | public static ItemStack DEFAULTSTACK; 15 | 16 | public ItemEnergyUpgrade() { 17 | super(NAME); 18 | } 19 | 20 | public boolean hasOverlay(ItemStack stack) { 21 | return getColor(stack) != 0x00FFFFFF; 22 | } 23 | 24 | /** 25 | * Return whether the specified card ItemStack has a color. 26 | */ 27 | public boolean hasColor(ItemStack stack) { 28 | NBTTagCompound nbttagcompound = stack.getTagCompound(); 29 | return (nbttagcompound != null && nbttagcompound.hasKey("display", 10)) && nbttagcompound.getCompoundTag("display").hasKey("color", 3); 30 | } 31 | 32 | /** 33 | * Return the color for the specified card ItemStack. 34 | */ 35 | public int getColor(ItemStack stack) { 36 | NBTTagCompound nbttagcompound = stack.getTagCompound(); 37 | 38 | if (nbttagcompound != null) 39 | { 40 | NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display"); 41 | 42 | if (nbttagcompound1.hasKey("color", 3)) 43 | { 44 | return nbttagcompound1.getInteger("color"); 45 | } 46 | } 47 | 48 | return 0xFFFFFF; 49 | 50 | } 51 | 52 | public void setColor(ItemStack stack, int color) { 53 | NBTTagCompound nbttagcompound = stack.getTagCompound(); 54 | 55 | if (nbttagcompound == null) 56 | { 57 | nbttagcompound = new NBTTagCompound(); 58 | stack.setTagCompound(nbttagcompound); 59 | } 60 | 61 | NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display"); 62 | 63 | if (!nbttagcompound.hasKey("display", 10)) 64 | { 65 | nbttagcompound.setTag("display", nbttagcompound1); 66 | } 67 | 68 | nbttagcompound1.setInteger("color", color); 69 | } 70 | 71 | @Override 72 | public EnumActionResult onItemUse(EntityPlayer player, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { 73 | return EnumActionResult.SUCCESS; 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/items/ItemMagCard.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.items; 2 | 3 | import net.minecraft.item.ItemStack; 4 | 5 | public class ItemMagCard extends ItemCard { 6 | public static final String NAME = "mag_card"; 7 | public static ItemStack DEFAULTSTACK; 8 | 9 | public ItemMagCard() { 10 | super(NAME); 11 | } 12 | } -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/items/ItemMovementUpgrade.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.items; 2 | 3 | import net.minecraft.entity.player.EntityPlayer; 4 | import net.minecraft.item.ItemStack; 5 | import net.minecraft.nbt.NBTTagCompound; 6 | import net.minecraft.util.EnumActionResult; 7 | import net.minecraft.util.EnumFacing; 8 | import net.minecraft.util.EnumHand; 9 | import net.minecraft.util.math.BlockPos; 10 | import net.minecraft.world.World; 11 | 12 | public class ItemMovementUpgrade extends ItemOSBase { 13 | public static final String NAME = "movement_upgrade"; 14 | public static ItemStack DEFAULTSTACK; 15 | 16 | public ItemMovementUpgrade() { 17 | super(NAME); 18 | } 19 | 20 | public boolean hasOverlay(ItemStack stack) { 21 | return getColor(stack) != 0x00FFFFFF; 22 | } 23 | 24 | /** 25 | * Return whether the specified card ItemStack has a color. 26 | */ 27 | public boolean hasColor(ItemStack stack) { 28 | NBTTagCompound nbttagcompound = stack.getTagCompound(); 29 | return (nbttagcompound != null && nbttagcompound.hasKey("display", 10)) && nbttagcompound.getCompoundTag("display").hasKey("color", 3); 30 | } 31 | 32 | /** 33 | * Return the color for the specified card ItemStack. 34 | */ 35 | public int getColor(ItemStack stack) { 36 | NBTTagCompound nbttagcompound = stack.getTagCompound(); 37 | 38 | if (nbttagcompound != null) 39 | { 40 | NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display"); 41 | 42 | if (nbttagcompound1.hasKey("color", 3)) 43 | { 44 | return nbttagcompound1.getInteger("color"); 45 | } 46 | } 47 | 48 | return 0xFFFFFF; 49 | 50 | } 51 | 52 | public void setColor(ItemStack stack, int color) { 53 | NBTTagCompound nbttagcompound = stack.getTagCompound(); 54 | 55 | if (nbttagcompound == null) 56 | { 57 | nbttagcompound = new NBTTagCompound(); 58 | stack.setTagCompound(nbttagcompound); 59 | } 60 | 61 | NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display"); 62 | 63 | if (!nbttagcompound.hasKey("display", 10)) 64 | { 65 | nbttagcompound.setTag("display", nbttagcompound1); 66 | } 67 | 68 | nbttagcompound1.setInteger("color", color); 69 | } 70 | 71 | @Override 72 | public EnumActionResult onItemUse(EntityPlayer player, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { 73 | return EnumActionResult.SUCCESS; 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/items/ItemNanoDNA.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.items; 2 | 3 | import net.minecraft.item.ItemStack; 4 | 5 | public class ItemNanoDNA extends ItemOSBase { 6 | public static final String NAME = "nanodna"; 7 | public static ItemStack DEFAULTSTACK; 8 | 9 | public ItemNanoDNA() { 10 | super(NAME); 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/items/ItemOSBase.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.items; 2 | 3 | import net.minecraft.item.Item; 4 | import pcl.opensecurity.OpenSecurity; 5 | import pcl.opensecurity.common.ContentRegistry; 6 | 7 | public abstract class ItemOSBase extends Item { 8 | 9 | ItemOSBase(String name) { 10 | setUnlocalizedName("opensecurity." + name); 11 | setRegistryName(OpenSecurity.MODID, name); 12 | setCreativeTab(ContentRegistry.creativeTab); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/items/ItemRFIDCard.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.items; 2 | 3 | import net.minecraft.entity.EntityLiving; 4 | import net.minecraft.entity.EntityLivingBase; 5 | import net.minecraft.entity.player.EntityPlayer; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraft.nbt.NBTTagCompound; 8 | import net.minecraft.util.EnumHand; 9 | 10 | public class ItemRFIDCard extends ItemCard { 11 | public static final String NAME = "rfid_card"; 12 | public static ItemStack DEFAULTSTACK; 13 | 14 | public ItemRFIDCard() { 15 | super(NAME); 16 | } 17 | 18 | @Override 19 | public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer playerIn, EntityLivingBase target, EnumHand hand) { 20 | if (!stack.hasTagCompound() || !stack.getTagCompound().hasKey("data")) { 21 | return super.itemInteractionForEntity(stack, playerIn, target, hand); 22 | } else if (target instanceof EntityLiving || target instanceof EntityPlayer) { 23 | NBTTagCompound entityData = target.getEntityData(); 24 | NBTTagCompound rfidData; 25 | if (!entityData.hasKey("rfidData")) { 26 | rfidData = new NBTTagCompound(); 27 | entityData.setTag("rfidData", rfidData); 28 | } else { 29 | rfidData = entityData.getCompoundTag("rfidData"); 30 | } 31 | 32 | rfidData.setString("data", stack.getTagCompound().getString("data")); 33 | rfidData.setString("uuid", stack.getTagCompound().getString("uuid")); 34 | stack.setCount((stack.getCount() - 1)); 35 | return true; 36 | } else { 37 | return super.itemInteractionForEntity(stack, playerIn, target, hand); 38 | } 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/items/ItemRFIDReaderCard.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.items; 2 | 3 | import net.minecraft.item.ItemStack; 4 | 5 | public class ItemRFIDReaderCard extends ItemOSBase { 6 | public static final String NAME = "rfid_reader_card"; 7 | public static ItemStack DEFAULTSTACK; 8 | 9 | public ItemRFIDReaderCard() { 10 | super(NAME); 11 | } 12 | } -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/items/ItemSecureDoor.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.items; 2 | 3 | import net.minecraft.block.Block; 4 | import net.minecraft.entity.player.EntityPlayer; 5 | import net.minecraft.item.ItemDoor; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraft.tileentity.TileEntity; 8 | import net.minecraft.util.EnumActionResult; 9 | import net.minecraft.util.EnumFacing; 10 | import net.minecraft.util.EnumHand; 11 | import net.minecraft.util.math.BlockPos; 12 | import net.minecraft.world.World; 13 | import pcl.opensecurity.common.ContentRegistry; 14 | import pcl.opensecurity.common.blocks.BlockSecureDoor; 15 | import pcl.opensecurity.common.tileentity.TileEntitySecureDoor; 16 | 17 | import javax.annotation.Nonnull; 18 | 19 | public class ItemSecureDoor extends ItemDoor { 20 | public static ItemStack DEFAULTSTACK; 21 | 22 | public ItemSecureDoor(){ 23 | this(BlockSecureDoor.DEFAULTITEM); 24 | } 25 | 26 | @SuppressWarnings("ConstantConditions") 27 | ItemSecureDoor(Block block) { 28 | super(block); 29 | setRegistryName(block.getRegistryName()); 30 | setCreativeTab(ContentRegistry.creativeTab); 31 | } 32 | 33 | @Nonnull 34 | @Override 35 | public String getUnlocalizedName() { 36 | return BlockSecureDoor.DEFAULTITEM.getUnlocalizedName(); 37 | } 38 | 39 | @Nonnull 40 | @Override 41 | public String getUnlocalizedName(ItemStack stack) { 42 | return getUnlocalizedName(); 43 | } 44 | 45 | @Override 46 | public EnumActionResult onItemUse(EntityPlayer player, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ){ 47 | EnumActionResult result = super.onItemUse(player, worldIn, pos, hand, facing, hitX, hitY, hitZ); 48 | 49 | if(result.equals(EnumActionResult.SUCCESS)){ 50 | TileEntity teLower = worldIn.getTileEntity(pos.add(0, 1, 0)); 51 | if(teLower instanceof TileEntitySecureDoor){ 52 | ((TileEntitySecureDoor) teLower).setOwner(player.getUniqueID()); 53 | } 54 | } 55 | 56 | return result; 57 | } 58 | 59 | } -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/items/ItemSecureMagDoor.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.items; 2 | 3 | import net.minecraft.entity.player.EntityPlayer; 4 | import net.minecraft.item.ItemStack; 5 | import net.minecraft.tileentity.TileEntity; 6 | import net.minecraft.util.EnumActionResult; 7 | import net.minecraft.util.EnumFacing; 8 | import net.minecraft.util.EnumHand; 9 | import net.minecraft.util.math.BlockPos; 10 | import net.minecraft.world.World; 11 | import pcl.opensecurity.common.blocks.BlockSecureMagDoor; 12 | import pcl.opensecurity.common.tileentity.TileEntitySecureDoor; 13 | 14 | import javax.annotation.Nonnull; 15 | 16 | public class ItemSecureMagDoor extends ItemSecureDoor { 17 | public static ItemStack DEFAULTSTACK; 18 | 19 | public ItemSecureMagDoor() { 20 | super(BlockSecureMagDoor.DEFAULTITEM); 21 | } 22 | 23 | @Nonnull 24 | @Override 25 | public String getUnlocalizedName() { 26 | return BlockSecureMagDoor.DEFAULTITEM.getUnlocalizedName(); 27 | } 28 | 29 | @Override 30 | public EnumActionResult onItemUse(EntityPlayer player, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ){ 31 | EnumActionResult result = super.onItemUse(player, worldIn, pos, hand, facing, hitX, hitY, hitZ); 32 | 33 | if(result.equals(EnumActionResult.SUCCESS)){ 34 | TileEntity teLower = worldIn.getTileEntity(pos.add(0, 1, 0)); 35 | if(teLower instanceof TileEntitySecureDoor){ 36 | ((TileEntitySecureDoor) teLower).setOwner(player.getUniqueID()); 37 | ((TileEntitySecureDoor) teLower).enableMagReader(); 38 | } 39 | } 40 | 41 | return result; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/items/ItemSecurePrivateDoor.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.items; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import pcl.opensecurity.common.blocks.BlockSecurePrivateDoor; 5 | 6 | import javax.annotation.Nonnull; 7 | 8 | public class ItemSecurePrivateDoor extends ItemSecureDoor { 9 | public static ItemStack DEFAULTSTACK; 10 | 11 | public ItemSecurePrivateDoor() { 12 | super(BlockSecurePrivateDoor.DEFAULTITEM); 13 | } 14 | 15 | @Nonnull 16 | @Override 17 | public String getUnlocalizedName() { 18 | return BlockSecurePrivateDoor.DEFAULTITEM.getUnlocalizedName(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/protection/IProtection.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.protection; 2 | /** 3 | * @author ben_mkiv 4 | */ 5 | import net.minecraft.entity.Entity; 6 | 7 | public interface IProtection { 8 | boolean isProtected(Entity entityIn, Protection.UserAction action); 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/protection/ProtectionAreaChunk.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.protection; 2 | /** 3 | * @author ben_mkiv 4 | */ 5 | import net.minecraft.nbt.NBTTagCompound; 6 | import net.minecraft.util.math.AxisAlignedBB; 7 | import net.minecraft.util.math.BlockPos; 8 | 9 | 10 | public class ProtectionAreaChunk { 11 | BlockPos controller; 12 | AxisAlignedBB area; 13 | 14 | public ProtectionAreaChunk(AxisAlignedBB areaIn, BlockPos controllerPosition){ 15 | area = areaIn; 16 | controller = controllerPosition; 17 | } 18 | 19 | public ProtectionAreaChunk(NBTTagCompound nbt){ 20 | readFromNBT(nbt); 21 | } 22 | 23 | public AxisAlignedBB getArea() { 24 | return area; 25 | } 26 | 27 | public BlockPos getControllerPosition() { 28 | return controller; 29 | } 30 | 31 | public NBTTagCompound writeToNBT(NBTTagCompound nbt){ 32 | //area 33 | nbt.setInteger("x1", (int) area.minX); 34 | nbt.setInteger("y1", (int) area.minY); 35 | nbt.setInteger("z1", (int) area.minZ); 36 | nbt.setInteger("x2", (int) area.maxX); 37 | nbt.setInteger("y2", (int) area.maxY); 38 | nbt.setInteger("z2", (int) area.maxZ); 39 | 40 | //controller 41 | nbt.setInteger("xC", controller.getX()); 42 | nbt.setInteger("yC", controller.getY()); 43 | nbt.setInteger("zC", controller.getZ()); 44 | 45 | return nbt; 46 | } 47 | 48 | public boolean intersects(BlockPos blockPos){ 49 | return intersects(new AxisAlignedBB(blockPos)); 50 | } 51 | 52 | public boolean intersects(AxisAlignedBB area){ 53 | return area.intersects(getArea()); 54 | } 55 | 56 | public void readFromNBT(NBTTagCompound nbt){ 57 | area = new AxisAlignedBB(nbt.getInteger("x1"), nbt.getInteger("y1"), nbt.getInteger("z1"), 58 | nbt.getInteger("x2"), nbt.getInteger("y2"), nbt.getInteger("z2")); 59 | 60 | controller = new BlockPos(nbt.getInteger("xC"), nbt.getInteger("yC"), nbt.getInteger("zC")); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/tileentity/TileEntityBiometricReader.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.tileentity; 2 | 3 | import li.cil.oc.api.Network; 4 | import li.cil.oc.api.machine.Arguments; 5 | import li.cil.oc.api.machine.Callback; 6 | import li.cil.oc.api.machine.Context; 7 | import li.cil.oc.api.network.Visibility; 8 | import net.minecraft.util.EnumFacing; 9 | import net.minecraft.entity.player.EntityPlayer; 10 | import net.minecraft.nbt.NBTTagCompound; 11 | 12 | public class TileEntityBiometricReader extends TileEntityOSBase { 13 | public String data; 14 | private String eventName = "bioReader"; 15 | 16 | public TileEntityBiometricReader() { 17 | super("os_biometric"); 18 | node = Network.newNode(this, Visibility.Network).withComponent(getComponentName()).withConnector(32).create(); 19 | } 20 | 21 | @Override 22 | public void readFromNBT(NBTTagCompound nbt) { 23 | super.readFromNBT(nbt); 24 | if (nbt.hasKey("eventName") && !nbt.getString("eventName").isEmpty()) { 25 | eventName = nbt.getString("eventName"); 26 | } else { 27 | eventName = "bioReader"; 28 | } 29 | } 30 | 31 | @Override 32 | public NBTTagCompound writeToNBT(NBTTagCompound nbt) { 33 | super.writeToNBT(nbt); 34 | nbt.setString("eventName", eventName); 35 | return nbt; 36 | } 37 | 38 | public void doRead(EntityPlayer entityplayer, EnumFacing side) { 39 | node.sendToReachable("computer.signal", eventName, entityplayer.getUniqueID().toString()); 40 | } 41 | 42 | @Callback(doc = "function(String:name):boolean; Sets the name of the event that gets sent", direct = true) 43 | public Object[] setEventName(Context context, Arguments args) { 44 | eventName = args.checkString(0); 45 | return new Object[]{ true }; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/tileentity/TileEntityOSCamoBase.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.tileentity; 2 | 3 | import li.cil.oc.api.network.EnvironmentHost; 4 | import net.minecraft.block.Block; 5 | import net.minecraft.block.state.IBlockState; 6 | import net.minecraft.nbt.NBTTagCompound; 7 | import pcl.opensecurity.common.interfaces.ICamo; 8 | 9 | public class TileEntityOSCamoBase extends TileEntityOSBase implements ICamo { 10 | MimicBlock mimicBlock = new MimicBlock(); 11 | 12 | public TileEntityOSCamoBase(String name){ 13 | super(name); 14 | } 15 | 16 | public TileEntityOSCamoBase(String name, EnvironmentHost host){ 17 | super(name, host); 18 | } 19 | 20 | @Override 21 | public void readFromNBT(NBTTagCompound nbt) { 22 | super.readFromNBT(nbt); 23 | if(nbt.hasKey("camo")) 24 | mimicBlock.readFromNBT(nbt.getCompoundTag("camo")); 25 | } 26 | 27 | @Override 28 | public NBTTagCompound writeToNBT(NBTTagCompound nbt) { 29 | nbt.setTag("camo", mimicBlock.writeToNBT(new NBTTagCompound())); 30 | return super.writeToNBT(nbt); 31 | } 32 | 33 | @Override 34 | public IBlockState getCamoBlock() { 35 | return mimicBlock.get(); 36 | } 37 | 38 | @Deprecated 39 | @Override 40 | public void setCamoBlock(Block block, int meta) { 41 | mimicBlock.set(block, meta); 42 | markDirtyClient(); 43 | } 44 | 45 | public void markDirtyClient() { 46 | markDirty(); 47 | if (getWorld() != null) { 48 | IBlockState state = getWorld().getBlockState(getPos()); 49 | getWorld().notifyBlockUpdate(getPos(), state, state, 3); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/common/tileentity/logic/EnergyTurretStats.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.common.tileentity.logic; 2 | 3 | import net.minecraft.item.Item; 4 | import net.minecraft.item.ItemStack; 5 | import net.minecraftforge.items.ItemStackHandler; 6 | import pcl.opensecurity.common.items.ItemCooldownUpgrade; 7 | import pcl.opensecurity.common.items.ItemDamageUpgrade; 8 | import pcl.opensecurity.common.items.ItemEnergyUpgrade; 9 | import pcl.opensecurity.common.items.ItemMovementUpgrade; 10 | 11 | public class EnergyTurretStats { 12 | private float damage, energyFactor, movePerTick; 13 | private int cooldownTicks; 14 | 15 | public EnergyTurretStats(){ 16 | loadDefaults(); 17 | } 18 | 19 | private void loadDefaults(){ 20 | damage = 5F; 21 | cooldownTicks = 1; 22 | energyFactor = 1; 23 | movePerTick = 0.005F; 24 | } 25 | 26 | public void loadFromInventory(ItemStackHandler inventory){ 27 | loadDefaults(); 28 | for(int slot = 0; slot < inventory.getSlots(); slot++){ 29 | ItemStack stack = inventory.getStackInSlot(slot); 30 | if(!stack.isEmpty()) 31 | checkItem(stack.getItem()); 32 | } 33 | } 34 | 35 | private void checkItem(Item item){ 36 | if(item instanceof ItemDamageUpgrade) 37 | damage*= 3F; 38 | 39 | if(item instanceof ItemEnergyUpgrade) 40 | energyFactor*= 0.7; 41 | 42 | if(item instanceof ItemMovementUpgrade) 43 | movePerTick+= 2.5F; 44 | 45 | if(item instanceof ItemCooldownUpgrade) 46 | cooldownTicks+= 3; 47 | } 48 | 49 | public float getDamage(){ 50 | return damage; 51 | } 52 | 53 | public float getEnergyUsage(){ 54 | return 2 * getDamage() * energyFactor; 55 | } 56 | 57 | public int getCooldown(){ 58 | return cooldownTicks; 59 | } 60 | 61 | public float getMoveSpeed(){ 62 | return movePerTick; 63 | } 64 | } -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/lib/easing/penner/Back.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.lib.easing.penner; 2 | 3 | public class Back { 4 | 5 | public static float easeIn(float t,float b , float c, float d) { 6 | float s = 1.70158f; 7 | return c*(t/=d)*t*((s+1)*t - s) + b; 8 | } 9 | 10 | public static float easeIn(float t,float b , float c, float d, float s) { 11 | return c*(t/=d)*t*((s+1)*t - s) + b; 12 | } 13 | 14 | public static float easeOut(float t,float b , float c, float d) { 15 | float s = 1.70158f; 16 | return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; 17 | } 18 | 19 | public static float easeOut(float t,float b , float c, float d, float s) { 20 | return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; 21 | } 22 | 23 | public static float easeInOut(float t,float b , float c, float d) { 24 | float s = 1.70158f; 25 | if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525f))+1)*t - s)) + b; 26 | return c/2*((t-=2)*t*(((s*=(1.525f))+1)*t + s) + 2) + b; 27 | } 28 | 29 | public static float easeInOut(float t,float b , float c, float d, float s) { 30 | if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525f))+1)*t - s)) + b; 31 | return c/2*((t-=2)*t*(((s*=(1.525f))+1)*t + s) + 2) + b; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/lib/easing/penner/Bounce.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.lib.easing.penner; 2 | 3 | public class Bounce { 4 | 5 | public static float easeIn(float t,float b , float c, float d) { 6 | return c - easeOut (d-t, 0, c, d) + b; 7 | } 8 | 9 | public static float easeOut(float t,float b , float c, float d) { 10 | if ((t/=d) < (1/2.75f)) { 11 | return c*(7.5625f*t*t) + b; 12 | } else if (t < (2/2.75f)) { 13 | return c*(7.5625f*(t-=(1.5f/2.75f))*t + .75f) + b; 14 | } else if (t < (2.5/2.75)) { 15 | return c*(7.5625f*(t-=(2.25f/2.75f))*t + .9375f) + b; 16 | } else { 17 | return c*(7.5625f*(t-=(2.625f/2.75f))*t + .984375f) + b; 18 | } 19 | } 20 | 21 | public static float easeInOut(float t,float b , float c, float d) { 22 | if (t < d/2) return easeIn (t*2, 0, c, d) * .5f + b; 23 | else return easeOut (t*2-d, 0, c, d) * .5f + c*.5f + b; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/lib/easing/penner/Circ.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.lib.easing.penner; 2 | 3 | public class Circ { 4 | 5 | public static float easeIn(float t,float b , float c, float d) { 6 | return -c * ((float)Math.sqrt(1 - (t/=d)*t) - 1) + b; 7 | } 8 | 9 | public static float easeOut(float t,float b , float c, float d) { 10 | return c * (float)Math.sqrt(1 - (t=t/d-1)*t) + b; 11 | } 12 | 13 | public static float easeInOut(float t,float b , float c, float d) { 14 | if ((t/=d/2) < 1) return -c/2 * ((float)Math.sqrt(1 - t*t) - 1) + b; 15 | return c/2 * ((float)Math.sqrt(1 - (t-=2)*t) + 1) + b; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/lib/easing/penner/Cubic.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.lib.easing.penner; 2 | 3 | public class Cubic { 4 | 5 | public static float easeIn (float t,float b , float c, float d) { 6 | return c*(t/=d)*t*t + b; 7 | } 8 | 9 | public static float easeOut (float t,float b , float c, float d) { 10 | return c*((t=t/d-1)*t*t + 1) + b; 11 | } 12 | 13 | public static float easeInOut (float t,float b , float c, float d) { 14 | if ((t/=d/2) < 1) return c/2*t*t*t + b; 15 | return c/2*((t-=2)*t*t + 2) + b; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/lib/easing/penner/Expo.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.lib.easing.penner; 2 | 3 | public class Expo { 4 | 5 | public static float easeIn(float t,float b , float c, float d) { 6 | return (t==0) ? b : c * (float)Math.pow(2, 10 * (t/d - 1)) + b; 7 | } 8 | 9 | public static float easeOut(float t,float b , float c, float d) { 10 | return (t==d) ? b+c : c * (-(float)Math.pow(2, -10 * t/d) + 1) + b; 11 | } 12 | 13 | public static float easeInOut(float t,float b , float c, float d) { 14 | if (t==0) return b; 15 | if (t==d) return b+c; 16 | if ((t/=d/2) < 1) return c/2 * (float)Math.pow(2, 10 * (t - 1)) + b; 17 | return c/2 * (-(float)Math.pow(2, -10 * --t) + 2) + b; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/lib/easing/penner/Linear.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.lib.easing.penner; 2 | 3 | public class Linear { 4 | 5 | public static float easeNone (float t,float b , float c, float d) { 6 | return c*t/d + b; 7 | } 8 | 9 | public static float easeIn (float t,float b , float c, float d) { 10 | return c*t/d + b; 11 | } 12 | 13 | public static float easeOut (float t,float b , float c, float d) { 14 | return c*t/d + b; 15 | } 16 | 17 | public static float easeInOut (float t,float b , float c, float d) { 18 | return c*t/d + b; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/lib/easing/penner/Quad.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.lib.easing.penner; 2 | 3 | public class Quad { 4 | 5 | public static float easeIn(float t,float b , float c, float d) { 6 | return c*(t/=d)*t + b; 7 | } 8 | 9 | public static float easeOut(float t,float b , float c, float d) { 10 | return -c *(t/=d)*(t-2) + b; 11 | } 12 | 13 | public static float easeInOut(float t,float b , float c, float d) { 14 | if ((t/=d/2) < 1) return c/2*t*t + b; 15 | return -c/2 * ((--t)*(t-2) - 1) + b; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/lib/easing/penner/Quart.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.lib.easing.penner; 2 | 3 | public class Quart { 4 | 5 | public static float easeIn(float t,float b , float c, float d) { 6 | return c*(t/=d)*t*t*t + b; 7 | } 8 | 9 | public static float easeOut(float t,float b , float c, float d) { 10 | return -c * ((t=t/d-1)*t*t*t - 1) + b; 11 | } 12 | 13 | public static float easeInOut(float t,float b , float c, float d) { 14 | if ((t/=d/2) < 1) return c/2*t*t*t*t + b; 15 | return -c/2 * ((t-=2)*t*t*t - 2) + b; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/lib/easing/penner/Quint.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.lib.easing.penner; 2 | 3 | public class Quint { 4 | 5 | public static float easeIn (float t,float b , float c, float d) { 6 | return c*(t/=d)*t*t*t*t + b; 7 | } 8 | 9 | public static float easeOut (float t,float b , float c, float d) { 10 | return c*((t=t/d-1)*t*t*t*t + 1) + b; 11 | } 12 | 13 | public static float easeInOut (float t,float b , float c, float d) { 14 | if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; 15 | return c/2*((t-=2)*t*t*t*t + 2) + b; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/lib/easing/penner/Sine.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.lib.easing.penner; 2 | 3 | public class Sine { 4 | 5 | public static float easeIn(float t,float b , float c, float d) { 6 | return -c * (float)Math.cos(t/d * (Math.PI/2)) + c + b; 7 | } 8 | 9 | public static float easeOut(float t,float b , float c, float d) { 10 | return c * (float)Math.sin(t/d * (Math.PI/2)) + b; 11 | } 12 | 13 | public static float easeInOut(float t,float b , float c, float d) { 14 | return -c/2 * ((float)Math.cos(Math.PI*t/d) - 1) + b; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/lib/easing/penner/easing_terms_of_use.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/java/pcl/opensecurity/lib/easing/penner/easing_terms_of_use.html -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/manual/IBlockWithDocumentation.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.manual; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import net.minecraft.util.math.BlockPos; 5 | import net.minecraft.world.World; 6 | 7 | /** 8 | * @author Vexatos 9 | */ 10 | public interface IBlockWithDocumentation { 11 | 12 | String getDocumentationName(World world, BlockPos pos); 13 | 14 | String getDocumentationName(ItemStack stack); 15 | } -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/manual/IItemWithDocumentation.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.manual; 2 | 3 | import net.minecraft.item.ItemStack; 4 | 5 | /** 6 | * @author Vexatos 7 | */ 8 | public interface IItemWithDocumentation { 9 | 10 | public String getDocumentationName(ItemStack stack); 11 | } -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/manual/Manual.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.manual; 2 | 3 | import net.minecraft.item.Item; 4 | import net.minecraft.util.ResourceLocation; 5 | import net.minecraftforge.fml.common.Loader; 6 | import pcl.opensecurity.OpenSecurity; 7 | import pcl.opensecurity.common.ContentRegistry; 8 | 9 | import java.util.HashSet; 10 | 11 | public class Manual { 12 | private static ResourceLocation iconResourceLocation = new ResourceLocation(OpenSecurity.MODID, "textures/blocks/security_terminal.png"); 13 | private static String tooltip = "OpenSecurity"; 14 | private static String homepage = "assets/" + OpenSecurity.MODID + "/doc/_Sidebar"; 15 | 16 | public static HashSet items = new HashSet<>(); 17 | 18 | 19 | public static void preInit(){ 20 | if(Loader.isModLoaded("rtfm")) { 21 | new ManualPathProviderRTFM().initialize(iconResourceLocation, tooltip, homepage); 22 | items.add(ManualPathProviderRTFM.getManualItem().setUnlocalizedName("manual").setRegistryName("manual").setCreativeTab(ContentRegistry.creativeTab)); 23 | } 24 | 25 | if(Loader.isModLoaded("opencomputers")) 26 | new ManualPathProviderOC().initialize(iconResourceLocation, tooltip, homepage); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/manual/ManualContentProvider.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.manual; 2 | 3 | import com.google.common.base.Charsets; 4 | 5 | import java.io.BufferedReader; 6 | import java.io.IOException; 7 | import java.io.InputStream; 8 | import java.io.InputStreamReader; 9 | import java.util.ArrayList; 10 | 11 | public abstract class ManualContentProvider { 12 | private static final String regExImageTag = "!\\[[^]]*]\\((http|https)://[^)]*\\)"; // regEx for ![description](http(s)://imageURL) 13 | 14 | public Iterable getContent(String path) { 15 | final ArrayList lines = new ArrayList<>(); 16 | 17 | if(path.contains("#")) //remove jumpmarks from uri 18 | path = path.substring(0, path.indexOf("#")); 19 | 20 | InputStream is = null; 21 | try { 22 | is = getClass().getClassLoader().getResourceAsStream(path + ".md"); 23 | final BufferedReader reader = new BufferedReader(new InputStreamReader(is, Charsets.UTF_8)); 24 | String line; 25 | boolean inCodeBlock = false; 26 | 27 | while ((line = reader.readLine()) != null) { 28 | //filter out lines with string screenshot in it... dirty hack to remove them from the "index/_Sidebar" page :> 29 | if(line.toLowerCase().contains("screenshot")) 30 | continue; 31 | 32 | line = line.replaceAll(regExImageTag, ""); // strip of markdown image tags to avoid logspamming of not resolvable image uris 33 | 34 | if (line.contains("```")) { // if this line would start/stop a codeblock we change our inCodeBlock var so that code tags are added to each line 35 | line = line.replaceAll("```lua", "").replaceAll("```", ""); // strip of codeblock tags, as they aren't supported 36 | inCodeBlock = !inCodeBlock; 37 | } 38 | 39 | if (inCodeBlock) 40 | line = "`" + line + "`"; 41 | 42 | lines.add(line); 43 | } 44 | } catch (Throwable ignored) { 45 | return null; 46 | } finally { 47 | if (is != null) 48 | try { is.close(); } catch (IOException ignored) {} 49 | } 50 | 51 | return lines; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/manual/ManualContentProviderOC.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.manual; 2 | 3 | import li.cil.oc.api.manual.ContentProvider; 4 | 5 | public class ManualContentProviderOC extends ManualContentProvider implements ContentProvider { 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/manual/ManualContentProviderRTFM.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.manual; 2 | 3 | import li.cil.manual.api.manual.ContentProvider; 4 | 5 | public class ManualContentProviderRTFM extends ManualContentProvider implements ContentProvider { 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/manual/ManualPathProvider.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.manual; 2 | 3 | 4 | import net.minecraft.block.Block; 5 | import net.minecraft.item.ItemBlock; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraft.util.math.BlockPos; 8 | import net.minecraft.world.World; 9 | 10 | import javax.annotation.Nullable; 11 | 12 | /** 13 | * @author Vexatos, ben-mkiv 14 | */ 15 | public abstract class ManualPathProvider { 16 | @Nullable 17 | public String pathFor(ItemStack stack) { 18 | if(stack == null) return null; 19 | 20 | if(stack.getItem() instanceof IItemWithDocumentation) { 21 | return ((IItemWithDocumentation) stack.getItem()).getDocumentationName(stack); 22 | } 23 | if(stack.getItem() instanceof ItemBlock) { 24 | Block block = Block.getBlockFromItem(stack.getItem()); 25 | if(block instanceof IBlockWithDocumentation) { 26 | return ((IBlockWithDocumentation) block).getDocumentationName(stack); 27 | } 28 | } 29 | return null; 30 | } 31 | 32 | @Nullable 33 | public String pathFor(World world, BlockPos pos) { 34 | if(world == null) return null; 35 | 36 | Block block = world.getBlockState(pos).getBlock(); 37 | if(block instanceof IBlockWithDocumentation) { 38 | return ((IBlockWithDocumentation) block).getDocumentationName(world, pos); 39 | } 40 | return null; 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/manual/ManualPathProviderOC.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.manual; 2 | 3 | import li.cil.oc.api.Manual; 4 | import li.cil.oc.api.manual.PathProvider; 5 | import li.cil.oc.api.prefab.TextureTabIconRenderer; 6 | import net.minecraft.util.ResourceLocation; 7 | import net.minecraftforge.fml.common.FMLCommonHandler; 8 | import net.minecraftforge.fml.relauncher.Side; 9 | 10 | class ManualPathProviderOC extends ManualPathProvider implements PathProvider { 11 | void initialize(ResourceLocation iconResourceLocation, String tooltip, String path) { 12 | if(FMLCommonHandler.instance().getEffectiveSide().equals(Side.CLIENT)) { 13 | Manual.addProvider(new ManualPathProviderOC()); 14 | Manual.addProvider(new ManualContentProviderOC()); 15 | Manual.addTab(new TextureTabIconRenderer(iconResourceLocation), tooltip, path); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/manual/ManualPathProviderRTFM.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.manual; 2 | 3 | import li.cil.manual.api.ManualAPI; 4 | import li.cil.manual.api.detail.ManualDefinition; 5 | import li.cil.manual.api.manual.PathProvider; 6 | import li.cil.manual.api.prefab.manual.TextureTabIconRenderer; 7 | import net.minecraft.item.Item; 8 | import net.minecraft.util.ResourceLocation; 9 | import net.minecraftforge.fml.common.FMLCommonHandler; 10 | import net.minecraftforge.fml.relauncher.Side; 11 | import pcl.opensecurity.OpenSecurity; 12 | 13 | class ManualPathProviderRTFM extends ManualPathProvider implements PathProvider { 14 | private static ManualDefinition manual; 15 | 16 | void initialize(ResourceLocation iconResourceLocation, String tooltip, String path) { 17 | manual = ManualAPI.createManual(false); 18 | 19 | if(FMLCommonHandler.instance().getEffectiveSide().equals(Side.CLIENT)) { 20 | manual.addProvider(new ManualPathProviderRTFM()); 21 | manual.addProvider(new ManualContentProviderRTFM()); 22 | manual.setDefaultPage(path); 23 | 24 | manual.addTab(new TextureTabIconRenderer(iconResourceLocation), tooltip, path); 25 | manual.addTab(new TextureTabIconRenderer(new ResourceLocation(OpenSecurity.MODID, "textures/blocks/door_controller.png")), "Blocks", "assets/" + OpenSecurity.MODID + "/doc/Blocks"); 26 | manual.addTab(new TextureTabIconRenderer(new ResourceLocation(OpenSecurity.MODID, "textures/items/mag_card.png")), "Items", "assets/" + OpenSecurity.MODID + "/doc/Items"); 27 | } 28 | } 29 | 30 | static Item getManualItem(){ 31 | return ManualAPI.createItemForManual(manual); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/networking/HandlerKeypadButton.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.networking; 2 | 3 | import net.minecraft.tileentity.TileEntity; 4 | import net.minecraft.util.math.BlockPos; 5 | import net.minecraft.world.World; 6 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage; 7 | import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; 8 | import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; 9 | import pcl.opensecurity.OpenSecurity; 10 | import pcl.opensecurity.common.tileentity.TileEntityKeypad; 11 | 12 | public class HandlerKeypadButton implements IMessageHandler { 13 | 14 | @Override 15 | public IMessage onMessage(PacketKeypadButton message, MessageContext ctx) { 16 | short instanceID = message.id; 17 | int dim = message.dimension; 18 | int x = message.x; 19 | int y = message.y; 20 | int z = message.z; 21 | 22 | //System.out.format("Keypad packet at %d, %d, %d in dim %d", x, y, z, dim); 23 | 24 | World world = OpenSecurity.proxy.getWorld(dim); 25 | 26 | if (world != null) { 27 | TileEntity te=world.getTileEntity(new BlockPos(x, y, z)); 28 | 29 | int button = message.button; 30 | //System.out.format("Got button for button # %d", button); 31 | 32 | TileEntityKeypad tek=(TileEntityKeypad)te; 33 | tek.buttonStates[button].press(te.getWorld().getTotalWorldTime()); 34 | } 35 | return null; 36 | } 37 | 38 | } -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/networking/PacketAssetData.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.networking; 2 | 3 | import io.netty.buffer.ByteBuf; 4 | import net.minecraftforge.fml.common.network.ByteBufUtils; 5 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage; 6 | import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; 7 | import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; 8 | 9 | public class PacketAssetData implements IMessage { 10 | String name = ""; 11 | byte[] data; 12 | 13 | public PacketAssetData() { 14 | //intentionally empty 15 | } 16 | 17 | public PacketAssetData(String fileName, byte[] fileData) { 18 | name = fileName; 19 | data = fileData; 20 | } 21 | 22 | @Override 23 | public void toBytes(ByteBuf buf) { 24 | ByteBufUtils.writeUTF8String(buf, name); 25 | buf.writeBytes(data); 26 | } 27 | 28 | @Override 29 | public void fromBytes(ByteBuf buf) { 30 | name = ByteBufUtils.readUTF8String(buf); 31 | buf.readBytes(data); 32 | } 33 | 34 | public static class Handler implements IMessageHandler { 35 | @Override 36 | public IMessage onMessage(PacketAssetData message, MessageContext ctx) { 37 | 38 | 39 | 40 | 41 | 42 | return null; 43 | } 44 | } 45 | 46 | } 47 | 48 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/networking/PacketKeypadButton.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.networking; 2 | 3 | import io.netty.buffer.ByteBuf; 4 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage; 5 | 6 | public class PacketKeypadButton implements IMessage { 7 | int button; 8 | short id; 9 | short instance; 10 | int dimension; 11 | int x, y, z; 12 | 13 | public PacketKeypadButton() { 14 | //intentionally empty 15 | } 16 | 17 | public PacketKeypadButton(short instance, int dim, int x, int y, int z, int button) { 18 | this.id = 1; 19 | this.instance = instance; 20 | this.dimension = dim; 21 | this.x = x; 22 | this.y = y; 23 | this.z = z; 24 | this.button = button; 25 | } 26 | 27 | @Override 28 | public void toBytes(ByteBuf buf) { 29 | buf.writeInt(button); 30 | buf.writeShort(instance); 31 | buf.writeInt(dimension); 32 | buf.writeInt(x); 33 | buf.writeInt(y); 34 | buf.writeInt(z); 35 | } 36 | 37 | @Override 38 | public void fromBytes(ByteBuf buf) { 39 | button = buf.readInt(); 40 | instance = buf.readShort(); 41 | dimension = buf.readInt(); 42 | x = buf.readInt(); 43 | y = buf.readInt(); 44 | z = buf.readInt(); 45 | } 46 | } -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/networking/PacketProtectionAdd.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.networking; 2 | 3 | import io.netty.buffer.ByteBuf; 4 | import net.minecraft.client.Minecraft; 5 | import net.minecraft.nbt.NBTTagCompound; 6 | import net.minecraft.util.math.AxisAlignedBB; 7 | import net.minecraft.util.math.BlockPos; 8 | import net.minecraft.world.World; 9 | import net.minecraftforge.fml.common.network.ByteBufUtils; 10 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage; 11 | import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; 12 | import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; 13 | import pcl.opensecurity.common.protection.Protection; 14 | import pcl.opensecurity.common.protection.ProtectionAreaChunk; 15 | 16 | public class PacketProtectionAdd implements IMessage { 17 | NBTTagCompound protection; 18 | 19 | public PacketProtectionAdd() { 20 | //intentionally empty 21 | } 22 | 23 | public PacketProtectionAdd(World world, BlockPos controller, AxisAlignedBB area) { 24 | protection = new ProtectionAreaChunk(area, controller).writeToNBT(new NBTTagCompound()); 25 | } 26 | 27 | @Override 28 | public void toBytes(ByteBuf buf) { 29 | ByteBufUtils.writeTag(buf, protection); 30 | } 31 | 32 | @Override 33 | public void fromBytes(ByteBuf buf) { 34 | protection = ByteBufUtils.readTag(buf); 35 | } 36 | 37 | public static class Handler implements IMessageHandler { 38 | @Override 39 | public IMessage onMessage(PacketProtectionAdd message, MessageContext ctx) { 40 | Minecraft.getMinecraft().addScheduledTask(new Runnable() { 41 | public void run() { 42 | ProtectionAreaChunk pac = new ProtectionAreaChunk(message.protection); 43 | Protection.addArea(Minecraft.getMinecraft().player.world, pac.getArea(), pac.getControllerPosition()); 44 | } 45 | }); 46 | 47 | return null; 48 | } 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/networking/PacketProtectionRemove.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.networking; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.nbt.NBTTagCompound; 5 | import net.minecraft.util.math.AxisAlignedBB; 6 | import net.minecraft.util.math.BlockPos; 7 | import net.minecraft.world.World; 8 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage; 9 | import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; 10 | import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; 11 | import pcl.opensecurity.common.protection.Protection; 12 | import pcl.opensecurity.common.protection.ProtectionAreaChunk; 13 | 14 | 15 | public class PacketProtectionRemove extends PacketProtectionAdd { 16 | public PacketProtectionRemove() { 17 | //better keep this if you dont want to break this network packet 18 | } 19 | 20 | public PacketProtectionRemove(World world, BlockPos controller) { 21 | ProtectionAreaChunk pac = new ProtectionAreaChunk(new AxisAlignedBB(0, 0, 0, 0, 0, 0), controller); 22 | protection = pac.writeToNBT(new NBTTagCompound()); 23 | } 24 | 25 | public static class Handler implements IMessageHandler { 26 | @Override 27 | public IMessage onMessage(PacketProtectionRemove message, MessageContext ctx) { 28 | Minecraft.getMinecraft().addScheduledTask(new Runnable() { 29 | public void run() { 30 | ProtectionAreaChunk pac = new ProtectionAreaChunk(message.protection); 31 | Protection.removeArea(Minecraft.getMinecraft().player.world, pac.getControllerPosition()); 32 | } 33 | }); 34 | return null; 35 | } 36 | } 37 | 38 | } -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/networking/PacketProtectionSync.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.networking; 2 | 3 | import io.netty.buffer.ByteBuf; 4 | import net.minecraft.client.Minecraft; 5 | import net.minecraft.nbt.NBTTagCompound; 6 | import net.minecraft.world.World; 7 | import net.minecraftforge.fml.common.network.ByteBufUtils; 8 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage; 9 | import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; 10 | import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; 11 | import pcl.opensecurity.common.protection.Protection; 12 | 13 | 14 | public class PacketProtectionSync implements IMessage { 15 | NBTTagCompound protection; 16 | int dimension; 17 | 18 | public PacketProtectionSync() { 19 | //intentionally empty 20 | } 21 | 22 | public PacketProtectionSync(World world) { 23 | this.dimension = world.provider.getDimension(); 24 | protection = Protection.get(world).writeToNBT(new NBTTagCompound()); 25 | } 26 | 27 | @Override 28 | public void toBytes(ByteBuf buf) { 29 | buf.writeInt(dimension); 30 | ByteBufUtils.writeTag(buf, protection); 31 | } 32 | 33 | @Override 34 | public void fromBytes(ByteBuf buf) { 35 | dimension = buf.readInt(); 36 | protection = ByteBufUtils.readTag(buf); 37 | } 38 | 39 | public static class Handler implements IMessageHandler { 40 | @Override 41 | public IMessage onMessage(PacketProtectionSync message, MessageContext ctx) { 42 | Minecraft.getMinecraft().addScheduledTask(new Runnable() { 43 | public void run() { 44 | Protection.get(Minecraft.getMinecraft().player.world).readFromNBT(message.protection); 45 | } 46 | }); 47 | 48 | return null; 49 | } 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/util/AABBHelper.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.util; 2 | 3 | import net.minecraft.nbt.NBTTagCompound; 4 | import net.minecraft.util.EnumFacing; 5 | import net.minecraft.util.math.AxisAlignedBB; 6 | 7 | public class AABBHelper { 8 | // no idea why the heck this wont work as switch for EnumFacing, so we use the ordinal() values -.- 9 | 10 | public static AxisAlignedBB rotateVertical(AxisAlignedBB bb, EnumFacing newFacing){ 11 | //allways assume bb facing NORTH as input 12 | switch(newFacing.ordinal()){ 13 | case 1: return new AxisAlignedBB(bb.minX, 1d-bb.minZ, bb.minY, bb.maxX, 1d-bb.maxZ, bb.maxY); // 90 (down) 14 | case 0: return new AxisAlignedBB(bb.minX, bb.minZ, 1d-bb.minY, bb.maxX, bb.maxZ, 1d-bb.maxY); // 270(up) 15 | default: return bb; 16 | } 17 | } 18 | 19 | public static AxisAlignedBB rotateHorizontal(AxisAlignedBB bb, EnumFacing newFacing){ 20 | //allways assume bb facing NORTH as input 21 | switch(newFacing.ordinal()){ 22 | case 4: return new AxisAlignedBB(bb.minZ, bb.minY, 1d - bb.minX, bb.maxZ, bb.maxY, 1d - bb.maxX); // (east) 23 | case 5: return new AxisAlignedBB(1d - bb.maxZ, bb.minY, bb.minX, 1d - bb.minZ, bb.maxY, bb.maxX); // (west) 24 | case 3: return new AxisAlignedBB(1d - bb.maxX, bb.minY, 1d - bb.maxZ, 1d - bb.minX, bb.maxY, 1d - bb.minZ); // (south) 25 | case 2: default: return bb; // (north) 26 | } 27 | } 28 | 29 | public static NBTTagCompound writeToNBT(AxisAlignedBB bb, NBTTagCompound nbt){ 30 | nbt.setDouble("x1", bb.minX); 31 | nbt.setDouble("y1", bb.minY); 32 | nbt.setDouble("z1", bb.minZ); 33 | nbt.setDouble("x2", bb.maxX); 34 | nbt.setDouble("y2", bb.maxY); 35 | nbt.setDouble("z2", bb.maxZ); 36 | return nbt; 37 | } 38 | 39 | public static AxisAlignedBB readFromNBT(NBTTagCompound nbt){ 40 | return new AxisAlignedBB( 41 | nbt.getDouble("x1"), nbt.getDouble("y1"), nbt.getDouble("z1"), 42 | nbt.getDouble("x2"), nbt.getDouble("y2"), nbt.getDouble("z2")); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/util/BlockUtils.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.util; 2 | 3 | import net.minecraft.block.state.IBlockState; 4 | import net.minecraft.entity.Entity; 5 | import net.minecraft.entity.player.EntityPlayer; 6 | import net.minecraft.item.ItemBlock; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.util.EnumFacing; 9 | import net.minecraft.util.EnumHand; 10 | import net.minecraft.util.math.BlockPos; 11 | import net.minecraft.util.math.Vec3d; 12 | import net.minecraft.util.math.Vec3i; 13 | import net.minecraft.world.World; 14 | import pcl.opensecurity.common.items.ItemNanoDNA; 15 | 16 | import javax.annotation.Nullable; 17 | 18 | public class BlockUtils { 19 | //from McJty Lib 20 | public static IBlockState placeStackAt(EntityPlayer player, ItemStack blockStack, World world, BlockPos pos, @Nullable IBlockState origState) { 21 | if (blockStack.getItem() instanceof ItemBlock) { 22 | ItemBlock itemBlock = (ItemBlock) blockStack.getItem(); 23 | if (origState == null) { 24 | origState = itemBlock.getBlock().getStateForPlacement(world, pos, EnumFacing.UP, 0, 0, 0, blockStack.getItem().getMetadata(blockStack), player, EnumHand.MAIN_HAND); 25 | } 26 | if (itemBlock.placeBlockAt(blockStack, player, world, pos, EnumFacing.UP, 0, 0, 0, origState)) { 27 | blockStack.shrink(1); 28 | } 29 | return origState; 30 | } else { 31 | player.setHeldItem(EnumHand.MAIN_HAND, blockStack); 32 | player.setPosition(pos.getX()+.5, pos.getY()+1.5, pos.getZ()+.5); 33 | blockStack.getItem().onItemUse(player, world, pos.down(), EnumHand.MAIN_HAND, EnumFacing.UP, 0, 0, 0); 34 | return world.getBlockState(pos); 35 | } 36 | } 37 | 38 | public static Vec3i getFacingFromEntity(BlockPos pos, Entity entity){ 39 | Vec3d blockpos = new Vec3d(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5); 40 | Vec3d entitypos = new Vec3d(entity.posX, entity.posY, entity.posZ); 41 | Vec3d offset = entitypos.subtract(blockpos); 42 | EnumFacing facing = EnumFacing.getFacingFromVector((float) offset.x, (float) offset.y, (float) offset.z); 43 | 44 | return facing.getDirectionVec(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/util/ClassHelper.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.util; 2 | 3 | 4 | import net.minecraft.entity.Entity; 5 | import net.minecraft.entity.EntityList; 6 | import net.minecraft.entity.item.EntityBoat; 7 | import net.minecraft.entity.player.EntityPlayer; 8 | import net.minecraft.util.ResourceLocation; 9 | import pcl.opensecurity.OpenSecurity; 10 | 11 | import java.util.HashSet; 12 | import java.util.logging.Logger; 13 | 14 | public class ClassHelper { 15 | static public HashSet> getEntityList(){ 16 | HashSet> list = new HashSet<>(); 17 | 18 | String skipedClasses = ""; 19 | for (ResourceLocation name : EntityList.getEntityNameList()){ 20 | Class eClazz = EntityList.getClass(name); 21 | if(eClazz == null) 22 | continue; 23 | 24 | try { 25 | list.add(EntityList.getClass(name)); 26 | } catch (Exception e) { skipedClasses+=", " + name.toString(); } 27 | } 28 | 29 | if(skipedClasses.length() > 0) 30 | Logger.getLogger(OpenSecurity.MODID).info("skipped not supported entity classes: " + skipedClasses.substring(2)); 31 | 32 | // this isnt part of the EntityList 33 | list.add(EntityPlayer.class); 34 | // this isn't exposed to EntityList.getEntityNameList() 35 | list.add(EntityBoat.class); 36 | 37 | return list; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/util/FileUtils.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.util; 2 | 3 | import java.io.File; 4 | import java.util.HashSet; 5 | 6 | public class FileUtils { 7 | public static HashSet listFilesForPath(String path) { 8 | return listFilesForPath(path, true); 9 | } 10 | 11 | public static HashSet listFilesForPath(String path, boolean recursive){ 12 | HashSet files = new HashSet<>(); 13 | 14 | File folder = new File(path); 15 | 16 | if (folder.listFiles() == null) 17 | return files; 18 | 19 | for (final File fileEntry : folder.listFiles()) { 20 | if (!fileEntry.isDirectory()) 21 | files.add(fileEntry); 22 | else if(recursive) 23 | files.addAll(listFilesForPath(fileEntry.getPath())); 24 | 25 | } 26 | 27 | return files; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/pcl/opensecurity/util/ItemUtils.java: -------------------------------------------------------------------------------- 1 | package pcl.opensecurity.util; 2 | 3 | import net.minecraft.entity.item.EntityItem; 4 | import net.minecraft.item.ItemStack; 5 | import net.minecraft.util.math.BlockPos; 6 | import net.minecraft.world.World; 7 | 8 | public class ItemUtils { 9 | public static void dropItem(ItemStack stack, World world, BlockPos pos, boolean motion, int pickupDelay){ 10 | if(world.isRemote) return; 11 | 12 | if(stack.getMaxStackSize() <= 0 || stack.isEmpty()) 13 | return; 14 | 15 | EntityItem entityitem = new EntityItem(world, pos.getX(), pos.getY(), pos.getZ(), stack); 16 | entityitem.setPickupDelay(pickupDelay); 17 | if(!motion){ 18 | entityitem.motionX=0; 19 | entityitem.motionY=0; 20 | entityitem.motionZ=0; 21 | } 22 | 23 | world.spawnEntity(entityitem); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/blockstates/alarm.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "textures": { 5 | "top": "opensecurity:blocks/machine_side", 6 | "front": "opensecurity:blocks/alarm", 7 | "side": "opensecurity:blocks/alarm" 8 | }, 9 | "model": "minecraft:orientable" 10 | }, 11 | "variants": { 12 | "normal": [{}], 13 | "inventory": [{ 14 | "transform": "forge:default-block" 15 | }], 16 | "facing": { 17 | "north": {"model": "minecraft:orientable", "y": 180}, 18 | "south": {"model": "minecraft:orientable"}, 19 | "west": {"model": "minecraft:orientable", "y": 90}, 20 | "east": {"model": "minecraft:orientable", "y": 270} 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/blockstates/biometric_reader.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "textures": { 5 | "top": "opensecurity:blocks/machine_side", 6 | "front": "opensecurity:blocks/biometricreader_front", 7 | "side": "opensecurity:blocks/machine_side" 8 | }, 9 | "model": "minecraft:orientable" 10 | }, 11 | "variants": { 12 | "normal": [{}], 13 | "inventory": [{ 14 | "transform": "forge:default-block" 15 | }], 16 | "facing": { 17 | "north": {"model": "minecraft:orientable", "y": 180}, 18 | "south": {"model": "minecraft:orientable"}, 19 | "west": {"model": "minecraft:orientable", "y": 90}, 20 | "east": {"model": "minecraft:orientable", "y": 270} 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/blockstates/card_writer.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "textures": { 5 | "top": "opensecurity:blocks/machine_side", 6 | "front": "opensecurity:blocks/cardwriter_front", 7 | "side": "opensecurity:blocks/machine_side" 8 | }, 9 | "model": "minecraft:orientable" 10 | }, 11 | "variants": { 12 | "normal": [{}], 13 | "inventory": [{ 14 | "transform": "forge:default-block" 15 | }], 16 | "facing": { 17 | "north": {"model": "minecraft:orientable", "y": 180}, 18 | "south": {"model": "minecraft:orientable"}, 19 | "west": {"model": "minecraft:orientable", "y": 90}, 20 | "east": {"model": "minecraft:orientable", "y": 270} 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/blockstates/case1.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "inventory": [{ 4 | "transform": "forge:default-block", 5 | "model": "opensecurity:case" 6 | }], 7 | "facing=north,running=false": { "model": "opensecurity:case" }, 8 | "facing=south,running=false": { "model": "opensecurity:case", "y": 180 }, 9 | "facing=west,running=false": { "model": "opensecurity:case", "y": 270 }, 10 | "facing=east,running=false": { "model": "opensecurity:case", "y": 90 }, 11 | "facing=north,running=true": { "model": "opensecurity:case_running" }, 12 | "facing=south,running=true": { "model": "opensecurity:case_running", "y": 180 }, 13 | "facing=west,running=true": { "model": "opensecurity:case_running", "y": 270 }, 14 | "facing=east,running=true": { "model": "opensecurity:case_running", "y": 90 } 15 | } 16 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/blockstates/case2.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "inventory": [{ 4 | "transform": "forge:default-block", 5 | "model": "opensecurity:case" 6 | }], 7 | "facing=north,running=false": { "model": "opensecurity:case" }, 8 | "facing=south,running=false": { "model": "opensecurity:case", "y": 180 }, 9 | "facing=west,running=false": { "model": "opensecurity:case", "y": 270 }, 10 | "facing=east,running=false": { "model": "opensecurity:case", "y": 90 }, 11 | "facing=north,running=true": { "model": "opensecurity:case_running" }, 12 | "facing=south,running=true": { "model": "opensecurity:case_running", "y": 180 }, 13 | "facing=west,running=true": { "model": "opensecurity:case_running", "y": 270 }, 14 | "facing=east,running=true": { "model": "opensecurity:case_running", "y": 90 } 15 | } 16 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/blockstates/case3.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "inventory": [{ 4 | "transform": "forge:default-block", 5 | "model": "opensecurity:case" 6 | }], 7 | "facing=north,running=false": { "model": "opensecurity:case" }, 8 | "facing=south,running=false": { "model": "opensecurity:case", "y": 180 }, 9 | "facing=west,running=false": { "model": "opensecurity:case", "y": 270 }, 10 | "facing=east,running=false": { "model": "opensecurity:case", "y": 90 }, 11 | "facing=north,running=true": { "model": "opensecurity:case_running" }, 12 | "facing=south,running=true": { "model": "opensecurity:case_running", "y": 180 }, 13 | "facing=west,running=true": { "model": "opensecurity:case_running", "y": 270 }, 14 | "facing=east,running=true": { "model": "opensecurity:case_running", "y": 90 } 15 | } 16 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/blockstates/data_block.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "textures": { 5 | "top": "opensecurity:blocks/dataprocblock_side", 6 | "front": "opensecurity:blocks/dataprocblock_front", 7 | "side": "opensecurity:blocks/dataprocblock_side" 8 | }, 9 | "model": "minecraft:orientable" 10 | }, 11 | "variants": { 12 | "normal": [{}], 13 | "inventory": [{ 14 | "transform": "forge:default-block" 15 | }], 16 | "facing": { 17 | "north": {"model": "minecraft:orientable", "y": 180}, 18 | "south": {"model": "minecraft:orientable"}, 19 | "west": {"model": "minecraft:orientable", "y": 90}, 20 | "east": {"model": "minecraft:orientable", "y": 270} 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/blockstates/door_controller.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "textures": { 5 | "top": "opensecurity:blocks/door_controller", 6 | "front": "opensecurity:blocks/door_controller", 7 | "side": "opensecurity:blocks/door_controller" 8 | }, 9 | "model": "minecraft:orientable" 10 | }, 11 | "variants": { 12 | "normal": [{ }], 13 | "inventory": [{ }], 14 | "facing": { 15 | "north": {"model": "minecraft:orientable", "y": 180}, 16 | "south": {"model": "minecraft:orientable"}, 17 | "west": {"model": "minecraft:orientable", "y": 90}, 18 | "east": {"model": "minecraft:orientable", "y": 270} 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/blockstates/energy_turret.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "textures": { 5 | "top": "opensecurity:blocks/machine_side", 6 | "front": "opensecurity:blocks/machine_side", 7 | "side": "opensecurity:blocks/machine_side" 8 | }, 9 | "model": "opensecurity:energy_turret" 10 | }, 11 | "variants": { 12 | "normal": [{}], 13 | "inventory": [{ "model": "opensecurity:energy_turret" }], 14 | "pitch": { 15 | "up": {"model": "minecraft:orientable", "x": 180}, 16 | "down": {"model": "minecraft:orientable"} 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/blockstates/entity_detector.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "textures": { 5 | "top": "opensecurity:blocks/machine_side", 6 | "front": "opensecurity:blocks/entitydetector", 7 | "side": "opensecurity:blocks/entitydetector" 8 | }, 9 | "model": "minecraft:orientable" 10 | }, 11 | "variants": { 12 | "normal": [{}], 13 | "inventory": [{ 14 | "transform": "forge:default-block" 15 | }], 16 | "facing": { 17 | "north": {"model": "minecraft:orientable", "y": 180}, 18 | "south": {"model": "minecraft:orientable"}, 19 | "west": {"model": "minecraft:orientable", "y": 90}, 20 | "east": {"model": "minecraft:orientable", "y": 270} 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/blockstates/keypad.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "textures": { 5 | "top": "opensecurity:blocks/machine_side", 6 | "front": "opensecurity:blocks/machine_side", 7 | "side": "opensecurity:blocks/machine_side" 8 | }, 9 | "model": "minecraft:orientable" 10 | }, 11 | "variants": { 12 | "normal": [{}], 13 | "inventory": [{ 14 | "transform": "forge:default-block" 15 | }], 16 | "facing": { 17 | "north": {"model": "minecraft:orientable", "y": 180}, 18 | "south": {"model": "minecraft:orientable"}, 19 | "west": {"model": "minecraft:orientable", "y": 90}, 20 | "east": {"model": "minecraft:orientable", "y": 270} 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/blockstates/mag_reader.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "textures": { 5 | "top": "opensecurity:blocks/machine_side", 6 | "front": "opensecurity:blocks/mag_reader", 7 | "side": "opensecurity:blocks/mag_reader" 8 | }, 9 | "model": "minecraft:orientable" 10 | }, 11 | "variants": { 12 | "normal": [{}], 13 | "inventory": [{ 14 | "transform": "forge:default-block" 15 | }], 16 | "variant": { 17 | "success": { 18 | "textures": { 19 | "front": "opensecurity:blocks/magreader_success", 20 | "side": "opensecurity:blocks/magreader_success" 21 | } 22 | }, 23 | "idle": { 24 | "textures": { 25 | "front": "opensecurity:blocks/mag_reader", 26 | "side": "opensecurity:blocks/mag_reader" 27 | } 28 | }, 29 | "active": { 30 | "textures": { 31 | "front": "opensecurity:blocks/magreader_active", 32 | "side": "opensecurity:blocks/magreader_active" 33 | } 34 | }, 35 | "error": { 36 | "textures": { 37 | "front": "opensecurity:blocks/magreader_error", 38 | "side": "opensecurity:blocks/magreader_error" 39 | } 40 | }, 41 | "three": { 42 | "textures": { 43 | "front": "opensecurity:blocks/magreader_three", 44 | "side": "opensecurity:blocks/magreader_three" 45 | } 46 | }, 47 | "five": { 48 | "textures": { 49 | "front": "opensecurity:blocks/magreader_five", 50 | "side": "opensecurity:blocks/magreader_five" 51 | } 52 | }, 53 | "six": { 54 | "textures": { 55 | "front": "opensecurity:blocks/magreader_six", 56 | "side": "opensecurity:blocks/magreader_six" 57 | } 58 | }, 59 | "seven": { 60 | "textures": { 61 | "front": "opensecurity:blocks/magreader_seven", 62 | "side": "opensecurity:blocks/magreader_seven" 63 | } 64 | } 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/blockstates/mag_reader_camo.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "textures": { 5 | "top": "opensecurity:blocks/machine_side", 6 | "front": "opensecurity:blocks/mag_reader", 7 | "side": "opensecurity:blocks/mag_reader" 8 | }, 9 | "model": "minecraft:orientable" 10 | }, 11 | "variants": { 12 | "normal": [{ }], 13 | "inventory": [{ }], 14 | "facing": { 15 | "north": {"model": "minecraft:orientable", "y": 180}, 16 | "south": {"model": "minecraft:orientable"}, 17 | "west": {"model": "minecraft:orientable", "y": 90}, 18 | "east": {"model": "minecraft:orientable", "y": 270} 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/blockstates/nanofog.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "model": "opensecurity:nanofog_flat" 5 | }, 6 | "variants": { 7 | "normal": [{ }], 8 | "inventory": [{ }] 9 | } 10 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/blockstates/nanofog_terminal.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "textures": { 5 | "top": "opensecurity:blocks/machine_side", 6 | "front": "opensecurity:blocks/nanofog_terminal", 7 | "side": "opensecurity:blocks/machine_side" 8 | }, 9 | "model": "minecraft:orientable" 10 | }, 11 | "variants": { 12 | "normal": [{}], 13 | "inventory": [{ 14 | "transform": "forge:default-block" 15 | }], 16 | "facing": { 17 | "north": {"model": "minecraft:orientable", "y": 180}, 18 | "south": {"model": "minecraft:orientable"}, 19 | "west": {"model": "minecraft:orientable", "y": 90}, 20 | "east": {"model": "minecraft:orientable", "y": 270} 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/blockstates/rack.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "textures": { 5 | "top": "opensecurity:blocks/case_top", 6 | "front": "opensecurity:blocks/rack_front", 7 | "bottom": "opensecurity:blocks/case_top", 8 | "side": "opensecurity:blocks/rack_side" 9 | }, 10 | "model": "minecraft:orientable" 11 | }, 12 | "variants": { 13 | "inventory": [{ 14 | "transform": "forge:default-block", 15 | "model": "opensecurity:rack" 16 | }], 17 | "normal": [{ 18 | "transform": "forge:default-block", 19 | "model": "opensecurity:rack" 20 | }], 21 | "facing=north": { "model": "opensecurity:rack" }, 22 | "facing=south": { "model": "opensecurity:rack", "y": 180 }, 23 | "facing=west": { "model": "opensecurity:rack", "y": 270 }, 24 | "facing=east": { "model": "opensecurity:rack", "y": 90 } 25 | } 26 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/blockstates/rfid_reader.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "textures": { 5 | "top": "opensecurity:blocks/machine_side", 6 | "front": "opensecurity:blocks/rfid_reader", 7 | "side": "opensecurity:blocks/rfid_reader" 8 | }, 9 | "model": "minecraft:orientable" 10 | }, 11 | "variants": { 12 | "normal": [{}], 13 | "inventory": [{ 14 | "transform": "forge:default-block" 15 | }], 16 | "facing": { 17 | "north": {"model": "minecraft:orientable", "y": 180}, 18 | "south": {"model": "minecraft:orientable"}, 19 | "west": {"model": "minecraft:orientable", "y": 90}, 20 | "east": {"model": "minecraft:orientable", "y": 270} 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/blockstates/rolldoor.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "textures": { 5 | "top": "opensecurity:blocks/machine_side", 6 | "front": "opensecurity:blocks/machine_side", 7 | "side": "opensecurity:blocks/machine_side", 8 | "particle": "opensecurity:blocks/machine_side" 9 | }, 10 | "model": "minecraft:orientable" 11 | }, 12 | "variants": { 13 | "normal": [{ }], 14 | "inventory": [{ }], 15 | "facing": { 16 | "north": {"model": "minecraft:orientable", "y": 180}, 17 | "south": {"model": "minecraft:orientable"}, 18 | "west": {"model": "minecraft:orientable", "y": 90}, 19 | "east": {"model": "minecraft:orientable", "y": 270} 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/blockstates/rolldoor_controller.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "textures": { 5 | "top": "opensecurity:blocks/machine_side", 6 | "front": "opensecurity:blocks/rolldoor_controller", 7 | "side": "opensecurity:blocks/rolldoor_controller", 8 | "bottom": "opensecurity:blocks/machine_side", 9 | "particle": "opensecurity:blocks/machine_side" 10 | }, 11 | "model": "minecraft:orientable" 12 | }, 13 | "variants": { 14 | "normal": [{ }], 15 | "inventory": [{ }], 16 | "facing": { 17 | "north": {"model": "minecraft:orientable", "y": 180}, 18 | "south": {"model": "minecraft:orientable"}, 19 | "west": {"model": "minecraft:orientable", "y": 90}, 20 | "east": {"model": "minecraft:orientable", "y": 270} 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/blockstates/rolldoor_element.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "textures": { 5 | "top": "opensecurity:blocks/rolldoor", 6 | "front": "opensecurity:blocks/rolldoor", 7 | "side": "opensecurity:blocks/rolldoor", 8 | "particle": "opensecurity:blocks/machine_side" 9 | }, 10 | "model": "minecraft:orientable" 11 | }, 12 | "variants": { 13 | "normal": [{ }], 14 | "inventory": [{ }] 15 | } 16 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/blockstates/security_terminal.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "textures": { 5 | "top": "opensecurity:blocks/machine_side", 6 | "front": "opensecurity:blocks/security_terminal", 7 | "side": "opensecurity:blocks/security_terminal" 8 | }, 9 | "model": "minecraft:orientable" 10 | }, 11 | "variants": { 12 | "normal": [{}], 13 | "inventory": [{ 14 | "transform": "forge:default-block" 15 | }], 16 | "facing": { 17 | "north": {"model": "minecraft:orientable", "y": 180}, 18 | "south": {"model": "minecraft:orientable"}, 19 | "west": {"model": "minecraft:orientable", "y": 90}, 20 | "east": {"model": "minecraft:orientable", "y": 270} 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/lua/cardwriter/.autorun.lua: -------------------------------------------------------------------------------- 1 | local event = require("event") 2 | local fs = require("filesystem") 3 | local process = require("process") 4 | 5 | local proxy = ... 6 | 7 | -- Install symlinks if they don't already exist. 8 | local links = {} 9 | local fsroot = fs.path(process.running()) 10 | local function inject(path) 11 | for file in fs.list(fs.concat(fsroot, path)) do 12 | local source = fs.concat(fsroot, path, file) 13 | local target = fs.concat(path, file) 14 | if fs.link(source, target) then 15 | table.insert(links, target) 16 | end 17 | end 18 | end 19 | inject("bin") 20 | 21 | -- Delete symlinks on removal. 22 | event.listen("component_removed", function(_, address) 23 | if address == proxy.address then 24 | for _, link in ipairs(links) do 25 | fs.remove(link) 26 | end 27 | return false -- remove listener 28 | end 29 | end) -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/lua/cardwriter/bin/cardwriter.lua: -------------------------------------------------------------------------------- 1 | local string = require("string") 2 | local term = require("term") 3 | local writer = require("component").os_cardwriter 4 | 5 | local data 6 | local name 7 | local lock 8 | local doLock 9 | 10 | term.clear() 11 | term.setCursor(1,1) 12 | term.write("OpenSecurity Mag/RFID Card Writer. \n") 13 | term.write("Enter Card Data: ") 14 | data = string.gsub(term.read(), "\n", "") 15 | term.setCursor(1,3) 16 | term.write("Enter Card Name: ") 17 | name = string.gsub(term.read(), "\n", "") 18 | term.setCursor(1,4) 19 | term.write("Lock Card? [y/N]") 20 | lock = term.read() 21 | term.setCursor(1,5) 22 | 23 | if lock and (lock == "" or lock:sub(1, 1):lower() == "y") then 24 | doLock = true 25 | else 26 | doLock = false 27 | end 28 | 29 | writer.write(data, name, doLock) 30 | term.clear() 31 | term.setCursor(1,1) 32 | -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/lua/datablock/.autorun.lua: -------------------------------------------------------------------------------- 1 | local event = require("event") 2 | local fs = require("filesystem") 3 | local process = require("process") 4 | 5 | local proxy = ... 6 | 7 | -- Install symlinks if they don't already exist. 8 | local links = {} 9 | local fsroot = fs.path(process.running()) 10 | local function inject(path) 11 | for file in fs.list(fs.concat(fsroot, path)) do 12 | local source = fs.concat(fsroot, path, file) 13 | local target = fs.concat(path, file) 14 | if fs.link(source, target) then 15 | table.insert(links, target) 16 | end 17 | end 18 | end 19 | inject("lib") 20 | inject("bin") 21 | inject("usr/man") 22 | 23 | -- Delete symlinks on removal. 24 | event.listen("component_removed", function(_, address) 25 | if address == proxy.address then 26 | for _, link in ipairs(links) do 27 | fs.remove(link) 28 | end 29 | return false -- remove listener 30 | end 31 | end) -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/lua/datablock/bin/os_base64.lua: -------------------------------------------------------------------------------- 1 | local shell = require("shell") 2 | local data = require("datablock") 3 | 4 | 5 | local args, parms = shell.parse(...) 6 | if parms.h or parms.help then 7 | io.stderr:write("See: man base64" .. "\n") 8 | os.exit(true) 9 | end 10 | local encodingfun = nil 11 | local encode 12 | if parms.d or parms.decode then 13 | encodingfun = data.decode64 14 | encode = false 15 | else 16 | encodingfun = data.encode64 17 | encode = true 18 | end 19 | 20 | if #args == 0 then 21 | repeat 22 | local read = io.read(encode and 3 or 4) 23 | if read then 24 | io.write(encodingfun(read)) 25 | end 26 | until not read 27 | else 28 | for i = 1, #args do 29 | local file, reason = io.open(shell.resolve(args[i])) 30 | if not file then 31 | io.stderr:write(tostring(reason) .. "\n") 32 | os.exit(false) 33 | end 34 | repeat 35 | local line = file:read(encode and 3 or 4) 36 | if line then 37 | io.write(encodingfun(line)) 38 | end 39 | until not line 40 | file:close() 41 | end 42 | end -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/lua/datablock/bin/os_deflate.lua: -------------------------------------------------------------------------------- 1 | local shell = require("shell") 2 | local data = require("datablock") 3 | 4 | local args = shell.parse(...) 5 | if #args == 0 then 6 | local read = "" 7 | repeat 8 | local current = io.read("*a") 9 | read = read .. current 10 | until current ~= "" 11 | io.write(data.deflate(read)) 12 | else 13 | local read = "" 14 | local file, reason = io.open(shell.resolve(args[1])) 15 | if not file then 16 | io.stderr:write(tostring(reason) .. "\n") 17 | os.exit(false) 18 | end 19 | repeat 20 | local current = file:read("*a") 21 | read = read .. current 22 | until current ~= "" 23 | file:close() 24 | io.write(data.deflate(read)) 25 | end -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/lua/datablock/bin/os_inflate.lua: -------------------------------------------------------------------------------- 1 | local shell = require("shell") 2 | local data = require("datablock") 3 | 4 | local args = shell.parse(...) 5 | if #args == 0 then 6 | local read = "" 7 | repeat 8 | local current = io.read("*a") 9 | read = read .. current 10 | until current ~= "" 11 | io.write(data.inflate(read)) 12 | else 13 | local read = "" 14 | local file, reason = io.open(shell.resolve(args[1])) 15 | if not file then 16 | io.stderr:write(tostring(reason) .. "\n") 17 | os.exit(false) 18 | end 19 | repeat 20 | local current = file:read("*a") 21 | read = read .. current 22 | until current ~= "" 23 | file:close() 24 | io.write(data.inflate(read)) 25 | end -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/lua/datablock/bin/os_md5sum.lua: -------------------------------------------------------------------------------- 1 | local shell = require("shell") 2 | local data = require("datablock") 3 | 4 | local args = shell.parse(...) 5 | if #args == 0 then 6 | local read = "" 7 | repeat 8 | local current = io.read("*a") 9 | read = read .. current 10 | until current ~= "" 11 | io.write(data.toHex(data.md5(read))) 12 | else 13 | for i = 1, #args do 14 | local read = "" 15 | local file, reason = io.open(shell.resolve(args[i])) 16 | if not file then 17 | io.stderr:write(tostring(reason) .. "\n") 18 | os.exit(false) 19 | end 20 | repeat 21 | local current = file:read("*a") 22 | read = read .. current 23 | until current ~= "" 24 | file:close() 25 | io.write(data.toHex(data.md5(read)) .. "\t".. args[i]) 26 | end 27 | end -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/lua/datablock/bin/os_rot13.lua: -------------------------------------------------------------------------------- 1 | local shell = require("shell") 2 | local data = require("datablock") 3 | 4 | local args = shell.parse(...) 5 | if #args == 0 then 6 | local read = "" 7 | repeat 8 | local current = io.read("*a") 9 | read = read .. current 10 | until current ~= "" 11 | io.write(data.rot13(read)) 12 | else 13 | for i = 1, #args do 14 | local read = "" 15 | local file, reason = io.open(shell.resolve(args[i])) 16 | if not file then 17 | io.stderr:write(tostring(reason) .. "\n") 18 | os.exit(false) 19 | end 20 | repeat 21 | local current = file:read("*a") 22 | read = read .. current 23 | until current ~= "" 24 | file:close() 25 | io.write(data.rot13(read) .. "\t".. args[i]) 26 | end 27 | end -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/lua/datablock/bin/os_sha256sum.lua: -------------------------------------------------------------------------------- 1 | local shell = require("shell") 2 | local data = require("datablock") 3 | 4 | local args = shell.parse(...) 5 | if #args == 0 then 6 | local read = "" 7 | repeat 8 | local current = io.read("*a") 9 | read = read .. current 10 | until current ~= "" 11 | io.write(data.toHex(data.sha256(read))) 12 | else 13 | for i = 1, #args do 14 | local read = "" 15 | local file, reason = io.open(shell.resolve(args[i])) 16 | if not file then 17 | io.stderr:write(tostring(reason) .. "\n") 18 | os.exit(false) 19 | end 20 | repeat 21 | local current = file:read("*a") 22 | read = read .. current 23 | until current ~= "" 24 | file:close() 25 | io.write(data.toHex(data.sha256(read)) .. "\t".. args[i]) 26 | end 27 | end -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/lua/datablock/lib/datablock.lua: -------------------------------------------------------------------------------- 1 | local component = require("component") 2 | 3 | 4 | local datablock = {} 5 | ------------------------------------------------------------------------------- 6 | -- Converts binary data into hexadecimal string. 7 | function datablock.toHex(data) 8 | return (data:gsub('.', function (c) 9 | return string.format('%02X', string.byte(c)) 10 | end)) 11 | end 12 | 13 | -- Converts hexadecimal string into binary data. 14 | function datablock.fromHex(hex) 15 | return (data:gsub('..', function (cc) 16 | return string.char(tonumber(cc, 16)) 17 | end)) 18 | end 19 | 20 | -- Applies base64 encoding. 21 | function datablock.encode64(data) 22 | return component.os_datablock.encode64(data) 23 | end 24 | 25 | -- Applies base64 decoding. 26 | function datablock.decode64(data) 27 | return component.os_datablock.decode64(data) 28 | end 29 | 30 | --Applies rot13 to the data. 31 | function datablock.rot13(data) 32 | return component.os_datablock.rot13(data) 33 | end 34 | 35 | -- Returns raw/binary SHA2-256 hash of data. Common form of presenting SHA is hexadecimal string, see data.toHex. 36 | function datablock.sha256(data) 37 | return component.os_datablock.sha256(data) 38 | end 39 | 40 | -- Returns raw/binary MD5 hash of data. Common form of presenting SHA is hexadecimal string, see data.toHex. 41 | function datablock.md5(data) 42 | return component.os_datablock.md5(data) 43 | end 44 | 45 | -- Returns raw/binary CRC-32 hash of data. Common form of presenting SHA is hexadecimal string, see data.toHex. 46 | function datablock.crc32(data) 47 | return component.os_datablock.crc32(data) 48 | end 49 | 50 | 51 | -- Applies DEFLATE compression. 52 | function datablock.deflate(data) 53 | return component.os_datablock.deflate(data) 54 | end 55 | 56 | -- Applies INFLATE decompression. 57 | function datablock.inflate(data) 58 | return component.os_datablock.inflate(data) 59 | end 60 | 61 | return datablock -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/block/case.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/block", 3 | "textures": { 4 | "down": "opensecurity:blocks/case_top", 5 | "up": "opensecurity:blocks/case_top", 6 | "north": "opensecurity:blocks/case_front", 7 | "east": "opensecurity:blocks/case_side", 8 | "south": "opensecurity:blocks/case_back", 9 | "west": "opensecurity:blocks/case_side", 10 | "particle": "opensecurity:blocks/case_top" 11 | }, 12 | "elements": [ 13 | { "from": [ 0, 0, 0 ], 14 | "to": [ 16, 16, 16 ], 15 | "faces": { 16 | "down": { "texture": "#down", "cullface": "down", "tintindex": 0 }, 17 | "up": { "texture": "#up", "cullface": "up", "tintindex": 0 }, 18 | "north": { "texture": "#north", "cullface": "north", "tintindex": 0 }, 19 | "south": { "texture": "#south", "cullface": "south", "tintindex": 0 }, 20 | "west": { "texture": "#west", "cullface": "west", "tintindex": 0 }, 21 | "east": { "texture": "#east", "cullface": "east", "tintindex": 0 } 22 | } 23 | } 24 | ] 25 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/block/case_running.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "opensecurity:block/case", 3 | "textures": { 4 | "east": "opensecurity:blocks/case_side_running", 5 | "west": "opensecurity:blocks/case_side_running", 6 | "south": "opensecurity:blocks/case_back_running" 7 | } 8 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/block/energy_turret.json: -------------------------------------------------------------------------------- 1 | { 2 | "credit": "Made with Blockbench, a free, modern block model editor by JannisX11", 3 | "textures": {}, 4 | "elements": [ 5 | { 6 | "name": "base", 7 | "from": [0, 0, 0], 8 | "to": [16, 6, 16], 9 | "shade": true, 10 | "faces": {} 11 | }, 12 | { 13 | "name": "pad", 14 | "from": [4, 6, 4], 15 | "to": [12, 7, 12], 16 | "shade": true, 17 | "faces": {} 18 | }, 19 | { 20 | "name": "shaft", 21 | "from": [6.5, 7, 6.5], 22 | "to": [7.5, 14, 9.5], 23 | "shade": true, 24 | "faces": {} 25 | }, 26 | { 27 | "name": "gun1", 28 | "from": [7, 13, 6], 29 | "to": [9, 15, 20], 30 | "shade": true, 31 | "faces": {} 32 | }, 33 | { 34 | "name": "cube", 35 | "from": [6, 12, 0], 36 | "to": [10, 16, 14], 37 | "shade": true, 38 | "faces": {} 39 | }, 40 | { 41 | "name": "shaft", 42 | "from": [8.5, 7, 6.5], 43 | "to": [9.5, 14, 9.5], 44 | "shade": true, 45 | "faces": {} 46 | } 47 | ] 48 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/block/nanofog.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/cube_all", 3 | "textures": { 4 | "all": "opensecurity:blocks/nanofog", 5 | "particle": "opensecurity:blocks/nanofog" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/block/nanofog_empty.json: -------------------------------------------------------------------------------- 1 | { 2 | "textures": { 3 | "particle": "opensecurity:blocks/empty" 4 | }, 5 | "elements": [ 6 | { 7 | "from": [ 0, 0, 0 ], 8 | "to": [ 0, 0, 0 ], 9 | "faces": { 10 | "down": { "texture": "opensecurity:blocks/empty", "cullface": "down" } 11 | } 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/block/nanofog_flat.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "opensecurity:blocks/nanofog" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/block/rack.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/orientable", 3 | "textures": { 4 | "bottom": "opensecurity:blocks/case_top", 5 | "top": "opensecurity:blocks/case_top", 6 | "side": "opensecurity:blocks/rack_side", 7 | "front": "opensecurity:blocks/rack_front" 8 | } 9 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/block/rolldoor.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "opensecurity:blocks/rolldoor" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/block/secure_door_bottom.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/door_bottom", 3 | "textures": { 4 | "bottom": "opensecurity:blocks/door_secure_lower", 5 | "top": "opensecurity:blocks/door_secure_upper" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/block/secure_door_bottom_rh.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/door_bottom_rh", 3 | "textures": { 4 | "bottom": "opensecurity:blocks/door_secure_lower", 5 | "top": "opensecurity:blocks/door_secure_upper" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/block/secure_door_top.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/door_top", 3 | "textures": { 4 | "bottom": "opensecurity:blocks/door_secure_lower", 5 | "top": "opensecurity:blocks/door_secure_upper" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/block/secure_door_top_rh.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/door_top_rh", 3 | "textures": { 4 | "bottom": "opensecurity:blocks/door_secure_lower", 5 | "top": "opensecurity:blocks/door_secure_upper" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/block/securepriv_door_bottom.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/door_bottom", 3 | "textures": { 4 | "bottom": "opensecurity:blocks/door_secure_lower", 5 | "top": "opensecurity:blocks/door_secure_upper_nowindow" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/block/securepriv_door_bottom_rh.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/door_bottom_rh", 3 | "textures": { 4 | "bottom": "opensecurity:blocks/door_secure_lower", 5 | "top": "opensecurity:blocks/door_secure_upper_nowindow" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/block/securepriv_door_top.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/door_top", 3 | "textures": { 4 | "bottom": "opensecurity:blocks/door_secure_lower", 5 | "top": "opensecurity:blocks/door_secure_upper_nowindow" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/block/securepriv_door_top_rh.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/door_top_rh", 3 | "textures": { 4 | "bottom": "opensecurity:blocks/door_secure_lower", 5 | "top": "opensecurity:blocks/door_secure_upper_nowindow" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/item/cooldown_upgrade.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "opensecurity:items/cooldown_upgrade" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/item/damage_upgrade.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "opensecurity:items/damage_upgrade" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/item/energy_turret.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "builtin/entity", 3 | "display": { 4 | "thirdperson": { 5 | "rotation": [ 0, 90, -90 ], 6 | "translation": [ 0, 0, -4 ], 7 | "scale": [ 0.5, 0.5, 0.5 ] 8 | }, 9 | "firstperson": { 10 | "rotation": [ 0, 225, 0 ] 11 | }, 12 | "gui": { 13 | "rotation": [ 0, -65, 0 ], 14 | "translation": [ 0, -3, 0 ], 15 | "scale": [ 0.75, 0.75, 0.75 ] 16 | }, 17 | "head": { 18 | "translation": [ 0, 8, 3.5 ], 19 | "scale": [ 1.5, 1.5, 1.5 ] 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/item/energy_upgrade.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "opensecurity:items/energy_upgrade" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/item/mag_card.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "opensecurity:items/mag_card", 5 | "layer1": "opensecurity:items/mag_card_color" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/item/mag_secure_door.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "opensecurity:items/door_secure_nowindow" 5 | }, 6 | "display": { 7 | "thirdperson": { 8 | "rotation": [ -90, 0, 0 ], 9 | "translation": [ 0, 1, -3 ], 10 | "scale": [ 0.55, 0.55, 0.55 ] 11 | }, 12 | "firstperson": { 13 | "rotation": [ 0, -135, 25 ], 14 | "translation": [ 0, 4, 2 ], 15 | "scale": [ 1.7, 1.7, 1.7 ] 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/item/manual.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "opensecurity:items/manual" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/item/movement_upgrade.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "opensecurity:items/movement_upgrade" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/item/nanodna.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "opensecurity:items/nanodna" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/item/private_secure_door.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "opensecurity:items/door_secure_nowindow" 5 | }, 6 | "display": { 7 | "thirdperson": { 8 | "rotation": [ -90, 0, 0 ], 9 | "translation": [ 0, 1, -3 ], 10 | "scale": [ 0.55, 0.55, 0.55 ] 11 | }, 12 | "firstperson": { 13 | "rotation": [ 0, -135, 25 ], 14 | "translation": [ 0, 4, 2 ], 15 | "scale": [ 1.7, 1.7, 1.7 ] 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/item/rfid_card.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "opensecurity:items/rfid_card", 5 | "layer1": "opensecurity:items/rfid_card_color" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/item/rfid_reader_card.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "opensecurity:items/rfid_reader_card" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/models/item/secure_door.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "opensecurity:items/door_secure" 5 | }, 6 | "display": { 7 | "thirdperson": { 8 | "rotation": [ -90, 0, 0 ], 9 | "translation": [ 0, 1, -3 ], 10 | "scale": [ 0.55, 0.55, 0.55 ] 11 | }, 12 | "firstperson": { 13 | "rotation": [ 0, -135, 25 ], 14 | "translation": [ 0, 4, 2 ], 15 | "scale": [ 1.7, 1.7, 1.7 ] 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/recipes/blocks/alarm.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | " R ", 5 | "PNC", 6 | " T " 7 | ], 8 | "key": { 9 | "T": { 10 | "item": "#opencomputers_chip2" 11 | }, 12 | "C": { 13 | "item": "#opencomputers_cable" 14 | }, 15 | "P": { 16 | "item": "#opencomputers_pcb" 17 | }, 18 | "N": { 19 | "item": "minecraft:noteblock" 20 | }, 21 | "R": { 22 | "item": "minecraft:redstone" 23 | } 24 | }, 25 | "result": { 26 | "item": "opensecurity:alarm" 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/recipes/blocks/biometric_reader.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "SIS", 5 | "STS", 6 | "SCS" 7 | ], 8 | "key": { 9 | "C": { 10 | "item": "#opencomputers_chip1" 11 | }, 12 | "T": { 13 | "item": "#opencomputers_transistor" 14 | }, 15 | "S": { 16 | "item": "minecraft:stone", "data": 0 17 | }, 18 | "I": { 19 | "item": "minecraft:iron_ingot" 20 | } 21 | }, 22 | "result": { 23 | "item": "opensecurity:biometric_reader" 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/recipes/blocks/card_writer.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "TRT", 5 | "SUS", 6 | "PC " 7 | ], 8 | "key": { 9 | "T": { 10 | "item": "#opencomputers_chip2" 11 | }, 12 | "C": { 13 | "item": "#opencomputers_cable" 14 | }, 15 | "P": { 16 | "item": "#opencomputers_pcb" 17 | }, 18 | "S": { 19 | "item": "#opencomputers_transistor" 20 | }, 21 | "U": { 22 | "item": "#opencomputers_controlunit" 23 | }, 24 | "R": { 25 | "item": "#opencomputers_memory1" 26 | } 27 | }, 28 | "result": { 29 | "item": "opensecurity:card_writer" 30 | } 31 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/recipes/blocks/data_block.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | " D ", 5 | "PRT", 6 | " C " 7 | ], 8 | "key": { 9 | "T": { 10 | "item": "#opencomputers_chip2" 11 | }, 12 | "C": { 13 | "item": "#opencomputers_cable" 14 | }, 15 | "P": { 16 | "item": "#opencomputers_pcb" 17 | }, 18 | "D": { 19 | "item": "#opencomputers_datacard1" 20 | }, 21 | "R": { 22 | "item": "minecraft:redstone" 23 | } 24 | }, 25 | "result": { 26 | "item": "opensecurity:data_block" 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/recipes/blocks/door_controller.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "TOT", 5 | "OCO", 6 | "SBS" 7 | ], 8 | "key": { 9 | "T": { 10 | "item": "#opencomputers_chip2" 11 | }, 12 | "S": { 13 | "item": "#opencomputers_transistor" 14 | }, 15 | "B": { 16 | "item": "#opencomputers_cable" 17 | }, 18 | "C": { 19 | "item": "#opencomputers_controlunit" 20 | }, 21 | "O": { 22 | "item": "minecraft:obsidian" 23 | } 24 | }, 25 | "result": { 26 | "item": "opensecurity:door_controller" 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/recipes/blocks/energy_turret.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "ABA", 5 | "BCB", 6 | "ABA" 7 | ], 8 | "key": { 9 | "B": { 10 | "item": "#opencomputers_chip2" 11 | }, 12 | "C": { 13 | "item": "minecraft:diamond" 14 | }, 15 | "A": { 16 | "item": "minecraft:iron_ingot" 17 | } 18 | }, 19 | "result": { 20 | "item": "opensecurity:energy_turret" 21 | } 22 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/recipes/blocks/entity_detector.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "MRM", 5 | " ", 6 | "BC " 7 | ], 8 | "key": { 9 | "M": { 10 | "item": "#opencomputers_chip2" 11 | }, 12 | "R": { 13 | "item": "#opencomputers_memory1" 14 | }, 15 | "B": { 16 | "item": "#opencomputers_cardbase" 17 | }, 18 | "C": { 19 | "item": "#opencomputers_controlunit" 20 | } 21 | }, 22 | "result": { 23 | "item": "opensecurity:entity_detector" 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/recipes/blocks/keypad.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "TIT", 5 | "INI", 6 | "ICI" 7 | ], 8 | "key": { 9 | "C": { 10 | "item": "#opencomputers_chip1" 11 | }, 12 | "T": { 13 | "item": "#opencomputers_transistor" 14 | }, 15 | "N": { 16 | "item": "#opencomputers_numpad" 17 | }, 18 | "I": { 19 | "item": "minecraft:iron_ingot" 20 | } 21 | }, 22 | "result": { 23 | "item": "opensecurity:keypad" 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/recipes/blocks/mag_reader.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "T T", 5 | "S S", 6 | "PC " 7 | ], 8 | "key": { 9 | "T": { 10 | "item": "#opencomputers_chip2" 11 | }, 12 | "C": { 13 | "item": "#opencomputers_cable" 14 | }, 15 | "P": { 16 | "item": "#opencomputers_pcb" 17 | }, 18 | "S": { 19 | "item": "#opencomputers_transistor" 20 | } 21 | }, 22 | "result": { 23 | "item": "opensecurity:mag_reader" 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/recipes/blocks/mag_secure_door.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shapeless", 3 | "ingredients": [ 4 | { 5 | "item": "opensecurity:mag_reader" 6 | }, 7 | { 8 | "item": "opensecurity:private_secure_door" 9 | } 10 | ], 11 | "result": { 12 | "item": "opensecurity:mag_secure_door" 13 | } 14 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/recipes/blocks/nanofog_terminal.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "SWS", 5 | "CTC", 6 | "ccc" 7 | ], 8 | "key": { 9 | "C": { 10 | "item": "#opencomputers_chip2" 11 | }, 12 | "T": { 13 | "item": "#opencomputers_controlunit" 14 | }, 15 | "c": { 16 | "item": "#opencomputers_capacitor" 17 | }, 18 | "W": { 19 | "item": "#opencomputers_wlancard2" 20 | }, 21 | "S": { 22 | "item": "#opencomputers_transistor" 23 | } 24 | }, 25 | "result": { 26 | "item": "opensecurity:nanofog_terminal" 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/recipes/blocks/private_secure_door.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "TOT", 5 | "ODO", 6 | "SOS" 7 | ], 8 | "key": { 9 | "T": { 10 | "item": "#opencomputers_chip2" 11 | }, 12 | "S": { 13 | "item": "#opencomputers_transistor" 14 | }, 15 | "D": { 16 | "item": "minecraft:iron_door" 17 | }, 18 | "O": { 19 | "item": "minecraft:obsidian" 20 | } 21 | }, 22 | "result": { 23 | "item": "opensecurity:private_secure_door" 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/recipes/blocks/rfid_reader.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | " R ", 5 | "PFT", 6 | " C " 7 | ], 8 | "key": { 9 | "T": { 10 | "item": "#opencomputers_chip2" 11 | }, 12 | "C": { 13 | "item": "#opencomputers_cable" 14 | }, 15 | "P": { 16 | "item": "#opencomputers_pcb" 17 | }, 18 | "F": { 19 | "item": "opensecurity:rfid_reader_card" 20 | }, 21 | "R": { 22 | "item": "minecraft:redstone" 23 | } 24 | }, 25 | "result": { 26 | "item": "opensecurity:rfid_reader" 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/recipes/blocks/rolldoor.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "III", 5 | "IMI", 6 | "TCT" 7 | ], 8 | "key": { 9 | "M": { 10 | "item": "#opencomputers_chip1" 11 | }, 12 | "T": { 13 | "item": "#opencomputers_transistor" 14 | }, 15 | "C": { 16 | "item": "#opencomputers_cable" 17 | }, 18 | "I": { 19 | "item": "minecraft:iron_ingot" 20 | } 21 | }, 22 | "result": { 23 | "item": "opensecurity:rolldoor" 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/recipes/blocks/rolldoor_controller.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "TQT", 5 | "QCQ", 6 | "SBS" 7 | ], 8 | "key": { 9 | "T": { 10 | "item": "#opencomputers_chip2" 11 | }, 12 | "S": { 13 | "item": "#opencomputers_transistor" 14 | }, 15 | "B": { 16 | "item": "#opencomputers_cable" 17 | }, 18 | "C": { 19 | "item": "#opencomputers_controlunit" 20 | }, 21 | "Q": { 22 | "item": "minecraft:quartz" 23 | } 24 | }, 25 | "result": { 26 | "item": "opensecurity:rolldoor_controller" 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/recipes/blocks/secure_door.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "TGT", 5 | "ODO", 6 | "SOS" 7 | ], 8 | "key": { 9 | "T": { 10 | "item": "#opencomputers_chip2" 11 | }, 12 | "S": { 13 | "item": "#opencomputers_transistor" 14 | }, 15 | "D": { 16 | "item": "minecraft:iron_door" 17 | }, 18 | "G": { 19 | "item": "minecraft:glass" 20 | }, 21 | "O": { 22 | "item": "minecraft:obsidian" 23 | } 24 | }, 25 | "result": { 26 | "item": "opensecurity:secure_door" 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/recipes/blocks/security_terminal.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "cIc", 5 | "cTc", 6 | "cCc" 7 | ], 8 | "key": { 9 | "C": { 10 | "item": "#opencomputers_chip2" 11 | }, 12 | "T": { 13 | "item": "#opencomputers_transistor" 14 | }, 15 | "c": { 16 | "item": "#opencomputers_capacitor" 17 | }, 18 | "I": { 19 | "item": "minecraft:iron_ingot" 20 | } 21 | }, 22 | "result": { 23 | "item": "opensecurity:security_terminal" 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/recipes/items/cooldown_upgrade.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "R R", 5 | " W ", 6 | "R R" 7 | ], 8 | "key": { 9 | "R": { 10 | "item": "minecraft:redstone" 11 | }, 12 | "W": { 13 | "item": "minecraft:water_bucket" 14 | } 15 | }, 16 | "result": { 17 | "item": "opensecurity:cooldown_upgrade" 18 | } 19 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/recipes/items/damage_upgrade.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "A A", 5 | " G ", 6 | "A A" 7 | ], 8 | "key": { 9 | "A": { 10 | "item": "minecraft:arrow" 11 | }, 12 | "G": { 13 | "item": "minecraft:gunpowder" 14 | } 15 | }, 16 | "result": { 17 | "item": "opensecurity:damage_upgrade" 18 | } 19 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/recipes/items/energy_upgrade.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "R R", 5 | " B ", 6 | "R R" 7 | ], 8 | "key": { 9 | "R": { 10 | "item": "minecraft:redstone" 11 | }, 12 | "B": { 13 | "item": "#opencomputers_batteryupgrade1" 14 | } 15 | }, 16 | "result": { 17 | "item": "opensecurity:energy_upgrade" 18 | } 19 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/recipes/items/mag_card.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "P P", 5 | " S ", 6 | "P P" 7 | ], 8 | "key": { 9 | "S": { 10 | "item": "#opencomputers_transistor" 11 | }, 12 | "P": { 13 | "item": "minecraft:paper" 14 | } 15 | }, 16 | "result": { 17 | "item": "opensecurity:mag_card" 18 | } 19 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/recipes/items/manual.json: -------------------------------------------------------------------------------- 1 | { 2 | "conditions": [ 3 | { 4 | "type": "forge:mod_loaded", 5 | "modid": "rtfm" 6 | } 7 | ], 8 | "type": "minecraft:crafting_shaped", 9 | "pattern": [ 10 | "BR ", 11 | " ", 12 | " " 13 | ], 14 | "key": { 15 | "B": { 16 | "item": "minecraft:book" 17 | }, 18 | "R": { 19 | "item": "opensecurity:rfid_card" 20 | } 21 | }, 22 | "result": { 23 | "item": "opensecurity:manual" 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/recipes/items/movement_upgrade.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "R R", 5 | " P ", 6 | "R R" 7 | ], 8 | "key": { 9 | "R": { 10 | "item": "minecraft:redstone" 11 | }, 12 | "P": { 13 | "item": "minecraft:piston" 14 | } 15 | }, 16 | "result": { 17 | "item": "opensecurity:movement_upgrade" 18 | } 19 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/recipes/items/nanodna.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "CCC", 5 | "CNC", 6 | "CCC" 7 | ], 8 | "key": { 9 | "C": { 10 | "item": "#opencomputers_chameliumblock" 11 | }, 12 | "N": { 13 | "item": "#opencomputers_nanomachines" 14 | } 15 | }, 16 | "result": { 17 | "item": "opensecurity:nanodna" 18 | } 19 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/recipes/items/rfid_card.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "P P", 5 | " S ", 6 | "PTP" 7 | ], 8 | "key": { 9 | "T": { 10 | "item": "#opencomputers_chip1" 11 | }, 12 | "S": { 13 | "item": "#opencomputers_transistor" 14 | }, 15 | "P": { 16 | "item": "minecraft:paper" 17 | } 18 | }, 19 | "result": { 20 | "item": "opensecurity:rfid_card" 21 | } 22 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/recipes/items/rfid_reader_card.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "MRM", 5 | " N ", 6 | "BC " 7 | ], 8 | "key": { 9 | "M": { 10 | "item": "#opencomputers_chip2" 11 | }, 12 | "R": { 13 | "item": "#opencomputers_memory1" 14 | }, 15 | "N": { 16 | "item": "#opencomputers_wlancard1" 17 | }, 18 | "B": { 19 | "item": "#opencomputers_cardbase" 20 | }, 21 | "C": { 22 | "item": "#opencomputers_controlunit" 23 | } 24 | }, 25 | "result": { 26 | "item": "opensecurity:rfid_reader_card" 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/sounds.json: -------------------------------------------------------------------------------- 1 | { 2 | "turretMove": {"category": "block","sounds": [{"name": "opensecurity:turretMove","stream": false}]}, 3 | "turretFire": {"category": "block","sounds": [{"name": "opensecurity:turretFire","stream": false}]}, 4 | "keypad_press": {"category": "block","sounds": [{"name": "opensecurity:keypad_press","stream": false}]}, 5 | "security_door": {"category": "block","sounds": [{"name": "opensecurity:security_door","stream": false}]}, 6 | "scanner1": {"category": "block","sounds": [{"name": "opensecurity:scanner1","stream": false}]}, 7 | "scanner2": {"category": "block","sounds": [{"name": "opensecurity:scanner2","stream": false}]}, 8 | "scanner3": {"category": "block","sounds": [{"name": "opensecurity:scanner3","stream": false}]}, 9 | "card_swipe": {"category": "block","sounds": [{"name": "opensecurity:card_swipe","stream": false}]} 10 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/sounds/alarms/klaxon1.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/sounds/alarms/klaxon1.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/sounds/alarms/klaxon2.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/sounds/alarms/klaxon2.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/sounds/card_swipe.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/sounds/card_swipe.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/sounds/keypad_press.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/sounds/keypad_press.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/sounds/scanner1.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/sounds/scanner1.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/sounds/scanner2.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/sounds/scanner2.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/sounds/scanner3.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/sounds/scanner3.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/sounds/security_door.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/sounds/security_door.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/sounds/turretfire.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/sounds/turretfire.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/sounds/turretmove.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/sounds/turretmove.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/alarm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/alarm.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/biometricreader_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/biometricreader_front.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/cardwriter_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/cardwriter_front.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/cardwriter_front.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 10 4 | } 5 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/case_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/case_back.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/case_back_running.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/case_back_running.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/case_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/case_front.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/case_front_activity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/case_front_activity.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/case_front_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/case_front_error.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/case_front_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/case_front_on.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/case_side.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/case_side.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/case_side_running.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/case_side_running.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/case_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/case_top.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/dataprocblock_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/dataprocblock_front.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/dataprocblock_front.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 2 4 | } 5 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/dataprocblock_side.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/dataprocblock_side.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/dataprocblock_side.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 10 4 | } 5 | } -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/door_controller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/door_controller.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/door_secure_lower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/door_secure_lower.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/door_secure_upper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/door_secure_upper.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/door_secure_upper_nowindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/door_secure_upper_nowindow.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/empty.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/encrypter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/encrypter.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/entitydetector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/entitydetector.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/filing_cabinet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/filing_cabinet.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/hub_input_connected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/hub_input_connected.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/hub_input_noconnected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/hub_input_noconnected.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/hub_output_connected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/hub_output_connected.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/hub_output_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/hub_output_disabled.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/hub_output_noconnected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/hub_output_noconnected.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/machine_side.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/machine_side.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/mag_reader.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/mag_reader.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/magreader_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/magreader_active.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/magreader_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/magreader_error.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/magreader_five.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/magreader_five.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/magreader_seven.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/magreader_seven.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/magreader_six.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/magreader_six.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/magreader_success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/magreader_success.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/magreader_three.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/magreader_three.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/nanofog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/nanofog.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/nanofog_terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/nanofog_terminal.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/rack_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/rack_front.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/rack_side.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/rack_side.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/rfid_reader.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/rfid_reader.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/rfidreader_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/rfidreader_active.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/rfidreader_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/rfidreader_found.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/rfidreader_nofound.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/rfidreader_nofound.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/rolldoor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/rolldoor.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/rolldoor_controller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/rolldoor_controller.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/blocks/security_terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/blocks/security_terminal.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/gui/energy_turret.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/gui/energy_turret.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/gui/kvm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/gui/kvm.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/gui/nanofog_terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/gui/nanofog_terminal.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/gui/rfidwriter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/gui/rfidwriter.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/items/cooldown_upgrade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/items/cooldown_upgrade.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/items/damage_upgrade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/items/damage_upgrade.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/items/door_secure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/items/door_secure.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/items/door_secure_nowindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/items/door_secure_nowindow.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/items/energy_upgrade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/items/energy_upgrade.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/items/mag_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/items/mag_card.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/items/mag_card_color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/items/mag_card_color.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/items/manual.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/items/manual.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/items/movement_upgrade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/items/movement_upgrade.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/items/nanodna.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/items/nanodna.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/items/rfid_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/items/rfid_card.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/items/rfid_card_color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/items/rfid_card_color.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/items/rfid_reader_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/items/rfid_reader_card.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/items/secure_network_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/items/secure_network_card.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/model/nanofogswarm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/model/nanofogswarm.png -------------------------------------------------------------------------------- /src/main/resources/assets/opensecurity/textures/model/turret.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PC-Logix/OpenSecurity/4ff9b314851d2edae5fa29c1740a773b4103aa11/src/main/resources/assets/opensecurity/textures/model/turret.png -------------------------------------------------------------------------------- /src/main/resources/mcmod.info: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "modid": "opensecurity", 4 | "name": "OpenSecurity", 5 | "description": "OpenSecurity an addon for OpenComputers.", 6 | "version": "${version}", 7 | "mcversion": "${mcversion}", 8 | "url": "", 9 | "updateUrl": "", 10 | "authors": ["Michiyo"], 11 | "credits": "", 12 | "logoFile": "", 13 | "screenshots": [], 14 | "dependencies": [] 15 | } 16 | ] 17 | --------------------------------------------------------------------------------