Skip to content

Commit

Permalink
#patch 1.20.2 and experimental kits (#57)
Browse files Browse the repository at this point in the history
* added default pom for maven usage

* Bump version from 2.0.1 to 2.0.1-SNAPSHOT0

* Bump version from 2.0.1-SNAPSHOT0 to 2.0.1-SNAPSHOT1

* Fix block breakage on bridge (#51)

* Update ArenaEvents.java

* Fix for a false, as my project ain't indexing.

* Cleanup code

* Potential resolve for block break sounds.

* Bump version from 2.0.1-SNAPSHOT1 to 2.0.1-SNAPSHOT2

* Update ArenaEvents.java (#53)

* Bump version from 2.0.1-SNAPSHOT2 to 2.0.1-SNAPSHOT3

* Fixed blindness after choosing base if arena border isn't inside spawn

* Bump version from 2.0.1-SNAPSHOT3 to 2.0.1-SNAPSHOT4

* Kits editing implementation (#54)

* Adapted kits to new core

* Recoded kits structure

* Update settings.gradle.kts

* Modify so I can run intellij

* Cleaned up code with handling items

* Added optional configurations

* Added bow cooldown implementation

---------

Co-authored-by: Tigerpanzer_02 <37453987+Tigerpanzer02@users.noreply.github.com>

* Bump version from 2.0.1-SNAPSHOT4 to 2.0.1-SNAPSHOT5

* Fixed new kits integration

* Bump version from 2.0.1-SNAPSHOT5 to 2.0.1-SNAPSHOT6

* Update ArenaEvents.java (#56)

* Bump version from 2.0.1-SNAPSHOT6 to 2.0.1-SNAPSHOT7

* Renamed kit actions to abilities

* Bump version from 2.0.1-SNAPSHOT7 to 2.0.1-SNAPSHOT8

* Fetch latest core changes

* Bump version from 2.0.2-SNAPSHOT8 to 2.0.2-SNAPSHOT9

* adjusted CHANGELOG.md

* Bump version from 2.0.2-SNAPSHOT9 to 2.0.2-SNAPSHOT10

---------

Co-authored-by: version-bump[github-action] <41898282+version-bump[github-action]@users.noreply.github.com>
Co-authored-by: Lagggpixel <93872019+Lagggpixel@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 4, 2023
1 parent bd749b5 commit 6a0a6f4
Show file tree
Hide file tree
Showing 24 changed files with 845 additions and 1,248 deletions.
16 changes: 16 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
### 2.0.3 Release (04.12.2023)
* Fixed block breakage on bridge
* Fixed blindness after choosing base if arena border isn't inside spawn
* (Experimental) Added new kits.yml where you can edit all kits file based (patreon: in-game gui based) [changes will happen; don't invest much time]
* Added bow cooldown per kit
* Updated to minigamesbox 1.3.3

### 2.0.2 Release (21.08.2023)
Fixed rewards enabling
Fixed bossbar disabling
Fixed locale registration if service unavailable (e.g. server blocks outgoing traffic, cloudflare blacklisted countries)

### 2.0.1 Release (08.08.2023)
* Fixed teleport after death
* Fixed block regeneration for lower 1.13

### 2.0.0 Release (07.08.2023)
* Added up to 1.20 compatibility
* Added full cage support
Expand Down
175 changes: 175 additions & 0 deletions .github/maven/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0"
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">
<modelVersion>4.0.0</modelVersion>

<groupId>plugily.projects</groupId>
<artifactId>thebridge</artifactId>
<version>2.0.1</version>
<name>TheBridge</name>

<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<licenses>
<license>
<name>GNU General Public License v3</name>
<url>https://www.gnu.org/licenses/gpl-3.0.en.html</url>
</license>
</licenses>

<repositories>
<repository>
<id>papermc</id>
<url>https://papermc.io/repo/repository/maven-public/</url>
</repository>
<repository>
<id>plugilyprojects</id>
<url>https://maven.plugily.xyz/releases</url>
</repository>
<repository>
<id>plugilyprojects-snapshots</id>
<url>https://maven.plugily.xyz/snapshots</url>
</repository>
<repository>
<id>jitpack</id>
<url>https://jitpack.io</url>
</repository>
<repository>
<id>codemc-repo</id>
<url>https://repo.codemc.org/repository/maven-public/</url>
</repository>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.20.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jetbrains/annotations -->
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>23.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>plugily.projects</groupId>
<artifactId>MiniGamesBox-Classic</artifactId>
<version>1.2.0-SNAPSHOT51</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.12.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.0</version>
<configuration>
<windowtitle>Murder Mystery API docs for v${project.version}</windowtitle>
<description>Minecraft survival minigame.
Be the murderer, innocent or the detective! Don't be killed during the game to win! API
documentation for hooking Murder Mystery with your plugin.
</description>
<destDir>minecraft/thebridge</destDir>
<isOffline>false</isOffline>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<pattern>com.zaxxer.hikari</pattern>
<shadedPattern>plugily.projects.thebridge.database.hikari</shadedPattern>
</relocation>
<relocation>
<pattern>plugily.projects.minigamesbox</pattern>
<shadedPattern>plugily.projects.thebridge.minigamesbox</shadedPattern>
</relocation>
<relocation>
<pattern>plugily.projects.commonsbox</pattern>
<shadedPattern>plugily.projects.thebridge.commonsbox</shadedPattern>
</relocation>
</relocations>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
</execution>
</executions>
</plugin>

<!-- External beta versions discord deployer plugin -->
<plugin>
<groupId>plugily.projects</groupId>
<artifactId>betty-maven-plugin</artifactId>
<version>1.0.2</version>
<configuration>
<changelogFile>${project.basedir}/CHANGELOG.md</changelogFile>
</configuration>
</plugin>
<!-- External beta versions discord deployer plugin -->
</plugins>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>3.5.2</version>
</extension>
</extensions>
</build>
<distributionManagement>
<repository>
<id>plugily-projects</id>
<url>https://maven.plugily.xyz/releases</url>
</repository>
</distributionManagement>

</project>
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ repositories {
}

dependencies {
implementation("plugily.projects:MiniGamesBox-Classic:1.3.1") { isTransitive = false }
compileOnly("org.spigotmc:spigot-api:1.19.3-R0.1-SNAPSHOT")
implementation("plugily.projects:MiniGamesBox-Classic:1.3.3") { isTransitive = false }
compileOnly("org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT")
compileOnly("io.papermc.paper:paper-api:1.19.3-R0.1-SNAPSHOT")
compileOnly("org.jetbrains:annotations:24.0.1")
}

group = "plugily.projects"
version = "2.0.1"
version = "2.0.2-SNAPSHOT10"
description = "TheBridge"

java {
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* This project uses @Incubating APIs which are subject to change.
*/

rootProject.name = "thebridge"
rootProject.name = "TheBridge"
39 changes: 10 additions & 29 deletions src/main/java/plugily/projects/thebridge/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,19 @@
import plugily.projects.minigamesbox.classic.handlers.setup.SetupInventory;
import plugily.projects.minigamesbox.classic.handlers.setup.categories.PluginSetupCategoryManager;
import plugily.projects.minigamesbox.classic.utils.services.metrics.Metrics;
import plugily.projects.thebridge.arena.Arena;
import plugily.projects.thebridge.arena.ArenaEvents;
import plugily.projects.thebridge.arena.ArenaManager;
import plugily.projects.thebridge.arena.ArenaRegistry;
import plugily.projects.thebridge.arena.ArenaUtils;
import plugily.projects.thebridge.arena.*;
import plugily.projects.thebridge.arena.base.BaseMenuHandler;
import plugily.projects.thebridge.boot.AdditionalValueInitializer;
import plugily.projects.thebridge.boot.MessageInitializer;
import plugily.projects.thebridge.boot.PlaceholderInitializer;
import plugily.projects.thebridge.commands.arguments.ArgumentsRegistry;
import plugily.projects.thebridge.events.PluginEvents;
import plugily.projects.thebridge.handlers.setup.SetupCategoryManager;
import plugily.projects.thebridge.kits.free.BridgeKit;
import plugily.projects.thebridge.kits.free.KnightKit;
import plugily.projects.thebridge.kits.free.LightTankKit;
import plugily.projects.thebridge.kits.level.ArcherKit;
import plugily.projects.thebridge.kits.level.HardcoreKit;
import plugily.projects.thebridge.kits.level.HealerKit;
import plugily.projects.thebridge.kits.level.MediumTankKit;
import plugily.projects.thebridge.kits.level.TerminatorKit;
import plugily.projects.thebridge.kits.premium.HeavyTankKit;
import plugily.projects.thebridge.kits.premium.NakedKit;
import plugily.projects.thebridge.kits.premium.PremiumHardcoreKit;
import plugily.projects.thebridge.kits.KitUtils;

import java.io.File;
import java.util.logging.Level;
import java.util.ArrayList;
import java.util.List;

/**
* Created by Tigerpanzer_02 on 13.03.2022
Expand Down Expand Up @@ -91,17 +78,12 @@ public void addKits() {
long start = System.currentTimeMillis();
getDebugger().debug("Adding kits...");
addFileName("kits");
Class<?>[] classKitNames = new Class[]{BridgeKit.class, KnightKit.class, LightTankKit.class, ArcherKit.class, HealerKit.class,
MediumTankKit.class, TerminatorKit.class, HardcoreKit.class, PremiumHardcoreKit.class, NakedKit.class, HeavyTankKit.class};
for(Class<?> kitClass : classKitNames) {
try {
kitClass.getDeclaredConstructor().newInstance();
} catch(Exception e) {
getLogger().log(Level.SEVERE, "Fatal error while registering existing game kit! Report this error to the developer!");
getLogger().log(Level.SEVERE, "Cause: " + e.getMessage() + " (kitClass " + kitClass.getName() + ")");
e.printStackTrace();
}
}

List<String> optionalConfigurations = new ArrayList<>();
optionalConfigurations.add("bow-cooldown");

getKitRegistry().setHandleItem((player, item) -> KitUtils.handleItem(this, player, item));
getKitRegistry().registerKits(optionalConfigurations);
getDebugger().debug("Kit adding finished took {0}ms", System.currentTimeMillis() - start);
}

Expand Down Expand Up @@ -139,5 +121,4 @@ public BaseMenuHandler getBaseMenuHandler() {
public PluginSetupCategoryManager getSetupCategoryManager(SetupInventory setupInventory) {
return new SetupCategoryManager(setupInventory);
}

}
36 changes: 27 additions & 9 deletions src/main/java/plugily/projects/thebridge/arena/ArenaEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
import plugily.projects.thebridge.Main;
import plugily.projects.thebridge.arena.base.Base;
import plugily.projects.thebridge.arena.managers.ScoreboardManager;
import plugily.projects.thebridge.kits.level.ArcherKit;

import java.text.DecimalFormat;
import java.util.HashMap;
Expand Down Expand Up @@ -98,9 +97,18 @@ public void onBlockBreakEvent(BlockBreakEvent event) {
arena.addBrokenBlock(event.getBlock().getLocation(), event.getBlock().getType());
}
}
else {
new MessageBuilder("IN_GAME_MESSAGES_ARENA_BUILD_BREAK")
.asKey()
.player(player)
.arena(arena)
.sendPlayer();
event.setCancelled(true);
return;
}
event.getBlock().getDrops().clear();
event.getBlock().setType(XMaterial.AIR.parseMaterial());
event.setCancelled(true);
event.setCancelled(false);
}

@EventHandler
Expand Down Expand Up @@ -225,6 +233,9 @@ public void onPlayerMove(PlayerMoveEvent event) {
if(arena == null) {
return;
}
if(arena.getArenaState() != ArenaState.IN_GAME) {
return;
}
if(arena.isResetRound() && !plugin.getUserManager().getUser(player).isSpectator()) {
roundReset(event, arena);
return;
Expand Down Expand Up @@ -364,6 +375,9 @@ public void onDeath(PlayerDeathEvent event) {
if(arena == null) {
return;
}
if(arena.getArenaState() != ArenaState.IN_GAME) {
return;
}
event.setDroppedExp(0);
event.getDrops().clear();
playerDeath(player, arena);
Expand Down Expand Up @@ -481,14 +495,17 @@ public void onBowShot(EntityShootBowEvent event) {
}
if(user.getCooldown("bow_shot") == 0) {
int cooldown = plugin.getConfig().getInt("Bow-Cooldown", 5);
if((user.getKit() instanceof ArcherKit)) {
cooldown = Math.max(0, Math.min(cooldown, cooldown - 2));

if (user.getKit().getOptionalConfiguration("bow-cooldown") != null) {
cooldown = Math.max(0, (int) user.getKit().getOptionalConfiguration("bow-cooldown"));
}
if (cooldown != 0) {
user.setCooldown("bow_shot", cooldown);
Player player = (Player) event.getEntity();
plugin
.getBukkitHelper()
.applyActionBarCooldown(player, cooldown);
}
user.setCooldown("bow_shot", cooldown);
Player player = (Player) event.getEntity();
plugin
.getBukkitHelper()
.applyActionBarCooldown(player, cooldown);
if(event.getBow() != null) {
VersionUtils.setDurability(event.getBow(), (short) 0);
}
Expand Down Expand Up @@ -560,6 +577,7 @@ public void onArrowDamage(EntityDamageByEntityEvent event) {
XSound.ENTITY_PLAYER_DEATH.play(victim.getLocation(), 50, 1);

if(victim.getHealth() - event.getDamage() <= 0) {
playerDeath(victim, arena);
return;
}
DecimalFormat df = new DecimalFormat("##.##");
Expand Down
Loading

0 comments on commit 6a0a6f4

Please sign in to comment.