Skip to content

Commit

Permalink
Updating build process
Browse files Browse the repository at this point in the history
  • Loading branch information
tyra314 committed Jul 6, 2021
1 parent ff801b2 commit 3e282d4
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 57 deletions.
64 changes: 35 additions & 29 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id 'java-library'
id 'fabric-loom' version '0.5-SNAPSHOT'
id 'fabric-loom' version '0.7-SNAPSHOT'
id 'maven-publish'
}

Expand All @@ -17,15 +16,15 @@ minecraft {

repositories {
maven {
url = "http://server.bbkr.space:8081/artifactory/libs-release"
}
maven {
// for fabric
url = "https://maven.modmuss50.me/"
}
maven {
// for mod menu
url = uri("https://jitpack.io")
}
maven {
// for cloth-config
url = "https://maven.shedaniel.me/"
}
}
Expand All @@ -45,48 +44,53 @@ dependencies {
exclude(group: "net.fabricmc.fabric-api")
}

compile 'com.google.code.findbugs:jsr305:3.0.2'
testCompile "junit:junit:4.+"
// compile 'com.google.code.findbugs:jsr305:3.0.2'
// testCompile "junit:junit:4.+"
}

processResources {
inputs.property "version", project.version
from(sourceSets.main.resources.srcDirs) {
include "fabric.mod.json"

// add mod metadata
filesMatching("fabric.mod.json") { // add mod metadata
expand "version": project.version
}
from(sourceSets.main.resources.srcDirs) {
exclude "fabric.mod.json"
}
}

// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
tasks.withType(JavaCompile).configureEach {
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
// If Javadoc is generated, this must be specified in that task too.
it.options.encoding = "UTF-8"

// The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too
// JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used.
// We'll use that if it's available, but otherwise we'll use the older option.
def targetVersion = 8
if (JavaVersion.current().isJava9Compatible()) {
it.options.release = targetVersion
}
}

// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this task, sources will not be generated.
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
}

jar {
from "LICENSE"
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
}
}

// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven
artifact(jar) {
artifact(remapJar) {
builtBy remapJar
}
artifact(sourcesJar) {
Expand All @@ -95,9 +99,11 @@ publishing {
}
}

// select the repositories you want to publish to
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// uncomment to publish to the local maven
// mavenLocal()
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties
minecraft_version = 1.16.5
yarn_mappings = 1.16.5+build.6
loader_version = 0.11.3
loader_version = 0.11.6

# Mod Properties
mod_version = 6.0.0-fabric
maven_group = hunternif.mc.atlas
archives_base_name = antiqueatlas

# Dependencies
cloth_config_version = 4.11.19
fabric_version = 0.32.5+1.16
mod_menu_version = 1.16.8
cloth_config_version = 4.11.26
fabric_version = 0.36.0+1.16
mod_menu_version = 1.16.9
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
1 change: 0 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
pluginManagement {
repositories {
jcenter()
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
Expand Down
13 changes: 6 additions & 7 deletions src/main/java/hunternif/mc/api/MarkerAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import net.minecraft.world.World;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
* API for putting custom markers to the atlases. Set the textures on the
Expand Down Expand Up @@ -37,7 +36,7 @@ public interface MarkerAPI {
* @return returns the marker. null if failed or client
*/
@Nullable
Marker putMarker(@Nonnull World world, boolean visibleAhead, int atlasID, Identifier marker, Text label, int x, int z);
Marker putMarker(@NotNull World world, boolean visibleAhead, int atlasID, Identifier marker, Text label, int x, int z);

/**
* Put a marker in all atlases in the world at specified block coordinates.
Expand All @@ -53,7 +52,7 @@ public interface MarkerAPI {
* @return returns the marker. null if failed or client
*/
@Nullable
Marker putGlobalMarker(@Nonnull World world, boolean visibleAhead, Identifier marker, Text label, int x, int z);
Marker putGlobalMarker(@NotNull World world, boolean visibleAhead, Identifier marker, Text label, int x, int z);

/**
* Delete a marker from an atlas.
Expand All @@ -66,13 +65,13 @@ public interface MarkerAPI {
* @param atlasID
* @param markerID
*/
void deleteMarker(@Nonnull World world, int atlasID, int markerID);
void deleteMarker(@NotNull World world, int atlasID, int markerID);

/**
* Delete a global marker from all atlases. Server side only!
*
* @param world
* @param markerID
*/
void deleteGlobalMarker(@Nonnull World world, int markerID);
void deleteGlobalMarker(@NotNull World world, int markerID);
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,34 @@
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import net.minecraft.world.World;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

@Environment(EnvType.CLIENT)
public class MarkerApiImplClient implements MarkerAPI {
@Nullable
@Override
public Marker putMarker(@Nonnull World world, boolean visibleAhead, int atlasID, Identifier marker, Text label, int x, int z) {
public Marker putMarker(@NotNull World world, boolean visibleAhead, int atlasID, Identifier marker, Text label, int x, int z) {
new AddMarkerC2SPacket(atlasID, marker, x, z, visibleAhead, label).send();
return null;
}

@Nullable
@Override
public Marker putGlobalMarker(@Nonnull World world, boolean visibleAhead, Identifier marker, Text label, int x, int z) {
public Marker putGlobalMarker(@NotNull World world, boolean visibleAhead, Identifier marker, Text label, int x, int z) {
AntiqueAtlasMod.LOG.warn("Client tried to add a global marker");

return null;
}

@Override
public void deleteMarker(@Nonnull World world, int atlasID, int markerID) {
public void deleteMarker(@NotNull World world, int atlasID, int markerID) {
new DeleteMarkerRequestC2SPacket(atlasID, markerID).send();
}

@Override
public void deleteGlobalMarker(@Nonnull World world, int markerID) {
public void deleteGlobalMarker(@NotNull World world, int markerID) {
AntiqueAtlasMod.LOG.warn("Client tried to delete a global marker");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import net.minecraft.world.World;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Collections;

public class MarkerApiImpl implements MarkerAPI {
Expand All @@ -25,13 +25,13 @@ public class MarkerApiImpl implements MarkerAPI {

@Nullable
@Override
public Marker putMarker(@Nonnull World world, boolean visibleAhead, int atlasID, Identifier marker, Text label, int x, int z) {
public Marker putMarker(@NotNull World world, boolean visibleAhead, int atlasID, Identifier marker, Text label, int x, int z) {
return doPutMarker(world, visibleAhead, atlasID, marker, label, x, z);
}

@Nullable
@Override
public Marker putGlobalMarker(@Nonnull World world, boolean visibleAhead, Identifier marker, Text label, int x, int z) {
public Marker putGlobalMarker(@NotNull World world, boolean visibleAhead, Identifier marker, Text label, int x, int z) {
return doPutMarker(world, visibleAhead, GLOBAL, marker, label, x, z);
}

Expand All @@ -50,12 +50,12 @@ private Marker doPutMarker(World world, boolean visibleAhead, int atlasID, Ident
}

@Override
public void deleteMarker(@Nonnull World world, int atlasID, int markerID) {
public void deleteMarker(@NotNull World world, int atlasID, int markerID) {
doDeleteMarker(world, atlasID, markerID);
}

@Override
public void deleteGlobalMarker(@Nonnull World world, int markerID) {
public void deleteGlobalMarker(@NotNull World world, int markerID) {
doDeleteMarker(world, GLOBAL, markerID);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import net.minecraft.util.Identifier;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import org.jetbrains.annotations.Nullable;

import javax.annotation.Nullable;

/**
* Finds the biome ID to be used for a given chunk.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@
import net.minecraft.screen.slot.Slot;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import javax.annotation.Nullable;

@Mixin(CartographyTableScreenHandler.class)
public abstract class MixinCartographyTableScreenHandler extends ScreenHandler {
@Shadow
Expand Down

0 comments on commit 3e282d4

Please sign in to comment.