Skip to content
This repository has been archived by the owner on Dec 16, 2023. It is now read-only.

Commit

Permalink
Update Forge workspace to 1.16.5
Browse files Browse the repository at this point in the history
Add gitlab CI and automatic publishing to curseforge
  • Loading branch information
percivalalb committed Mar 21, 2021
1 parent 767cbf6 commit ed8f2ce
Show file tree
Hide file tree
Showing 38 changed files with 196 additions and 59 deletions.
33 changes: 33 additions & 0 deletions .gitlab-ci.yaml
@@ -0,0 +1,33 @@
# Known to run on a centos-8, java-openjdk-11 machine
# with gitlab runner installed

stages:
- build
- publish

variables:
GIT_DEPTH: 0 # clone all

before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
- chmod +x ./gradlew

cache:
paths:
- .gradle
- build

build:
stage: build
script:
- ./gradlew build
artifacts:
paths:
- 'build/libs/*.jar'
expire_in: 1 week

publish:
stage: publish
script:
- './gradlew curseforge'
when: manual
71 changes: 61 additions & 10 deletions build.gradle
@@ -1,27 +1,41 @@
buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
gradlePluginPortal()
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.1.+', changing: true
classpath "gradle.plugin.se.bjurr.gitchangelog:git-changelog-gradle-plugin:1.65"
classpath "gradle.plugin.com.matthewprenger:CurseGradle:1.4.0"
}
}
apply plugin: 'net.minecraftforge.gradle'
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
apply plugin: 'com.matthewprenger.cursegradle'
apply plugin: 'se.bjurr.gitchangelog.git-changelog-gradle-plugin'

version = project.output_version
group = 'com.github.percivalalb' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'DoggyTalents-1.16.4'
archivesBaseName = 'DoggyTalents-1.16.5'

sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
java.toolchain.languageVersion = JavaLanguageVersion.of(8)

repositories {
maven { url "https://dvs1.progwml6.com/files/maven/" }
maven { url "https://modmaven.k-4u.nl" }
maven {
url "http://dvs1.progwml6.com/files/maven"
content {
includeGroup "mezz.jei"
}
}
maven {
url "https://modmaven.k-4u.nl"
content {
includeGroup "mezz.jei"
}
}
}

