Removed Logging singleton
This commit is contained in:
@@ -4,7 +4,6 @@ import com.hypixel.hytale.server.core.plugin.JavaPlugin;
|
||||
import com.hypixel.hytale.server.core.plugin.JavaPluginInit;
|
||||
import com.tikaiz.commands.ExampleCommand;
|
||||
import com.tikaiz.components.EndermanTeleportComponent;
|
||||
import com.tikaiz.singletons.LoggerSingleton;
|
||||
import com.tikaiz.systems.AddEndermanTeleportComponentTickSystem;
|
||||
import com.tikaiz.systems.EndermanComponentTickSystem;
|
||||
import com.tikaiz.systems.DamageEventSystem;
|
||||
@@ -15,7 +14,6 @@ public class HytaleDemo extends JavaPlugin {
|
||||
|
||||
public HytaleDemo(@Nonnull JavaPluginInit init) {
|
||||
super(init);
|
||||
LoggerSingleton.getInstance().setHytaleLogger(this.getLogger());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -49,6 +49,6 @@ public class EndermanTeleportComponent implements Component<EntityStore> {
|
||||
}
|
||||
|
||||
public void randomizeTickInterval() {
|
||||
tickInterval = (float) ((Math.random()*5)+25);
|
||||
tickInterval = (float) ((Math.random()*20)+10);
|
||||
}
|
||||
}
|
||||
@@ -22,5 +22,6 @@ public abstract class TeleportHelper {
|
||||
|
||||
Teleport teleportForPlayer = Teleport.createForPlayer(newPos, new Vector3f());
|
||||
commandBuffer.addComponent(ref, Teleport.getComponentType(), teleportForPlayer);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.tikaiz.singletons;
|
||||
|
||||
import com.hypixel.hytale.logger.HytaleLogger;
|
||||
|
||||
public class LoggerSingleton {
|
||||
private HytaleLogger hytaleLogger;
|
||||
private static LoggerSingleton instance;
|
||||
public static LoggerSingleton getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new LoggerSingleton();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
private LoggerSingleton() {
|
||||
}
|
||||
|
||||
public HytaleLogger getHytaleLogger() {
|
||||
return hytaleLogger;
|
||||
}
|
||||
|
||||
public void setHytaleLogger(HytaleLogger hytaleLogger) {
|
||||
this.hytaleLogger = hytaleLogger;
|
||||
}
|
||||
}
|
||||
@@ -3,10 +3,10 @@ package com.tikaiz.systems;
|
||||
import com.hypixel.hytale.component.*;
|
||||
import com.hypixel.hytale.component.query.Query;
|
||||
import com.hypixel.hytale.component.system.tick.EntityTickingSystem;
|
||||
import com.hypixel.hytale.logger.HytaleLogger;
|
||||
import com.hypixel.hytale.server.core.modules.entity.component.DisplayNameComponent;
|
||||
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
|
||||
import com.tikaiz.components.EndermanTeleportComponent;
|
||||
import com.tikaiz.singletons.LoggerSingleton;
|
||||
import org.checkerframework.checker.nullness.compatqual.NonNullDecl;
|
||||
import org.checkerframework.checker.nullness.compatqual.NullableDecl;
|
||||
|
||||
@@ -33,7 +33,7 @@ public class AddEndermanTeleportComponentTickSystem extends EntityTickingSystem<
|
||||
return;
|
||||
}
|
||||
commandBuffer.addComponent(ref, endermanComponentType, new EndermanTeleportComponent());
|
||||
LoggerSingleton.getInstance().getHytaleLogger().at(Level.INFO).log("Added Component to ref: " + displayName);
|
||||
HytaleLogger.getLogger().atInfo().log("Added Component to ref: " + displayName);
|
||||
}
|
||||
|
||||
@NullableDecl
|
||||
|
||||
@@ -3,21 +3,14 @@ package com.tikaiz.systems;
|
||||
import com.hypixel.hytale.component.*;
|
||||
import com.hypixel.hytale.component.query.Query;
|
||||
import com.hypixel.hytale.component.system.EntityEventSystem;
|
||||
import com.hypixel.hytale.math.vector.Vector3d;
|
||||
import com.hypixel.hytale.math.vector.Vector3f;
|
||||
import com.hypixel.hytale.server.core.modules.entity.component.DisplayNameComponent;
|
||||
import com.hypixel.hytale.server.core.modules.entity.component.TransformComponent;
|
||||
import com.hypixel.hytale.server.core.modules.entity.damage.Damage;
|
||||
import com.hypixel.hytale.server.core.modules.entity.teleport.Teleport;
|
||||
import com.hypixel.hytale.server.core.universe.world.ParticleUtil;
|
||||
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
|
||||
import com.hypixel.hytale.server.core.util.NotificationUtil;
|
||||
import com.tikaiz.components.EndermanTeleportComponent;
|
||||
import org.checkerframework.checker.nullness.compatqual.NonNullDecl;
|
||||
import org.checkerframework.checker.nullness.compatqual.NullableDecl;
|
||||
|
||||
import static com.tikaiz.helpers.TeleportHelper.EndermanTeleport;
|
||||
import static com.tikaiz.helpers.TeleportHelper.randomTeleport;
|
||||
|
||||
public class DamageEventSystem extends EntityEventSystem<EntityStore, Damage> {
|
||||
private final ComponentType<EntityStore, EndermanTeleportComponent> endermanTeleportComponentType;
|
||||
|
||||
Reference in New Issue
Block a user