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 {
74
74
mappings = ' stable_32'
75
75
// coreMod = ""
76
76
makeObfSourceJar = false
77
+
78
+ replace ' @FINGERPRINT@' , project. findProperty(' signSHA1' )
77
79
}
78
80
79
81
repositories {
@@ -179,6 +181,26 @@ task deobfJar(type: Jar) {
179
181
from sourceSets. main. output
180
182
}
181
183
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
+
182
204
task javadocJar (type : Jar , dependsOn : javadoc) {
183
205
classifier = ' javadoc'
184
206
from javadoc. getDestinationDir()
Original file line number Diff line number Diff line change 27
27
import net .minecraftforge .fml .common .Mod ;
28
28
import net .minecraftforge .fml .common .Mod .EventHandler ;
29
29
import net .minecraftforge .fml .common .Mod .Instance ;
30
+ import net .minecraftforge .fml .common .event .FMLFingerprintViolationEvent ;
30
31
import net .minecraftforge .fml .common .event .FMLInitializationEvent ;
31
32
import net .minecraftforge .fml .common .event .FMLPostInitializationEvent ;
32
33
import net .minecraftforge .fml .common .event .FMLPreInitializationEvent ;
42
43
@ Mod (modid = Constants .MODID ,
43
44
name = Constants .NAME ,
44
45
version = Constants .VERSION ,
45
- acceptedMinecraftVersions = "[1.11.2,)" )
46
+ acceptedMinecraftVersions = "[1.11.2,)" ,
47
+ certificateFingerprint = "@FINGERPRINT@" )
46
48
47
49
public class OreSpawn {
48
50
@ Instance
@@ -61,6 +63,11 @@ public static Map<Integer, List<SpawnBuilder>> getSpawns() {
61
63
return spawns ;
62
64
}
63
65
66
+ @ EventHandler
67
+ public void onFingerprintViolation (FMLFingerprintViolationEvent event ) {
68
+ logger .warn ("Invalid fingerprint detected!" );
69
+ }
70
+
64
71
@ EventHandler
65
72
public void preInit (FMLPreInitializationEvent ev ) {
66
73
Config .loadConfig ();
You can’t perform that action at this time.
0 commit comments