File tree Expand file tree Collapse file tree 2 files changed +29
-2
lines changed
src/main/java/com/mcmoddev/orespawn Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,8 @@ minecraft {
7474 mappings = " snapshot_20170925"
7575// coreMod = ""
7676 makeObfSourceJar = false
77+
78+ replace ' @FINGERPRINT@' , project. findProperty(' signSHA1' )
7779}
7880
7981repositories {
@@ -179,6 +181,26 @@ task deobfJar(type: Jar) {
179181 from sourceSets. main. output
180182}
181183
184+ task signJar (type : SignJar , dependsOn : reobfJar) {
185+
186+ // Skips if the keyStore property is missing.
187+ onlyIf {
188+ project. hasProperty(' keyStore' )
189+ }
190+
191+ // findProperty allows us to reference the property without it existing.
192+ // Using project.propName would cause the script to fail validation if
193+ // the property did not exist.
194+ keyStore = project. findProperty(' keyStore' )
195+ alias = project. findProperty(' keyStoreAlias' )
196+ storePass = project. findProperty(' keyStorePass' )
197+ keyPass = project. findProperty(' keyStoreKeyPass' )
198+ inputFile = jar. archivePath
199+ outputFile = jar. archivePath
200+ }
201+
202+ build. dependsOn signJar
203+
182204task javadocJar (type : Jar , dependsOn : javadoc) {
183205 classifier = ' javadoc'
184206 from javadoc. getDestinationDir()
Original file line number Diff line number Diff line change 2222import org .apache .logging .log4j .LogManager ;
2323import org .apache .logging .log4j .Logger ;
2424
25-
2625import net .minecraftforge .common .MinecraftForge ;
2726import net .minecraftforge .fml .common .Mod ;
2827import net .minecraftforge .fml .common .Mod .EventHandler ;
4241@ Mod (modid = Constants .MODID ,
4342 name = Constants .NAME ,
4443 version = Constants .VERSION ,
45- acceptedMinecraftVersions = "[1.12,)" )
44+ acceptedMinecraftVersions = "[1.12,)" ,
45+ certificateFingerprint = "@FINGERPRINT@" )
4646
4747public class OreSpawn {
4848 @ Instance
@@ -61,6 +61,11 @@ public static Map<Integer, List<SpawnBuilder>> getSpawns() {
6161 return spawns ;
6262 }
6363
64+ @ EventHandler
65+ public void onFingerprintViolation (FMLFingerprintViolationEvent event ) {
66+ logger .warn ("Invalid fingerprint detected!" );
67+ }
68+
6469 @ EventHandler
6570 public void preInit (FMLPreInitializationEvent ev ) {
6671 Config .loadConfig ();
You can’t perform that action at this time.
0 commit comments