Merge branch 'master' into master
This commit is contained in:
51
.github/workflows/dev-analysis.yml
vendored
Normal file
51
.github/workflows/dev-analysis.yml
vendored
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
name: "CodeQL"
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
analyze:
|
||||||
|
name: Analyze
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
actions: read
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
language: [ 'java' ]
|
||||||
|
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
||||||
|
# Learn more:
|
||||||
|
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Cache local repo
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.m2/repository
|
||||||
|
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-maven-
|
||||||
|
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v1
|
||||||
|
with:
|
||||||
|
languages: ${{ matrix.language }}
|
||||||
|
|
||||||
|
- name: Autobuild
|
||||||
|
uses: github/codeql-action/autobuild@v1
|
||||||
|
|
||||||
|
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@v1
|
||||||
|
|
||||||
|
- name: Upload a Build Artifact
|
||||||
|
uses: actions/upload-artifact@v2.2.4
|
||||||
|
if: success()
|
||||||
|
with:
|
||||||
|
name: TerminatorPlus
|
||||||
|
path: target/
|
||||||
25
pom.xml
25
pom.xml
@@ -3,7 +3,6 @@
|
|||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<groupId>net.nuggetmc</groupId>
|
<groupId>net.nuggetmc</groupId>
|
||||||
<artifactId>TerminatorPlus</artifactId>
|
<artifactId>TerminatorPlus</artifactId>
|
||||||
<version>3.1-BETA</version>
|
<version>3.1-BETA</version>
|
||||||
@@ -18,6 +17,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.8.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>8</source>
|
<source>8</source>
|
||||||
<target>8</target>
|
<target>8</target>
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
<version>3.2.1</version>
|
<version>3.2.4</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>package</phase>
|
<phase>package</phase>
|
||||||
@@ -49,9 +49,6 @@
|
|||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
<version>2.3.1</version>
|
<version>2.3.1</version>
|
||||||
<configuration>
|
|
||||||
<outputDirectory>D:\Minecraft Server\plugins</outputDirectory>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
<resources>
|
<resources>
|
||||||
@@ -62,12 +59,26 @@
|
|||||||
</resources>
|
</resources>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<!-- Spigot Repo -->
|
||||||
|
<repository>
|
||||||
|
<id>spigot-repo</id>
|
||||||
|
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||||
|
</repository>
|
||||||
|
<!-- Advanced Spigot Repo -->
|
||||||
|
<repository>
|
||||||
|
<id>dre-repo</id>
|
||||||
|
<url>https://erethon.de/repo/</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<!--Spigot + Bukkit -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>spigot</artifactId>
|
<artifactId>spigot</artifactId>
|
||||||
<version>1.16.4-R0.1-SNAPSHOT</version>
|
<version>1.16.5-R0.1-SNAPSHOT</version>
|
||||||
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
@@ -498,8 +498,11 @@ public class Bot extends EntityPlayer {
|
|||||||
|
|
||||||
private void dieCheck() {
|
private void dieCheck() {
|
||||||
if (removeOnDeath) {
|
if (removeOnDeath) {
|
||||||
//scheduler.runTask(plugin, () -> plugin.getManager().remove(this)); // maybe making this later will fix the concurrentmodificationexception?
|
|
||||||
plugin.getManager().remove(this); //I replaced HashSet with ConcurrentHashMap.newKeySet which creates a "ConcurrentHashSet"
|
// I replaced HashSet with ConcurrentHashMap.newKeySet which creates a "ConcurrentHashSet"
|
||||||
|
// this should fix the concurrentmodificationexception mentioned above, I used the ConcurrentHashMap.newKeySet to make a "ConcurrentHashSet"
|
||||||
|
plugin.getManager().remove(this);
|
||||||
|
|
||||||
scheduler.runTaskLater(plugin, this::setDead, 30);
|
scheduler.runTaskLater(plugin, this::setDead, 30);
|
||||||
|
|
||||||
this.removeTab();
|
this.removeTab();
|
||||||
|
|||||||
@@ -297,7 +297,7 @@ public class LegacyAgent extends Agent {
|
|||||||
|
|
||||||
Material itemType;
|
Material itemType;
|
||||||
|
|
||||||
if (bot.getBukkitEntity().getWorld().getName().equals("world_nether")) {
|
if (bot.getBukkitEntity().getWorld().getEnvironment() == World.Environment.NETHER) {
|
||||||
itemType = Material.TWISTING_VINES;
|
itemType = Material.TWISTING_VINES;
|
||||||
} else {
|
} else {
|
||||||
itemType = Material.WATER_BUCKET;
|
itemType = Material.WATER_BUCKET;
|
||||||
@@ -339,7 +339,7 @@ public class LegacyAgent extends Agent {
|
|||||||
Material placeType;
|
Material placeType;
|
||||||
Sound sound;
|
Sound sound;
|
||||||
|
|
||||||
if (world.getName().equals("world_nether")) {
|
if (bot.getBukkitEntity().getWorld().getEnvironment() == World.Environment.NETHER) {
|
||||||
itemType = Material.TWISTING_VINES;
|
itemType = Material.TWISTING_VINES;
|
||||||
sound = Sound.BLOCK_WEEPING_VINES_PLACE;
|
sound = Sound.BLOCK_WEEPING_VINES_PLACE;
|
||||||
placeType = itemType;
|
placeType = itemType;
|
||||||
@@ -934,7 +934,7 @@ public class LegacyAgent extends Agent {
|
|||||||
Location loc = bot.getLocation();
|
Location loc = bot.getLocation();
|
||||||
|
|
||||||
if (bot.isOnFire()) {
|
if (bot.isOnFire()) {
|
||||||
if (!worldName.equals("world_nether")) {
|
if (bot.getBukkitEntity().getWorld().getEnvironment() != World.Environment.NETHER) {
|
||||||
placeWaterDown(bot, world, loc);
|
placeWaterDown(bot, world, loc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -942,7 +942,7 @@ public class LegacyAgent extends Agent {
|
|||||||
Material atType = loc.getBlock().getType();
|
Material atType = loc.getBlock().getType();
|
||||||
|
|
||||||
if (atType == Material.FIRE || atType == Material.SOUL_FIRE) {
|
if (atType == Material.FIRE || atType == Material.SOUL_FIRE) {
|
||||||
if (!worldName.equals("world_nether")) {
|
if (bot.getBukkitEntity().getWorld().getEnvironment() != World.Environment.NETHER) {
|
||||||
placeWaterDown(bot, world, loc);
|
placeWaterDown(bot, world, loc);
|
||||||
world.playSound(loc, Sound.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 1, 1);
|
world.playSound(loc, Sound.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 1, 1);
|
||||||
} else {
|
} else {
|
||||||
@@ -954,7 +954,7 @@ public class LegacyAgent extends Agent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (atType == Material.LAVA) {
|
if (atType == Material.LAVA) {
|
||||||
if (worldName.equals("world_nether")) {
|
if (bot.getBukkitEntity().getWorld().getEnvironment() == World.Environment.NETHER) {
|
||||||
bot.attemptBlockPlace(loc, Material.COBBLESTONE, false);
|
bot.attemptBlockPlace(loc, Material.COBBLESTONE, false);
|
||||||
} else {
|
} else {
|
||||||
placeWaterDown(bot, world, loc);
|
placeWaterDown(bot, world, loc);
|
||||||
@@ -965,7 +965,7 @@ public class LegacyAgent extends Agent {
|
|||||||
Material headType = head.getBlock().getType();
|
Material headType = head.getBlock().getType();
|
||||||
|
|
||||||
if (headType == Material.LAVA) {
|
if (headType == Material.LAVA) {
|
||||||
if (worldName.equals("world_nether")) {
|
if (bot.getBukkitEntity().getWorld().getEnvironment() == World.Environment.NETHER) {
|
||||||
bot.attemptBlockPlace(head, Material.COBBLESTONE, false);
|
bot.attemptBlockPlace(head, Material.COBBLESTONE, false);
|
||||||
} else {
|
} else {
|
||||||
placeWaterDown(bot, world, head);
|
placeWaterDown(bot, world, head);
|
||||||
@@ -973,7 +973,7 @@ public class LegacyAgent extends Agent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (headType == Material.FIRE || headType == Material.SOUL_FIRE) {
|
if (headType == Material.FIRE || headType == Material.SOUL_FIRE) {
|
||||||
if (worldName.equals("world_nether")) {
|
if (bot.getBukkitEntity().getWorld().getEnvironment() == World.Environment.NETHER) {
|
||||||
bot.look(BlockFace.DOWN);
|
bot.look(BlockFace.DOWN);
|
||||||
bot.punch();
|
bot.punch();
|
||||||
world.playSound(head, Sound.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 1, 1);
|
world.playSound(head, Sound.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 1, 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user