Fixed weather not triggering serverside
This commit is contained in:
@@ -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()){
|
||||
|
||||
@@ -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(){
|
||||
|
||||
@@ -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!");
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user