diff --git a/build.gradle b/build.gradle index db14265..2934aab 100644 --- a/build.gradle +++ b/build.gradle @@ -1,20 +1,25 @@ plugins { - id 'fabric-loom' version '0.2.7-SNAPSHOT' + id 'java-library' + id "org.jetbrains.kotlin.jvm" + id 'fabric-loom' version '0.9-SNAPSHOT' id 'maven-publish' } -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 +java { + toolchain { + languageVersion = JavaLanguageVersion.of(16) + } +} -archivesBaseName = project.mod_archive_base_name -version = project.mod_version + +archivesBaseName = project.mod_name + "-" + project.mod_version + "+" + project.version_meta group = project.mod_group repositories() { // modmuss50 maven { name = "modmuss50" - url = "https://maven.fabricmc.net/io/github/prospector/modmenu/" + url = "https://maven.terraformersmc.com/releases/" } // Cotton @@ -22,11 +27,12 @@ repositories() { name = "Cotton" url = "https://server.bbkr.space/artifactory/libs-release/" } + maven { url "https://maven.shedaniel.me/" } } dependencies { // Minecraft - minecraft "tcom.mojang:minecraft:${minecraft_version}" + minecraft "com.mojang:minecraft:${minecraft_version}" // Yarn mappings "net.fabricmc:yarn:${yarn_mappings}:v2" @@ -38,28 +44,27 @@ dependencies { modImplementation "net.fabricmc.fabric-api:fabric-api:${api_version}" // ClotConfig - modApi "me.shedaniel.cloth:config-2:${clothconfig_version}" + // modApi "me.shedaniel.cloth:config-2:${clothconfig_version}" // AutoConfig - modApi "me.sargunvohra.mcmods:autoconfig1u:${autoconfig_version}" + // https://mvnrepository.com/artifact/me.sargunvohra.mcmods/autoconfig1u + modImplementation group: "me.sargunvohra.mcmods", name: 'autoconfig1u', version: '3.3.1' + + + //"me.sargunvohra.mcmods:autoconfig1u:${autoconfig_version}" // ModMenu - modImplementation "io.github.prospector:modmenu:${modmenu_version}" + modImplementation "com.terraformersmc:modmenu:${modmenu_version}" // LibCD - modImplementation "io.github.cottonmc:LibCD:${libcd_version}" + // modImplementation "io.github.cottonmc:LibCD:${libcd_version}" } processResources { - inputs.property "version", project.version - - from(sourceSets.main.resources.srcDirs) { - include "fabric.mod.json" - expand "version": project.version - } + inputs.property "version", project.version.toString() - from(sourceSets.main.resources.srcDirs) { - exclude "fabric.mod.json" + filesMatching("fabric.mod.json") { + expand "version": project.version.toString() } } @@ -92,3 +97,5 @@ publishing { mavenLocal() } } + +compileKotlin.kotlinOptions.jvmTarget = "16" \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index b3e63dd..a2c9c1d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,20 +1,27 @@ -# Gradle org.gradle.jvmargs=-Xmx4G -# Fabric -minecraft_version=1.15.2 -yarn_mappings=1.15.2+build.15 -loader_version=0.8.2+build.194 -api_version=0.5.1+build.294-1.15 + +minecraft_version=1.17.1 +yarn_mappings=1.17.1+build.63 +loader_version=0.12.3 + +#Fabric api +api_version=0.41.0+1.17 +loom_version=0.9-SNAPSHOT + +# Kotlin +kotlin_version=1.5.30 +fabric_kotlin_version=1.6.4+kotlin.1.5.30 + # Mod mod_name = linkart -mod_version = 1.2.4 +mod_version = 1.3.3 mod_group = com.gitub.vini2003 -mod_archive_base_name = linkart +version_meta = fabric-1.16.3 # Dependencies -clothconfig_version = 2.14.1 -autoconfig_version = 2.2.0 -modmenu_version = 1.10.0+build.28 -libcd_version = 2.4.1+1.15.2 \ No newline at end of file +clothconfig_version = 4.8.2 +autoconfig_version = 3.2.2 +modmenu_version = 2.0.14 +# libcd_version = 2.5.0+1.16.1 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar old mode 100644 new mode 100755 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties old mode 100644 new mode 100755 index 701fdc4..f371643 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Wed May 13 17:42:25 BRT 2020 -distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/settings.gradle b/settings.gradle index 5b60df3..68d828d 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,10 +1,17 @@ pluginManagement { repositories { - jcenter() + mavenCentral() maven { name = 'Fabric' url = 'https://maven.fabricmc.net/' } + gradlePluginPortal() } + + plugins { + id 'fabric-loom' version loom_version + id "org.jetbrains.kotlin.jvm" version kotlin_version + } + } diff --git a/src/main/java/com/github/vini2003/linkart/Linkart.java b/src/main/java/com/github/vini2003/linkart/Linkart.java old mode 100644 new mode 100755 diff --git a/src/main/java/com/github/vini2003/linkart/accessor/AbstractMinecartEntityAccessor.java b/src/main/java/com/github/vini2003/linkart/accessor/AbstractMinecartEntityAccessor.java old mode 100644 new mode 100755 diff --git a/src/main/java/com/github/vini2003/linkart/configuration/LinkartConfiguration.java b/src/main/java/com/github/vini2003/linkart/configuration/LinkartConfiguration.java old mode 100644 new mode 100755 index 5a26edc..162dfe3 --- a/src/main/java/com/github/vini2003/linkart/configuration/LinkartConfiguration.java +++ b/src/main/java/com/github/vini2003/linkart/configuration/LinkartConfiguration.java @@ -10,7 +10,7 @@ public class LinkartConfiguration implements ConfigData { public boolean enableLinker = true; @ConfigEntry.Gui.Tooltip - public boolean enableChain = true; + public boolean enableChain = false; @ConfigEntry.Gui.Tooltip public int pathfindingDistance = 8; diff --git a/src/main/java/com/github/vini2003/linkart/integration/LinkartModMenuIntegration.java b/src/main/java/com/github/vini2003/linkart/integration/LinkartModMenuIntegration.java old mode 100644 new mode 100755 index 009574b..aa0f42f --- a/src/main/java/com/github/vini2003/linkart/integration/LinkartModMenuIntegration.java +++ b/src/main/java/com/github/vini2003/linkart/integration/LinkartModMenuIntegration.java @@ -2,21 +2,24 @@ import com.github.vini2003.linkart.Linkart; import com.github.vini2003.linkart.configuration.LinkartConfiguration; +import io.github.prospector.modmenu.api.ConfigScreenFactory; import io.github.prospector.modmenu.api.ModMenuApi; import me.sargunvohra.mcmods.autoconfig1u.AutoConfig; +import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.Screen; import java.util.Optional; import java.util.function.Supplier; public class LinkartModMenuIntegration implements ModMenuApi { - @Override - public String getModId() { - return Linkart.ID; - } + +// @Override +// public String getModId() { +// return Linkart.ID; +// } @Override - public Optional> getConfigScreen(Screen screen) { - return Optional.of(AutoConfig.getConfigScreen(LinkartConfiguration.class, screen)); + public ConfigScreenFactory getModConfigScreenFactory() { + return (ConfigScreenFactory) screen -> AutoConfig.getConfigScreen(LinkartConfiguration.class, screen).get(); } } diff --git a/src/main/java/com/github/vini2003/linkart/item/LinkerItem.java b/src/main/java/com/github/vini2003/linkart/item/LinkerItem.java old mode 100644 new mode 100755 diff --git a/src/main/java/com/github/vini2003/linkart/mixin/AbstractMinecartEntityMixin.java b/src/main/java/com/github/vini2003/linkart/mixin/AbstractMinecartEntityMixin.java deleted file mode 100644 index 138f30d..0000000 --- a/src/main/java/com/github/vini2003/linkart/mixin/AbstractMinecartEntityMixin.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.github.vini2003.linkart.mixin; - -import com.github.vini2003.linkart.accessor.AbstractMinecartEntityAccessor; -import com.github.vini2003.linkart.utility.CollisionUtils; -import com.github.vini2003.linkart.utility.RailUtils; -import net.minecraft.entity.Entity; -import net.minecraft.entity.vehicle.AbstractMinecartEntity; -import net.minecraft.server.world.ServerWorld; -import net.minecraft.util.math.Vec3d; -import net.minecraft.world.World; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Unique; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import java.util.UUID; - -@Mixin(AbstractMinecartEntity.class) -public abstract class AbstractMinecartEntityMixin implements AbstractMinecartEntityAccessor { - @Unique - UUID nextUuid; - - @Unique - private AbstractMinecartEntity previous; - - @Unique - private AbstractMinecartEntity next; - - @Unique - private UUID previousUuid; - - @Override - public AbstractMinecartEntity getPrevious() { - if (previous == null && getPreviousUuid() != null && !((AbstractMinecartEntity) (Object) this).world.isClient) { - previous = (AbstractMinecartEntity) ((ServerWorld) ((AbstractMinecartEntity) (Object) this).world).getEntity(getPreviousUuid()); - } - - return previous; - } - - @Override - public void setPrevious(AbstractMinecartEntity previous) { - this.previous = previous; - this.nextUuid = previous == null ? null : previous.getUuid(); - } - - @Override - public AbstractMinecartEntity getNext() { - if (next == null && getNextUuid() != null && !((AbstractMinecartEntity) (Object) this).world.isClient) { - next = (AbstractMinecartEntity) ((ServerWorld) ((AbstractMinecartEntity) (Object) this).world).getEntity(getNextUuid()); - } - - return next; - } - - @Override - public void setNext(AbstractMinecartEntity next) { - this.next = next; - this.nextUuid = next == null ? null : next.getUuid(); - } - - @Override - public UUID getPreviousUuid() { - return previousUuid; - } - - @Override - public void setPreviousUuid(UUID uuid) { - this.previousUuid = uuid; - } - - @Override - public UUID getNextUuid() { - return nextUuid; - } - - @Override - public void setNextUuid(UUID uuid) { - this.nextUuid = uuid; - } - - @Inject(at = @At("HEAD"), method = "tick()V") - void onTick(CallbackInfo callbackInformation) { - World mixedWorld = ((AbstractMinecartEntity) (Object) this).world; - - AbstractMinecartEntity next = (AbstractMinecartEntity) (Object) this; - AbstractMinecartEntityAccessor accessor = (AbstractMinecartEntityAccessor) next; - - if (!mixedWorld.isClient) { - - if (accessor.getPrevious() != null) { - AbstractMinecartEntity previous = accessor.getPrevious(); - - Vec3d nextVelocity = RailUtils.getNextVelocity(next, previous); - - if (nextVelocity != null) { - next.setVelocity(nextVelocity); - } - } - } - } - - @Inject(at = @At("HEAD"), method = "pushAwayFrom(Lnet/minecraft/entity/Entity;)V", cancellable = true) - void onPushAway(Entity entity, CallbackInfo callbackInformation) { - if (!CollisionUtils.shouldCollide((Entity) (Object) this, entity)) { - callbackInformation.cancel(); - } - } -} diff --git a/src/main/java/com/github/vini2003/linkart/mixin/AbstractMinecartEntityMixin.kt b/src/main/java/com/github/vini2003/linkart/mixin/AbstractMinecartEntityMixin.kt new file mode 100755 index 0000000..38129a5 --- /dev/null +++ b/src/main/java/com/github/vini2003/linkart/mixin/AbstractMinecartEntityMixin.kt @@ -0,0 +1,104 @@ +package com.github.vini2003.linkart.mixin + +import org.spongepowered.asm.mixin.Mixin +import net.minecraft.entity.vehicle.AbstractMinecartEntity +import com.github.vini2003.linkart.accessor.AbstractMinecartEntityAccessor +import org.spongepowered.asm.mixin.Unique +import java.util.UUID +import net.minecraft.server.world.ServerWorld +import org.spongepowered.asm.mixin.injection.Inject +import org.spongepowered.asm.mixin.injection.At +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo +import com.github.vini2003.linkart.utility.RailUtils +import net.fabricmc.api.EnvType +import net.minecraft.entity.player.PlayerEntity +import com.github.vini2003.linkart.utility.CollisionUtils +import net.fabricmc.api.Environment +import net.minecraft.entity.Entity + +@Mixin(AbstractMinecartEntity::class) +abstract class AbstractMinecartEntityMixin : AbstractMinecartEntityAccessor { + + @Unique + var nextUuid2: UUID? = null + + override fun getNextUuid(): UUID? { + return nextUuid2 + } + + override fun setNextUuid(uuid: UUID?) { + nextUuid2 = uuid + } + + + @Unique + private var previous: AbstractMinecartEntity? = null + + @Unique + private var next: AbstractMinecartEntity? = null + + @Unique + private var previousUuid: UUID? = null + override fun getPrevious(): AbstractMinecartEntity? { + if (previous == null && getPreviousUuid() != null && !(this as AbstractMinecartEntity).world.isClient) { + previous = + ((this as AbstractMinecartEntity).world as? ServerWorld?)?.getEntity(getPreviousUuid()) as AbstractMinecartEntity? + } + return previous + } + + override fun setPrevious(previous: AbstractMinecartEntity?) { + this.previous = previous + nextUuid = previous?.uuid + } + + override fun getNext(): AbstractMinecartEntity? { + if (next == null && getNextUuid() != null && !(this as AbstractMinecartEntity).world.isClient) { + next = + ((this as? AbstractMinecartEntity)?.world as? ServerWorld)?.getEntity(getNextUuid()) as AbstractMinecartEntity? + } + return next + } + + override fun setNext(next: AbstractMinecartEntity?) { + this.next = next + nextUuid = next?.uuid + } + + override fun getPreviousUuid(): UUID? { + return previousUuid + } + + override fun setPreviousUuid(uuid: UUID?) { + previousUuid = uuid + } + + + @Inject(at = [At("HEAD")], method = ["tick()V"]) + fun onTickCommon(callbackInformation: CallbackInfo?) { + RailUtils.handleTickCommon(this as? AbstractMinecartEntity, callbackInformation) + } + + + + @Environment(EnvType.CLIENT) + @Inject(at = [At("HEAD")], method = ["tick()V"]) + fun onTickClient(callbackInformation: CallbackInfo?) { + val entity = (this as? AbstractMinecartEntity) ?: return + entity.passengerList.stream().filter { passenger: Entity? -> passenger is PlayerEntity } + .forEach { player: Entity -> +// entity.yaw = entity.yaw + 90 * 0.75f +// player.pitch = entity.pitch +// player.prevYaw = entity.prevYaw + 90 * 0.75f +// player.prevPitch = entity.prevPitch + } + } + + @Inject(at = [At("HEAD")], method = ["pushAwayFrom(Lnet/minecraft/entity/Entity;)V"], cancellable = true) + fun onPushAway(entity: Entity?, callbackInformation: CallbackInfo) { + if (!CollisionUtils.shouldCollide(this as Entity, entity)) { + callbackInformation.cancel() + } + } + +} \ No newline at end of file diff --git a/src/main/java/com/github/vini2003/linkart/mixin/EntityMixin.java b/src/main/java/com/github/vini2003/linkart/mixin/EntityMixin.java old mode 100644 new mode 100755 index 13d238f..f64ffd4 --- a/src/main/java/com/github/vini2003/linkart/mixin/EntityMixin.java +++ b/src/main/java/com/github/vini2003/linkart/mixin/EntityMixin.java @@ -5,7 +5,7 @@ import net.minecraft.block.AbstractRailBlock; import net.minecraft.entity.Entity; import net.minecraft.entity.vehicle.AbstractMinecartEntity; -import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.NbtCompound; import net.minecraft.util.math.Box; import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; @@ -35,8 +35,8 @@ public abstract class EntityMixin { @Shadow public abstract double getZ(); - @Inject(at = @At("RETURN"), method = "toTag(Lnet/minecraft/nbt/CompoundTag;)Lnet/minecraft/nbt/CompoundTag;") - void onToTag(CompoundTag tag, CallbackInfoReturnable callbackInformationReturnable) { + @Inject(at = @At("RETURN"), method = "writeNbt(Lnet/minecraft/nbt/NbtCompound;)Lnet/minecraft/nbt/NbtCompound;") + void onToTag(NbtCompound tag, CallbackInfoReturnable callbackInformationReturnable) { if ((Object) this instanceof AbstractMinecartEntity) { AbstractMinecartEntity entity = (AbstractMinecartEntity) (Object) this; AbstractMinecartEntityAccessor accessor = (AbstractMinecartEntityAccessor) entity; @@ -51,8 +51,8 @@ void onToTag(CompoundTag tag, CallbackInfoReturnable callbackInform } } - @Inject(at = @At("RETURN"), method = "fromTag(Lnet/minecraft/nbt/CompoundTag;)V") - void onFromTag(CompoundTag tag, CallbackInfo callbackInformation) { + @Inject(at = @At("RETURN"), method = "readNbt(Lnet/minecraft/nbt/NbtCompound;)V") + void onFromTag(NbtCompound tag, CallbackInfo callbackInformation) { if ((Object) this instanceof AbstractMinecartEntity) { AbstractMinecartEntity entity = (AbstractMinecartEntity) (Object) this; AbstractMinecartEntityAccessor accessor = (AbstractMinecartEntityAccessor) entity; @@ -86,7 +86,7 @@ void removeLink(CallbackInfo callbackInformation) { @Inject(at = @At("HEAD"), method = "adjustMovementForCollisions(Lnet/minecraft/util/math/Vec3d;)Lnet/minecraft/util/math/Vec3d;", cancellable = true) void onRecalculateVelocity(Vec3d movement, CallbackInfoReturnable callbackInformationReturnable) { - List collisions = this.world.getEntities((Entity) (Object) this, getBoundingBox().stretch(movement)); + List collisions = this.world.getOtherEntities((Entity) (Object) this, getBoundingBox().stretch(movement)); for (Entity entity : collisions) { if (!CollisionUtils.shouldCollide((Entity) (Object) this, entity) && world.getBlockState(((AbstractMinecartEntity) (Object) this).getBlockPos()).getBlock() instanceof AbstractRailBlock) { diff --git a/src/main/java/com/github/vini2003/linkart/mixin/PlayerEntityMixin.java b/src/main/java/com/github/vini2003/linkart/mixin/PlayerEntityMixin.java old mode 100644 new mode 100755 index 6bc7688..ee593e0 --- a/src/main/java/com/github/vini2003/linkart/mixin/PlayerEntityMixin.java +++ b/src/main/java/com/github/vini2003/linkart/mixin/PlayerEntityMixin.java @@ -6,13 +6,16 @@ import com.github.vini2003.linkart.registry.LinkartItems; import com.github.vini2003.linkart.registry.LinkartLinkerRegistry; import com.github.vini2003.linkart.registry.LinkartNetworks; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; import net.fabricmc.fabric.api.network.ClientSidePacketRegistry; -import net.minecraft.container.PlayerContainer; -import net.minecraft.container.Slot; import net.minecraft.entity.Entity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.vehicle.AbstractMinecartEntity; import net.minecraft.item.Item; +import net.minecraft.item.Items; +import net.minecraft.screen.PlayerScreenHandler; +import net.minecraft.screen.slot.Slot; import net.minecraft.text.Text; import net.minecraft.text.TranslatableText; import net.minecraft.util.ActionResult; @@ -23,6 +26,7 @@ import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import java.util.Optional; @@ -30,10 +34,11 @@ import static com.github.vini2003.linkart.utility.TextUtils.literal; @Mixin(PlayerEntity.class) -public class PlayerEntityMixin { - @Shadow +public abstract class PlayerEntityMixin { @Final - public PlayerContainer playerContainer; + public PlayerScreenHandler playerScreenHandler; + + @Shadow protected abstract boolean shouldDismount(); @Inject(at = @At("HEAD"), method = "interact(Lnet/minecraft/entity/Entity;Lnet/minecraft/util/Hand;)Lnet/minecraft/util/ActionResult;", cancellable = true) void onInteract(Entity entityA, Hand hand, CallbackInfoReturnable callbackInformationReturnable) { @@ -127,7 +132,7 @@ void onInteract(Entity entityA, Hand hand, CallbackInfoReturnable } if (LinkartConfigurations.INSTANCE.getConfig().isChainEnabled()) { - Optional optionalSlot = playerContainer.slots.stream().filter(slot -> slot.getStack().getItem() == LinkartItems.CHAIN_ITEM).findFirst(); + Optional optionalSlot = playerScreenHandler.slots.stream().filter(slot -> slot.getStack().getItem() == Items.CHAIN).findFirst(); if (!optionalSlot.isPresent()) { sendToClient(playerEntity, new TranslatableText("text.linkart.message.cart_link_failure_chain").formatted(Formatting.RED)); @@ -172,7 +177,7 @@ private static void cancelCallback(CallbackInfoReturnable callback private static void sendToClient(PlayerEntity playerEntity, Text text) { if (playerEntity.world.isClient) { - playerEntity.sendMessage(text); + playerEntity.sendMessage(text, true); } } } diff --git a/src/main/java/com/github/vini2003/linkart/registry/LinkartConfigurations.java b/src/main/java/com/github/vini2003/linkart/registry/LinkartConfigurations.java old mode 100644 new mode 100755 diff --git a/src/main/java/com/github/vini2003/linkart/registry/LinkartDistanceRegistry.java b/src/main/java/com/github/vini2003/linkart/registry/LinkartDistanceRegistry.java old mode 100644 new mode 100755 diff --git a/src/main/java/com/github/vini2003/linkart/registry/LinkartItemGroups.java b/src/main/java/com/github/vini2003/linkart/registry/LinkartItemGroups.java old mode 100644 new mode 100755 index 9d06d86..3a40ae9 --- a/src/main/java/com/github/vini2003/linkart/registry/LinkartItemGroups.java +++ b/src/main/java/com/github/vini2003/linkart/registry/LinkartItemGroups.java @@ -12,8 +12,6 @@ public class LinkartItemGroups { public static void initialize() { if (LinkartConfigurations.INSTANCE.getConfig().isLinkerEnabled()) { LINKART_GROUP = FabricItemGroupBuilder.build(new Identifier(Linkart.ID, "linkart"), () -> new ItemStack(LinkartItems.LINKER_ITEM)); - } else if (LinkartConfigurations.INSTANCE.getConfig().isChainEnabled()) { - LINKART_GROUP = FabricItemGroupBuilder.build(new Identifier(Linkart.ID, "linkart"), () -> new ItemStack(LinkartItems.CHAIN_ITEM)); } } } diff --git a/src/main/java/com/github/vini2003/linkart/registry/LinkartItems.java b/src/main/java/com/github/vini2003/linkart/registry/LinkartItems.java old mode 100644 new mode 100755 index 4f786b6..45f7861 --- a/src/main/java/com/github/vini2003/linkart/registry/LinkartItems.java +++ b/src/main/java/com/github/vini2003/linkart/registry/LinkartItems.java @@ -8,14 +8,10 @@ public class LinkartItems { public static Item LINKER_ITEM; - public static Item CHAIN_ITEM; public static void initialize() { if (LinkartConfigurations.INSTANCE.getConfig().isLinkerEnabled()) { LINKER_ITEM = Registry.register(Registry.ITEM, new Identifier(Linkart.ID, "linker"), new LinkerItem(new Item.Settings().maxCount(1).group(LinkartItemGroups.LINKART_GROUP))); } - if (LinkartConfigurations.INSTANCE.getConfig().isChainEnabled()) { - CHAIN_ITEM = Registry.register(Registry.ITEM, new Identifier(Linkart.ID, "chain"), new Item(new Item.Settings().group(LinkartItemGroups.LINKART_GROUP))); - } } } diff --git a/src/main/java/com/github/vini2003/linkart/registry/LinkartLinkerRegistry.java b/src/main/java/com/github/vini2003/linkart/registry/LinkartLinkerRegistry.java old mode 100644 new mode 100755 diff --git a/src/main/java/com/github/vini2003/linkart/registry/LinkartNetworks.java b/src/main/java/com/github/vini2003/linkart/registry/LinkartNetworks.java old mode 100644 new mode 100755 index b2fdcf3..e8bffcc --- a/src/main/java/com/github/vini2003/linkart/registry/LinkartNetworks.java +++ b/src/main/java/com/github/vini2003/linkart/registry/LinkartNetworks.java @@ -3,18 +3,19 @@ import com.github.vini2003.linkart.accessor.AbstractMinecartEntityAccessor; import io.netty.buffer.Unpooled; import net.fabricmc.fabric.api.network.ServerSidePacketRegistry; -import net.minecraft.container.PlayerContainer; -import net.minecraft.container.Slot; import net.minecraft.entity.Entity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.vehicle.AbstractMinecartEntity; import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; +import net.minecraft.network.PacketByteBuf; +import net.minecraft.screen.PlayerScreenHandler; +import net.minecraft.screen.slot.Slot; import net.minecraft.server.world.ServerWorld; import net.minecraft.text.TranslatableText; import net.minecraft.util.Formatting; import net.minecraft.util.Identifier; import net.minecraft.util.ItemScatterer; -import net.minecraft.util.PacketByteBuf; import java.util.Optional; import java.util.UUID; @@ -39,13 +40,13 @@ public static void initialize() { context.getTaskQueue().execute(() -> { PlayerEntity playerEntity = context.getPlayer(); - PlayerContainer playerContainer = playerEntity.playerContainer; + PlayerScreenHandler playerContainer = playerEntity.playerScreenHandler; if (LinkartConfigurations.INSTANCE.getConfig().isChainEnabled()) { - Optional optionalSlot = playerContainer.slots.stream().filter(slot -> slot.getStack().getItem() == LinkartItems.CHAIN_ITEM).findFirst(); + Optional optionalSlot = playerContainer.slots.stream().filter(slot -> slot.getStack().getItem() == Items.CHAIN).findFirst(); if (!optionalSlot.isPresent()) { - playerEntity.sendMessage(new TranslatableText("text.linkart.message.cart_link_failure_desynchronization").formatted(Formatting.RED)); + playerEntity.sendMessage(new TranslatableText("text.linkart.message.cart_link_failure_desynchronization").formatted(Formatting.RED), true); return; } else { optionalSlot.get().getStack().decrement(1); @@ -82,7 +83,7 @@ public static void initialize() { PlayerEntity playerEntity = context.getPlayer(); if (LinkartConfigurations.INSTANCE.getConfig().isChainEnabled()) { - ItemScatterer.spawn(playerEntity.world, playerEntity.getX(), playerEntity.getY(), playerEntity.getZ(), new ItemStack(LinkartItems.CHAIN_ITEM)); + ItemScatterer.spawn(playerEntity.world, playerEntity.getX(), playerEntity.getY(), playerEntity.getZ(), new ItemStack(Items.CHAIN)); } }); })); diff --git a/src/main/java/com/github/vini2003/linkart/utility/CollisionUtils.java b/src/main/java/com/github/vini2003/linkart/utility/CollisionUtils.java old mode 100644 new mode 100755 diff --git a/src/main/java/com/github/vini2003/linkart/utility/RailUtils.java b/src/main/java/com/github/vini2003/linkart/utility/RailUtils.java deleted file mode 100644 index 7bf46d0..0000000 --- a/src/main/java/com/github/vini2003/linkart/utility/RailUtils.java +++ /dev/null @@ -1,172 +0,0 @@ -package com.github.vini2003.linkart.utility; - -import com.github.vini2003.linkart.registry.LinkartConfigurations; -import com.github.vini2003.linkart.registry.LinkartDistanceRegistry; -import net.minecraft.block.AbstractRailBlock; -import net.minecraft.block.BlockState; -import net.minecraft.block.enums.RailShape; -import net.minecraft.entity.vehicle.AbstractMinecartEntity; -import net.minecraft.util.Pair; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; -import net.minecraft.world.World; -import org.apache.commons.lang3.mutable.MutableDouble; - -import java.util.*; - -public class RailUtils { - public static Pair getNextRail(AbstractMinecartEntity next, AbstractMinecartEntity previous) { - BlockPos entityPosition = next.getBlockPos(); - BlockPos finalPosition = previous.getBlockPos(); - - BlockState state = next.world.getBlockState(next.getBlockPos()); - - if (!(state.getBlock() instanceof AbstractRailBlock)) return null; - - List fuck = (List) getNeighbors(next.getBlockPos(), state.get(((AbstractRailBlock) state.getBlock()).getShapeProperty())); - - for (BlockPos initialPosition : fuck) { - Set cache = new HashSet<>(); - - cache.add(entityPosition); - - MutableDouble distance = new MutableDouble(0); - - if (step(next.world, cache, initialPosition, finalPosition, distance)) { - return new Pair<>(initialPosition, distance); - } - } - - return null; - } - - public static Vec3d getNextVelocity(AbstractMinecartEntity entityA, AbstractMinecartEntity entityB) { - Pair pair = getNextRail(entityA, entityB); - - double maximumDistance = Math.max(LinkartDistanceRegistry.INSTANCE.getByKey(entityA.getType()), LinkartDistanceRegistry.INSTANCE.getByKey(entityB.getType())); - - if (pair == null && entityA.dimension == entityB.dimension) { - return new Vec3d(entityB.getX() - entityA.getX(), entityB.getY() - entityA.getY(), entityB.getZ() - entityA.getZ()); - } else if (pair == null) { - return entityB.getVelocity(); - } - - BlockPos position = pair.getLeft(); - double distance = pair.getRight().getValue(); - - distance += Math.abs((entityA.getX() - (entityA.getBlockPos().getX()) - (entityB.getX() - entityB.getBlockPos().getX()))); - distance += Math.abs((entityA.getZ() - (entityA.getBlockPos().getZ()) - (entityB.getZ() - entityB.getBlockPos().getZ()))); - distance += Math.abs((entityA.getY() - (entityA.getBlockPos().getY()) - (entityB.getY() - entityB.getBlockPos().getY()))); - - Vec3d velocity = Vec3d.ZERO; - - if (distance > maximumDistance) { - distance = maximumDistance; - - if (position.getX() > entityA.getBlockPos().getX()) { - velocity = new Vec3d(velocity.x + LinkartConfigurations.INSTANCE.getConfig().getVelocityMultiplier() * distance, velocity.y, velocity.z); - } else if (position.getX() < entityA.getBlockPos().getX()) { - velocity = new Vec3d(velocity.x - LinkartConfigurations.INSTANCE.getConfig().getVelocityMultiplier() * distance, velocity.y, velocity.z); - } - if (position.getY() > entityA.getBlockPos().getY()) { - velocity = new Vec3d(velocity.x, velocity.y - LinkartConfigurations.INSTANCE.getConfig().getVelocityMultiplier() * distance, velocity.z); - } else if (position.getY() < entityA.getBlockPos().getY()) { - velocity = new Vec3d(velocity.x, velocity.y + LinkartConfigurations.INSTANCE.getConfig().getVelocityMultiplier() * distance, velocity.z); - } - if (position.getZ() > entityA.getBlockPos().getZ()) { - velocity = new Vec3d(velocity.x, velocity.y, velocity.z + LinkartConfigurations.INSTANCE.getConfig().getVelocityMultiplier() * distance); - } else if (position.getZ() < entityA.getBlockPos().getZ()) { - velocity = new Vec3d(velocity.x, velocity.y, velocity.z - LinkartConfigurations.INSTANCE.getConfig().getVelocityMultiplier() * distance); - } - } - - return velocity; - } - - public static boolean step(World world, Set cache, BlockPos currentPosition, BlockPos finalPosition, MutableDouble distance) { - BlockState state = world.getBlockState(currentPosition); - - if (!(state.getBlock() instanceof AbstractRailBlock)) return false; - - if (currentPosition.equals(finalPosition)) return true; - - cache.add(currentPosition); - - List neighbors = (List) getNeighbors(currentPosition, state.get(((AbstractRailBlock) state.getBlock()).getShapeProperty())); - - for (BlockPos neighbor : neighbors) { - if (!cache.contains(neighbor) && step(world, cache, neighbor, finalPosition, distance)) { - if (distance.getValue() > LinkartConfigurations.INSTANCE.getConfig().getPathfindingDistance()) { - return false; - } else { - distance.increment(); - return true; - } - } - } - - return false; - } - - public static Collection getNeighbors(BlockPos position, RailShape shape) { - List neighbors = new ArrayList<>(); - switch (shape) { - case NORTH_SOUTH: - neighbors.add(position.north()); - neighbors.add(position.south()); - neighbors.add(position.north().down()); - neighbors.add(position.south().down()); - break; - case EAST_WEST: - neighbors.add(position.west()); - neighbors.add(position.east()); - neighbors.add(position.west().down()); - neighbors.add(position.east().down()); - break; - case ASCENDING_EAST: - neighbors.add(position.west().down()); - neighbors.add(position.west()); - neighbors.add(position.east().up()); - break; - case ASCENDING_WEST: - neighbors.add(position.west().up()); - neighbors.add(position.east()); - neighbors.add(position.east().down()); - break; - case ASCENDING_NORTH: - neighbors.add(position.north().up()); - neighbors.add(position.south()); - neighbors.add(position.south().down()); - break; - case ASCENDING_SOUTH: - neighbors.add(position.north().down()); - neighbors.add(position.north()); - neighbors.add(position.south().up()); - break; - case SOUTH_EAST: - neighbors.add(position.east()); - neighbors.add(position.south()); - neighbors.add(position.east().down()); - neighbors.add(position.south().down()); - break; - case SOUTH_WEST: - neighbors.add(position.west()); - neighbors.add(position.south()); - neighbors.add(position.west().down()); - neighbors.add(position.south().down()); - break; - case NORTH_WEST: - neighbors.add(position.west()); - neighbors.add(position.north()); - neighbors.add(position.west().down()); - neighbors.add(position.north().down()); - break; - case NORTH_EAST: - neighbors.add(position.east()); - neighbors.add(position.north()); - neighbors.add(position.east().down()); - neighbors.add(position.north().down()); - } - return neighbors; - } -} diff --git a/src/main/java/com/github/vini2003/linkart/utility/RailUtils.kt b/src/main/java/com/github/vini2003/linkart/utility/RailUtils.kt new file mode 100755 index 0000000..a7dc6c7 --- /dev/null +++ b/src/main/java/com/github/vini2003/linkart/utility/RailUtils.kt @@ -0,0 +1,231 @@ +package com.github.vini2003.linkart.utility + +import com.github.vini2003.linkart.accessor.AbstractMinecartEntityAccessor +import com.github.vini2003.linkart.registry.LinkartConfigurations +import com.github.vini2003.linkart.registry.LinkartDistanceRegistry +import net.minecraft.block.AbstractRailBlock +import net.minecraft.block.enums.RailShape +import net.minecraft.entity.Entity +import net.minecraft.entity.vehicle.AbstractMinecartEntity +import net.minecraft.entity.vehicle.FurnaceMinecartEntity +import net.minecraft.util.Pair +import net.minecraft.util.math.BlockPos +import net.minecraft.util.math.Vec3d +import net.minecraft.world.World +import org.apache.commons.lang3.mutable.MutableDouble +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo +import java.util.* + +object RailUtils { + + fun getNextRail(next: AbstractMinecartEntity, previous: AbstractMinecartEntity): Pair? { + Optional.ofNullable(if (next.passengerList.size >= 1) next.passengerList[0] else null) + .ifPresent { entity: Entity -> + entity.yaw = next.yaw + entity.pitch = next.pitch + entity.prevYaw = next.yaw + entity.prevPitch = next.pitch + } + Optional.ofNullable(if (previous.passengerList.size >= 1) previous.passengerList[0] else null) + .ifPresent { entity: Entity -> + entity.yaw = previous.yaw + entity.pitch = previous.pitch + entity.prevYaw = previous.yaw + entity.prevPitch = previous.pitch + } + val entityPosition = next.blockPos + val finalPosition = previous.blockPos + val state = next.world.getBlockState(next.blockPos) + if (state.block !is AbstractRailBlock) return null + val fuck = + getNeighbors(next.blockPos, state.get((state.block as AbstractRailBlock).shapeProperty)) as List + for (initialPosition in fuck) { + val cache: MutableSet = HashSet() + cache.add(entityPosition) + val distance = MutableDouble(0) + if (step(next.world, cache, initialPosition, finalPosition, distance)) { + return Pair(initialPosition, distance) + } + } + return null + } + + fun getNextVelocity(entityA: AbstractMinecartEntity, entityB: AbstractMinecartEntity): Vec3d { + val pair = getNextRail(entityA, entityB) + val maximumDistance = Math.max( + LinkartDistanceRegistry.INSTANCE.getByKey(entityA.type), + LinkartDistanceRegistry.INSTANCE.getByKey(entityB.type) + ) + if (pair == null && entityA.world.registryKey === entityB.world.registryKey) { + return Vec3d(entityB.x - entityA.x, entityB.y - entityA.y, entityB.z - entityA.z) + } else if (pair == null) { + return entityB.velocity + } + val position = pair.left + var distance = pair.right.value + distance += Math.abs(entityA.x - entityA.blockPos.x - (entityB.x - entityB.blockPos.x)) + distance += Math.abs(entityA.z - entityA.blockPos.z - (entityB.z - entityB.blockPos.z)) + distance += Math.abs(entityA.y - entityA.blockPos.y - (entityB.y - entityB.blockPos.y)) + var velocity = Vec3d.ZERO + if (distance > maximumDistance) { + distance = maximumDistance + if (position.x > entityA.blockPos.x) { + velocity = Vec3d( + velocity.x + LinkartConfigurations.INSTANCE.config.getVelocityMultiplier() * distance, + velocity.y, + velocity.z + ) + } else if (position.x < entityA.blockPos.x) { + velocity = Vec3d( + velocity.x - LinkartConfigurations.INSTANCE.config.getVelocityMultiplier() * distance, + velocity.y, + velocity.z + ) + } + if (position.y > entityA.blockPos.y) { + velocity = Vec3d( + velocity.x, + velocity.y - LinkartConfigurations.INSTANCE.config.getVelocityMultiplier() * distance, + velocity.z + ) + } else if (position.y < entityA.blockPos.y) { + velocity = Vec3d( + velocity.x, + velocity.y + LinkartConfigurations.INSTANCE.config.getVelocityMultiplier() * distance, + velocity.z + ) + } + if (position.z > entityA.blockPos.z) { + velocity = Vec3d( + velocity.x, + velocity.y, + velocity.z + LinkartConfigurations.INSTANCE.config.getVelocityMultiplier() * distance + ) + } else if (position.z < entityA.blockPos.z) { + velocity = Vec3d( + velocity.x, + velocity.y, + velocity.z - LinkartConfigurations.INSTANCE.config.getVelocityMultiplier() * distance + ) + } + } + return velocity + } + + fun step( + world: World, + cache: MutableSet, + currentPosition: BlockPos, + finalPosition: BlockPos, + distance: MutableDouble + ): Boolean { + val state = world.getBlockState(currentPosition) + if (state.block !is AbstractRailBlock) return false + if (currentPosition == finalPosition) return true + cache.add(currentPosition) + val neighbors = + getNeighbors(currentPosition, state.get((state.block as AbstractRailBlock).shapeProperty)) as List + for (neighbor in neighbors) { + if (!cache.contains(neighbor) && step(world, cache, neighbor, finalPosition, distance)) { + return if (distance.value > LinkartConfigurations.INSTANCE.config.getPathfindingDistance()) { + false + } else { + distance.increment() + true + } + } + } + return false + } + + fun getNeighbors(position: BlockPos, shape: RailShape?): Collection { + val neighbors: MutableList = ArrayList() + when (shape) { + RailShape.NORTH_SOUTH -> { + neighbors.add(position.north()) + neighbors.add(position.south()) + neighbors.add(position.north().down()) + neighbors.add(position.south().down()) + } + RailShape.EAST_WEST -> { + neighbors.add(position.west()) + neighbors.add(position.east()) + neighbors.add(position.west().down()) + neighbors.add(position.east().down()) + } + RailShape.ASCENDING_EAST -> { + neighbors.add(position.west().down()) + neighbors.add(position.west()) + neighbors.add(position.east().up()) + } + RailShape.ASCENDING_WEST -> { + neighbors.add(position.west().up()) + neighbors.add(position.east()) + neighbors.add(position.east().down()) + } + RailShape.ASCENDING_NORTH -> { + neighbors.add(position.north().up()) + neighbors.add(position.south()) + neighbors.add(position.south().down()) + } + RailShape.ASCENDING_SOUTH -> { + neighbors.add(position.north().down()) + neighbors.add(position.north()) + neighbors.add(position.south().up()) + } + RailShape.SOUTH_EAST -> { + neighbors.add(position.east()) + neighbors.add(position.south()) + neighbors.add(position.east().down()) + neighbors.add(position.south().down()) + } + RailShape.SOUTH_WEST -> { + neighbors.add(position.west()) + neighbors.add(position.south()) + neighbors.add(position.west().down()) + neighbors.add(position.south().down()) + } + RailShape.NORTH_WEST -> { + neighbors.add(position.west()) + neighbors.add(position.north()) + neighbors.add(position.west().down()) + neighbors.add(position.north().down()) + } + RailShape.NORTH_EAST -> { + neighbors.add(position.east()) + neighbors.add(position.north()) + neighbors.add(position.east().down()) + neighbors.add(position.north().down()) + } + } + return neighbors + } + + fun adjustVelocities(next: AbstractMinecartEntity, previous: AbstractMinecartEntity) { + + + var entityA: AbstractMinecartEntity = next + var entityB: AbstractMinecartEntity = previous + + if (entityA is FurnaceMinecartEntity) { + val temp = entityB + entityB = entityA + entityA = temp + } + + val nextVelocity = RailUtils.getNextVelocity(entityA, entityB) + entityA.velocity = nextVelocity + } + + fun handleTickCommon(entityMixin: AbstractMinecartEntity?, callbackInformation: CallbackInfo?) { + val mixedWorld = (entityMixin as? AbstractMinecartEntity)?.world ?: return + val next = (entityMixin as? AbstractMinecartEntity) ?: return + val accessor = (next as? AbstractMinecartEntityAccessor) ?: return + if (!mixedWorld.isClient) { + if (accessor.previous != null) { + val previous = accessor.previous + RailUtils.adjustVelocities(next, previous) + } + } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/vini2003/linkart/utility/TextUtils.java b/src/main/java/com/github/vini2003/linkart/utility/TextUtils.java old mode 100644 new mode 100755 diff --git a/src/main/resources/assets/linkart/icon.png b/src/main/resources/assets/linkart/icon.png old mode 100644 new mode 100755 index c6d2ebb..26ff4ca Binary files a/src/main/resources/assets/linkart/icon.png and b/src/main/resources/assets/linkart/icon.png differ diff --git a/src/main/resources/assets/linkart/lang/en_us.json b/src/main/resources/assets/linkart/lang/en_us.json old mode 100644 new mode 100755 index b4ec20a..6d3ca4e --- a/src/main/resources/assets/linkart/lang/en_us.json +++ b/src/main/resources/assets/linkart/lang/en_us.json @@ -23,6 +23,5 @@ "text.linkart.message.cart_link_failure_self": "Failed to link carts; cannot link cart with itself!", "text.linkart.message.cart_link_failure_desynchronization": "Failed to link carts on the server; server-side inventory did not contain enough chains!", "text.linkart.message.cart_unlink_success": "Cart at [%s, %s, %s] unlinked as child of [%s, %s, %s]!", - "item.linkart.linker": "Linker", - "item.linkart.chain": "Chain" + "item.linkart.linker": "Linker" } \ No newline at end of file diff --git a/src/main/resources/assets/linkart/models/item/chain.json b/src/main/resources/assets/linkart/models/item/chain.json deleted file mode 100644 index adcf491..0000000 --- a/src/main/resources/assets/linkart/models/item/chain.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "item/generated", - "textures": { - "layer0": "linkart:item/chain" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/linkart/models/item/linker.json b/src/main/resources/assets/linkart/models/item/linker.json old mode 100644 new mode 100755 diff --git a/src/main/resources/assets/linkart/textures/item/chain.png b/src/main/resources/assets/linkart/textures/item/chain.png deleted file mode 100644 index 748c547..0000000 Binary files a/src/main/resources/assets/linkart/textures/item/chain.png and /dev/null differ diff --git a/src/main/resources/assets/linkart/textures/item/linker.png b/src/main/resources/assets/linkart/textures/item/linker.png old mode 100644 new mode 100755 diff --git a/src/main/resources/data/data/tenor/recipes/chain_from_crafting_table.json b/src/main/resources/data/data/tenor/recipes/chain_from_crafting_table.json deleted file mode 100644 index 0072f98..0000000 --- a/src/main/resources/data/data/tenor/recipes/chain_from_crafting_table.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - " 1 ", - "1 1", - " 1 " - ], - "key": { - "1": { - "item": "minecraft:iron_ingot" - } - }, - "result": { - "item": "linkart:chain", - "count": 2 - } -} diff --git a/src/main/resources/data/data/tenor/recipes/chain_from_crafting_table.json.mcmeta b/src/main/resources/data/data/tenor/recipes/chain_from_crafting_table.json.mcmeta deleted file mode 100644 index e38fe7f..0000000 --- a/src/main/resources/data/data/tenor/recipes/chain_from_crafting_table.json.mcmeta +++ /dev/null @@ -1,7 +0,0 @@ -{ - "when": [ - { - "libcd:item_exists": "linkart:chain" - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/data/tenor/recipes/linker_from_crafting_table.json b/src/main/resources/data/linkart/recipes/linker_from_crafting_table.json old mode 100644 new mode 100755 similarity index 100% rename from src/main/resources/data/data/tenor/recipes/linker_from_crafting_table.json rename to src/main/resources/data/linkart/recipes/linker_from_crafting_table.json diff --git a/src/main/resources/data/data/tenor/recipes/linker_from_crafting_table.json.mcmeta b/src/main/resources/data/linkart/recipes/linker_from_crafting_table.json.mcmeta old mode 100644 new mode 100755 similarity index 100% rename from src/main/resources/data/data/tenor/recipes/linker_from_crafting_table.json.mcmeta rename to src/main/resources/data/linkart/recipes/linker_from_crafting_table.json.mcmeta diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json old mode 100644 new mode 100755 index 0248cfb..8e2b060 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -27,8 +27,7 @@ ], "depends": { "fabricloader": ">=0.7.4", - "fabric": "*", - "minecraft": "1.15.x" + "fabric": "*" }, "suggests": { "flamingo": "*" diff --git a/src/main/resources/linkart.mixins.json b/src/main/resources/linkart.mixins.json old mode 100644 new mode 100755 index 0b9e3e1..73aa5d0 --- a/src/main/resources/linkart.mixins.json +++ b/src/main/resources/linkart.mixins.json @@ -2,7 +2,7 @@ "required": true, "minVersion": "0.8", "package": "com.github.vini2003.linkart.mixin", - "compatibilityLevel": "JAVA_8", + "compatibilityLevel": "JAVA_16", "mixins": [ "AbstractMinecartEntityMixin", "EntityMixin",