Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update minestom version #376

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion anticheat/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ repositories {
}

dependencies {
implementation("net.minestom:minestom-snapshots:12794d4263") {
implementation("net.minestom:minestom-snapshots:789befee31") {
exclude(group = "org.jboss.shrinkwrap.resolver", module = "shrinkwrap-resolver-depchain")
}
}
Expand Down
2 changes: 1 addition & 1 deletion commons/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ java {

dependencies {
implementation(project(":packer"))
implementation("net.minestom:minestom-snapshots:12794d4263") {
implementation("net.minestom:minestom-snapshots:789befee31") {
exclude(group = "org.jboss.shrinkwrap.resolver", module = "shrinkwrap-resolver-depchain")
}
}
8 changes: 4 additions & 4 deletions loader/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ group = "net.swofty"
version = "3.0"

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
Expand All @@ -32,10 +32,10 @@ dependencies {
implementation(project(":spark"))
implementation(project(":anticheat"))
implementation("org.slf4j:slf4j-api:2.0.13")
implementation("net.minestom:minestom-snapshots:12794d4263") {
implementation("net.minestom:minestom-snapshots:789befee31") {
exclude(group = "org.jboss.shrinkwrap.resolver", module = "shrinkwrap-resolver-depchain")
}
implementation("dev.hollowcube:polar:1.10.0")
implementation("dev.hollowcube:polar:1.11.1")
}

application {
Expand Down
2 changes: 1 addition & 1 deletion proxy.api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repositories {
dependencies {
implementation(project(":commons"))
implementation("com.github.Swofty-Developments:AtlasRedisAPI:1.1.2")
implementation("net.minestom:minestom-snapshots:12794d4263") {
implementation("net.minestom:minestom-snapshots:789befee31") {
exclude(group = "org.jboss.shrinkwrap.resolver", module = "shrinkwrap-resolver-depchain")
}
implementation("net.kyori:adventure-api:4.17.0")
Expand Down
2 changes: 1 addition & 1 deletion spark/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repositories {
}

dependencies {
implementation("net.minestom:minestom-snapshots:12794d4263") {
implementation("net.minestom:minestom-snapshots:789befee31") {
exclude(group = "org.jboss.shrinkwrap.resolver", module = "shrinkwrap-resolver-depchain")
}
implementation(files("dependencies/spark-1.10.1.10-minestom.jar"))
Expand Down
4 changes: 2 additions & 2 deletions type.generic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ dependencies {
implementation(project(":commons"))
implementation(project(":packer"))
implementation(project(":proxy.api"))
implementation("net.minestom:minestom-snapshots:12794d4263") {
implementation("net.minestom:minestom-snapshots:789befee31") {
exclude(group = "org.jboss.shrinkwrap.resolver", module = "shrinkwrap-resolver-depchain")
}
implementation("dev.hollowcube:polar:1.10.0")
implementation("dev.hollowcube:polar:1.11.1")
}

tasks.withType<JavaCompile> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

import lombok.Getter;
import net.minestom.server.MinecraftServer;
import net.minestom.server.collision.CollisionUtils;
import net.minestom.server.collision.PhysicsResult;
import net.minestom.server.collision.ShapeImpl;
import net.minestom.server.collision.*;
import net.minestom.server.coordinate.Pos;
import net.minestom.server.coordinate.Vec;
import net.minestom.server.entity.Entity;
Expand All @@ -16,6 +14,9 @@
import net.minestom.server.timer.TaskSchedule;
import net.swofty.types.generic.item.SkyBlockItem;
import net.swofty.types.generic.utility.MathUtility;
import org.jetbrains.annotations.NotNull;

import java.util.Collection;

public class ArrowEntityImpl extends LivingEntity {
private long cooldown = 0;
Expand Down Expand Up @@ -72,24 +73,27 @@ public void tick(long time) {
cooldown = System.currentTimeMillis();
}

PhysicsResult collided = CollisionUtils.checkEntityCollisions(instance, this.getBoundingBox(), posBefore, diff, 3, (e) -> e != this, result);
if (collided != null && collided.collisionShapes()[0] != shooter) {
if (collided.collisionShapes()[0] instanceof Entity entity) {
EntityType entityType = entity.getEntityType();
if (entityType == EntityType.PLAYER ||
entityType == EntityType.ARMOR_STAND) {
Collection<EntityCollisionResult> entityCollisionResults = CollisionUtils.checkEntityCollisions(instance, this.getBoundingBox(), posBefore, diff, 3, (e) -> e != this, result);
entityCollisionResults.forEach((collided) ->{

if (collided != null && collided.entity() != shooter) {
if (collided.entity() instanceof Entity entity) {
EntityType entityType = entity.getEntityType();
if (entityType == EntityType.PLAYER ||
entityType == EntityType.ARMOR_STAND) {
return;
}
ProjectileCollideWithEntityEvent e = new ProjectileCollideWithEntityEvent(this, (Pos) collided.collisionPoint(), entity);
MinecraftServer.getGlobalEventHandler().call(e);
if (!e.isCancelled()) {
remove();
kill();
}
return;
}

var e = new ProjectileCollideWithEntityEvent(this, collided.newPosition(), entity);
MinecraftServer.getGlobalEventHandler().call(e);
if (!e.isCancelled()) {
remove();
kill();
}
return;
}
}

});

if (result.hasCollision()) {
Block hitBlock = null;
Expand Down
2 changes: 1 addition & 1 deletion type.hub/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies {
implementation(project(":type.generic"))
implementation(project(":commons"))
implementation(project(":proxy.api"))
implementation("net.minestom:minestom-snapshots:12794d4263") {
implementation("net.minestom:minestom-snapshots:789befee31") {
exclude(group = "org.jboss.shrinkwrap.resolver", module = "shrinkwrap-resolver-depchain")
}
}
2 changes: 1 addition & 1 deletion type.island/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies {
implementation(project(":type.generic"))
implementation(project(":commons"))
implementation(project(":proxy.api"))
implementation("net.minestom:minestom-snapshots:12794d4263") {
implementation("net.minestom:minestom-snapshots:789befee31") {
exclude(group = "org.jboss.shrinkwrap.resolver", module = "shrinkwrap-resolver-depchain")
}
}
2 changes: 1 addition & 1 deletion type.thefarmingislands/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies {
implementation(project(":type.generic"))
implementation(project(":commons"))
implementation(project(":proxy.api"))
implementation("net.minestom:minestom-snapshots:12794d4263") {
implementation("net.minestom:minestom-snapshots:789befee31") {
exclude(group = "org.jboss.shrinkwrap.resolver", module = "shrinkwrap-resolver-depchain")
}
}
Loading