mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-06-29 19:46:42 +00:00
Fixed /dtoggle
Apparantly LibsDisguises does not support plugin reloading. Now switched back to OxLemonxO's method, using a modified LibsDisguises method
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
package me.totalfreedom.totalfreedommod.bridge;
|
||||
|
||||
import me.libraryaddict.disguise.DisallowedDisguises;
|
||||
import me.libraryaddict.disguise.LibsDisguises;
|
||||
import me.libraryaddict.disguise.DisguiseAPI;
|
||||
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||
@ -49,6 +50,7 @@ public class LibsDisguisesBridge extends FreedomService
|
||||
FLog.severe(ex);
|
||||
}
|
||||
}
|
||||
|
||||
return libsDisguisesPlugin;
|
||||
}
|
||||
|
||||
@ -98,25 +100,28 @@ public class LibsDisguisesBridge extends FreedomService
|
||||
}
|
||||
}
|
||||
|
||||
public boolean setPluginEnabled(boolean enabled)
|
||||
public void setDisguisesEnabled(boolean state)
|
||||
{
|
||||
Plugin ld = getLibsDisguisesPlugin();
|
||||
final LibsDisguises libsDisguises = getLibsDisguisesPlugin();
|
||||
|
||||
if (ld == null)
|
||||
if (libsDisguises == null)
|
||||
{
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (enabled)
|
||||
if (state)
|
||||
{
|
||||
server.getPluginManager().enablePlugin(ld);
|
||||
DisguiseAPI.enableDisguises();
|
||||
}
|
||||
else
|
||||
{
|
||||
server.getPluginManager().disablePlugin(ld);
|
||||
DisguiseAPI.disableDisguises();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
public boolean isDisguisesEnabled()
|
||||
{
|
||||
return !DisallowedDisguises.disabled;
|
||||
}
|
||||
|
||||
public boolean isPluginEnabled()
|
||||
|
Reference in New Issue
Block a user