this is necessary again

This commit is contained in:
Anuken 2020-05-26 19:59:31 -04:00
parent a375dd3fc2
commit da2a8aaf26
8 changed files with 29 additions and 19 deletions

View File

@ -392,6 +392,15 @@ public class Control implements ApplicationListener, Loadable{
public void init(){
platform.updateRPC();
//just a regular reminder
if(!OS.prop("user.name").equals("anuke") && !OS.hasEnv("iknowwhatimdoing")){
if(mobile){
ui.showInfo("[scarlet]6.0 doesn't work on mobile.[] Don't play it.");
}else{
ui.showInfo("[scarlet]6.0 is not supposed to be played.[] Go do something else.");
}
}
//play tutorial on stop
if(!settings.getBool("playedtutorial", false)){
Core.app.post(() -> Core.app.post(this::playTutorial));

View File

@ -33,10 +33,6 @@ import static mindustry.Vars.*;
public class Logic implements ApplicationListener{
public Logic(){
Events.on(WorldLoadEvent.class, event -> {
//TODO remove later
//Weathers.snow.create();
});
Events.on(WaveEvent.class, event -> {
if(state.isCampaign()){

View File

@ -14,7 +14,7 @@ public abstract class Content implements Comparable<Content>, Disposable{
public Content(){
this.id = (short) Vars.content.getBy(getContentType()).size;
this.id = (short)Vars.content.getBy(getContentType()).size;
Vars.content.handleContent(this);
}
@ -25,15 +25,13 @@ public abstract class Content implements Comparable<Content>, Disposable{
public abstract ContentType getContentType();
/** Called after all content and modules are created. Do not use to load regions or texture data! */
public void init(){
}
public void init(){}
/**
* Called after all content is created, only on non-headless versions.
* Use for loading regions or other image data.
*/
public void load(){
}
public void load(){}
/** @return whether an error ocurred during mod loading. */
public boolean hasErrored(){

View File

@ -1,6 +1,6 @@
package mindustry.editor;
import mindustry.annotations.Annotations.Struct;
import mindustry.annotations.Annotations.*;
import arc.struct.LongArray;
import mindustry.game.Team;
import mindustry.gen.TileOp;

View File

@ -7,11 +7,13 @@ import mindustry.annotations.Annotations.*;
import mindustry.content.*;
import mindustry.entities.*;
import mindustry.gen.*;
import mindustry.type.*;
import mindustry.world.blocks.environment.*;
@Component
abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc{
@Import float x, y, elevation;
@Import UnitType type;
transient Leg[] legs = {};
transient float totalLength;
@ -22,12 +24,12 @@ abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc{
//keep elevation halfway
elevation = 0.5f;
int count = type().legCount;
float legLength = type().legLength;
int count = type.legCount;
float legLength = type.legLength;
float rotation = vel().angle();
//set up initial leg positions
if(legs.length != type().legCount){
if(legs.length != type.legCount){
this.legs = new Leg[count];
float spacing = 360f / count;
@ -42,7 +44,7 @@ abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc{
}
}
float moveSpeed = type().legSpeed;
float moveSpeed = type.legSpeed;
int div = Math.max(legs.length / 2, 2);
float moveSpace = legLength / 1.6f / (div / 2f);
@ -62,6 +64,11 @@ abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc{
}else{
Fx.unitLandSmall.at(l.base.x, l.base.y, 0.5f, floor.mapColor);
}
//shake when legs contact ground
if(type.landShake > 0){
Effects.shake(type.landShake, type.landShake, this);
}
}
}
@ -69,7 +76,7 @@ abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc{
}
float movespace = 360f / legs.length / 4f;
float trns = vel().len() * 12.5f * div/1.5f * type().legTrns;
float trns = vel().len() * 12.5f * div/1.5f * type.legTrns;
Tmp.v4.trns(rotation, trns);

View File

@ -5,14 +5,14 @@ import arc.func.Prov;
import mindustry.net.Packets.*;
public class Registrator{
private static ClassEntry[] classes = {
private static final ClassEntry[] classes = {
new ClassEntry(StreamBegin.class, StreamBegin::new),
new ClassEntry(StreamChunk.class, StreamChunk::new),
new ClassEntry(WorldStream.class, WorldStream::new),
new ClassEntry(ConnectPacket.class, ConnectPacket::new),
new ClassEntry(InvokePacket.class, InvokePacket::new)
};
private static ObjectIntMap<Class> ids = new ObjectIntMap<>();
private static final ObjectIntMap<Class<?>> ids = new ObjectIntMap<>();
static{
if(classes.length > 127) throw new RuntimeException("Can't have more than 127 registered classes!");

View File

@ -71,7 +71,7 @@ public abstract class Weather extends MappableContent{
return ContentType.weather;
}
@Remote
@Remote(called = Loc.server)
public static void createWeather(Weather weather, float intensity, float duration){
weather.create(intensity, duration);
}

View File

@ -1,3 +1,3 @@
org.gradle.daemon=true
org.gradle.jvmargs=-Xms256m -Xmx1024m
archash=c8cdb44c30f50d0350c403547ad25532ad77c465
archash=edaf52e6768e0c24cc4598de8105d07a6c66efd8