1.16 initial, dependencies, projects.
This commit is contained in:
parent
bd5c8c050d
commit
51c0524d07
|
@ -6,7 +6,7 @@ A Bukkit server implementation utilizing Mixin.
|
||||||
|
|
||||||
| Minecraft | Forge | Status | Build |
|
| Minecraft | Forge | Status | Build |
|
||||||
| :----: | :----: | :---: | :---: |
|
| :----: | :----: | :---: | :---: |
|
||||||
| 1.16.x | - | - | [![1.16 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-16?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-16) |
|
| 1.16.x | 33.0.5 | - | [![1.16 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-16?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-16) |
|
||||||
| 1.15.x | 31.2.30 | ACTIVE | [![1.15 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-15?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-15) |
|
| 1.15.x | 31.2.30 | ACTIVE | [![1.15 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-15?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-15) |
|
||||||
| 1.14.x | 28.2.0 | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/1.0.6) | [![1.14 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight) |
|
| 1.14.x | 28.2.0 | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/1.0.6) | [![1.14 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight) |
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
version: '{branch}-{build}'
|
version: '{branch}-{build}'
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- 1.15
|
- 1.16
|
||||||
environment:
|
environment:
|
||||||
JAVA_HOME: C:\Program Files\Java\jdk1.8.0
|
JAVA_HOME: C:\Program Files\Java\jdk1.8.0
|
||||||
cache:
|
cache:
|
|
@ -20,14 +20,14 @@ apply plugin: 'idea'
|
||||||
apply plugin: 'io.izzel.arclight'
|
apply plugin: 'io.izzel.arclight'
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
minecraftVersion = '1.15.2'
|
minecraftVersion = '1.16.2'
|
||||||
forgeVersion = '31.2.30'
|
forgeVersion = '33.0.5'
|
||||||
}
|
}
|
||||||
|
|
||||||
arclight {
|
arclight {
|
||||||
mcVersion = minecraftVersion
|
mcVersion = minecraftVersion
|
||||||
forgeVersion = project.ext.forgeVersion
|
forgeVersion = project.ext.forgeVersion
|
||||||
bukkitVersion = 'v1_15_R1'
|
bukkitVersion = 'v1_16_R2'
|
||||||
wipeVersion = true
|
wipeVersion = true
|
||||||
reobfVersion = false
|
reobfVersion = false
|
||||||
accessTransformer = project.file('bukkit.at')
|
accessTransformer = project.file('bukkit.at')
|
||||||
|
@ -36,7 +36,7 @@ arclight {
|
||||||
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
|
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
|
||||||
|
|
||||||
minecraft {
|
minecraft {
|
||||||
mappings channel: 'snapshot', version: "20200705-1.15.1"
|
mappings channel: 'snapshot', version: "20200813-1.16.1"
|
||||||
accessTransformer = project.file('src/main/resources/META-INF/accesstransformer.cfg')
|
accessTransformer = project.file('src/main/resources/META-INF/accesstransformer.cfg')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,6 +47,7 @@ repositories {
|
||||||
maven { url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
|
maven { url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
|
||||||
maven { url = 'https://repo.codemc.io/repository/nms/' }
|
maven { url = 'https://repo.codemc.io/repository/nms/' }
|
||||||
maven { url = 'https://files.minecraftforge.net/maven/' }
|
maven { url = 'https://files.minecraftforge.net/maven/' }
|
||||||
|
maven { url = 'https://www.dogforce-games.com/maven/' }
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
@ -57,9 +58,9 @@ dependencies {
|
||||||
compile 'jline:jline:2.12.1'
|
compile 'jline:jline:2.12.1'
|
||||||
compile 'net.md-5:SpecialSource:1.8.6'
|
compile 'net.md-5:SpecialSource:1.8.6'
|
||||||
compile 'org.apache.logging.log4j:log4j-jul:2.11.2'
|
compile 'org.apache.logging.log4j:log4j-jul:2.11.2'
|
||||||
compile 'net.md-5:bungeecord-chat:1.13-SNAPSHOT'
|
compile 'net.md-5:bungeecord-chat:1.16-R0.3'
|
||||||
compile 'mysql:mysql-connector-java:5.1.47'
|
compile 'mysql:mysql-connector-java:5.1.49'
|
||||||
compile 'org.yaml:snakeyaml:1.23'
|
compile 'org.yaml:snakeyaml:1.26'
|
||||||
compile project(':arclight-api')
|
compile project(':arclight-api')
|
||||||
compile project(':i18n-config')
|
compile project(':i18n-config')
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,128 +0,0 @@
|
||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
maven { url = 'https://files.minecraftforge.net/maven' }
|
|
||||||
maven { url = 'https://repo.spongepowered.org/maven' }
|
|
||||||
jcenter()
|
|
||||||
mavenCentral()
|
|
||||||
maven { url = 'https://jitpack.io' }
|
|
||||||
}
|
|
||||||
dependencies {
|
|
||||||
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
|
|
||||||
classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
|
|
||||||
classpath "com.github.ArclightTeam:arclight-gradle-plugin:$agpVersion"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'net.minecraftforge.gradle'
|
|
||||||
apply plugin: 'org.spongepowered.mixin'
|
|
||||||
apply plugin: 'java'
|
|
||||||
apply plugin: 'idea'
|
|
||||||
apply plugin: 'io.izzel.arclight'
|
|
||||||
|
|
||||||
ext {
|
|
||||||
minecraftVersion = '1.15.2'
|
|
||||||
forgeVersion = '31.2.30'
|
|
||||||
}
|
|
||||||
|
|
||||||
arclight {
|
|
||||||
mcVersion = minecraftVersion
|
|
||||||
forgeVersion = project.ext.forgeVersion
|
|
||||||
bukkitVersion = 'v1_15_R1'
|
|
||||||
wipeVersion = true
|
|
||||||
reobfVersion = true
|
|
||||||
accessTransformer = project(':arclight-common').file('bukkit.at')
|
|
||||||
}
|
|
||||||
|
|
||||||
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
|
|
||||||
|
|
||||||
configurations {
|
|
||||||
embed
|
|
||||||
compile.extendsFrom(embed)
|
|
||||||
}
|
|
||||||
|
|
||||||
minecraft {
|
|
||||||
mappings channel: 'snapshot', version: "20200705-1.15.1"
|
|
||||||
accessTransformer = project(':arclight-common').file('src/main/resources/META-INF/accesstransformer.cfg')
|
|
||||||
}
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
jcenter()
|
|
||||||
maven {
|
|
||||||
name = 'sponge-repo'
|
|
||||||
url = 'https://repo.spongepowered.org/maven'
|
|
||||||
}
|
|
||||||
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots/' }
|
|
||||||
maven { url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
|
|
||||||
maven { url = 'https://repo.codemc.io/repository/nms/' }
|
|
||||||
maven { url = 'https://files.minecraftforge.net/maven/' }
|
|
||||||
}
|
|
||||||
|
|
||||||
def embedLibs = ['org.spongepowered:mixin:0.8', 'org.ow2.asm:asm-util:6.2',
|
|
||||||
'org.ow2.asm:asm-analysis:6.2', 'org.yaml:snakeyaml:1.25',
|
|
||||||
'org.xerial:sqlite-jdbc:3.30.1', 'mysql:mysql-connector-java:5.1.48',
|
|
||||||
'commons-lang:commons-lang:2.6', 'com.googlecode.json-simple:json-simple:1.1.1',
|
|
||||||
'org.apache.logging.log4j:log4j-jul:2.11.2', 'net.md-5:SpecialSource:1.8.6',
|
|
||||||
'net.minecraftforge:eventbus:2.0.0-milestone.1:service', 'org.jline:jline-terminal-jansi:3.12.1',
|
|
||||||
'org.fusesource.jansi:jansi:1.18', 'org.jline:jline-terminal:3.12.1',
|
|
||||||
'org.jline:jline-reader:3.12.1', 'jline:jline:2.12.1']
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
minecraft "net.minecraftforge:forge:$minecraftVersion-$forgeVersion"
|
|
||||||
compile group: 'org.jetbrains', name: 'annotations', version: '19.0.0'
|
|
||||||
compile(project(':arclight-common')) {
|
|
||||||
exclude module: 'forge'
|
|
||||||
}
|
|
||||||
embed project(':i18n-config')
|
|
||||||
embed project(':forge-installer')
|
|
||||||
for (def lib : embedLibs) {
|
|
||||||
arclight lib
|
|
||||||
}
|
|
||||||
embed 'net.md-5:bungeecord-chat:1.15-SNAPSHOT@jar'
|
|
||||||
embed "org.spigotmc:spigot-api:$minecraftVersion-R0.1-SNAPSHOT@jar"
|
|
||||||
}
|
|
||||||
|
|
||||||
def getGitHash = { ->
|
|
||||||
def stdout = new ByteArrayOutputStream()
|
|
||||||
exec {
|
|
||||||
commandLine 'git', 'rev-parse', '--short', 'HEAD'
|
|
||||||
standardOutput = stdout
|
|
||||||
}
|
|
||||||
return stdout.toString().trim()
|
|
||||||
}
|
|
||||||
|
|
||||||
processResources {
|
|
||||||
filesMatching("**/mods.toml") {
|
|
||||||
expand 'version': "$minecraftVersion-${project.version}-${getGitHash()}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
jar {
|
|
||||||
manifest.attributes 'MixinConnector': 'io.izzel.arclight.impl.ArclightConnector_1_15'
|
|
||||||
manifest.attributes 'Main-Class': 'io.izzel.arclight.server.Main_1_15'
|
|
||||||
manifest.attributes 'Implementation-Title': 'Arclight'
|
|
||||||
manifest.attributes 'Implementation-Version': "arclight-$minecraftVersion-${project.version}-${getGitHash()}"
|
|
||||||
manifest.attributes 'Implementation-Vendor': 'Arclight Team'
|
|
||||||
manifest.attributes 'Implementation-Timestamp': new Date().format("yyyy-MM-dd HH:mm:ss")
|
|
||||||
from(configurations.embed.collect { it.isDirectory() ? it : zipTree(it) }) {
|
|
||||||
exclude "META-INF/MANIFEST.MF"
|
|
||||||
exclude "META-INF/*.SF"
|
|
||||||
exclude "META-INF/*.DSA"
|
|
||||||
exclude "META-INF/*.RSA"
|
|
||||||
exclude "LICENSE.txt"
|
|
||||||
}
|
|
||||||
from(project(':arclight-common').tasks.jar.outputs.files.collect { it.isDirectory() ? it : zipTree(it) })
|
|
||||||
}
|
|
||||||
|
|
||||||
remapSpigotJar {
|
|
||||||
includes.add('net/minecraft/block/ChestBlock$DoubleInventory')
|
|
||||||
includes.add('net/minecraft/tileentity/LecternTileEntity$LecternInventory')
|
|
||||||
}
|
|
||||||
|
|
||||||
mixin {
|
|
||||||
add sourceSets.main, 'mixins.arclight.impl.refmap.1_15.json'
|
|
||||||
}
|
|
||||||
|
|
||||||
compileJava {
|
|
||||||
options.compilerArgs << '-XDignore.symbol.file' << '-XDenableSunApiLintControl'
|
|
||||||
options.encoding = 'UTF-8'
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
package io.izzel.arclight.impl;
|
|
||||||
|
|
||||||
import io.izzel.arclight.common.mod.ArclightConnector;
|
|
||||||
import io.izzel.arclight.i18n.ArclightConfig;
|
|
||||||
import org.spongepowered.asm.mixin.Mixins;
|
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
public class ArclightConnector_1_15 extends ArclightConnector {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void connect() {
|
|
||||||
super.connect();
|
|
||||||
if (ArclightConfig.spec().getOptimization().isRemoveStream()) {
|
|
||||||
Mixins.addConfiguration("mixins.arclight.impl.optimization.stream.1_15.json");
|
|
||||||
}
|
|
||||||
LOGGER.info("mixin-load.optimization");
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
package io.izzel.arclight.impl;
|
|
||||||
|
|
||||||
import io.izzel.arclight.common.mod.ArclightLocator;
|
|
||||||
import net.minecraftforge.fml.loading.moddiscovery.ModFile;
|
|
||||||
import net.minecraftforge.forgespi.locating.IModFile;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.net.URISyntaxException;
|
|
||||||
|
|
||||||
public class ArclightLocator_1_15 extends ArclightLocator {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected IModFile loadJars() {
|
|
||||||
try {
|
|
||||||
return ModFile.newFMLInstance(new File(ArclightLocator.class.getProtectionDomain().getCodeSource().getLocation().toURI()).toPath(), this);
|
|
||||||
} catch (URISyntaxException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,119 +0,0 @@
|
||||||
package io.izzel.arclight.impl.mixin.v1_15.optimization.stream;
|
|
||||||
|
|
||||||
import net.minecraft.entity.ai.goal.Goal;
|
|
||||||
import net.minecraft.entity.ai.goal.GoalSelector;
|
|
||||||
import net.minecraft.entity.ai.goal.PrioritizedGoal;
|
|
||||||
import net.minecraft.profiler.IProfiler;
|
|
||||||
import org.spongepowered.asm.mixin.Final;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.Overwrite;
|
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
|
||||||
|
|
||||||
import java.util.EnumSet;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
@Mixin(GoalSelector.class)
|
|
||||||
public abstract class GoalSelectorMixin {
|
|
||||||
|
|
||||||
// @formatter:off
|
|
||||||
@Shadow @Final private Set<PrioritizedGoal> goals;
|
|
||||||
@Shadow @Final private IProfiler profiler;
|
|
||||||
@Shadow @Final private EnumSet<Goal.Flag> disabledFlags;
|
|
||||||
@Shadow @Final private Map<Goal.Flag, PrioritizedGoal> flagGoals;
|
|
||||||
@Shadow @Final private static PrioritizedGoal DUMMY;
|
|
||||||
// @formatter:on
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author IzzelAliz
|
|
||||||
* @reason
|
|
||||||
*/
|
|
||||||
@Overwrite
|
|
||||||
public void removeGoal(Goal task) {
|
|
||||||
for (PrioritizedGoal p_220882_1_ : this.goals) {
|
|
||||||
if (p_220882_1_.getGoal() == task) {
|
|
||||||
if (p_220882_1_.isRunning()) {
|
|
||||||
p_220882_1_.resetTask();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.goals.removeIf((p_220884_1_) -> {
|
|
||||||
return p_220884_1_.getGoal() == task;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author IzzelAliz
|
|
||||||
* @reason
|
|
||||||
*/
|
|
||||||
@Overwrite
|
|
||||||
public void tick() {
|
|
||||||
this.profiler.startSection("goalCleanup");
|
|
||||||
for (PrioritizedGoal p_220881_1_ : this.goals) {
|
|
||||||
if (p_220881_1_.isRunning()) {
|
|
||||||
EnumSet<Goal.Flag> flags = this.disabledFlags;
|
|
||||||
boolean b = false;
|
|
||||||
for (Goal.Flag flag : p_220881_1_.getMutexFlags()) {
|
|
||||||
if (flags.contains(flag)) {
|
|
||||||
b = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (b) {
|
|
||||||
p_220881_1_.resetTask();
|
|
||||||
} else if (!p_220881_1_.isRunning() || !p_220881_1_.shouldContinueExecuting()) {
|
|
||||||
p_220881_1_.resetTask();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (Map.Entry<Goal.Flag, PrioritizedGoal> entry : this.flagGoals.entrySet()) {
|
|
||||||
Goal.Flag p_220885_1_ = entry.getKey();
|
|
||||||
PrioritizedGoal p_220885_2_ = entry.getValue();
|
|
||||||
if (!p_220885_2_.isRunning()) {
|
|
||||||
this.flagGoals.remove(p_220885_1_);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
this.profiler.endSection();
|
|
||||||
this.profiler.startSection("goalUpdate");
|
|
||||||
for (PrioritizedGoal p_220883_0_ : this.goals) {
|
|
||||||
if (!p_220883_0_.isRunning()) {
|
|
||||||
EnumSet<Goal.Flag> flags = this.disabledFlags;
|
|
||||||
boolean b = true;
|
|
||||||
for (Goal.Flag flag : p_220883_0_.getMutexFlags()) {
|
|
||||||
if (flags.contains(flag)) {
|
|
||||||
b = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (b) {
|
|
||||||
boolean result = true;
|
|
||||||
for (Goal.Flag p_220887_2_ : p_220883_0_.getMutexFlags()) {
|
|
||||||
if (!this.flagGoals.getOrDefault(p_220887_2_, DUMMY).isPreemptedBy(p_220883_0_)) {
|
|
||||||
result = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (result) {
|
|
||||||
if (p_220883_0_.shouldExecute()) {
|
|
||||||
for (Goal.Flag p_220876_2_ : p_220883_0_.getMutexFlags()) {
|
|
||||||
PrioritizedGoal prioritizedgoal = this.flagGoals.getOrDefault(p_220876_2_, DUMMY);
|
|
||||||
prioritizedgoal.resetTask();
|
|
||||||
this.flagGoals.put(p_220876_2_, p_220883_0_);
|
|
||||||
}
|
|
||||||
p_220883_0_.startExecuting();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.profiler.endSection();
|
|
||||||
this.profiler.startSection("goalTick");
|
|
||||||
for (PrioritizedGoal goal : this.goals) {
|
|
||||||
if (goal.isRunning()) {
|
|
||||||
goal.tick();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.profiler.endSection();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,162 +0,0 @@
|
||||||
package io.izzel.arclight.impl.mixin.v1_15.optimization.stream;
|
|
||||||
|
|
||||||
import net.minecraft.entity.MobEntity;
|
|
||||||
import net.minecraft.pathfinding.FlaggedPathPoint;
|
|
||||||
import net.minecraft.pathfinding.NodeProcessor;
|
|
||||||
import net.minecraft.pathfinding.Path;
|
|
||||||
import net.minecraft.pathfinding.PathFinder;
|
|
||||||
import net.minecraft.pathfinding.PathHeap;
|
|
||||||
import net.minecraft.pathfinding.PathPoint;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.Region;
|
|
||||||
import org.spongepowered.asm.mixin.Final;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.Overwrite;
|
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
@Mixin(PathFinder.class)
|
|
||||||
public abstract class PathFinderMixin {
|
|
||||||
|
|
||||||
// @formatter:off
|
|
||||||
@Shadow protected abstract float func_224776_a(PathPoint p_224776_1_, Set<FlaggedPathPoint> p_224776_2_);
|
|
||||||
@Shadow @Final private PathHeap path;
|
|
||||||
@Shadow @Final private Set<PathPoint> closedSet;
|
|
||||||
@Shadow @Final private int field_215751_d;
|
|
||||||
@Shadow @Final private NodeProcessor nodeProcessor;
|
|
||||||
@Shadow @Final private PathPoint[] pathOptions;
|
|
||||||
@Shadow protected abstract Path func_224780_a(PathPoint p_224780_1_, BlockPos p_224780_2_, boolean p_224780_3_);
|
|
||||||
// @formatter:on
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author IzzelAliz
|
|
||||||
* @reason
|
|
||||||
*/
|
|
||||||
@Overwrite
|
|
||||||
@Nullable
|
|
||||||
public Path func_227478_a_(Region p_227478_1_, MobEntity p_227478_2_, Set<BlockPos> p_227478_3_, float p_227478_4_, int p_227478_5_, float p_227478_6_) {
|
|
||||||
this.path.clearPath();
|
|
||||||
this.nodeProcessor.func_225578_a_(p_227478_1_, p_227478_2_);
|
|
||||||
PathPoint pathpoint = this.nodeProcessor.getStart();
|
|
||||||
Map<FlaggedPathPoint, BlockPos> map = new HashMap<>();
|
|
||||||
for (BlockPos p_224782_1_ : p_227478_3_) {
|
|
||||||
if (map.put(this.nodeProcessor.func_224768_a(p_224782_1_.getX(), p_224782_1_.getY(), p_224782_1_.getZ()), p_224782_1_) != null) {
|
|
||||||
throw new IllegalStateException("Duplicate key");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Path path = this.func_227479_a_(pathpoint, map, p_227478_4_, p_227478_5_, p_227478_6_);
|
|
||||||
this.nodeProcessor.postProcess();
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author IzzelAliz
|
|
||||||
* @reason
|
|
||||||
*/
|
|
||||||
@Overwrite
|
|
||||||
@Nullable
|
|
||||||
private Path func_227479_a_(PathPoint p_227479_1_, Map<FlaggedPathPoint, BlockPos> p_227479_2_, float p_227479_3_, int p_227479_4_, float p_227479_5_) {
|
|
||||||
Set<FlaggedPathPoint> set = p_227479_2_.keySet();
|
|
||||||
p_227479_1_.totalPathDistance = 0.0F;
|
|
||||||
p_227479_1_.distanceToNext = this.func_224776_a(p_227479_1_, set);
|
|
||||||
p_227479_1_.distanceToTarget = p_227479_1_.distanceToNext;
|
|
||||||
this.path.clearPath();
|
|
||||||
this.closedSet.clear();
|
|
||||||
this.path.addPoint(p_227479_1_);
|
|
||||||
int i = 0;
|
|
||||||
int j = (int) ((float) this.field_215751_d * p_227479_5_);
|
|
||||||
|
|
||||||
while (!this.path.isPathEmpty()) {
|
|
||||||
++i;
|
|
||||||
if (i >= j) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
PathPoint pathpoint = this.path.dequeue();
|
|
||||||
pathpoint.visited = true;
|
|
||||||
for (FlaggedPathPoint p_224781_2_ : set) {
|
|
||||||
if (pathpoint.func_224757_c(p_224781_2_) <= (float) p_227479_4_) {
|
|
||||||
p_224781_2_.func_224764_e();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
boolean b = false;
|
|
||||||
for (FlaggedPathPoint flaggedPathPoint : set) {
|
|
||||||
if (flaggedPathPoint.func_224762_f()) {
|
|
||||||
b = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (b) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(pathpoint.distanceTo(p_227479_1_) >= p_227479_3_)) {
|
|
||||||
int k = this.nodeProcessor.func_222859_a(this.pathOptions, pathpoint);
|
|
||||||
|
|
||||||
for (int l = 0; l < k; ++l) {
|
|
||||||
PathPoint pathpoint1 = this.pathOptions[l];
|
|
||||||
float f = pathpoint.distanceTo(pathpoint1);
|
|
||||||
pathpoint1.field_222861_j = pathpoint.field_222861_j + f;
|
|
||||||
float f1 = pathpoint.totalPathDistance + f + pathpoint1.costMalus;
|
|
||||||
if (pathpoint1.field_222861_j < p_227479_3_ && (!pathpoint1.isAssigned() || f1 < pathpoint1.totalPathDistance)) {
|
|
||||||
pathpoint1.previous = pathpoint;
|
|
||||||
pathpoint1.totalPathDistance = f1;
|
|
||||||
pathpoint1.distanceToNext = this.func_224776_a(pathpoint1, set) * 1.5F;
|
|
||||||
if (pathpoint1.isAssigned()) {
|
|
||||||
this.path.changeDistance(pathpoint1, pathpoint1.totalPathDistance + pathpoint1.distanceToNext);
|
|
||||||
} else {
|
|
||||||
pathpoint1.distanceToTarget = pathpoint1.totalPathDistance + pathpoint1.distanceToNext;
|
|
||||||
this.path.addPoint(pathpoint1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Optional<Path> optional;
|
|
||||||
if (set.stream().anyMatch(FlaggedPathPoint::func_224762_f)) {
|
|
||||||
List<Path> toSort = new ArrayList<>();
|
|
||||||
for (FlaggedPathPoint p_224778_2_ : set) {
|
|
||||||
if (p_224778_2_.func_224762_f()) {
|
|
||||||
Path func_224780_a = this.func_224780_a(p_224778_2_.func_224763_d(), p_227479_2_.get(p_224778_2_), true);
|
|
||||||
toSort.add(func_224780_a);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
toSort.sort(Comparator.comparingInt(Path::getCurrentPathLength));
|
|
||||||
Optional<Path> found = Optional.empty();
|
|
||||||
for (Path func_224780_a : toSort) {
|
|
||||||
found = Optional.of(func_224780_a);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
optional = found;
|
|
||||||
} else {
|
|
||||||
List<Path> toSort = new ArrayList<>();
|
|
||||||
for (FlaggedPathPoint p_224777_2_ : set) {
|
|
||||||
Path func_224780_a = this.func_224780_a(p_224777_2_.func_224763_d(), p_227479_2_.get(p_224777_2_), false);
|
|
||||||
toSort.add(func_224780_a);
|
|
||||||
}
|
|
||||||
toSort.sort(Comparator.comparingDouble(Path::func_224769_l).thenComparingInt(Path::getCurrentPathLength));
|
|
||||||
Optional<Path> found = Optional.empty();
|
|
||||||
for (Path func_224780_a : toSort) {
|
|
||||||
found = Optional.of(func_224780_a);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
optional = found;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!optional.isPresent()) {
|
|
||||||
return null;
|
|
||||||
} else {
|
|
||||||
Path path = optional.get();
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
package io.izzel.arclight.server;
|
|
||||||
|
|
||||||
import io.izzel.arclight.api.ArclightVersion;
|
|
||||||
import io.izzel.arclight.common.ArclightMain;
|
|
||||||
import io.izzel.arclight.forgeinstaller.ForgeInstaller;
|
|
||||||
|
|
||||||
public class Main_1_15 extends ArclightMain {
|
|
||||||
|
|
||||||
public static void main(String[] args) throws Throwable {
|
|
||||||
new Main_1_15().run(args);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void afterSetup() throws Throwable {
|
|
||||||
ArclightVersion.setVersion(ArclightVersion.v1_15);
|
|
||||||
ForgeInstaller.install();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
modLoader="javafml"
|
|
||||||
loaderVersion="[24,]"
|
|
||||||
|
|
||||||
[[mods]]
|
|
||||||
modId="arclight"
|
|
||||||
version="${version}"
|
|
||||||
displayName="Arclight Mod"
|
|
||||||
credits="IzzelAliz,lona"
|
|
||||||
authors="IzzelAliz,lona"
|
|
||||||
description='''
|
|
||||||
Arclight bukkit layer for MinecraftForge
|
|
||||||
'''
|
|
|
@ -1 +0,0 @@
|
||||||
io.izzel.arclight.impl.ArclightLocator_1_15
|
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"minVersion": "0.8",
|
|
||||||
"package": "io.izzel.arclight.impl.mixin.v1_15.optimization.stream",
|
|
||||||
"target": "@env(DEFAULT)",
|
|
||||||
"refmap": "mixins.arclight.impl.refmap.1_15.json",
|
|
||||||
"mixins": [
|
|
||||||
"GoalSelectorMixin",
|
|
||||||
"PathFinderMixin"
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
"pack": {
|
|
||||||
"description": "Arclight resources",
|
|
||||||
"pack_format": 4
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -2,6 +2,6 @@ rootProject.name = 'arclight'
|
||||||
include 'arclight-common'
|
include 'arclight-common'
|
||||||
include 'forge-installer'
|
include 'forge-installer'
|
||||||
include 'arclight-api'
|
include 'arclight-api'
|
||||||
include 'arclight-forge-1.15'
|
include 'arclight-forge-1.16'
|
||||||
include 'i18n-config'
|
include 'i18n-config'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user