Fixed weather not triggering serverside

This commit is contained in:
Anuken
2020-05-26 19:59:31 -04:00
parent a375dd3fc2
commit aaf7911735
5 changed files with 7 additions and 13 deletions

View File

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

View File

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

View File

@@ -5,14 +5,14 @@ import arc.func.Prov;
import mindustry.net.Packets.*; import mindustry.net.Packets.*;
public class Registrator{ public class Registrator{
private static ClassEntry[] classes = { private static final ClassEntry[] classes = {
new ClassEntry(StreamBegin.class, StreamBegin::new), new ClassEntry(StreamBegin.class, StreamBegin::new),
new ClassEntry(StreamChunk.class, StreamChunk::new), new ClassEntry(StreamChunk.class, StreamChunk::new),
new ClassEntry(WorldStream.class, WorldStream::new), new ClassEntry(WorldStream.class, WorldStream::new),
new ClassEntry(ConnectPacket.class, ConnectPacket::new), new ClassEntry(ConnectPacket.class, ConnectPacket::new),
new ClassEntry(InvokePacket.class, InvokePacket::new) new ClassEntry(InvokePacket.class, InvokePacket::new)
}; };
private static ObjectIntMap<Class> ids = new ObjectIntMap<>(); private static final ObjectIntMap<Class<?>> ids = new ObjectIntMap<>();
static{ static{
if(classes.length > 127) throw new RuntimeException("Can't have more than 127 registered classes!"); 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; return ContentType.weather;
} }
@Remote @Remote(called = Loc.server)
public static void createWeather(Weather weather, float intensity, float duration){ public static void createWeather(Weather weather, float intensity, float duration){
weather.create(intensity, duration); weather.create(intensity, duration);
} }

View File

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