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

Pulling All my Changes into 1.20.1/main instead of 1.20.1/api #1072

Closed
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
35 changes: 27 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
id "dev.architectury.loom" version "1.3.355" apply false
id 'io.github.juuxel.loom-vineflower' version '1.11.0' apply false
// Kotlin
id "org.jetbrains.kotlin.jvm" version "1.9.10" apply false
id "org.jetbrains.kotlin.jvm" version "2.1.0" apply false
id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
id "com.modrinth.minotaur" version "2.4.3" apply false
}
Expand Down Expand Up @@ -70,20 +70,25 @@ subprojects {
apply plugin: "org.jetbrains.kotlin.jvm"
apply plugin: "io.github.juuxel.loom-vineflower"

configurations.each { it.resolutionStrategy.useGlobalDependencySubstitutionRules.set(false) }

repositories {
try {
def vsCoreBuild = gradle.includedBuild("vs-core")
mavenLocal {
content {
includeGroup("org.valkyrienskies.core")

tasks.register('removeIncludedClasses') {
// IntelliJ bug: IntelliJ always adds the build/classes folder in composite builds to the classpath,
// even though we want the shadowJar stuff on the classpath rather than build/classes
//
// To fix this, we just delete it. Very reliable and supported and not cursed at all.
doLast {
new File(vsCoreBuild.projectDir, "build/classes").deleteDir()
}
}

[':impl', ':api', ':api-game'].each {
compileJava.dependsOn(vsCoreBuild.task("${it}:publishToMavenLocal"))
tasks.named('classes') {
finalizedBy tasks.named('removeIncludedClasses')
dependsOn vsCoreBuild.task(":shadowJar")
}

} catch (UnknownDomainObjectException ignore) {}

mavenCentral()
Expand Down Expand Up @@ -114,6 +119,20 @@ subprojects {
maven { url = "https://maven.cafeteria.dev/releases" } // Fake Player API
maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } // Reach Entity Attributes
maven { url = "https://jitpack.io"}
maven { // FTB Stuffs
url "https://maven.saps.dev/releases"
content {
includeGroup "dev.latvian.mods"
includeGroup "dev.ftb.mods"
}
}
maven { // FTB Stuffs
url "https://maven.saps.dev/snapshots"
content {
includeGroup "dev.latvian.mods"
includeGroup "dev.ftb.mods"
}
}
}
maven {
name = "Valkyrien Skies Internal"
Expand Down
23 changes: 16 additions & 7 deletions common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

dependencies {
implementation(annotationProcessor("io.github.llamalad7:mixinextras-common:0.2.0"))

Expand All @@ -11,19 +10,26 @@ dependencies {

modCompileOnly("maven.modrinth:sodium:${sodium_version}")

implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.0")

// vs-core
implementation("org.valkyrienskies.core:impl:${rootProject.vs_core_version}") {
exclude module: "netty-buffer"
exclude module: "fastutil"
exclude module: "kotlin-stdlib"
}
implementation("org.valkyrienskies.core:api:${rootProject.vs_core_version}") {
exclude module: "kotlin-stdlib"
}
implementation("org.valkyrienskies.core:api-game:${rootProject.vs_core_version}") {
exclude module: "kotlin-stdlib"
}
implementation("org.valkyrienskies.core:util:${rootProject.vs_core_version}") {
exclude module: "kotlin-stdlib"
}
implementation("org.valkyrienskies.core:api:${rootProject.vs_core_version}")
implementation("org.valkyrienskies.core:api-game:${rootProject.vs_core_version}")
implementation("org.valkyrienskies.core:util:${rootProject.vs_core_version}")

// FTB Stuffs
modCompileOnly("curse.maven:ftb-util-404465:4210935")
modCompileOnly("curse.maven:ftb-teams-404468:4229138")
modCompileOnly("curse.maven:ftb-chunks-314906:4229120")
modCompileOnly("dev.ftb.mods:ftb-chunks:2001.3.4") { transitive = false }

// EMF compat
modCompileOnly("curse.maven:entity-model-features-844662:5696901")
Expand All @@ -32,6 +38,9 @@ dependencies {
// Weather2 1.20.1
modCompileOnly("curse.maven:weather-storms-tornadoes-237746:5244118")

// CC: Tweaked
modCompileOnly("maven.modrinth:cc-tweaked:${cc_tweaked_version}")

//Common create compat,
//We just use a version from a platform and hope the classes exist on both versions and mixins apply correctly
modCompileOnly("com.simibubi.create:create-fabric-${minecraft_version}:${create_fabric_version}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.valkyrienskies.mod.common.VSGameUtilsKt;
import org.valkyrienskies.mod.api.ValkyrienSkies;

@Mixin(ConduitBlockEntity.class)
public class ConduitMixin extends BlockEntity {
Expand All @@ -31,12 +31,7 @@ public ConduitMixin(final BlockEntityType<?> blockEntityType, final BlockPos blo
)
private static boolean closerThan(final BlockPos instance, final Vec3i vec3i, final double distance,
final Level level, final BlockPos blockPos, final List<BlockPos> list) {
final double retValue =
VSGameUtilsKt.squaredDistanceBetweenInclShips(level, instance.getX(), instance.getY(), instance.getZ(),
vec3i.getX(),
vec3i.getY(),
vec3i.getZ());
return retValue < distance * distance;
return ValkyrienSkies.closerThan(level, instance, vec3i, distance);
}

@Redirect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.valkyrienskies.core.api.ships.ServerShip;
import org.valkyrienskies.core.api.ships.LoadedServerShip;
import org.valkyrienskies.mod.common.VSGameUtilsKt;
import org.valkyrienskies.mod.common.config.VSGameConfig;
import org.valkyrienskies.mod.common.util.GameTickForceApplier;
Expand Down Expand Up @@ -74,8 +74,8 @@ private void doExplodeForce() {
ClipContext.Fluid.NONE, null));
if (result.getType() == Type.BLOCK) {
final BlockPos blockPos = result.getBlockPos();
final ServerShip ship =
(ServerShip) VSGameUtilsKt.getShipObjectManagingPos(this.level, blockPos);
final LoadedServerShip ship =
(LoadedServerShip) VSGameUtilsKt.getShipObjectManagingPos(this.level, blockPos);
if (ship != null) {
final Vector3d forceVector =
VectorConversionsMCKt.toJOML(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import net.minecraft.world.phys.AABB;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.valkyrienskies.mod.common.VSGameUtilsKt;
import org.valkyrienskies.mod.api.ValkyrienSkies;

/**
* Transform the player's vehicle's bounding box to the shipyard, preventing the 'collision box too big' error.
Expand All @@ -29,6 +29,6 @@ protected MixinPlayer(final EntityType<? extends LivingEntity> entityType,
)
)
private AABB transformBoundingBoxToWorld(final AABB aabb) {
return VSGameUtilsKt.transformAabbToWorld(this.level(), aabb);
return ValkyrienSkies.toWorld(this.level(), aabb);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.valkyrienskies.mod.common.VSGameUtilsKt;
import org.valkyrienskies.mod.api.ValkyrienSkies;
import org.valkyrienskies.mod.common.config.VSGameConfig;

@Mixin(NaturalSpawner.class)
Expand All @@ -18,7 +18,7 @@ public class NaturalSpawnerMixin {
private static void determineSpawningOnShips(final ServerLevel level, final LevelChunk chunk,
final SpawnState spawnState,
final boolean spawnFriendlies, final boolean spawnMonsters, final boolean bl, final CallbackInfo ci) {
if (VSGameUtilsKt.isChunkInShipyard(level, chunk.getPos().x, chunk.getPos().z)) {
if (ValkyrienSkies.isChunkInShipyard(level, chunk.getPos().x, chunk.getPos().z)) {
if (!VSGameConfig.SERVER.getAllowMobSpawns()) {
ci.cancel();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import org.spongepowered.asm.mixin.injection.At;
import org.valkyrienskies.core.api.ships.ClientShip;
import org.valkyrienskies.core.api.ships.Ship;
import org.valkyrienskies.mod.common.VSGameUtilsKt;
import org.valkyrienskies.mod.api.ValkyrienSkies;

/**
* This mixin fixes {@link BlockEntity}s belonging to ships not rendering.
Expand Down Expand Up @@ -48,7 +48,7 @@ private <E extends BlockEntity> boolean isTileEntityInRenderRange(final BlockEnt

// If by default was false, then check if this BlockEntity belongs to a ship
final BlockPos bePos = blockEntity.getBlockPos();
final Ship nullableShip = VSGameUtilsKt.getShipObjectManagingPos(level, bePos);
final Ship nullableShip = ValkyrienSkies.getShipManagingBlock(level, bePos);
if (nullableShip instanceof ClientShip ship) {
final Matrix4dc m = ship.getRenderTransform().getShipToWorld();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.valkyrienskies.core.api.ships.Ship;
import org.valkyrienskies.mod.common.VSGameUtilsKt;
import org.valkyrienskies.mod.api.ValkyrienSkies;
import org.valkyrienskies.mod.common.config.VSGameConfig;
import org.valkyrienskies.mod.common.entity.ShipyardPosSavable;
import org.valkyrienskies.mod.common.util.EntityDraggingInformation;
import org.valkyrienskies.mod.common.util.IEntityDraggingInformationProvider;
import org.valkyrienskies.mod.common.util.VectorConversionsMCKt;

@Mixin(ChunkMap.class)
public class MixinChunkMap {
Expand All @@ -35,12 +34,13 @@ public class MixinChunkMap {

@Inject(method = "removeEntity", at = @At("HEAD"))
protected void unloadEntityMixin(Entity entity, CallbackInfo info) {
if (entity instanceof Mob mob) {
if (entity instanceof Mob mob && entity instanceof ShipyardPosSavable savable) {
Vector3d shipyardPos = valkyrienskies$getShipyardPos(mob);
if (shipyardPos != null &&
VSGameUtilsKt.getShipManagingPos(this.level, shipyardPos) != null &&
((ShipyardPosSavable)mob).valkyrienskies$getUnloadedShipyardPos() == null) {
((ShipyardPosSavable)mob).valkyrienskies$setUnloadedShipyardPos(shipyardPos);
ValkyrienSkies.getShipManagingBlock(this.level, shipyardPos) != null &&
savable.valkyrienskies$getUnloadedShipyardPos() == null
) {
savable.valkyrienskies$setUnloadedShipyardPos(shipyardPos);
}
}
}
Expand All @@ -53,13 +53,13 @@ protected void unloadEntityMixin(Entity entity, CallbackInfo info) {

@Inject(method = "addEntity", at = @At("RETURN"))
protected void loadEntityMixin(Entity entity, CallbackInfo info) {
if (entity instanceof Mob mob) {
Vector3d shipyardPos = ((ShipyardPosSavable)mob).valkyrienskies$getUnloadedShipyardPos();
if(shipyardPos != null) {
if (entity instanceof Mob mob && entity instanceof ShipyardPosSavable savable) {
Vector3d shipyardPos = savable.valkyrienskies$getUnloadedShipyardPos();
if (shipyardPos != null) {
if (VSGameConfig.SERVER.getSaveMobsPositionOnShip()){
mob.teleportTo(shipyardPos.x, shipyardPos.y, shipyardPos.z);
}
((ShipyardPosSavable) mob).valkyrienskies$setUnloadedShipyardPos(null);
savable.valkyrienskies$setUnloadedShipyardPos(null);
}
}
}
Expand All @@ -75,9 +75,9 @@ protected void loadEntityMixin(Entity entity, CallbackInfo info) {
EntityDraggingInformation dragInfo = ((IEntityDraggingInformationProvider) entity).getDraggingInformation();

if (dragInfo.getLastShipStoodOn() != null) {
Ship ship = VSGameUtilsKt.getAllShips(this.level).getById(dragInfo.getLastShipStoodOn());
if (ship != null && ship.getWorldAABB().containsPoint(VectorConversionsMCKt.toJOML(entity.position()))) {
return ship.getWorldToShip().transformPosition(VectorConversionsMCKt.toJOML(entity.position()));
Ship ship = ValkyrienSkies.getShipById(this.level, dragInfo.getLastShipStoodOn());
if (ship != null && ship.getWorldAABB().containsPoint(ValkyrienSkies.toJOML(entity.position()))) {
return ship.getWorldToShip().transformPosition(ValkyrienSkies.toJOML(entity.position()));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.valkyrienskies.core.api.ships.Ship;
import org.valkyrienskies.mod.api.ValkyrienSkies;
import org.valkyrienskies.mod.client.audio.SimpleSoundInstanceOnShip;
import org.valkyrienskies.mod.common.VSGameUtilsKt;

@Mixin(SimpleSoundInstance.class)
public class MixinSimpleSoundInstance {
Expand All @@ -25,7 +25,7 @@ public class MixinSimpleSoundInstance {
private static void forRecord(final SoundEvent sound, final Vec3 pos,
final CallbackInfoReturnable<SimpleSoundInstance> cir) {

final Ship ship = VSGameUtilsKt.getShipManagingPos(Minecraft.getInstance().level, pos.x(), pos.y(), pos.z());
final Ship ship = ValkyrienSkies.getShipManagingBlock(Minecraft.getInstance().level, pos.x(), pos.y(), pos.z());
if (ship != null) {
cir.setReturnValue(new SimpleSoundInstanceOnShip(
sound, SoundSource.RECORDS, 4.0F, 1.0F, SoundInstance.createUnseededRandom(), false, 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.valkyrienskies.core.api.ships.Ship;
import org.valkyrienskies.mod.common.VSGameUtilsKt;
import org.valkyrienskies.mod.api.ValkyrienSkies;
import org.valkyrienskies.mod.common.config.VSGameConfig;
import org.valkyrienskies.mod.common.util.EntityDraggingInformation;
import org.valkyrienskies.mod.common.util.IEntityDraggingInformationProvider;
Expand All @@ -42,7 +42,7 @@ void teleportToShip(final CompoundTag compoundTag, final CallbackInfo ci) {

final long lastShipId = compoundTag.getLong("LastShipId");

final Ship ship = VSGameUtilsKt.getShipObjectWorld(serverLevel()).getAllShips().getById(lastShipId);
final Ship ship = ValkyrienSkies.getShipById(serverLevel(), lastShipId);
// Don't teleport if the ship doesn't exist anymore
if (ship == null)
return;
Expand All @@ -69,7 +69,7 @@ void rememberLastShip(final CompoundTag compoundTag, final CallbackInfo ci) {
if (lastShipId == null)
return;

final Ship ship = VSGameUtilsKt.getShipObjectWorld(serverLevel()).getAllShips().getById(lastShipId);
final Ship ship = ValkyrienSkies.getShipById(serverLevel(), lastShipId);
if (ship == null)
return;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.valkyrienskies.mod.forge.mixin.compat.cc_tweaked;
package org.valkyrienskies.mod.mixin.mod_compat.cc_tweaked;

import dan200.computercraft.client.sound.SpeakerSound;
import dan200.computercraft.shared.peripheral.speaker.SpeakerPosition;
Expand All @@ -16,8 +16,8 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.valkyrienskies.core.api.ships.Ship;
import org.valkyrienskies.mod.api.ValkyrienSkies;
import org.valkyrienskies.mod.client.audio.VelocityTickableSoundInstance;
import org.valkyrienskies.mod.common.VSGameUtilsKt;

@Mixin(SpeakerSound.class)
public abstract class MixinSpeakerSound extends AbstractSoundInstance implements VelocityTickableSoundInstance {
Expand All @@ -35,9 +35,9 @@ protected MixinSpeakerSound(ResourceLocation arg, SoundSource arg2, RandomSource
)
private void isOnShip(SpeakerPosition position, CallbackInfo ci) {
this.speakerPosition = position;
this.ship = VSGameUtilsKt.getShipManagingPos(position.level(), position.position());
this.ship = ValkyrienSkies.getShipManagingBlock(position.level(), position.position());
if (this.ship != null) {
Vec3 worldPos = VSGameUtilsKt.toWorldCoordinates(speakerPosition.level(), speakerPosition.position());
Vec3 worldPos = ValkyrienSkies.positionToWorld(speakerPosition.level(), speakerPosition.position());
x = worldPos.x;
y = worldPos.y;
z = worldPos.z;
Expand All @@ -50,7 +50,7 @@ private void isOnShip(SpeakerPosition position, CallbackInfo ci) {
)
private void updateWorldPos(CallbackInfo ci) {
if (this.ship != null) {
Vec3 worldPos = VSGameUtilsKt.toWorldCoordinates(speakerPosition.level(), speakerPosition.position());
Vec3 worldPos = ValkyrienSkies.positionToWorld(speakerPosition.level(), speakerPosition.position());
x = worldPos.x;
y = worldPos.y;
z = worldPos.z;
Expand Down
Loading
Loading