Skip to content

Commit

Permalink
Update to 1.18.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyrofab committed Mar 4, 2022
1 parent 40425d3 commit 005907c
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 100 deletions.
104 changes: 17 additions & 87 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
import com.modrinth.minotaur.TaskModrinthUpload

import java.time.Year

plugins {
id "fabric-loom" version "0.11-SNAPSHOT"
id 'org.quiltmc.quilt-mappings-on-loom' version "3.1.1"
id 'io.github.ladysnake.chenille' version '0.6.1'
id 'io.github.juuxel.loom-quiltflower' version "1.6.0"
id 'org.cadixdev.licenser' version '0.6.1'
id 'com.matthewprenger.cursegradle' version '1.4.0'
id 'com.jfrog.artifactory' version '4.21.0'
id 'org.ajoberstar.grgit' version '3.1.1'
id 'com.github.breadmoirai.github-release' version '2.2.12'
id 'com.modrinth.minotaur' version '1.2.1'
id 'maven-publish'
}

sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
Expand All @@ -21,6 +9,21 @@ archivesBaseName = project.name
version = project.mod_version
group = project.maven_group

chenille {
configurePublishing {
withArtifactory()
withCurseforgeRelease()
withGithubRelease()
withModrinthRelease()
}
configureTestmod {
withDependencyConfiguration()
}

javaVersion = 17
license = 'LGPL'
}

processResources {
inputs.property "version", project.version

Expand All @@ -32,38 +35,6 @@ processResources {
}
}

sourceSets {
testmod {
compileClasspath += main.compileClasspath
runtimeClasspath += main.runtimeClasspath
}
}

loom {
runs {
gametest {
server()
source sourceSets.testmod

name "Game Test"

// Enable the gametest runner
vmArg "-Dfabric-api.gametest"
vmArg "-Dfabric-api.gametest.report-file=${project.buildDir}/junit.xml"
runDir "build/gametest"
}
autoTestServer {
server()
source sourceSets.testmod

name "Auto Test Server"

vmArg "-Dfabric.autoTest"
}
}
}
check.dependsOn runGametest

repositories {
maven {
name = "FabricMC"
Expand Down Expand Up @@ -103,51 +74,10 @@ dependencies {
testmodImplementation sourceSets.main.output
}

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"

// Minecraft 1.18 (pre2) upwards uses Java 17.
it.options.release.set(17)
}


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()
}

license {
header = rootProject.file("code_quality/${project.license_header}_HEADER.txt")

include "**/*.java"

newLine.set(false) // Disables the empty line between the header and package name
//ignoreFailures = true //Ignore failures and only print a warning on license violations

//export variables
ext {
year = Year.now()
projectDisplayName = project.mod_name
projectOwners = rootProject.owners
if (project.license_header.contains('GPL')) {
if (!project.hasProperty("gpl_version")) {
throw new RuntimeException("GPL version needs to be specified through the 'gpl_version' property")
}
gplVersion = project.gpl_version
}
}
}

ext {
// no idea how else to import TaskModrinthUpload from release.gradle
ModrinthUpload = TaskModrinthUpload
}

apply from: 'gradle/utilities.gradle'
apply from: 'gradle/release.gradle'
}
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
------------------------------------------------------
Version 1.8.0
------------------------------------------------------
Updated to MC 1.18.2

------------------------------------------------------
Version 1.7.3
------------------------------------------------------
Expand Down
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# General
# see https://modmuss50.me/fabric.html
minecraft_version=1.18.1
yarn_mappings=1.18.1+build.22
loader_version=0.13.1
minecraft_version=1.18.2
yarn_mappings=1.18.2+build.1
loader_version=0.13.3

#Fabric api
fabric_version=0.46.4+1.18
fabric_version=0.47.8+1.18.2

# Base properties
mod_name = Creeper Spores
mod_version = 1.7.3
mod_version = 1.8.0
owners = Ladysnake
maven_group = io.github.ladysnake

Expand All @@ -20,8 +20,8 @@ license_header = LGPL
gpl_version = 3
modrinth_id = WSdgoMoj
curseforge_id = 331636
curseforge_versions = 1.18-Snapshot; 1.18; 1.18.1
modrinth_versions = 1.18; 1.18.1
curseforge_versions = 1.18.2
modrinth_versions = 1.18.2
cf_requirements = fabric-api
release_type = release
changelog_url = https://github.com/Ladysnake/Creeper-Spores/blob
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import net.fabricmc.fabric.api.gamerule.v1.rule.EnumRule;
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricDefaultAttributeRegistry;
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricEntityTypeBuilder;
import net.fabricmc.fabric.api.tag.TagFactory;
import net.minecraft.entity.EntityDimensions;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
Expand All @@ -39,7 +38,7 @@
import net.minecraft.entity.effect.StatusEffectCategory;
import net.minecraft.entity.mob.MobEntity;
import net.minecraft.item.Item;
import net.minecraft.tag.Tag;
import net.minecraft.tag.TagKey;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.GameRules;
Expand Down Expand Up @@ -68,7 +67,7 @@ public class CreeperSpores implements ModInitializer {
new Identifier("mobz", "crip_entity")
));

public static final Tag<Item> FERTILIZERS = TagFactory.ITEM.create(new Identifier("fabric", "fertilizers"));
public static final TagKey<Item> FERTILIZERS = TagKey.of(Registry.ITEM_KEY, new Identifier("fabric", "fertilizers"));

public static final Identifier CREEPERLING_FERTILIZATION_PACKET = id("creeperling-fertilization");
public static final String GIVE_SPORES_TAG = "cspores:giveSpores";
Expand All @@ -88,8 +87,8 @@ public static Identifier id(String path) {
}

public static <T> void visitRegistry(Registry<T> registry, BiConsumer<Identifier, T> visitor) {
registry.getIds().forEach(id -> visitor.accept(id, registry.get(id)));
RegistryEntryAddedCallback.event(registry).register((index, identifier, entry) -> visitor.accept(identifier, entry));
new HashSet<>(registry.getIds()).forEach(id -> visitor.accept(id, registry.get(id)));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void setTrusting(boolean trusting) {
@Override
protected ActionResult interactMob(PlayerEntity player, Hand hand) {
ItemStack held = player.getStackInHand(hand);
if (CreeperSpores.FERTILIZERS.contains(held.getItem())) {
if (held.isIn(CreeperSpores.FERTILIZERS)) {
if (!world.isClient) {
this.applyFertilizer(held);
this.setTrusting(true);
Expand Down Expand Up @@ -234,7 +234,7 @@ public float getPathfindingFavor(BlockPos pos, WorldView worldView) {
@SuppressWarnings("deprecation") float brightnessAtPos = worldView.getBrightness(pos);
float favor = Math.max(brightnessAtPos - 0.5F, skyFavor);
// They like good soils too
if (BlockTags.BAMBOO_PLANTABLE_ON.contains(worldView.getBlockState(pos.down(1)).getBlock())) {
if (worldView.getBlockState(pos.down(1)).isIn(BlockTags.BAMBOO_PLANTABLE_ON)) {
favor += 3.0F;
}
// What they really want is camouflage
Expand Down

0 comments on commit 005907c

Please sign in to comment.