Merge branch 'master' of https://github.com/Anuken/Mindustry into 7.0-features
This commit is contained in:
@@ -13,7 +13,6 @@ import com.android.dx.dex.cf.*;
|
|||||||
import com.android.dx.dex.file.DexFile;
|
import com.android.dx.dex.file.DexFile;
|
||||||
import com.android.dx.merge.*;
|
import com.android.dx.merge.*;
|
||||||
import dalvik.system.*;
|
import dalvik.system.*;
|
||||||
import mindustry.*;
|
|
||||||
import mindustry.mod.*;
|
import mindustry.mod.*;
|
||||||
import rhino.*;
|
import rhino.*;
|
||||||
|
|
||||||
@@ -67,9 +66,6 @@ public class AndroidRhinoContext{
|
|||||||
protected Context makeContext(){
|
protected Context makeContext(){
|
||||||
Context ctx = super.makeContext();
|
Context ctx = super.makeContext();
|
||||||
ctx.setClassShutter(Scripts::allowClass);
|
ctx.setClassShutter(Scripts::allowClass);
|
||||||
if(Vars.mods != null){
|
|
||||||
ctx.setApplicationClassLoader(Vars.mods.mainLoader());
|
|
||||||
}
|
|
||||||
return ctx;
|
return ctx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import arc.math.*;
|
|||||||
import arc.struct.*;
|
import arc.struct.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import arc.util.serialization.*;
|
import arc.util.serialization.*;
|
||||||
import mindustry.*;
|
|
||||||
import mindustry.mod.*;
|
import mindustry.mod.*;
|
||||||
import mindustry.net.*;
|
import mindustry.net.*;
|
||||||
import mindustry.net.Net.*;
|
import mindustry.net.Net.*;
|
||||||
@@ -85,9 +84,6 @@ public interface Platform{
|
|||||||
protected Context makeContext(){
|
protected Context makeContext(){
|
||||||
Context ctx = super.makeContext();
|
Context ctx = super.makeContext();
|
||||||
ctx.setClassShutter(Scripts::allowClass);
|
ctx.setClassShutter(Scripts::allowClass);
|
||||||
if(Vars.mods != null){
|
|
||||||
ctx.setApplicationClassLoader(Vars.mods.mainLoader());
|
|
||||||
}
|
|
||||||
return ctx;
|
return ctx;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,7 +4,12 @@ import arc.struct.*;
|
|||||||
|
|
||||||
public class ModClassLoader extends ClassLoader{
|
public class ModClassLoader extends ClassLoader{
|
||||||
private Seq<ClassLoader> children = new Seq<>();
|
private Seq<ClassLoader> children = new Seq<>();
|
||||||
private volatile boolean inChild = false;
|
private ThreadLocal<Boolean> inChild = new ThreadLocal<>(){
|
||||||
|
@Override
|
||||||
|
protected Boolean initialValue(){
|
||||||
|
return Boolean.FALSE;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
public void addChild(ClassLoader child){
|
public void addChild(ClassLoader child){
|
||||||
children.add(child);
|
children.add(child);
|
||||||
@@ -13,21 +18,25 @@ public class ModClassLoader extends ClassLoader{
|
|||||||
@Override
|
@Override
|
||||||
protected Class<?> findClass(String name) throws ClassNotFoundException{
|
protected Class<?> findClass(String name) throws ClassNotFoundException{
|
||||||
//a child may try to delegate class loading to its parent, which is *this class loader* - do not let that happen
|
//a child may try to delegate class loading to its parent, which is *this class loader* - do not let that happen
|
||||||
if(inChild) throw new ClassNotFoundException(name);
|
if(inChild.get()){
|
||||||
|
inChild.set(false);
|
||||||
|
throw new ClassNotFoundException(name);
|
||||||
|
}
|
||||||
|
|
||||||
ClassNotFoundException last = null;
|
ClassNotFoundException last = null;
|
||||||
int size = children.size;
|
int size = children.size;
|
||||||
|
|
||||||
|
inChild.set(true);
|
||||||
//if it doesn't exist in the main class loader, try all the children
|
//if it doesn't exist in the main class loader, try all the children
|
||||||
for(int i = 0; i < size; i++){
|
for(int i = 0; i < size; i++){
|
||||||
try{
|
try{
|
||||||
inChild = true;
|
return children.get(i).loadClass(name);
|
||||||
var out = children.get(i).loadClass(name);
|
|
||||||
inChild = false;
|
|
||||||
return out;
|
|
||||||
}catch(ClassNotFoundException e){
|
}catch(ClassNotFoundException e){
|
||||||
last = e;
|
last = e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
inChild.set(false);
|
||||||
|
|
||||||
throw (last == null ? new ClassNotFoundException(name) : last);
|
throw (last == null ? new ClassNotFoundException(name) : last);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,8 @@ public class ImpactReactor extends PowerGenerator{
|
|||||||
hasItems = true;
|
hasItems = true;
|
||||||
outputsPower = consumesPower = true;
|
outputsPower = consumesPower = true;
|
||||||
flags = EnumSet.of(BlockFlag.reactor, BlockFlag.generator);
|
flags = EnumSet.of(BlockFlag.reactor, BlockFlag.generator);
|
||||||
|
lightRadius = 115f;
|
||||||
|
emitLight = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ public class DrawSmelter extends DrawBlock{
|
|||||||
@Override
|
@Override
|
||||||
public void load(Block block){
|
public void load(Block block){
|
||||||
top = Core.atlas.find(block.name + "-top");
|
top = Core.atlas.find(block.name + "-top");
|
||||||
|
block.clipSize = Math.max(block.clipSize, (lightRadius + lightSinMag) * 2f * block.size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user