This commit is contained in:
Anuken
2020-08-22 09:00:55 -04:00
parent 467d995aed
commit c1cd27b9da
5 changed files with 65 additions and 55 deletions
+2
View File
@@ -998,10 +998,12 @@ public class Blocks implements ContentList{
payloadConveyor = new PayloadConveyor("payload-conveyor"){{ payloadConveyor = new PayloadConveyor("payload-conveyor"){{
requirements(Category.distribution, with(Items.graphite, 10, Items.copper, 20)); requirements(Category.distribution, with(Items.graphite, 10, Items.copper, 20));
canOverdrive = false;
}}; }};
payloadRouter = new PayloadRouter("payload-router"){{ payloadRouter = new PayloadRouter("payload-router"){{
requirements(Category.distribution, with(Items.graphite, 15, Items.copper, 20)); requirements(Category.distribution, with(Items.graphite, 15, Items.copper, 20));
canOverdrive = false;
}}; }};
//endregion //endregion
@@ -1094,6 +1094,7 @@ public class UnitTypes implements ContentList{
hitsize = 0f; hitsize = 0f;
health = 1; health = 1;
rotateSpeed = 360f; rotateSpeed = 360f;
itemCapacity = 0;
} }
@Override @Override
@@ -167,6 +167,10 @@ public class ContentLoader{
} }
public void handleContent(Content content){ public void handleContent(Content content){
if(content instanceof Item && content.id > 127){
throw new IllegalArgumentException("You may not have more than 127 different items total. Remove some mods.");
}
this.lastAdded = content; this.lastAdded = content;
contentMap[content.getContentType().ordinal()].add(content); contentMap[content.getContentType().ordinal()].add(content);
} }
+1 -7
View File
@@ -852,13 +852,7 @@ public class MobileInput extends InputHandler implements GestureListener{
//pathfind for ground units //pathfind for ground units
if(!flying && !type.canBoost && !(unit instanceof WaterMovec)){ if(!flying && !type.canBoost && !(unit instanceof WaterMovec)){
Tile on = unit.tileOn(); movement.set(targetPos).sub(unit).limit(speed);
if(on != null && !on.solid()){
Tile to = pathfinder.getTargetTile(unit.tileOn(), unit.team, targetPos);
if(to != null){
movement.set(to).sub(unit).setLength(speed);
}
}
} }
if(player.within(targetPos, attractDst)){ if(player.within(targetPos, attractDst)){
+10 -1
View File
@@ -588,7 +588,10 @@ public class Mods implements Loadable{
private LoadedMod loadMod(Fi sourceFile) throws Exception{ private LoadedMod loadMod(Fi sourceFile) throws Exception{
Time.mark(); Time.mark();
Fi zip = sourceFile.isDirectory() ? sourceFile : new ZipFi(sourceFile); ZipFi rootZip = null;
try{
Fi zip = sourceFile.isDirectory() ? sourceFile : (rootZip = new ZipFi(sourceFile));
if(zip.list().length == 1 && zip.list()[0].isDirectory()){ if(zip.list().length == 1 && zip.list()[0].isDirectory()){
zip = zip.list()[0]; zip = zip.list()[0];
} }
@@ -641,6 +644,12 @@ public class Mods implements Loadable{
Log.info("Loaded mod '@' in @", meta.name, Time.elapsed()); Log.info("Loaded mod '@' in @", meta.name, Time.elapsed());
return new LoadedMod(sourceFile, zip, mainMod, meta); return new LoadedMod(sourceFile, zip, mainMod, meta);
}catch(Exception e){
//delete root zip file so it can be closed on windows
if(rootZip != null) rootZip.delete();
throw e;
}
} }
/** Represents a mod's state. May be a jar file, folder or zip. */ /** Represents a mod's state. May be a jar file, folder or zip. */