Bugfixes
This commit is contained in:
@@ -324,8 +324,6 @@ project(":tools"){
|
|||||||
implementation arcModule("natives:natives-freetype-desktop")
|
implementation arcModule("natives:natives-freetype-desktop")
|
||||||
implementation arcModule("natives:natives-box2d-desktop")
|
implementation arcModule("natives:natives-box2d-desktop")
|
||||||
implementation arcModule("backends:backend-headless")
|
implementation arcModule("backends:backend-headless")
|
||||||
|
|
||||||
implementation "org.reflections:reflections:0.9.11"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -30,11 +30,73 @@ const extend = function(classType, params){
|
|||||||
const newEffect = (lifetime, renderer) => new Effects.Effect(lifetime, new Effects.EffectRenderer({render: renderer}))
|
const newEffect = (lifetime, renderer) => new Effects.Effect(lifetime, new Effects.EffectRenderer({render: renderer}))
|
||||||
Call = Packages.mindustry.gen.Call
|
Call = Packages.mindustry.gen.Call
|
||||||
|
|
||||||
importPackage(Packages.arc.graphics.g2d)
|
importPackage(Packages.mindustry.maps)
|
||||||
|
importPackage(Packages.mindustry.world.blocks.production)
|
||||||
|
importPackage(Packages.mindustry.graphics.g3d)
|
||||||
|
importPackage(Packages.mindustry.ai.types)
|
||||||
|
importPackage(Packages.mindustry.world.draw)
|
||||||
|
importPackage(Packages.mindustry.game)
|
||||||
|
importPackage(Packages.mindustry.logic)
|
||||||
|
importPackage(Packages.mindustry.entities.comp)
|
||||||
|
importPackage(Packages.mindustry.world.blocks.sandbox)
|
||||||
|
importPackage(Packages.mindustry.world.consumers)
|
||||||
|
importPackage(Packages.mindustry.type)
|
||||||
|
importPackage(Packages.mindustry.maps.filters)
|
||||||
|
importPackage(Packages.arc.struct)
|
||||||
|
importPackage(Packages.mindustry.world.meta.values)
|
||||||
|
importPackage(Packages.mindustry.world.blocks.distribution)
|
||||||
|
importPackage(Packages.mindustry.ui.dialogs)
|
||||||
importPackage(Packages.mindustry.gen)
|
importPackage(Packages.mindustry.gen)
|
||||||
|
importPackage(Packages.mindustry.graphics)
|
||||||
|
importPackage(Packages.arc.scene.ui)
|
||||||
|
importPackage(Packages.mindustry.ai)
|
||||||
|
importPackage(Packages.mindustry.content)
|
||||||
|
importPackage(Packages.mindustry.ctype)
|
||||||
|
importPackage(Packages.arc.scene.event)
|
||||||
|
importPackage(Packages.mindustry.entities.bullet)
|
||||||
|
importPackage(Packages.arc.math.geom)
|
||||||
|
importPackage(Packages.mindustry.ui)
|
||||||
|
importPackage(Packages.mindustry.ai.formations)
|
||||||
|
importPackage(Packages.arc.func)
|
||||||
|
importPackage(Packages.mindustry.ui.fragments)
|
||||||
|
importPackage(Packages.mindustry.world.blocks.units)
|
||||||
|
importPackage(Packages.mindustry.world.modules)
|
||||||
|
importPackage(Packages.mindustry.world.blocks.power)
|
||||||
|
importPackage(Packages.arc.scene.utils)
|
||||||
|
importPackage(Packages.mindustry.entities)
|
||||||
|
importPackage(Packages.mindustry.audio)
|
||||||
importPackage(Packages.arc.math)
|
importPackage(Packages.arc.math)
|
||||||
importPackage(Packages.arc.graphics)
|
importPackage(Packages.arc.scene.ui.layout)
|
||||||
|
importPackage(Packages.arc.scene.actions)
|
||||||
|
importPackage(Packages.arc.scene.style)
|
||||||
|
importPackage(Packages.mindustry.world.blocks.defense.turrets)
|
||||||
|
importPackage(Packages.mindustry.core)
|
||||||
|
importPackage(Packages.arc.scene)
|
||||||
|
importPackage(Packages.mindustry.entities.units)
|
||||||
|
importPackage(Packages.mindustry.world.blocks.defense)
|
||||||
|
importPackage(Packages.mindustry.world)
|
||||||
|
importPackage(Packages.mindustry.world.blocks)
|
||||||
|
importPackage(Packages.mindustry.editor)
|
||||||
|
importPackage(Packages.mindustry.world.blocks.storage)
|
||||||
|
importPackage(Packages.mindustry.world.blocks.environment)
|
||||||
|
importPackage(Packages.mindustry.async)
|
||||||
|
importPackage(Packages.mindustry.maps.planet)
|
||||||
|
importPackage(Packages.mindustry.world.blocks.liquid)
|
||||||
|
importPackage(Packages.mindustry.ai.formations.patterns)
|
||||||
|
importPackage(Packages.mindustry.ui.layout)
|
||||||
|
importPackage(Packages.mindustry.input)
|
||||||
|
importPackage(Packages.mindustry.world.blocks.legacy)
|
||||||
|
importPackage(Packages.mindustry.entities.abilities)
|
||||||
|
importPackage(Packages.mindustry)
|
||||||
|
importPackage(Packages.mindustry.world.meta)
|
||||||
|
importPackage(Packages.mindustry.world.blocks.experimental)
|
||||||
|
importPackage(Packages.mindustry.world.blocks.payloads)
|
||||||
|
importPackage(Packages.mindustry.maps.generators)
|
||||||
|
importPackage(Packages.arc.graphics.g2d)
|
||||||
importPackage(Packages.arc.util)
|
importPackage(Packages.arc.util)
|
||||||
|
importPackage(Packages.mindustry.world.blocks.campaign)
|
||||||
|
importPackage(Packages.arc.graphics)
|
||||||
|
importPackage(Packages.mindustry.world.producers)
|
||||||
importPackage(Packages.arc)
|
importPackage(Packages.arc)
|
||||||
const PlayerIpUnbanEvent = Packages.mindustry.game.EventType.PlayerIpUnbanEvent
|
const PlayerIpUnbanEvent = Packages.mindustry.game.EventType.PlayerIpUnbanEvent
|
||||||
const PlayerIpBanEvent = Packages.mindustry.game.EventType.PlayerIpBanEvent
|
const PlayerIpBanEvent = Packages.mindustry.game.EventType.PlayerIpBanEvent
|
||||||
|
|||||||
@@ -24,11 +24,12 @@ public class Shaders{
|
|||||||
public static PlanetShader planet;
|
public static PlanetShader planet;
|
||||||
public static PlanetGridShader planetGrid;
|
public static PlanetGridShader planetGrid;
|
||||||
public static AtmosphereShader atmosphere;
|
public static AtmosphereShader atmosphere;
|
||||||
public static MeshShader mesh = new MeshShader();
|
public static MeshShader mesh;
|
||||||
public static Shader unlit;
|
public static Shader unlit;
|
||||||
public static Shader screenspace;
|
public static Shader screenspace;
|
||||||
|
|
||||||
public static void init(){
|
public static void init(){
|
||||||
|
mesh = new MeshShader();
|
||||||
blockbuild = new BlockBuild();
|
blockbuild = new BlockBuild();
|
||||||
try{
|
try{
|
||||||
shield = new ShieldShader();
|
shield = new ShieldShader();
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public abstract class LegacySaveVersion extends SaveVersion{
|
|||||||
readChunk(stream, true, in -> {
|
readChunk(stream, true, in -> {
|
||||||
byte version = in.readByte();
|
byte version = in.readByte();
|
||||||
//legacy impl of Building#read()
|
//legacy impl of Building#read()
|
||||||
tile.build.health(stream.readUnsignedShort());
|
tile.build.health = stream.readUnsignedShort();
|
||||||
byte packedrot = stream.readByte();
|
byte packedrot = stream.readByte();
|
||||||
byte team = Pack.leftByte(packedrot) == 8 ? stream.readByte() : Pack.leftByte(packedrot);
|
byte team = Pack.leftByte(packedrot) == 8 ? stream.readByte() : Pack.leftByte(packedrot);
|
||||||
byte rotation = Pack.rightByte(packedrot);
|
byte rotation = Pack.rightByte(packedrot);
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ package mindustry.maps;
|
|||||||
import arc.*;
|
import arc.*;
|
||||||
import arc.assets.*;
|
import arc.assets.*;
|
||||||
import arc.assets.loaders.*;
|
import arc.assets.loaders.*;
|
||||||
import arc.struct.*;
|
|
||||||
import arc.struct.IntSet.*;
|
|
||||||
import arc.files.*;
|
import arc.files.*;
|
||||||
import arc.func.*;
|
import arc.func.*;
|
||||||
import arc.graphics.*;
|
import arc.graphics.*;
|
||||||
|
import arc.struct.IntSet.*;
|
||||||
|
import arc.struct.*;
|
||||||
import arc.util.ArcAnnotate.*;
|
import arc.util.ArcAnnotate.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import arc.util.async.*;
|
import arc.util.async.*;
|
||||||
@@ -15,7 +15,7 @@ import arc.util.io.*;
|
|||||||
import arc.util.serialization.*;
|
import arc.util.serialization.*;
|
||||||
import mindustry.*;
|
import mindustry.*;
|
||||||
import mindustry.content.*;
|
import mindustry.content.*;
|
||||||
import mindustry.ctype.*;
|
import mindustry.core.*;
|
||||||
import mindustry.game.EventType.*;
|
import mindustry.game.EventType.*;
|
||||||
import mindustry.game.*;
|
import mindustry.game.*;
|
||||||
import mindustry.io.*;
|
import mindustry.io.*;
|
||||||
@@ -87,7 +87,7 @@ public class Maps{
|
|||||||
});
|
});
|
||||||
|
|
||||||
if(Core.assets != null){
|
if(Core.assets != null){
|
||||||
((CustomLoader) Core.assets.getLoader(Content.class)).loaded = this::createAllPreviews;
|
((CustomLoader)Core.assets.getLoader(ContentLoader.class)).loaded = this::createAllPreviews;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ public class BuildBlock extends Block{
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean construct(Unitc builder, @Nullable Building core, float amount, boolean configured){
|
public boolean construct(Unit builder, @Nullable Building core, float amount, boolean configured){
|
||||||
if(cblock == null){
|
if(cblock == null){
|
||||||
kill();
|
kill();
|
||||||
return false;
|
return false;
|
||||||
@@ -211,10 +211,10 @@ public class BuildBlock extends Block{
|
|||||||
maxProgress = core == null || team.rules().infiniteResources ? maxProgress : checkRequired(core.items, maxProgress, true);
|
maxProgress = core == null || team.rules().infiniteResources ? maxProgress : checkRequired(core.items, maxProgress, true);
|
||||||
|
|
||||||
progress = Mathf.clamp(progress + maxProgress);
|
progress = Mathf.clamp(progress + maxProgress);
|
||||||
builderID = builder.id();
|
builderID = builder.id;
|
||||||
|
|
||||||
if(progress >= 1f || state.rules.infiniteResources){
|
if(progress >= 1f || state.rules.infiniteResources){
|
||||||
constructed(tile, cblock, builderID, (byte)rotation, builder.team(), configured);
|
constructed(tile, cblock, builderID, (byte)rotation, builder.team, configured);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ public class OverdriveProjector extends Block{
|
|||||||
phaseHeat = Mathf.lerpDelta(phaseHeat, Mathf.num(cons.optionalValid()), 0.1f);
|
phaseHeat = Mathf.lerpDelta(phaseHeat, Mathf.num(cons.optionalValid()), 0.1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(timer(timerUse, useTime) && efficiency() > 0){
|
if(timer(timerUse, useTime) && efficiency() > 0 && consValid()){
|
||||||
consume();
|
consume();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -395,6 +395,7 @@ public abstract class Turret extends Block{
|
|||||||
@Override
|
@Override
|
||||||
public void read(Reads read, byte revision){
|
public void read(Reads read, byte revision){
|
||||||
super.read(read, revision);
|
super.read(read, revision);
|
||||||
|
|
||||||
if(revision == 1){
|
if(revision == 1){
|
||||||
reload = read.f();
|
reload = read.f();
|
||||||
rotation = read.f();
|
rotation = read.f();
|
||||||
|
|||||||
@@ -1,22 +1,19 @@
|
|||||||
package mindustry.tools;
|
package mindustry.tools;
|
||||||
|
|
||||||
import arc.*;
|
import arc.*;
|
||||||
import arc.struct.Seq;
|
|
||||||
import arc.struct.*;
|
|
||||||
import arc.files.*;
|
import arc.files.*;
|
||||||
import arc.graphics.*;
|
import arc.graphics.*;
|
||||||
import arc.graphics.g2d.*;
|
import arc.graphics.g2d.*;
|
||||||
import arc.graphics.g2d.TextureAtlas.*;
|
import arc.graphics.g2d.TextureAtlas.*;
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
|
import arc.struct.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.game.*;
|
import mindustry.game.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import org.reflections.*;
|
|
||||||
import org.reflections.scanners.*;
|
|
||||||
import org.reflections.util.*;
|
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.lang.reflect.*;
|
import java.lang.reflect.*;
|
||||||
|
import java.net.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
public class ScriptStubGenerator{
|
public class ScriptStubGenerator{
|
||||||
@@ -31,23 +28,13 @@ public class ScriptStubGenerator{
|
|||||||
DataInputStream.class, DataOutputStream.class, Integer.class, Float.class, Double.class, Long.class, Boolean.class, Short.class, Byte.class, Character.class);
|
DataInputStream.class, DataOutputStream.class, Integer.class, Float.class, Double.class, Long.class, Boolean.class, Short.class, Byte.class, Character.class);
|
||||||
Seq<String> nopackage = Seq.with("java.lang", "java");
|
Seq<String> nopackage = Seq.with("java.lang", "java");
|
||||||
|
|
||||||
List<ClassLoader> classLoadersList = new LinkedList<>();
|
Seq<Class<?>> classes = Seq.withArrays(
|
||||||
classLoadersList.add(ClasspathHelper.contextClassLoader());
|
getClasses("mindustry"),
|
||||||
classLoadersList.add(ClasspathHelper.staticClassLoader());
|
getClasses("arc.func"),
|
||||||
|
getClasses("arc.struct"),
|
||||||
Reflections reflections = new Reflections(new ConfigurationBuilder()
|
getClasses("arc.scene"),
|
||||||
.setScanners(new SubTypesScanner(false), new ResourcesScanner())
|
getClasses("arc.math")
|
||||||
.setUrls(ClasspathHelper.forClassLoader(classLoadersList.toArray(new ClassLoader[0])))
|
);
|
||||||
.filterInputsBy(new FilterBuilder()
|
|
||||||
.include(FilterBuilder.prefix("mindustry"))
|
|
||||||
.include(FilterBuilder.prefix("arc.func"))
|
|
||||||
.include(FilterBuilder.prefix("arc.struct"))
|
|
||||||
.include(FilterBuilder.prefix("arc.scene"))
|
|
||||||
.include(FilterBuilder.prefix("arc.math"))
|
|
||||||
));
|
|
||||||
|
|
||||||
Seq<Class<?>> classes = Seq.with(reflections.getSubTypesOf(Object.class));
|
|
||||||
classes.addAll(reflections.getSubTypesOf(Enum.class));
|
|
||||||
classes.addAll(whitelist);
|
classes.addAll(whitelist);
|
||||||
classes.sort(Structs.comparing(Class::getName));
|
classes.sort(Structs.comparing(Class::getName));
|
||||||
|
|
||||||
@@ -72,4 +59,35 @@ public class ScriptStubGenerator{
|
|||||||
|
|
||||||
new Fi("core/assets/scripts/global.js").writeString(result.toString());
|
new Fi("core/assets/scripts/global.js").writeString(result.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static Seq<Class> getClasses(String packageName) throws Exception{
|
||||||
|
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
|
||||||
|
Seq<File> dirs = new Seq<>();
|
||||||
|
|
||||||
|
for(URL resource : Collections.list(classLoader.getResources(packageName.replace('.', '/')))){
|
||||||
|
dirs.add(new File(resource.getFile()));
|
||||||
|
}
|
||||||
|
|
||||||
|
Seq<Class> classes = new Seq<>();
|
||||||
|
for(File directory : dirs){
|
||||||
|
classes.addAll(findClasses(directory, packageName));
|
||||||
|
}
|
||||||
|
return classes;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Seq<Class> findClasses(File directory, String packageName) throws Exception{
|
||||||
|
Seq<Class> classes = new Seq<>();
|
||||||
|
if(!directory.exists()) return classes;
|
||||||
|
|
||||||
|
File[] files = directory.listFiles();
|
||||||
|
for(File file : files){
|
||||||
|
if(file.isDirectory()){
|
||||||
|
classes.addAll(findClasses(file, packageName + "." + file.getName()));
|
||||||
|
}else if(file.getName().endsWith(".class")){
|
||||||
|
classes.add(Class.forName(packageName + '.' + file.getName().substring(0, file.getName().length() - 6), false, Thread.currentThread().getContextClassLoader()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return classes;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user