sourceSets {
Expand All @@ -38,9 +52,9 @@ configurations {

minecraft {
mappings channel: 'snapshot', version: project.mcp_mappings

accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')

runs {
client {
taskName 'doggytalents_client'
Expand Down Expand Up @@ -89,8 +103,8 @@ dependencies {
compileOnly fg.deobf("mezz.jei:jei-${jei_version}:api")
runtimeOnly fg.deobf("mezz.jei:jei-${jei_version}")

testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.0")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.1")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.1")
}

task sourcesJar(type: Jar) {
Expand Down Expand Up @@ -133,3 +147,40 @@ jar {
test {
useJUnitPlatform()
}

import se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask
task makeChangelog(type: GitChangelogTask) {
file = new File("build/changelog.html")
untaggedName = "Current release ${project.version}"
fromCommit = 'f594ba81ba02d04a2189b6cf15216d2afb6943ba'
toRef = 'HEAD'

templateContent = file('changelog.mustache').getText('UTF-8')
}

curseforge {
apiKey = findProperty('curseforge_api_key') ?: 0
project {
id = project.curseforge_project_id
changelog = file("build/changelog.html")
changelogType = 'html'
releaseType = findProperty("curseforge_release_type") ?: 'alpha'
addArtifact apiJar
}
}

// Must be done in afterEvaluate as the specific curseforge$id
// task is generated lazily
afterEvaluate {
tasks.named("curseforge${project.curseforge_project_id}").get().dependsOn.add(makeChangelog)
}

if (project.hasProperty('UPDATE_MAPPINGS')) {
extractRangeMap {
sources sourceSets.api.java.srcDirs
}
applyRangeMap {
sources sourceSets.api.java.srcDirs
}
sourceSets.api.java.srcDirs.each { extractMappedNew.addTarget it }
}
15 changes: 15 additions & 0 deletions changelog.mustache
@@ -0,0 +1,15 @@
{{#tags}}
<h3>{{name}}</h3>
<ul>
{{#commits}}
<li>
<a href="https://github.com/percivalalb/DoggyTalents/commit/{{hashFull}}">{{{messageTitle}}}</a> - {{{authorName}}}
<ul>
{{#messageBodyItems}}
<li>{{.}}</li>
{{/messageBodyItems}}
</ul>
</li>
{{/commits}}
</ul>
{{/tags}}
8 changes: 5 additions & 3 deletions gradle.properties
Expand Up @@ -3,9 +3,11 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

forge_version=1.16.4-35.1.37
mcp_mappings=20201028-1.16.3
forge_version=1.16.5-36.1.0
mcp_mappings=20210309-1.16.5

jei_version=1.16.4:7.6.1.71
jei_version=1.16.5:7.6.1.75

output_version=2.0.1.3

curseforge_project_id=271050
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip
2 changes: 1 addition & 1 deletion src/api/java/doggytalents/api/feature/IDog.java
Expand Up @@ -61,7 +61,7 @@ default Optional<TalentInstance> getTalent(Supplier<? extends Talent> talentGett
public void markAccessoriesDirty();

public float getWagAngle(float limbSwing, float limbSwingAmount, float partialTickTime);
public float getShakeAngle(float partialTicks, float p_70923_2_);
public float getShakeAngle(float partialTicks, float offset);
public float getInterestedAngle(float partialTicks);

public boolean isLying();
Expand Down
Expand Up @@ -15,7 +15,7 @@ public class PackPuppyScreen extends ContainerScreen<PackPuppyContainer> {

public PackPuppyScreen(PackPuppyContainer packPuppy, PlayerInventory playerInventory, ITextComponent displayName) {
super(packPuppy, playerInventory, displayName);
//TODO this.field_147002_h.allowUserInput = false;
//TODO this.container.allowUserInput = false;
}

@Override
Expand Down
Expand Up @@ -21,6 +21,8 @@
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.TranslationTextComponent;

import net.minecraft.client.gui.widget.button.Button.IPressable;

public class DogInventoryButton extends Button {

private Screen parent;
Expand Down Expand Up @@ -60,7 +62,7 @@ public void render(MatrixStack stack, int mouseX, int mouseY, float partialTicks
}

@Override
public void renderButton(MatrixStack stack, int mouseX, int mouseY, float partialTicks) {
public void renderWidget(MatrixStack stack, int mouseX, int mouseY, float partialTicks) {
Minecraft mc = Minecraft.getInstance();
mc.getTextureManager().bindTexture(Resources.SMALL_WIDGETS);
RenderSystem.color4f(1.0F, 1.0F, 1.0F, this.alpha);
Expand Down
Expand Up @@ -11,14 +11,16 @@
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.text.ITextComponent;

import net.minecraft.client.gui.widget.button.Button.IPressable;

public class SmallButton extends Button {

public SmallButton(int x, int y, ITextComponent text, IPressable onPress) {
super(x, y, 12, 12, text, onPress);
}

@Override
public void renderButton(MatrixStack stack, int mouseX, int mouseY, float partialTicks) {
public void renderWidget(MatrixStack stack, int mouseX, int mouseY, float partialTicks) {
Minecraft mc = Minecraft.getInstance();
FontRenderer font = mc.fontRenderer;
mc.getTextureManager().bindTexture(Resources.SMALL_WIDGETS);
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/doggytalents/common/block/DogBedBlock.java
Expand Up @@ -239,16 +239,16 @@ public void addInformation(ItemStack stack, @Nullable IBlockReader worldIn, List
ITextComponent ownerName = NBTUtil.getTextComponent(tag, "ownerName");

if (name != null) {
tooltip.add(new StringTextComponent("Bed Name: ").mergeStyle(TextFormatting.WHITE).append(name));
tooltip.add(new StringTextComponent("Bed Name: ").mergeStyle(TextFormatting.WHITE).appendSibling(name));
}

if (ownerName != null) {
tooltip.add(new StringTextComponent("Name: ").mergeStyle(TextFormatting.DARK_AQUA).append(ownerName));
tooltip.add(new StringTextComponent("Name: ").mergeStyle(TextFormatting.DARK_AQUA).appendSibling(ownerName));

}

if (ownerId != null && (flagIn.isAdvanced() || Screen.hasShiftDown())) {
tooltip.add(new StringTextComponent("UUID: ").mergeStyle(TextFormatting.AQUA).append(new StringTextComponent(ownerId.toString())));
tooltip.add(new StringTextComponent("UUID: ").mergeStyle(TextFormatting.AQUA).appendSibling(new StringTextComponent(ownerId.toString())));
}
}
}
Expand Down
Expand Up @@ -49,14 +49,14 @@ public String getName() {
public void act(DirectoryCache cache) throws IOException {
Path path = this.generator.getOutputFolder();
Set<ResourceLocation> set = Sets.newHashSet();
Consumer<Advancement> consumer = (p_204017_3_) -> {
if (!set.add(p_204017_3_.getId())) {
throw new IllegalStateException("Duplicate advancement " + p_204017_3_.getId());
Consumer<Advancement> consumer = (advancement) -> {
if (!set.add(advancement.getId())) {
throw new IllegalStateException("Duplicate advancement " + advancement.getId());
} else {
Path path1 = getPath(path, p_204017_3_);
Path path1 = getPath(path, advancement);

try {
IDataProvider.save(GSON, cache, p_204017_3_.copy().serialize(), path1);
IDataProvider.save(GSON, cache, advancement.copy().serialize(), path1);
} catch (IOException ioexception) {
LOGGER.error("Couldn't save advancement {}", path1, ioexception);
}
Expand Down
Expand Up @@ -87,8 +87,8 @@ public DoggyTalentsAdvancements.Builder withRewards(AdvancementRewards.Builder r
return this.withRewards(rewardsBuilder.build());
}

public DoggyTalentsAdvancements.Builder withRewards(AdvancementRewards p_200274_1_) {
this.rewards = p_200274_1_;
public DoggyTalentsAdvancements.Builder withRewards(AdvancementRewards rewards) {
this.rewards = rewards;
return this;
}

Expand Down Expand Up @@ -132,7 +132,7 @@ public boolean resolveParent(Function<ResourceLocation, Advancement> lookup) {
}

public Advancement build(ResourceLocation id) {
if (!this.resolveParent((p_199750_0_) -> {
if (!this.resolveParent((parentID) -> {
return null;
})) {
throw new IllegalStateException("Tried to build incomplete advancement!");
Expand Down
22 changes: 11 additions & 11 deletions src/main/java/doggytalents/common/entity/DogEntity.java
Expand Up @@ -282,8 +282,8 @@ public float getShadingWhileWet(float partialTicks) {

@Override
@OnlyIn(Dist.CLIENT)
public float getShakeAngle(float partialTicks, float p_70923_2_) {
float f = (MathHelper.lerp(partialTicks, this.prevTimeWolfIsShaking, this.timeWolfIsShaking) + p_70923_2_) / 1.8F;
public float getShakeAngle(float partialTicks, float offset) {
float f = (MathHelper.lerp(partialTicks, this.prevTimeWolfIsShaking, this.timeWolfIsShaking) + offset) / 1.8F;
if (f < 0.0F) {
f = 0.0F;
} else if (f > 1.0F) {
Expand Down Expand Up @@ -325,7 +325,7 @@ protected float getStandingEyeHeight(Pose poseIn, EntitySize sizeIn) {
}

@Override
public Vector3d func_241205_ce_() {
public Vector3d getLeashStartPosition() {
return new Vector3d(0.0D, 0.6F * this.getEyeHeight(), this.getWidth() * 0.4F);
}

Expand Down Expand Up @@ -481,7 +481,7 @@ public void livingTick() {

// If the dog has a food bowl in this dimension then check if it is still there
// Only check if the chunk it is in is loaded
if (bowlPos.isPresent() && this.world.isBlockLoaded(bowlPos.get()) && !this.world.getBlockState(bowlPos.get()).isIn(DoggyBlocks.FOOD_BOWL.get())) {
if (bowlPos.isPresent() && this.world.isBlockLoaded(bowlPos.get()) && !this.world.getBlockState(bowlPos.get()).matchesBlock(DoggyBlocks.FOOD_BOWL.get())) {
this.setBowlPos(dimKey, Optional.empty());
}
}
Expand All @@ -490,7 +490,7 @@ public void livingTick() {
}

@Override
public ActionResultType func_230254_b_(PlayerEntity player, Hand hand) {
public ActionResultType getEntityInteractionResult(PlayerEntity player, Hand hand) {

ItemStack stack = player.getHeldItem(hand);

Expand All @@ -513,7 +513,7 @@ public ActionResultType func_230254_b_(PlayerEntity player, Hand hand) {
this.setTamedBy(player);
this.navigator.clearPath();
this.setAttackTarget((LivingEntity) null);
this.func_233687_w_(true);
this.setSitting(true);
this.setHealth(20.0F);
this.world.setEntityState(this, doggytalents.common.lib.Constants.EntityState.WOLF_HEARTS);
} else {
Expand Down Expand Up @@ -544,9 +544,9 @@ public ActionResultType func_230254_b_(PlayerEntity player, Hand hand) {
}
}

ActionResultType actionresulttype = super.func_230254_b_(player, hand);
ActionResultType actionresulttype = super.getEntityInteractionResult(player, hand);
if ((!actionresulttype.isSuccessOrConsume() || this.isChild()) && this.canInteract(player)) {
this.func_233687_w_(!this.isSitting());
this.setSitting(!this.isQueuedToSit());
this.isJumping = false;
this.navigator.clearPath();
this.setAttackTarget(null);
Expand Down Expand Up @@ -771,7 +771,7 @@ public boolean attackEntityFrom(DamageSource source, float amount) {
return false;
}

this.func_233687_w_(false);
this.setSitting(false);

if (entity != null && !(entity instanceof PlayerEntity) && !(entity instanceof AbstractArrowEntity)) {
amount = (amount + 1.0F) / 2.0F;
Expand Down Expand Up @@ -1014,7 +1014,7 @@ public boolean canMateWith(AnimalEntity otherAnimal) {
}

@Override
public AgeableEntity func_241840_a(ServerWorld worldIn, AgeableEntity partner) {
public AgeableEntity createChild(ServerWorld worldIn, AgeableEntity partner) {
DogEntity child = DoggyEntityTypes.DOG.get().create(worldIn);
UUID uuid = this.getOwnerId();

Expand Down Expand Up @@ -1950,7 +1950,7 @@ public <T> boolean hasData(DataKey<T> key) {
public void untame() {
this.setTamed(false);
this.navigator.clearPath();
this.func_233687_w_(false);
this.setSitting(false);
this.setHealth(8);

this.getTalentMap().clear();
Expand Down
Expand Up @@ -41,7 +41,7 @@ protected void onImpact(RayTraceResult result) {
if (result.getType() == RayTraceResult.Type.ENTITY) {
Entity entityHit = ((EntityRayTraceResult) result).getEntity();

Entity thrower = this.func_234616_v_();
Entity thrower = this.getShooter();

if (thrower instanceof LivingEntity && entityHit instanceof LivingEntity) {
LivingEntity livingThrower = (LivingEntity) thrower;
Expand Down

0 comments on commit ed8f2ce

Please sign in to comment.