Skip to content
Permalink
Browse files

Updated to 1.14.2, Fixed #4, Fixed #6, Fixed #8

Another full rewrite, this time for 1.14.2! LOts of changes so I'll list the main ones that come to mind:
- Locks and keys now use ints instead of UUIDs
- Shrunk packets even more so even less bandwidth is used
- Fixed bugs
- Added config options for random lock generation
- Probably something else I forgot

Due to the new forge version and changes in minecraft there are a few new issues out of my control however:
- Locks can only be removed by hand for now so breaking blocks will not drop the lock, it will stay
- Some blocks such as doors and trapdoors can desync when used while locked
- The logo file doesn't appear for some reason
- Key ring doesn't update its model instantly
  • Loading branch information...
Melonslise committed Jun 14, 2019
1 parent a91573c commit accee0b6c48c29883c718c9c5782f4f9ae4ddf99
Showing with 2,609 additions and 2,787 deletions.
  1. +84 −66 build.gradle
  2. +325 −0 src/main/java/melonslise/locks/Locks.java
  3. +0 −19 src/main/java/melonslise/locks/LocksCore.java
  4. +0 −137 src/main/java/melonslise/locks/client/event/LocksClientEvents.java
  5. +0 −53 src/main/java/melonslise/locks/client/gui/GuiKeyRing.java
  6. +0 −162 src/main/java/melonslise/locks/client/gui/GuiLockPicking.java
  7. +52 −0 src/main/java/melonslise/locks/client/gui/ScreenKeyRing.java
  8. +168 −0 src/main/java/melonslise/locks/client/gui/ScreenLockPicking.java
  9. +0 −22 src/main/java/melonslise/locks/client/gui/api/sprite/Texture.java
  10. +3 −3 src/main/java/melonslise/locks/client/gui/{api → }/sprite/Sprite.java
  11. +0 −3 src/main/java/melonslise/locks/client/gui/sprite/SpriteLockPick.java
  12. +0 −3 src/main/java/melonslise/locks/client/gui/sprite/SpritePin.java
  13. +8 −7 src/main/java/melonslise/locks/client/gui/{api → }/sprite/SpriteRotatable.java
  14. +25 −0 src/main/java/melonslise/locks/client/gui/sprite/Texture.java
  15. +17 −0 src/main/java/melonslise/locks/client/init/LocksScreens.java
  16. +24 −0 src/main/java/melonslise/locks/common/capability/CapabilityLockPosition.java
  17. +96 −0 src/main/java/melonslise/locks/common/capability/CapabilityLockables.java
  18. +31 −0 src/main/java/melonslise/locks/common/capability/CapabilityProvider.java
  19. +26 −0 src/main/java/melonslise/locks/common/capability/CapabilityProviderSerializable.java
  20. +5 −5 src/main/java/melonslise/locks/common/capability/{api → }/CapabilityStorage.java
  21. +18 −0 src/main/java/melonslise/locks/common/capability/CapabilityStorageDummy.java
  22. +10 −0 src/main/java/melonslise/locks/common/capability/ICapabilityLockPosition.java
  23. +18 −0 src/main/java/melonslise/locks/common/capability/ICapabilityLockables.java
  24. +116 −8 src/main/java/melonslise/locks/common/capability/InventoryKeyRing.java
  25. +0 −43 src/main/java/melonslise/locks/common/capability/LocksCapabilities.java
  26. +0 −31 src/main/java/melonslise/locks/common/capability/api/CapabilityProvider.java
  27. +0 −26 src/main/java/melonslise/locks/common/capability/api/CapabilityProviderSerializable.java
  28. +0 −18 src/main/java/melonslise/locks/common/capability/api/CapabilityStorageDummy.java
  29. +0 −23 src/main/java/melonslise/locks/common/capability/entity/CapabilityLockBounds.java
  30. +0 −11 src/main/java/melonslise/locks/common/capability/entity/ICapabilityLockBounds.java
  31. +38 −37 src/main/java/melonslise/locks/common/config/LocksConfiguration.java
  32. +67 −20 src/main/java/melonslise/locks/common/container/ContainerKeyRing.java
  33. +124 −39 src/main/java/melonslise/locks/common/container/ContainerLockPicking.java
  34. +13 −0 src/main/java/melonslise/locks/common/container/LocksContainerType.java
  35. +11 −8 src/main/java/melonslise/locks/common/container/slot/SlotKeyRing.java
  36. +0 −133 src/main/java/melonslise/locks/common/crafting/recipe/RecipeLockableCloning.java
  37. +0 −20 src/main/java/melonslise/locks/common/creativetab/LocksCreativeTab.java
  38. +0 −10 src/main/java/melonslise/locks/common/creativetab/LocksCreativeTabs.java
  39. +0 −199 src/main/java/melonslise/locks/common/event/LocksEvents.java
  40. +45 −0 src/main/java/melonslise/locks/common/init/LocksCapabilities.java
  41. +31 −0 src/main/java/melonslise/locks/common/init/LocksContainerTypes.java
  42. +22 −0 src/main/java/melonslise/locks/common/init/LocksFeatures.java
  43. +11 −0 src/main/java/melonslise/locks/common/init/LocksItemGroups.java
  44. +39 −0 src/main/java/melonslise/locks/common/init/LocksItems.java
  45. +28 −0 src/main/java/melonslise/locks/common/init/LocksNetworks.java
  46. +28 −0 src/main/java/melonslise/locks/common/init/LocksRecipeSerializers.java
  47. +34 −0 src/main/java/melonslise/locks/common/init/LocksSounds.java
  48. +22 −22 src/main/java/melonslise/locks/common/item/ItemKey.java
  49. +51 −47 src/main/java/melonslise/locks/common/item/ItemKeyRing.java
  50. +42 −35 src/main/java/melonslise/locks/common/item/ItemLock.java
  51. +26 −33 src/main/java/melonslise/locks/common/item/ItemLockPick.java
  52. +58 −0 src/main/java/melonslise/locks/common/item/ItemLocking.java
  53. +22 −17 src/main/java/melonslise/locks/common/item/ItemMasterKey.java
  54. +14 −0 src/main/java/melonslise/locks/common/item/LocksItem.java
  55. +0 −62 src/main/java/melonslise/locks/common/item/LocksItems.java
  56. +0 −13 src/main/java/melonslise/locks/common/item/api/ItemNamed.java
  57. +0 −12 src/main/java/melonslise/locks/common/item/api/LocksItem.java
  58. +0 −64 src/main/java/melonslise/locks/common/item/api/lockable/ItemLockable.java
  59. +20 −0 src/main/java/melonslise/locks/common/item/group/LocksItemGroup.java
  60. +0 −39 src/main/java/melonslise/locks/common/network/LocksNetworks.java
  61. +0 −55 src/main/java/melonslise/locks/common/network/client/MessageAddLockable.java
  62. +0 −62 src/main/java/melonslise/locks/common/network/client/MessageCheckPinResult.java
  63. +0 −87 src/main/java/melonslise/locks/common/network/client/MessageConfiguration.java
  64. +0 −62 src/main/java/melonslise/locks/common/network/client/MessageKeyRing.java
  65. +0 −70 src/main/java/melonslise/locks/common/network/client/MessageLockPicking.java
  66. +0 −55 src/main/java/melonslise/locks/common/network/client/MessageRemoveLockables.java
  67. +0 −62 src/main/java/melonslise/locks/common/network/client/MessageSetLockables.java
  68. +0 −55 src/main/java/melonslise/locks/common/network/client/MessageToggleLockables.java
  69. +0 −61 src/main/java/melonslise/locks/common/network/client/MessageToggleLockablesByID.java
  70. +0 −55 src/main/java/melonslise/locks/common/network/server/MessageCheckPin.java
  71. +42 −0 src/main/java/melonslise/locks/common/network/toClient/PacketCheckPinResult.java
  72. +36 −0 src/main/java/melonslise/locks/common/network/toClient/PacketLockableAdd.java
  73. +34 −0 src/main/java/melonslise/locks/common/network/toClient/PacketLockableRemove.java
  74. +38 −0 src/main/java/melonslise/locks/common/network/toClient/PacketLockableStatus.java
  75. +39 −0 src/main/java/melonslise/locks/common/network/toServer/PacketCheckPin.java
  76. +13 −0 src/main/java/melonslise/locks/common/recipe/LocksRecipeSerializer.java
  77. +152 −0 src/main/java/melonslise/locks/common/recipe/RecipeLockingItemCloning.java
  78. +14 −0 src/main/java/melonslise/locks/common/sound/LocksSoundEvent.java
  79. +0 −22 src/main/java/melonslise/locks/common/sound/LocksSounds.java
  80. +0 −13 src/main/java/melonslise/locks/common/sound/api/SoundEventNamed.java
  81. +0 −66 src/main/java/melonslise/locks/common/world/ListenerLockables.java
  82. +0 −83 src/main/java/melonslise/locks/common/world/storage/Lock.java
  83. +0 −51 src/main/java/melonslise/locks/common/world/storage/Lockable.java
  84. +0 −144 src/main/java/melonslise/locks/common/world/storage/StorageLockables.java
  85. +42 −0 src/main/java/melonslise/locks/common/worldgen/FeatureLockChest.java
  86. +30 −0 src/main/java/melonslise/locks/common/worldgen/PlacementAtChest.java
  87. +3 −21 src/main/java/melonslise/locks/{common/world/storage → utility}/Box.java
  88. +73 −0 src/main/java/melonslise/locks/utility/Lock.java
  89. +59 −0 src/main/java/melonslise/locks/utility/Lockable.java
  90. +95 −159 src/main/java/melonslise/locks/utility/LocksUtilities.java
  91. +14 −0 src/main/java/melonslise/locks/utility/predicate/LocksPredicates.java
  92. +0 −28 src/main/java/melonslise/locks/utility/predicate/LocksSelectors.java
  93. +11 −5 src/main/java/melonslise/locks/utility/predicate/PredicateIntersecting.java
  94. +6 −8 src/main/java/melonslise/locks/utility/predicate/PredicateMatching.java
  95. +15 −0 src/main/resources/META-INF/mods.toml
  96. +36 −0 src/main/resources/assets/locks/lang/en_us.json
  97. +0 −45 src/main/resources/assets/locks/lang/en_us.lang
  98. +1 −1 src/main/resources/assets/locks/models/item/key.json
  99. +1 −1 src/main/resources/assets/locks/models/item/key_blank.json
  100. +31 −0 src/main/resources/assets/locks/models/item/key_ring.json
  101. +0 −7 src/main/resources/assets/locks/models/item/key_ring_0.json
  102. +1 −1 src/main/resources/assets/locks/models/item/key_ring_1.json
  103. +1 −1 src/main/resources/assets/locks/models/item/key_ring_2.json
  104. +1 −1 src/main/resources/assets/locks/models/item/key_ring_3.json
  105. +1 −1 src/main/resources/assets/locks/models/item/lock.json
  106. +1 −1 src/main/resources/assets/locks/models/item/lock_pick.json
  107. +1 −1 src/main/resources/assets/locks/models/item/master_key.json
  108. +0 −6 src/main/resources/assets/locks/recipes/_factories.json
  109. +0 −22 src/main/resources/assets/locks/recipes/lock_pick.json
  110. BIN src/main/resources/assets/locks/textures/{items → item}/key.png
  111. BIN src/main/resources/assets/locks/textures/{items/blank.png → item/key_blank.png}
  112. BIN src/main/resources/assets/locks/textures/{items → item}/key_ring_0.png
  113. BIN src/main/resources/assets/locks/textures/{items → item}/key_ring_1.png
  114. BIN src/main/resources/assets/locks/textures/{items → item}/key_ring_2.png
  115. BIN src/main/resources/assets/locks/textures/{items → item}/key_ring_3.png
  116. BIN src/main/resources/assets/locks/textures/{items → item}/lock.png
  117. BIN src/main/resources/assets/locks/textures/{items → item}/lock_pick.png
  118. BIN src/main/resources/assets/locks/textures/{items → item}/master_key.png
  119. +5 −3 src/main/resources/{assets → data}/locks/recipes/key_blank.json
  120. +2 −2 src/main/resources/{assets → data}/locks/recipes/key_from_key.json
  121. +2 −2 src/main/resources/{assets → data}/locks/recipes/key_from_lock.json
  122. +5 −3 src/main/resources/{assets → data}/locks/recipes/key_ring.json
  123. +23 −0 src/main/resources/data/locks/recipes/lock_pick.json
  124. +7 −0 src/main/resources/data/locks/tags/items/leather.json
  125. +0 −13 src/main/resources/mcmod.info
  126. +2 −2 src/main/resources/pack.mcmeta
