File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed
src/main/java/com/mcmoddev/orespawn Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,8 @@ minecraft {
7474 mappings = ' stable_32'
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 2727import net .minecraftforge .fml .common .Mod ;
2828import net .minecraftforge .fml .common .Mod .EventHandler ;
2929import net .minecraftforge .fml .common .Mod .Instance ;
30+ import net .minecraftforge .fml .common .event .FMLFingerprintViolationEvent ;
3031import net .minecraftforge .fml .common .event .FMLInitializationEvent ;
3132import net .minecraftforge .fml .common .event .FMLPostInitializationEvent ;
3233import net .minecraftforge .fml .common .event .FMLPreInitializationEvent ;
4243@ Mod (modid = Constants .MODID ,
4344 name = Constants .NAME ,
4445 version = Constants .VERSION ,
45- acceptedMinecraftVersions = "[1.11.2,)" )
46+ acceptedMinecraftVersions = "[1.11.2,)" ,
47+ certificateFingerprint = "@FINGERPRINT@" )
4648
4749public class OreSpawn {
4850 @ Instance
@@ -61,6 +63,11 @@ public static Map<Integer, List<SpawnBuilder>> getSpawns() {
6163 return spawns ;
6264 }
6365
66+ @ EventHandler
67+ public void onFingerprintViolation (FMLFingerprintViolationEvent event ) {
68+ logger .warn ("Invalid fingerprint detected!" );
69+ }
70+
6471 @ EventHandler
6572 public void preInit (FMLPreInitializationEvent ev ) {
6673 Config .loadConfig ();
You can’t perform that action at this time.
0 commit comments