mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Obfuscation fixes
This commit is contained in:
parent
9880248e49
commit
0b583bcf80
26633
lint/ChangeLog.txt
26633
lint/ChangeLog.txt
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
912
lint/ZKM_log.txt
912
lint/ZKM_log.txt
File diff suppressed because it is too large
Load Diff
BIN
lint/out/in.jar
BIN
lint/out/in.jar
Binary file not shown.
Binary file not shown.
@ -21,6 +21,9 @@ trimExclude *.Iris and
|
||||
* extends com.volmit.iris.util.MortarCommand and
|
||||
*.* @com.volmit.iris.util.Command * and
|
||||
@com.volmit.iris.gen.post.Post *.* and
|
||||
@org.bukkit.event.EventHandler *.* and
|
||||
*.* @org.bukkit.event.EventHandler * and
|
||||
*.* @org.bukkit.event.EventHandler *(*) and
|
||||
*.* extends com.volmit.iris.util.IrisPostBlockFilter;
|
||||
|
||||
trim deleteSourceFileAttributes=false
|
||||
@ -33,6 +36,9 @@ exclude @com.volmit.iris.util.DontObfuscate *.* and
|
||||
*.* @com.volmit.iris.util.DontObfuscate * and
|
||||
*.* @com.volmit.iris.util.DontObfuscate *(*) and
|
||||
*.Iris and
|
||||
@org.bukkit.event.EventHandler *.* and
|
||||
*.* @org.bukkit.event.EventHandler * and
|
||||
*.* @org.bukkit.event.EventHandler *(*) and
|
||||
public *.^* and
|
||||
*.* public * and
|
||||
*.* protected * and
|
||||
|
@ -17,20 +17,24 @@ import com.volmit.iris.util.BoardProvider;
|
||||
import com.volmit.iris.util.BoardSettings;
|
||||
import com.volmit.iris.util.C;
|
||||
import com.volmit.iris.util.ChronoLatch;
|
||||
import com.volmit.iris.util.DontObfuscate;
|
||||
import com.volmit.iris.util.Form;
|
||||
import com.volmit.iris.util.IrisStructureResult;
|
||||
import com.volmit.iris.util.J;
|
||||
import com.volmit.iris.util.KList;
|
||||
import com.volmit.iris.util.RollingSequence;
|
||||
import com.volmit.iris.util.ScoreDirection;
|
||||
|
||||
public class IrisBoardManager implements BoardProvider, Listener
|
||||
{
|
||||
@DontObfuscate
|
||||
private BoardManager manager;
|
||||
private String mem = "...";
|
||||
public RollingSequence hits = new RollingSequence(20);
|
||||
public RollingSequence tp = new RollingSequence(100);
|
||||
private ChronoLatch cl = new ChronoLatch(1000);
|
||||
|
||||
@DontObfuscate
|
||||
public IrisBoardManager()
|
||||
{
|
||||
Iris.instance.registerListener(this);
|
||||
@ -42,18 +46,29 @@ public class IrisBoardManager implements BoardProvider, Listener
|
||||
//@done
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void on(PlayerChangedWorldEvent e)
|
||||
{
|
||||
J.s(() -> updatePlayer(e.getPlayer()));
|
||||
}
|
||||
|
||||
@DontObfuscate
|
||||
private boolean isIrisWorld(World w)
|
||||
{
|
||||
return (w.getGenerator() instanceof IrisChunkGenerator) && ((IrisChunkGenerator) w.getGenerator()).isDev();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void on(PlayerChangedWorldEvent e)
|
||||
public void updatePlayer(Player p)
|
||||
{
|
||||
if(isIrisWorld(e.getPlayer().getWorld()))
|
||||
if(isIrisWorld(p.getWorld()))
|
||||
{
|
||||
manager.remove(e.getPlayer());
|
||||
manager.setup(e.getPlayer());
|
||||
manager.remove(p);
|
||||
manager.setup(p);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
manager.remove(p);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,6 +78,7 @@ public class IrisBoardManager implements BoardProvider, Listener
|
||||
return C.GREEN + "Iris";
|
||||
}
|
||||
|
||||
@DontObfuscate
|
||||
@Override
|
||||
public List<String> getLines(Player player)
|
||||
{
|
||||
@ -114,6 +130,7 @@ public class IrisBoardManager implements BoardProvider, Listener
|
||||
return v;
|
||||
}
|
||||
|
||||
@DontObfuscate
|
||||
public void disable()
|
||||
{
|
||||
manager.onDisable();
|
||||
|
@ -169,6 +169,7 @@ public class IrisDataManager
|
||||
dimensionLoader.preferFolder(name);
|
||||
generatorLoader.preferFolder(name);
|
||||
structureLoader.preferFolder(name);
|
||||
Iris.info("Preferred Folder: " + name);
|
||||
}
|
||||
|
||||
public void clearLists()
|
||||
|
@ -93,6 +93,7 @@ public abstract class ParallaxChunkGenerator extends TerrainChunkGenerator imple
|
||||
@Override
|
||||
public void onHotload()
|
||||
{
|
||||
getData().preferFolder(getDimension().getLoadFile().getParentFile().getParentFile().getName());
|
||||
super.onHotload();
|
||||
cacheID = RNG.r.simax();
|
||||
}
|
||||
|
@ -179,7 +179,17 @@ public class IrisBiome extends IrisRegistrant implements IRare
|
||||
return null;
|
||||
}
|
||||
|
||||
return Color.getColor(getDebugColor().substring(1));
|
||||
try
|
||||
{
|
||||
return Color.decode(getDebugColor());
|
||||
}
|
||||
|
||||
catch(Throwable e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -11,13 +11,22 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
@DontObfuscate
|
||||
public class BoardManager
|
||||
{
|
||||
@DontObfuscate
|
||||
private final JavaPlugin plugin;
|
||||
|
||||
@DontObfuscate
|
||||
private BoardSettings boardSettings;
|
||||
|
||||
@DontObfuscate
|
||||
private Map<UUID, Board> scoreboards;
|
||||
|
||||
@DontObfuscate
|
||||
private BukkitTask updateTask;
|
||||
|
||||
@DontObfuscate
|
||||
public BoardManager(JavaPlugin plugin, BoardSettings boardSettings)
|
||||
{
|
||||
this.plugin = plugin;
|
||||
@ -27,22 +36,26 @@ public class BoardManager
|
||||
plugin.getServer().getOnlinePlayers().forEach(this::setup);
|
||||
}
|
||||
|
||||
@DontObfuscate
|
||||
public void setBoardSettings(BoardSettings boardSettings)
|
||||
{
|
||||
this.boardSettings = boardSettings;
|
||||
scoreboards.values().forEach(board -> board.setBoardSettings(boardSettings));
|
||||
}
|
||||
|
||||
@DontObfuscate
|
||||
public boolean hasBoard(Player player)
|
||||
{
|
||||
return scoreboards.containsKey(player.getUniqueId());
|
||||
}
|
||||
|
||||
@DontObfuscate
|
||||
public Optional<Board> getBoard(Player player)
|
||||
{
|
||||
return Optional.ofNullable(scoreboards.get(player.getUniqueId()));
|
||||
}
|
||||
|
||||
@DontObfuscate
|
||||
public void setup(Player player)
|
||||
{
|
||||
Optional.ofNullable(scoreboards.remove(player.getUniqueId())).ifPresent(Board::resetScoreboard);
|
||||
@ -53,16 +66,19 @@ public class BoardManager
|
||||
scoreboards.put(player.getUniqueId(), new Board(player, boardSettings));
|
||||
}
|
||||
|
||||
@DontObfuscate
|
||||
public void remove(Player player)
|
||||
{
|
||||
Optional.ofNullable(scoreboards.remove(player.getUniqueId())).ifPresent(Board::remove);
|
||||
}
|
||||
|
||||
@DontObfuscate
|
||||
public Map<UUID, Board> getScoreboards()
|
||||
{
|
||||
return Collections.unmodifiableMap(scoreboards);
|
||||
}
|
||||
|
||||
@DontObfuscate
|
||||
public void onDisable()
|
||||
{
|
||||
updateTask.cancel();
|
||||
|
@ -4,9 +4,12 @@ import java.util.List;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@DontObfuscate
|
||||
public interface BoardProvider
|
||||
{
|
||||
@DontObfuscate
|
||||
String getTitle(Player player);
|
||||
|
||||
@DontObfuscate
|
||||
List<String> getLines(Player player);
|
||||
}
|
||||
|
@ -3,11 +3,14 @@ package com.volmit.iris.util;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@DontObfuscate
|
||||
@Getter
|
||||
@Builder
|
||||
public class BoardSettings
|
||||
{
|
||||
@DontObfuscate
|
||||
private BoardProvider boardProvider;
|
||||
|
||||
@DontObfuscate
|
||||
private ScoreDirection scoreDirection;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RUNTIME)
|
||||
@Target({FIELD, TYPE, CONSTRUCTOR})
|
||||
@Target({FIELD, TYPE, CONSTRUCTOR, METHOD})
|
||||
public @interface DontObfuscate
|
||||
{
|
||||
|
||||
|
@ -160,14 +160,16 @@ public class ResourceLoader<T extends IrisRegistrant>
|
||||
{
|
||||
for(File i : folderCache.copy())
|
||||
{
|
||||
if(i.getParentFile().getName().equals(preferredFolder))
|
||||
if(i.getParentFile().getName().equals(preferredFolder) || i.getParentFile().getParentFile().getName().equals(preferredFolder))
|
||||
{
|
||||
folderCache.remove(i);
|
||||
folderCache.add(0, i);
|
||||
Iris.verbose("Prefering " + i.getPath() + " in the folder cache because we prefer " + preferredFolder);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lock.unlock();
|
||||
|
||||
return folderCache;
|
||||
@ -193,9 +195,11 @@ public class ResourceLoader<T extends IrisRegistrant>
|
||||
|
||||
public void clearCache()
|
||||
{
|
||||
lock.lock();
|
||||
possibleKeys = null;
|
||||
loadCache.clear();
|
||||
folderCache = null;
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
public File fileFor(T b)
|
||||
@ -228,12 +232,15 @@ public class ResourceLoader<T extends IrisRegistrant>
|
||||
|
||||
public void preferFolder(String name)
|
||||
{
|
||||
clearList();
|
||||
preferredFolder = name;
|
||||
}
|
||||
|
||||
public void clearList()
|
||||
{
|
||||
lock.lock();
|
||||
folderCache = null;
|
||||
possibleKeys = null;
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,12 @@ package com.volmit.iris.util;
|
||||
* @author Missionary (missionarymc@gmail.com)
|
||||
* @since 5/31/2018
|
||||
*/
|
||||
public enum ScoreDirection {
|
||||
@DontObfuscate
|
||||
public enum ScoreDirection
|
||||
{
|
||||
@DontObfuscate
|
||||
UP,
|
||||
|
||||
@DontObfuscate
|
||||
DOWN
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user