@@ -1,86 +1,104 @@
buildscript
{
repositories
repositories
{
jcenter()
maven { url = "https://files.minecraftforge.net/maven" }
}
dependencies
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
mavenCentral()
}
dependencies
{
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
}
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.

apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'

version = "2.2.1"
group = "melonslise.locks" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "Locks"
version = '2.3'
group = 'melonslise.locks'
archivesBaseName = 'Locks'

sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
compileJava
{
sourceCompatibility = targetCompatibility = '1.8'
}
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'

minecraft
{
version = "1.12.2-14.23.5.2807"
runDir = "run"

// the mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work.
// simply re-run your setup task after changing the mappings to update your workspace.
mappings = "snapshot_20171003"
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
mappings channel: 'snapshot', version: '20190608-1.14.2'

runs
{
client
{
workingDirectory project.file('run')
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
mods
{
locks
{
source sourceSets.main
}
}
}

server
{
workingDirectory project.file('run')
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
mods
{
locks
{
source sourceSets.main
}
}
}
}
}

dependencies
{
// you may put jars on which you depend on in ./libs
// or you may define them like so..
//compile "some.group:artifact:version:classifier"
//compile "some.group:artifact:version"

// real examples
//compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
//compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env

// the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
//provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'

// the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided,
// except that these dependencies get remapped to your current MCP mappings
//deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev'
//deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev'

// for more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html

minecraft 'net.minecraftforge:forge:1.14.2-26.0.21'
}

processResources
jar
{
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
manifest
{
attributes
([
"Specification-Title": archivesBaseName,
"Specification-Vendor": "melonslise",
"Specification-Version": version,
"Implementation-Title": archivesBaseName,
"Implementation-Version": version,
"Implementation-Vendor" :"melonslise",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}

// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs)
def reobfFile = file("$buildDir/reobfJar/output.jar")
def reobfArtifact = artifacts.add('default', reobfFile)
{
type 'jar'
builtBy 'reobfJar'
}
publishing
{
publications
{
include 'mcmod.info'

// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
}

// copy everything else except the mcmod.info
from(sourceSets.main.resources.srcDirs)
mavenJava(MavenPublication)
{
artifact reobfArtifact
}
}
repositories
{
exclude 'mcmod.info'
}
}
maven
{
url "file:///${project.projectDir}/mcmodsrepo"
}
}
}

0 comments on commit accee0b

Please sign in to comment.
You can’t perform that action at this time.