mirror of
https://github.com/songoda/EpicFarming.git
synced 2024-11-27 13:05:11 +01:00
Merge branch 'development'
This commit is contained in:
commit
01bcb19ded
1
.github/FUNDING.yml
vendored
Normal file
1
.github/FUNDING.yml
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
custom: [ 'https://craftaro.to/+' ]
|
16
.github/dependabot.yml
vendored
Normal file
16
.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# Please see the documentation for all configuration options:
|
||||||
|
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
||||||
|
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: maven
|
||||||
|
directory: /
|
||||||
|
target-branch: development
|
||||||
|
schedule:
|
||||||
|
interval: monthly
|
||||||
|
|
||||||
|
- package-ecosystem: github-actions
|
||||||
|
directory: /
|
||||||
|
target-branch: development
|
||||||
|
schedule:
|
||||||
|
interval: monthly
|
78
.github/workflows/build.yml
vendored
Normal file
78
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master, development ]
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
pull_request:
|
||||||
|
types: [ opened, synchronize, reopened ]
|
||||||
|
|
||||||
|
permissions: read-all
|
||||||
|
|
||||||
|
env:
|
||||||
|
DEPLOYMENT_POM_PATH: ./dependency-reduced-pom.xml
|
||||||
|
DEPLOYMENT_ARTIFACT_DIR: ./target
|
||||||
|
DEPLOYMENT_ARTIFACT_SELECTOR: EpicFarming-*.jar
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Build:
|
||||||
|
name: Build + Deploy
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Prepare Workspace
|
||||||
|
uses: craftaro/GH-Commons/.github/actions/setup_workspace@master
|
||||||
|
with:
|
||||||
|
maven_username: ${{ secrets.PLUGINS_MAVEN_REPO_USERNAME }}
|
||||||
|
maven_password: ${{ secrets.PLUGINS_MAVEN_REPO_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Set project version
|
||||||
|
uses: craftaro/GH-Commons/.github/actions/maven_set_project_version@master
|
||||||
|
with:
|
||||||
|
append_snapshot: ${{ github.ref_type == 'tag' && 'false' || 'true' }}
|
||||||
|
version: ${{ github.ref_type == 'tag' && github.ref_name || '' }}
|
||||||
|
increment_version: ${{ github.ref_type != 'tag' && 'patch' || '' }}
|
||||||
|
increment_version_only_if_not_snapshot_version: ${{ github.ref == 'refs/heads/development' && 'true' || 'false' }}
|
||||||
|
|
||||||
|
- name: Build with Maven
|
||||||
|
run: mvn -B -Duser.name="GitHub Actions on $GITHUB_REPOSITORY (id=$GITHUB_RUN_ID)" -DskipTests clean package
|
||||||
|
|
||||||
|
- name: Upload Build Artifacts
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ${{ github.event.repository.name }}
|
||||||
|
path: ${{ env.DEPLOYMENT_ARTIFACT_DIR }}/${{ env.DEPLOYMENT_ARTIFACT_SELECTOR }}
|
||||||
|
|
||||||
|
- name: Sign jar archives
|
||||||
|
uses: craftaro/GH-Commons/.github/actions/sign_jars@master
|
||||||
|
with:
|
||||||
|
jar_file_selector: ${{ env.DEPLOYMENT_ARTIFACT_DIR }}/${{ env.DEPLOYMENT_ARTIFACT_SELECTOR }}
|
||||||
|
keystore_gpg_encrypted: ${{ secrets.PLUGINS_JARSIGNER_KEYSTORE_GPG }}
|
||||||
|
keystore_gpg_password: ${{ secrets.PLUGINS_JARSIGNER_KEYSTORE_GPG_PASSWORD }}
|
||||||
|
keystore_password: ${{ secrets.PLUGINS_JARSIGNER_KEYSTORE_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Deploy to Maven repo
|
||||||
|
if: ${{ github.event_name == 'push' }}
|
||||||
|
uses: craftaro/GH-Commons/.github/actions/maven_deploy@master
|
||||||
|
with:
|
||||||
|
repository_url: ${{ vars.PLUGINS_MAVEN_REPO_URL_RELEASE }}
|
||||||
|
repository_url_snapshots: ${{ vars.PLUGINS_MAVEN_REPO_URL_SNAPSHOT }}
|
||||||
|
maven_pom_path: ${{ env.DEPLOYMENT_POM_PATH }}
|
||||||
|
maven_out_dir: ${{ env.DEPLOYMENT_ARTIFACT_DIR }}
|
||||||
|
|
||||||
|
discord_webhook:
|
||||||
|
name: Send Discord Webhook
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
needs: [ Build ]
|
||||||
|
if: ${{ always() && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development' || github.ref_type == 'tag') }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Notify Webhook
|
||||||
|
uses: craftaro/GH-Commons/.github/actions/discord_send_job_results@master
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
webhook_url: ${{ secrets.DISCORD_BUILD_STATUS_WEBHOOK }}
|
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>com.craftaro</groupId>
|
<groupId>com.craftaro</groupId>
|
||||||
<artifactId>EpicFarming</artifactId>
|
<artifactId>EpicFarming</artifactId>
|
||||||
<version>4.1.0</version>
|
<version>4.1.1</version>
|
||||||
|
|
||||||
<name>EpicFarming</name>
|
<name>EpicFarming</name>
|
||||||
<description>Allow your players to grow crops faster, automatically replant, harvest and store crops and animal produce in the farm's inventory, as well as much more</description>
|
<description>Allow your players to grow crops faster, automatically replant, harvest and store crops and animal produce in the farm's inventory, as well as much more</description>
|
||||||
|
@ -54,7 +54,7 @@ public class ModuleAutoBreeding extends Module {
|
|||||||
|
|
||||||
List<LivingEntity> entities = new ArrayList<>(entitiesAroundFarm);
|
List<LivingEntity> entities = new ArrayList<>(entitiesAroundFarm);
|
||||||
Collections.shuffle(entities);
|
Collections.shuffle(entities);
|
||||||
if (entities.size() >= this.autoBreedCap) {
|
if (entities.size() < this.autoBreedCap) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,15 +63,15 @@ public class ModuleAutoButcher extends Module {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (LivingEntity entity : entities) {
|
Bukkit.getScheduler().runTask(this.plugin, () -> {
|
||||||
entity.setMetadata("EFA-TAGGED", new FixedMetadataValue(this.plugin, farm.getLocation()));
|
for (LivingEntity entity : entities) {
|
||||||
XSound.ENTITY_PLAYER_ATTACK_SWEEP.play(entity);
|
entity.setMetadata("EFA-TAGGED", new FixedMetadataValue(this.plugin, farm.getLocation()));
|
||||||
Bukkit.getScheduler().runTask(this.plugin, () -> {
|
XSound.ENTITY_PLAYER_ATTACK_SWEEP.play(entity);
|
||||||
entity.damage(99999999, entity);
|
entity.damage(99999999, entity);
|
||||||
Methods.animate(farm.getLocation(), XMaterial.IRON_SWORD);
|
Methods.animate(farm.getLocation(), XMaterial.IRON_SWORD);
|
||||||
});
|
|
||||||
return;
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -11,6 +11,7 @@ import com.craftaro.epicfarming.farming.Farm;
|
|||||||
import com.craftaro.epicfarming.farming.FarmType;
|
import com.craftaro.epicfarming.farming.FarmType;
|
||||||
import com.craftaro.epicfarming.utils.Methods;
|
import com.craftaro.epicfarming.utils.Methods;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.DyeColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
@ -119,8 +120,11 @@ public class ModuleAutoCollect extends Module {
|
|||||||
}
|
}
|
||||||
((Sheep) entity).setSheared(true);
|
((Sheep) entity).setSheared(true);
|
||||||
|
|
||||||
Wool woolColor = new Wool(((Sheep) entity).getColor());
|
|
||||||
ItemStack wool = woolColor.toItemStack((int) Math.round(1 + (Math.random() * 3)));
|
DyeColor dyeColor = ((Sheep) entity).getColor();
|
||||||
|
XMaterial woolColor = XMaterial.matchXMaterial(dyeColor.name() + "_WOOL").orElse(XMaterial.WHITE_WOOL);
|
||||||
|
ItemStack wool = woolColor.parseItem();
|
||||||
|
wool.setAmount((int) Math.round(1 + (Math.random() * 3)));
|
||||||
if (!isEnabled(farm)) {
|
if (!isEnabled(farm)) {
|
||||||
Bukkit.getScheduler().runTask(this.plugin, () ->
|
Bukkit.getScheduler().runTask(this.plugin, () ->
|
||||||
entity.getLocation().getWorld().dropItemNaturally(entity.getLocation(), wool));
|
entity.getLocation().getWorld().dropItemNaturally(entity.getLocation(), wool));
|
||||||
|
Loading…
Reference in New Issue
Block a user