diff --git a/.gitignore b/.gitignore index 82a4bca..f4d0773 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,5 @@ build eclipse run -*.bytelog* \ No newline at end of file +*.bytelog* +logs diff --git a/.travis.yml b/.travis.yml-disabled similarity index 100% rename from .travis.yml rename to .travis.yml-disabled diff --git a/README.md b/README.md index 4a9772c..dc556ce 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ -# Fast Log Block [![Build Status](https://travis-ci.org/LionZXY/FastLogBlock.svg?branch=master)](https://travis-ci.org/LionZXY/FastLogBlock) [![codecov](https://codecov.io/gh/LionZXY/FastLogBlock/branch/master/graph/badge.svg)](https://codecov.io/gh/LionZXY/FastLogBlock) +# Fast Log Block - Server Side Version -This is minecraft mod for easy and fast logging block place and break. +This is server-side only Minecraft Forge mod for easy and fast logging block place and break. + +## How to use: +Simply type /blocklog when looking at a block to see the block's history. ## Event multithread handling ![](https://image.ibb.co/hyaPRw/Fast_Log_Block.png) diff --git a/build.gradle b/build.gradle index 173c147..756fd3c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,38 +1,30 @@ buildscript { repositories { + maven { url = 'https://files.minecraftforge.net/maven' } jcenter() - maven { url = "http://files.minecraftforge.net/maven" } + mavenCentral() } dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT' + classpath 'net.minecraftforge.gradle:ForgeGradle:3.+' } } +repositories { + mavenCentral() +} apply plugin: 'java' apply plugin: 'jacoco' -apply plugin: 'net.minecraftforge.gradle.forge' -//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. - +apply plugin: 'net.minecraftforge.gradle' version = "1.0.3" -group = "ru.lionzxy.fastlogblock" // http://maven.apache.org/guides/mini/guide-naming-conventions.html -archivesBaseName = "FastLogBlock" +group = "club.moddedminecraft.fastlogblockserver" +archivesBaseName = "FastLogBlockServer" -sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. compileJava { sourceCompatibility = targetCompatibility = '1.8' } minecraft { - version = "1.12.2-14.23.1.2555" - runDir = "run" - - // the mappings can be changed at any time, and must be in the following format. - // snapshot_YYYYMMDD snapshot are built nightly. - // stable_# stables are built at the discretion of the MCP team. - // Use non-default mappings at your own risk. they may not always work. - // simply re-run your setup task after changing the mappings to update your workspace. - mappings = "snapshot_20171003" - // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. + mappings channel: 'snapshot', version: '20171003-1.12' } configurations { @@ -41,9 +33,11 @@ configurations { } dependencies { + minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2854' + + embed "jline:jline:2.14.6" embed "trove:trove:1.0.2" - // https://mvnrepository.com/artifact/org.mapdb/thread-weaver testCompile 'junit:junit:4.12' testCompile "org.mapdb:thread-weaver:3.0.mapdb" } @@ -56,25 +50,6 @@ jacocoTestReport { } } -processResources { - // this will ensure that this task is redone when the versions change. - inputs.property "version", project.version - inputs.property "mcversion", project.minecraft.version - - // replace stuff in mcmod.info, nothing else - from(sourceSets.main.resources.srcDirs) { - include 'mcmod.info' - - // replace version and mcversion - expand 'version': project.version, 'mcversion': project.minecraft.version - } - - // copy everything else except the mcmod.info - from(sourceSets.main.resources.srcDirs) { - exclude 'mcmod.info' - } -} - jar { from configurations.embed.collect { it.isDirectory() ? it : zipTree(it) } } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 758de96..7a3265e 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1495fe3..a106e6e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ -#Sun Jan 26 20:15:46 MSK 2020 -distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-all.zip +#Thu May 21 01:32:57 EDT 2020 +distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStorePath=wrapper/dists diff --git a/gradlew.bat b/gradlew.bat index f955316..aec9973 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,84 +1,90 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/src/main/java/club/moddedminecraft/fastlogblockserver/FastLogBlockServer.java b/src/main/java/club/moddedminecraft/fastlogblockserver/FastLogBlockServer.java new file mode 100644 index 0000000..cbf90d3 --- /dev/null +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/FastLogBlockServer.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ + +package club.moddedminecraft.fastlogblockserver; + +import club.moddedminecraft.fastlogblockserver.handlers.EventHandlingManager; +import club.moddedminecraft.fastlogblockserver.ui.InfoCommand; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.FMLLog; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.common.Mod.EventHandler; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import net.minecraftforge.fml.common.event.FMLServerStartingEvent; +import net.minecraftforge.fml.common.event.FMLServerStoppedEvent; + +import java.io.IOException; + +@Mod(modid = FastLogBlockServer.MODID, version = FastLogBlockServer.VERSION, updateJSON = "https://raw.githubusercontent.com/LionZXY/FastLogBlock/master/update.json", serverSideOnly = true, acceptableRemoteVersions = "*") +public class FastLogBlockServer { + public static final String MODID = "fastlogblockserver"; + public static final String VERSION = "1.1.0"; + private EventHandlingManager eventHandlingManager; + + @EventHandler + public void preInit(FMLPreInitializationEvent event) throws IOException { + FMLLog.log.info("Initializing eventHandlingManager..."); + eventHandlingManager = new EventHandlingManager(); + FMLLog.log.info("Done!"); + MinecraftForge.EVENT_BUS.register(eventHandlingManager); + MinecraftForge.EVENT_BUS.register(this); + } + + @Mod.EventHandler + public void serverStarting(FMLServerStartingEvent event) { + event.registerServerCommand(new InfoCommand(eventHandlingManager)); + } + + @EventHandler + public void serverStopped(final FMLServerStoppedEvent event) { + eventHandlingManager.stop(); + } +} diff --git a/src/main/java/ru/lionzxy/fastlogblock/config/LogConfig.java b/src/main/java/club/moddedminecraft/fastlogblockserver/config/LogConfig.java similarity index 64% rename from src/main/java/ru/lionzxy/fastlogblock/config/LogConfig.java rename to src/main/java/club/moddedminecraft/fastlogblockserver/config/LogConfig.java index 3ba1bc4..d4fcd21 100644 --- a/src/main/java/ru/lionzxy/fastlogblock/config/LogConfig.java +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/config/LogConfig.java @@ -1,15 +1,34 @@ -package ru.lionzxy.fastlogblock.config; +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ +package club.moddedminecraft.fastlogblockserver.config; + +import club.moddedminecraft.fastlogblockserver.FastLogBlockServer; +import club.moddedminecraft.fastlogblockserver.io.filesplitter.FileSplitterEnum; import net.minecraftforge.common.config.Config; import net.minecraftforge.common.config.ConfigManager; import net.minecraftforge.fml.client.event.ConfigChangedEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import ru.lionzxy.fastlogblock.FastLogBlock; -import ru.lionzxy.fastlogblock.io.filesplitter.FileSplitterEnum; -@Config(modid = FastLogBlock.MODID) +@Config(modid = FastLogBlockServer.MODID) @Config.LangKey("fastlogblock.config.title") public class LogConfig { @Config.Comment("Enable handling event") @@ -40,7 +59,7 @@ public static class HashConfig { public final String fileNamePattern = "part%d.bytelog"; } - @Mod.EventBusSubscriber(modid = FastLogBlock.MODID) + @Mod.EventBusSubscriber(modid = FastLogBlockServer.MODID) private static class EventHandler { /** @@ -50,8 +69,8 @@ private static class EventHandler { */ @SubscribeEvent public static void onConfigChanged(final ConfigChangedEvent.OnConfigChangedEvent event) { - if (event.getModID().equals(FastLogBlock.MODID)) { - ConfigManager.sync(FastLogBlock.MODID, Config.Type.INSTANCE); + if (event.getModID().equals(FastLogBlockServer.MODID)) { + ConfigManager.sync(FastLogBlockServer.MODID, Config.Type.INSTANCE); } } } diff --git a/src/main/java/ru/lionzxy/fastlogblock/handlers/EventHandlingManager.java b/src/main/java/club/moddedminecraft/fastlogblockserver/handlers/EventHandlingManager.java similarity index 64% rename from src/main/java/ru/lionzxy/fastlogblock/handlers/EventHandlingManager.java rename to src/main/java/club/moddedminecraft/fastlogblockserver/handlers/EventHandlingManager.java index 79748d6..b23362c 100644 --- a/src/main/java/ru/lionzxy/fastlogblock/handlers/EventHandlingManager.java +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/handlers/EventHandlingManager.java @@ -1,20 +1,41 @@ -package ru.lionzxy.fastlogblock.handlers; +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ +package club.moddedminecraft.fastlogblockserver.handlers; + +import club.moddedminecraft.fastlogblockserver.FastLogBlockServer; +import club.moddedminecraft.fastlogblockserver.config.LogConfig; +import club.moddedminecraft.fastlogblockserver.io.ReadRunnable; +import club.moddedminecraft.fastlogblockserver.models.BlockChangeEventModel; +import club.moddedminecraft.fastlogblockserver.models.BlockChangeEventModelWithWorld; +import club.moddedminecraft.fastlogblockserver.models.FindTask; +import club.moddedminecraft.fastlogblockserver.models.FindTaskResult; +import club.moddedminecraft.fastlogblockserver.utils.TranslationUtils; +import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.util.text.translation.I18n; import net.minecraft.world.World; import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.fml.common.FMLLog; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; -import ru.lionzxy.fastlogblock.config.LogConfig; -import ru.lionzxy.fastlogblock.io.ReadRunnable; -import ru.lionzxy.fastlogblock.models.BlockChangeEventModel; -import ru.lionzxy.fastlogblock.models.BlockChangeEventModelWithWorld; -import ru.lionzxy.fastlogblock.models.FindTask; -import ru.lionzxy.fastlogblock.models.FindTaskResult; import java.io.IOException; import java.text.SimpleDateFormat; @@ -59,10 +80,11 @@ public void flushUIWait(TickEvent.ServerTickEvent event) { for (BlockChangeEventModel blockEvent : findTaskResult.getBlockChangeEventModels()) { notifyAboutEvent(blockEvent, findTaskResult.getEntityPlayer()); } + EntityPlayer sender = findTaskResult.getEntityPlayer(); if (findTaskResult.getBlockChangeEventModels().isEmpty()) { - findTaskResult.getEntityPlayer().sendMessage(new TextComponentTranslation("message.fastlogblock:blockinfo.event.empty")); + sender.sendMessage(TranslationUtils.createComponentTranslation(sender, "message.fastlogblock:blockinfo.event.empty")); } else { - findTaskResult.getEntityPlayer().sendMessage(new TextComponentTranslation("message.fastlogblock:blockinfo.event.done")); + sender.sendMessage(TranslationUtils.createComponentTranslation(sender, "message.fastlogblock:blockinfo.event.done")); } } } @@ -92,19 +114,19 @@ private void notifyAboutEvent(BlockChangeEventModel blockEvent, EntityPlayer ent } else { nickname = playerEvent.getDisplayNameString(); } + String block = entityPlayer.getEntityWorld().getBlockState(blockEvent.getBlockPos()).getBlock().getLocalizedName(); final String[] args = new String[]{new SimpleDateFormat(dateformat).format(new Date(blockEvent.getTimestamp().getTime())), nickname, - blockEvent.getNameblock().toString()}; - TextComponentTranslation textComponent; + block + }; switch (blockEvent.getBlockChangeType()) { default: case INSERT: - textComponent = new TextComponentTranslation("message.fastlogblock:blockinfo.event.insert", (Object[]) args); + entityPlayer.sendMessage(TranslationUtils.createComponentTranslation(entityPlayer, "message.fastlogblock:blockinfo.event.insert", (Object []) args)); break; case REMOVE: - textComponent = new TextComponentTranslation("message.fastlogblock:blockinfo.event.remove", (Object[]) args); + entityPlayer.sendMessage(TranslationUtils.createComponentTranslation(entityPlayer, "message.fastlogblock:blockinfo.event.remove", (Object []) args)); } - entityPlayer.sendMessage(textComponent); } diff --git a/src/main/java/ru/lionzxy/fastlogblock/handlers/SplitterRunnable.java b/src/main/java/club/moddedminecraft/fastlogblockserver/handlers/SplitterRunnable.java similarity index 67% rename from src/main/java/ru/lionzxy/fastlogblock/handlers/SplitterRunnable.java rename to src/main/java/club/moddedminecraft/fastlogblockserver/handlers/SplitterRunnable.java index 4d1f15b..d6c7bc7 100644 --- a/src/main/java/ru/lionzxy/fastlogblock/handlers/SplitterRunnable.java +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/handlers/SplitterRunnable.java @@ -1,15 +1,34 @@ -package ru.lionzxy.fastlogblock.handlers; - +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ + +package club.moddedminecraft.fastlogblockserver.handlers; + +import club.moddedminecraft.fastlogblockserver.config.LogConfig; +import club.moddedminecraft.fastlogblockserver.io.ReadRunnable; +import club.moddedminecraft.fastlogblockserver.io.WriteRunnable; +import club.moddedminecraft.fastlogblockserver.io.filesplitter.IFileSplitter; +import club.moddedminecraft.fastlogblockserver.io.filesplitter.impl.BlockHashFileSplitter; +import club.moddedminecraft.fastlogblockserver.io.filesplitter.impl.SingleFileSplitter; +import club.moddedminecraft.fastlogblockserver.io.mappers.BlockMapper; +import club.moddedminecraft.fastlogblockserver.io.mappers.NickMapper; +import club.moddedminecraft.fastlogblockserver.models.BlockChangeEventModelWithWorld; import net.minecraftforge.fml.common.FMLLog; -import ru.lionzxy.fastlogblock.config.LogConfig; -import ru.lionzxy.fastlogblock.io.ReadRunnable; -import ru.lionzxy.fastlogblock.io.WriteRunnable; -import ru.lionzxy.fastlogblock.io.filesplitter.IFileSplitter; -import ru.lionzxy.fastlogblock.io.filesplitter.impl.BlockHashFileSplitter; -import ru.lionzxy.fastlogblock.io.filesplitter.impl.SingleFileSplitter; -import ru.lionzxy.fastlogblock.io.mappers.BlockMapper; -import ru.lionzxy.fastlogblock.io.mappers.NickMapper; -import ru.lionzxy.fastlogblock.models.BlockChangeEventModelWithWorld; import java.io.File; import java.io.IOException; diff --git a/src/main/java/ru/lionzxy/fastlogblock/io/ReadRunnable.java b/src/main/java/club/moddedminecraft/fastlogblockserver/io/ReadRunnable.java similarity index 60% rename from src/main/java/ru/lionzxy/fastlogblock/io/ReadRunnable.java rename to src/main/java/club/moddedminecraft/fastlogblockserver/io/ReadRunnable.java index 26e299a..9ade52e 100644 --- a/src/main/java/ru/lionzxy/fastlogblock/io/ReadRunnable.java +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/io/ReadRunnable.java @@ -1,12 +1,31 @@ -package ru.lionzxy.fastlogblock.io; +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ +package club.moddedminecraft.fastlogblockserver.io; + +import club.moddedminecraft.fastlogblockserver.io.filesplitter.IFileSplitter; +import club.moddedminecraft.fastlogblockserver.io.log.LogReader; +import club.moddedminecraft.fastlogblockserver.io.mappers.BlockMapper; +import club.moddedminecraft.fastlogblockserver.io.mappers.NickMapper; +import club.moddedminecraft.fastlogblockserver.models.BlockChangeEventModel; +import club.moddedminecraft.fastlogblockserver.models.FindTask; import net.minecraftforge.fml.common.FMLLog; -import ru.lionzxy.fastlogblock.io.filesplitter.IFileSplitter; -import ru.lionzxy.fastlogblock.io.log.LogReader; -import ru.lionzxy.fastlogblock.io.mappers.BlockMapper; -import ru.lionzxy.fastlogblock.io.mappers.NickMapper; -import ru.lionzxy.fastlogblock.models.BlockChangeEventModel; -import ru.lionzxy.fastlogblock.models.FindTask; import java.io.File; import java.util.List; diff --git a/src/main/java/ru/lionzxy/fastlogblock/io/WriteRunnable.java b/src/main/java/club/moddedminecraft/fastlogblockserver/io/WriteRunnable.java similarity index 68% rename from src/main/java/ru/lionzxy/fastlogblock/io/WriteRunnable.java rename to src/main/java/club/moddedminecraft/fastlogblockserver/io/WriteRunnable.java index 69267a6..478917c 100644 --- a/src/main/java/ru/lionzxy/fastlogblock/io/WriteRunnable.java +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/io/WriteRunnable.java @@ -1,11 +1,30 @@ -package ru.lionzxy.fastlogblock.io; +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ +package club.moddedminecraft.fastlogblockserver.io; + +import club.moddedminecraft.fastlogblockserver.io.filesplitter.IFileSplitter; +import club.moddedminecraft.fastlogblockserver.io.log.LogWritter; +import club.moddedminecraft.fastlogblockserver.io.mappers.BlockMapper; +import club.moddedminecraft.fastlogblockserver.io.mappers.NickMapper; +import club.moddedminecraft.fastlogblockserver.models.BlockChangeEventModelWithWorld; import net.minecraftforge.fml.common.FMLLog; -import ru.lionzxy.fastlogblock.io.filesplitter.IFileSplitter; -import ru.lionzxy.fastlogblock.io.log.LogWritter; -import ru.lionzxy.fastlogblock.io.mappers.BlockMapper; -import ru.lionzxy.fastlogblock.io.mappers.NickMapper; -import ru.lionzxy.fastlogblock.models.BlockChangeEventModelWithWorld; import java.io.File; import java.io.IOException; diff --git a/src/main/java/ru/lionzxy/fastlogblock/io/base/IterrateByteFile.java b/src/main/java/club/moddedminecraft/fastlogblockserver/io/base/IterrateByteFile.java similarity index 74% rename from src/main/java/ru/lionzxy/fastlogblock/io/base/IterrateByteFile.java rename to src/main/java/club/moddedminecraft/fastlogblockserver/io/base/IterrateByteFile.java index 6ec2858..b16bdca 100644 --- a/src/main/java/ru/lionzxy/fastlogblock/io/base/IterrateByteFile.java +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/io/base/IterrateByteFile.java @@ -1,8 +1,27 @@ -package ru.lionzxy.fastlogblock.io.base; - +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ + +package club.moddedminecraft.fastlogblockserver.io.base; + +import club.moddedminecraft.fastlogblockserver.utils.FileUtils; import gnu.trove.list.array.TByteArrayList; import net.minecraftforge.fml.common.FMLLog; -import ru.lionzxy.fastlogblock.utils.FileUtils; import java.io.*; import java.nio.file.Files; diff --git a/src/main/java/club/moddedminecraft/fastlogblockserver/io/filesplitter/FileSplitterEnum.java b/src/main/java/club/moddedminecraft/fastlogblockserver/io/filesplitter/FileSplitterEnum.java new file mode 100644 index 0000000..790140d --- /dev/null +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/io/filesplitter/FileSplitterEnum.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ + +package club.moddedminecraft.fastlogblockserver.io.filesplitter; + +public enum FileSplitterEnum { + SINGLE, + BLOCKHASH + +} diff --git a/src/main/java/club/moddedminecraft/fastlogblockserver/io/filesplitter/FileSplitterManager.java b/src/main/java/club/moddedminecraft/fastlogblockserver/io/filesplitter/FileSplitterManager.java new file mode 100644 index 0000000..cb1876e --- /dev/null +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/io/filesplitter/FileSplitterManager.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ + +package club.moddedminecraft.fastlogblockserver.io.filesplitter; + +public class FileSplitterManager { +} diff --git a/src/main/java/club/moddedminecraft/fastlogblockserver/io/filesplitter/IFileSplitter.java b/src/main/java/club/moddedminecraft/fastlogblockserver/io/filesplitter/IFileSplitter.java new file mode 100644 index 0000000..7e171d7 --- /dev/null +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/io/filesplitter/IFileSplitter.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ + +package club.moddedminecraft.fastlogblockserver.io.filesplitter; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import java.io.File; + +public abstract class IFileSplitter { + protected final File modFolder; + + public IFileSplitter(final File modFolder) { + this.modFolder = modFolder; + } + + public abstract File[] getAllLogFile(); + + public abstract File getFileByPosAndWorld(BlockPos blockPos, World world); +} diff --git a/src/main/java/ru/lionzxy/fastlogblock/io/filesplitter/impl/BlockHashFileSplitter.java b/src/main/java/club/moddedminecraft/fastlogblockserver/io/filesplitter/impl/BlockHashFileSplitter.java similarity index 66% rename from src/main/java/ru/lionzxy/fastlogblock/io/filesplitter/impl/BlockHashFileSplitter.java rename to src/main/java/club/moddedminecraft/fastlogblockserver/io/filesplitter/impl/BlockHashFileSplitter.java index 6ff5166..02e4ed8 100644 --- a/src/main/java/ru/lionzxy/fastlogblock/io/filesplitter/impl/BlockHashFileSplitter.java +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/io/filesplitter/impl/BlockHashFileSplitter.java @@ -1,10 +1,29 @@ -package ru.lionzxy.fastlogblock.io.filesplitter.impl; +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ +package club.moddedminecraft.fastlogblockserver.io.filesplitter.impl; + +import club.moddedminecraft.fastlogblockserver.config.LogConfig; +import club.moddedminecraft.fastlogblockserver.io.filesplitter.IFileSplitter; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; -import ru.lionzxy.fastlogblock.config.LogConfig; -import ru.lionzxy.fastlogblock.io.filesplitter.IFileSplitter; import java.io.File; import java.util.ArrayList; diff --git a/src/main/java/ru/lionzxy/fastlogblock/io/filesplitter/impl/SingleFileSplitter.java b/src/main/java/club/moddedminecraft/fastlogblockserver/io/filesplitter/impl/SingleFileSplitter.java similarity index 55% rename from src/main/java/ru/lionzxy/fastlogblock/io/filesplitter/impl/SingleFileSplitter.java rename to src/main/java/club/moddedminecraft/fastlogblockserver/io/filesplitter/impl/SingleFileSplitter.java index 1a6984d..7acf946 100644 --- a/src/main/java/ru/lionzxy/fastlogblock/io/filesplitter/impl/SingleFileSplitter.java +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/io/filesplitter/impl/SingleFileSplitter.java @@ -1,9 +1,28 @@ -package ru.lionzxy.fastlogblock.io.filesplitter.impl; +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ +package club.moddedminecraft.fastlogblockserver.io.filesplitter.impl; + +import club.moddedminecraft.fastlogblockserver.io.filesplitter.IFileSplitter; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; -import ru.lionzxy.fastlogblock.io.filesplitter.IFileSplitter; import java.io.File; diff --git a/src/main/java/ru/lionzxy/fastlogblock/io/log/LogReader.java b/src/main/java/club/moddedminecraft/fastlogblockserver/io/log/LogReader.java similarity index 72% rename from src/main/java/ru/lionzxy/fastlogblock/io/log/LogReader.java rename to src/main/java/club/moddedminecraft/fastlogblockserver/io/log/LogReader.java index e02aaba..f2c0c6c 100644 --- a/src/main/java/ru/lionzxy/fastlogblock/io/log/LogReader.java +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/io/log/LogReader.java @@ -1,5 +1,33 @@ -package ru.lionzxy.fastlogblock.io.log; - +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ + +package club.moddedminecraft.fastlogblockserver.io.log; + +import club.moddedminecraft.fastlogblockserver.io.base.IterrateByteFile; +import club.moddedminecraft.fastlogblockserver.io.mappers.BlockMapper; +import club.moddedminecraft.fastlogblockserver.io.mappers.NickMapper; +import club.moddedminecraft.fastlogblockserver.models.ASCIString; +import club.moddedminecraft.fastlogblockserver.models.BlockChangeEventModel; +import club.moddedminecraft.fastlogblockserver.models.BlockChangeType; +import club.moddedminecraft.fastlogblockserver.models.PrepareReadBlockChangeEvent; +import club.moddedminecraft.fastlogblockserver.utils.CollectionUtils; +import club.moddedminecraft.fastlogblockserver.utils.Constants; import gnu.trove.list.array.TByteArrayList; import gnu.trove.map.TIntObjectMap; import gnu.trove.map.TLongObjectMap; @@ -9,15 +37,6 @@ import gnu.trove.set.hash.TLongHashSet; import net.minecraft.util.math.BlockPos; import net.minecraftforge.fml.common.FMLLog; -import ru.lionzxy.fastlogblock.io.base.IterrateByteFile; -import ru.lionzxy.fastlogblock.io.mappers.BlockMapper; -import ru.lionzxy.fastlogblock.io.mappers.NickMapper; -import ru.lionzxy.fastlogblock.models.ASCIString; -import ru.lionzxy.fastlogblock.models.BlockChangeEventModel; -import ru.lionzxy.fastlogblock.models.BlockChangeType; -import ru.lionzxy.fastlogblock.models.PrepareReadBlockChangeEvent; -import ru.lionzxy.fastlogblock.utils.CollectionUtils; -import ru.lionzxy.fastlogblock.utils.Constants; import java.io.File; import java.io.IOException; diff --git a/src/main/java/ru/lionzxy/fastlogblock/io/log/LogWritter.java b/src/main/java/club/moddedminecraft/fastlogblockserver/io/log/LogWritter.java similarity index 64% rename from src/main/java/ru/lionzxy/fastlogblock/io/log/LogWritter.java rename to src/main/java/club/moddedminecraft/fastlogblockserver/io/log/LogWritter.java index eed8572..464600d 100644 --- a/src/main/java/ru/lionzxy/fastlogblock/io/log/LogWritter.java +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/io/log/LogWritter.java @@ -1,10 +1,29 @@ -package ru.lionzxy.fastlogblock.io.log; +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ -import ru.lionzxy.fastlogblock.io.mappers.BlockMapper; -import ru.lionzxy.fastlogblock.io.mappers.NickMapper; -import ru.lionzxy.fastlogblock.models.BlockChangeEventModel; -import ru.lionzxy.fastlogblock.utils.Constants; -import ru.lionzxy.fastlogblock.utils.FileUtils; +package club.moddedminecraft.fastlogblockserver.io.log; + +import club.moddedminecraft.fastlogblockserver.io.mappers.BlockMapper; +import club.moddedminecraft.fastlogblockserver.io.mappers.NickMapper; +import club.moddedminecraft.fastlogblockserver.models.BlockChangeEventModel; +import club.moddedminecraft.fastlogblockserver.utils.Constants; +import club.moddedminecraft.fastlogblockserver.utils.FileUtils; import java.io.BufferedOutputStream; import java.io.File; diff --git a/src/main/java/ru/lionzxy/fastlogblock/io/mappers/BlockMapper.java b/src/main/java/club/moddedminecraft/fastlogblockserver/io/mappers/BlockMapper.java similarity index 79% rename from src/main/java/ru/lionzxy/fastlogblock/io/mappers/BlockMapper.java rename to src/main/java/club/moddedminecraft/fastlogblockserver/io/mappers/BlockMapper.java index fff2ec0..f567791 100644 --- a/src/main/java/ru/lionzxy/fastlogblock/io/mappers/BlockMapper.java +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/io/mappers/BlockMapper.java @@ -1,13 +1,32 @@ -package ru.lionzxy.fastlogblock.io.mappers; +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ + +package club.moddedminecraft.fastlogblockserver.io.mappers; +import club.moddedminecraft.fastlogblockserver.io.base.IterrateByteFile; +import club.moddedminecraft.fastlogblockserver.models.ASCIString; import com.google.common.annotations.VisibleForTesting; import gnu.trove.TObjectLongHashMap; import gnu.trove.list.array.TByteArrayList; import gnu.trove.map.TLongObjectMap; import gnu.trove.map.hash.TLongObjectHashMap; import gnu.trove.set.TLongSet; -import ru.lionzxy.fastlogblock.io.base.IterrateByteFile; -import ru.lionzxy.fastlogblock.models.ASCIString; import java.io.File; import java.io.IOException; @@ -16,7 +35,7 @@ import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.locks.ReentrantReadWriteLock; -import static ru.lionzxy.fastlogblock.utils.Constants.DEVIDER_SYMBOL; +import static club.moddedminecraft.fastlogblockserver.utils.Constants.DEVIDER_SYMBOL; /** diff --git a/src/main/java/ru/lionzxy/fastlogblock/io/mappers/NickMapper.java b/src/main/java/club/moddedminecraft/fastlogblockserver/io/mappers/NickMapper.java similarity index 77% rename from src/main/java/ru/lionzxy/fastlogblock/io/mappers/NickMapper.java rename to src/main/java/club/moddedminecraft/fastlogblockserver/io/mappers/NickMapper.java index 516f6e3..4771b75 100644 --- a/src/main/java/ru/lionzxy/fastlogblock/io/mappers/NickMapper.java +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/io/mappers/NickMapper.java @@ -1,12 +1,31 @@ -package ru.lionzxy.fastlogblock.io.mappers; - +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ + +package club.moddedminecraft.fastlogblockserver.io.mappers; + +import club.moddedminecraft.fastlogblockserver.io.base.IterrateByteFile; +import club.moddedminecraft.fastlogblockserver.models.ASCIString; +import club.moddedminecraft.fastlogblockserver.utils.Constants; import com.google.common.annotations.VisibleForTesting; import gnu.trove.TIntObjectHashMap; import gnu.trove.TObjectIntHashMap; import gnu.trove.list.array.TByteArrayList; -import ru.lionzxy.fastlogblock.io.base.IterrateByteFile; -import ru.lionzxy.fastlogblock.models.ASCIString; -import ru.lionzxy.fastlogblock.utils.Constants; import java.io.File; import java.io.IOException; @@ -14,7 +33,7 @@ import java.nio.ByteBuffer; import java.util.concurrent.atomic.AtomicInteger; -import static ru.lionzxy.fastlogblock.utils.Constants.DEVIDER_SYMBOL; +import static club.moddedminecraft.fastlogblockserver.utils.Constants.DEVIDER_SYMBOL; public class NickMapper extends IterrateByteFile { private final AtomicInteger maxId = new AtomicInteger(Integer.MIN_VALUE); diff --git a/src/main/java/ru/lionzxy/fastlogblock/models/ASCIString.java b/src/main/java/club/moddedminecraft/fastlogblockserver/models/ASCIString.java similarity index 64% rename from src/main/java/ru/lionzxy/fastlogblock/models/ASCIString.java rename to src/main/java/club/moddedminecraft/fastlogblockserver/models/ASCIString.java index 0200bee..3d9f084 100644 --- a/src/main/java/ru/lionzxy/fastlogblock/models/ASCIString.java +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/models/ASCIString.java @@ -1,9 +1,29 @@ -package ru.lionzxy.fastlogblock.models; +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ + +package club.moddedminecraft.fastlogblockserver.models; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; public class ASCIString implements CharSequence { - private final static Charset ASCI = Charset.forName("ASCII"); + private final static Charset ASCI = StandardCharsets.US_ASCII; private final byte[] shortString; private int hashcode = -1; diff --git a/src/main/java/ru/lionzxy/fastlogblock/models/BlockChangeEventModel.java b/src/main/java/club/moddedminecraft/fastlogblockserver/models/BlockChangeEventModel.java similarity index 79% rename from src/main/java/ru/lionzxy/fastlogblock/models/BlockChangeEventModel.java rename to src/main/java/club/moddedminecraft/fastlogblockserver/models/BlockChangeEventModel.java index c579a85..31fb741 100644 --- a/src/main/java/ru/lionzxy/fastlogblock/models/BlockChangeEventModel.java +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/models/BlockChangeEventModel.java @@ -1,10 +1,29 @@ -package ru.lionzxy.fastlogblock.models; - +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ + +package club.moddedminecraft.fastlogblockserver.models; + +import club.moddedminecraft.fastlogblockserver.config.LogConfig; import jline.internal.Nullable; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import net.minecraftforge.event.world.BlockEvent; -import ru.lionzxy.fastlogblock.config.LogConfig; import java.sql.Timestamp; diff --git a/src/main/java/club/moddedminecraft/fastlogblockserver/models/BlockChangeEventModelWithWorld.java b/src/main/java/club/moddedminecraft/fastlogblockserver/models/BlockChangeEventModelWithWorld.java new file mode 100644 index 0000000..451d398 --- /dev/null +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/models/BlockChangeEventModelWithWorld.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ + +package club.moddedminecraft.fastlogblockserver.models; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import java.sql.Timestamp; + +public class BlockChangeEventModelWithWorld extends BlockChangeEventModel { + private final World world; + + public BlockChangeEventModelWithWorld(BlockPos blockPos, String nameblock, String playernick, Timestamp timestamp, BlockChangeType blockChangeType, World world) { + super(blockPos, nameblock, playernick, timestamp, blockChangeType); + this.world = world; + } + + public World getWorld() { + return world; + } +} diff --git a/src/main/java/club/moddedminecraft/fastlogblockserver/models/BlockChangeType.java b/src/main/java/club/moddedminecraft/fastlogblockserver/models/BlockChangeType.java new file mode 100644 index 0000000..fb06e10 --- /dev/null +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/models/BlockChangeType.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ + +package club.moddedminecraft.fastlogblockserver.models; + +public enum BlockChangeType { + INSERT(0), + REMOVE(1), + UPDATE(2), + UNKNOWN(100); + private final byte typeId; + + BlockChangeType(final int typeid) { + this.typeId = (byte) typeid; + } + + public static BlockChangeType valueOf(final byte typeId) { + for (final BlockChangeType blockChangeType : BlockChangeType.values()) { + if (blockChangeType.getTypeId() == typeId) { + return blockChangeType; + } + } + return null; + } + + public byte getTypeId() { + return typeId; + } +} diff --git a/src/main/java/ru/lionzxy/fastlogblock/models/FindTask.java b/src/main/java/club/moddedminecraft/fastlogblockserver/models/FindTask.java similarity index 52% rename from src/main/java/ru/lionzxy/fastlogblock/models/FindTask.java rename to src/main/java/club/moddedminecraft/fastlogblockserver/models/FindTask.java index 59b703c..b607276 100644 --- a/src/main/java/ru/lionzxy/fastlogblock/models/FindTask.java +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/models/FindTask.java @@ -1,4 +1,23 @@ -package ru.lionzxy.fastlogblock.models; +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ + +package club.moddedminecraft.fastlogblockserver.models; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.math.BlockPos; diff --git a/src/main/java/club/moddedminecraft/fastlogblockserver/models/FindTaskResult.java b/src/main/java/club/moddedminecraft/fastlogblockserver/models/FindTaskResult.java new file mode 100644 index 0000000..0312fc4 --- /dev/null +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/models/FindTaskResult.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ + +package club.moddedminecraft.fastlogblockserver.models; + +import net.minecraft.entity.player.EntityPlayer; + +import java.util.List; + +public class FindTaskResult { + private final List blockChangeEventModels; + private final EntityPlayer entityPlayer; + + public FindTaskResult(List blockChangeEventModels, EntityPlayer entityPlayer) { + this.blockChangeEventModels = blockChangeEventModels; + this.entityPlayer = entityPlayer; + } + + public EntityPlayer getEntityPlayer() { + return entityPlayer; + } + + public List getBlockChangeEventModels() { + + return blockChangeEventModels; + } +} diff --git a/src/main/java/club/moddedminecraft/fastlogblockserver/models/IFindResultListener.java b/src/main/java/club/moddedminecraft/fastlogblockserver/models/IFindResultListener.java new file mode 100644 index 0000000..5434702 --- /dev/null +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/models/IFindResultListener.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ + +package club.moddedminecraft.fastlogblockserver.models; + +import jline.internal.Nullable; +import net.minecraft.entity.player.EntityPlayer; + +import java.util.List; + +public interface IFindResultListener { + void onResultAsync(List blockChangeEventModels, @Nullable EntityPlayer entityPlayer); +} diff --git a/src/main/java/ru/lionzxy/fastlogblock/models/PrepareReadBlockChangeEvent.java b/src/main/java/club/moddedminecraft/fastlogblockserver/models/PrepareReadBlockChangeEvent.java similarity index 64% rename from src/main/java/ru/lionzxy/fastlogblock/models/PrepareReadBlockChangeEvent.java rename to src/main/java/club/moddedminecraft/fastlogblockserver/models/PrepareReadBlockChangeEvent.java index 1039e7c..171792b 100644 --- a/src/main/java/ru/lionzxy/fastlogblock/models/PrepareReadBlockChangeEvent.java +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/models/PrepareReadBlockChangeEvent.java @@ -1,4 +1,23 @@ -package ru.lionzxy.fastlogblock.models; +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ + +package club.moddedminecraft.fastlogblockserver.models; import gnu.trove.map.TIntObjectMap; import gnu.trove.map.TLongObjectMap; diff --git a/src/main/java/club/moddedminecraft/fastlogblockserver/ui/InfoCommand.java b/src/main/java/club/moddedminecraft/fastlogblockserver/ui/InfoCommand.java new file mode 100644 index 0000000..0861902 --- /dev/null +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/ui/InfoCommand.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ + +package club.moddedminecraft.fastlogblockserver.ui; + +import club.moddedminecraft.fastlogblockserver.handlers.EventHandlingManager; +import club.moddedminecraft.fastlogblockserver.utils.TranslationUtils; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.math.Vec3d; + + +public class InfoCommand extends CommandBase { + private final EventHandlingManager eventHandlingManager; + + public InfoCommand(EventHandlingManager eventHandlingManager) { + this.eventHandlingManager = eventHandlingManager; + } + + @Override + public String getName() { + return "blocklog"; + } + + @Override + public String getUsage(ICommandSender sender) { + return "/blocklog"; + } + + @Override + public int getRequiredPermissionLevel() { + return 4; + } + + + @Override + public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { + if (sender instanceof EntityPlayer) { + RayTraceResult lookingAt = rayTrace(8, sender); + sender.sendMessage(TranslationUtils.createComponentTranslation(sender, "message.fastlogblock:blockinfo.start", lookingAt.getBlockPos().getX(), lookingAt.getBlockPos().getY(), lookingAt.getBlockPos().getZ())); + eventHandlingManager.handleLogByPos(((EntityPlayer) sender), lookingAt.getBlockPos(), ((EntityPlayer) sender).world); + } + } + + public RayTraceResult rayTrace(double blockReachDistance, ICommandSender sender) { + Vec3d vec3d = ((EntityPlayer) sender).getPositionEyes(1.0f); + Vec3d vec3d1 = ((EntityPlayer) sender).getLook(1.0f); + Vec3d vec3d2 = vec3d.addVector(vec3d1.x * blockReachDistance, vec3d1.y * blockReachDistance, vec3d1.z * blockReachDistance); + return ((EntityPlayer) sender).world.rayTraceBlocks(vec3d, vec3d2, false, false, true); + } + +} \ No newline at end of file diff --git a/src/main/java/club/moddedminecraft/fastlogblockserver/utils/CollectionUtils.java b/src/main/java/club/moddedminecraft/fastlogblockserver/utils/CollectionUtils.java new file mode 100644 index 0000000..abfa662 --- /dev/null +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/utils/CollectionUtils.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ + +package club.moddedminecraft.fastlogblockserver.utils; + +import gnu.trove.map.TIntObjectMap; +import gnu.trove.map.hash.TIntObjectHashMap; +import gnu.trove.set.TIntSet; + +import java.util.function.Function; + +public class CollectionUtils { + + public static TIntObjectMap toHashMap(final TIntSet set, final Function mapper) { + final TIntObjectMap toReturn = new TIntObjectHashMap<>(); + + set.forEach((i) -> { + toReturn.put(i, mapper.apply(i)); + return true; + }); + + return toReturn; + } +} diff --git a/src/main/java/club/moddedminecraft/fastlogblockserver/utils/Constants.java b/src/main/java/club/moddedminecraft/fastlogblockserver/utils/Constants.java new file mode 100644 index 0000000..104d8d2 --- /dev/null +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/utils/Constants.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ + +package club.moddedminecraft.fastlogblockserver.utils; + +public class Constants { + public static final int SIZE_LOGLINE = Integer.BYTES * 4 + Long.BYTES * 2 + Byte.BYTES * 2; + public static final byte DEVIDER_SYMBOL = 28; +} diff --git a/src/main/java/club/moddedminecraft/fastlogblockserver/utils/FileUtils.java b/src/main/java/club/moddedminecraft/fastlogblockserver/utils/FileUtils.java new file mode 100644 index 0000000..6b95894 --- /dev/null +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/utils/FileUtils.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ + +package club.moddedminecraft.fastlogblockserver.utils; + +import java.io.File; +import java.io.IOException; + +public class FileUtils { + public static final int BYTEBUFFERSIZE = 2048; + + public static void createFileIfNotExist(final File file) throws IOException { + if (!file.exists()) { + if (file.getParentFile() != null && !file.getParentFile().exists() && !file.getParentFile().mkdirs()) { + throw new IOException("Can't create dir to file " + file.getParentFile().getAbsolutePath()); + } + if (!file.createNewFile()) { + throw new IOException("Can't create file " + file.getAbsolutePath()); + } + } + } +} diff --git a/src/main/java/club/moddedminecraft/fastlogblockserver/utils/TranslationUtils.java b/src/main/java/club/moddedminecraft/fastlogblockserver/utils/TranslationUtils.java new file mode 100644 index 0000000..ec5e0c2 --- /dev/null +++ b/src/main/java/club/moddedminecraft/fastlogblockserver/utils/TranslationUtils.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2020 LionZXY + * Copyright (c) 2020 132ikl + * This file is part of FastLogBlockServer. + * + * FastLogBlockServer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FastLogBlockServer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FastLogBlockServer. If not, see . + */ + +package club.moddedminecraft.fastlogblockserver.utils; + +import io.netty.channel.Channel; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.NetHandlerPlayServer; +import net.minecraft.network.NetworkManager; +import net.minecraft.util.text.TextComponentBase; +import net.minecraft.util.text.TextComponentString; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.util.text.translation.I18n; +import net.minecraftforge.fml.common.network.NetworkRegistry; + +public class TranslationUtils { + private TranslationUtils() { + } + + public static TextComponentBase createComponentTranslation(ICommandSender sender, String translation, Object... args) { + return isVanillaClient(sender) ? new TextComponentString(I18n.translateToLocalFormatted(translation, args)) : new TextComponentTranslation(translation, args); + } + + private static boolean isVanillaClient(ICommandSender sender) { + if (sender instanceof EntityPlayerMP) { + EntityPlayerMP playerMP = (EntityPlayerMP) sender; + NetHandlerPlayServer connection = playerMP.connection; + if (connection != null) { + NetworkManager netManager = connection.netManager; + Channel channel = netManager.channel(); + return !channel.attr(NetworkRegistry.FML_MARKER).get(); + } + } + + return false; + } +} diff --git a/src/main/java/ru/lionzxy/fastlogblock/FastLogBlock.java b/src/main/java/ru/lionzxy/fastlogblock/FastLogBlock.java deleted file mode 100644 index aff1965..0000000 --- a/src/main/java/ru/lionzxy/fastlogblock/FastLogBlock.java +++ /dev/null @@ -1,56 +0,0 @@ -package ru.lionzxy.fastlogblock; - -import net.minecraft.client.renderer.block.model.ModelResourceLocation; -import net.minecraft.item.Item; - -import net.minecraftforge.client.event.ModelRegistryEvent; -import net.minecraftforge.client.model.ModelLoader; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.RegistryEvent; -import net.minecraftforge.fml.common.FMLLog; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.common.Mod.EventHandler; -import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; -import net.minecraftforge.fml.common.event.FMLServerStoppedEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import ru.lionzxy.fastlogblock.handlers.EventHandlingManager; -import ru.lionzxy.fastlogblock.ui.InfoItem; - -import java.io.IOException; - -@Mod(modid = FastLogBlock.MODID, version = FastLogBlock.VERSION, updateJSON = "https://raw.githubusercontent.com/LionZXY/FastLogBlock/master/update.json") -public class FastLogBlock { - public static final String MODID = "fastlogblock"; - public static final String VERSION = "1.0.2"; - private EventHandlingManager eventHandlingManager; - private InfoItem infoitem; - - @EventHandler - public void preInit(FMLPreInitializationEvent event) throws IOException { - FMLLog.log.info("Initializing eventHandlingManager..."); - eventHandlingManager = new EventHandlingManager(); - this.infoitem = new InfoItem(eventHandlingManager); - FMLLog.log.info("Done!"); - MinecraftForge.EVENT_BUS.register(eventHandlingManager); - MinecraftForge.EVENT_BUS.register(this); - } - - @SubscribeEvent - @SideOnly(Side.CLIENT) - public void registerModels(ModelRegistryEvent event){ - ModelLoader.setCustomModelResourceLocation(infoitem, 0, new ModelResourceLocation(infoitem.getRegistryName(), "inventory")); - } - - @SubscribeEvent - public void registerItems(RegistryEvent.Register event) { - event.getRegistry().registerAll(infoitem); - } - - @EventHandler - public void serverStopped(final FMLServerStoppedEvent event) { - eventHandlingManager.stop(); - } -} diff --git a/src/main/java/ru/lionzxy/fastlogblock/io/filesplitter/FileSplitterEnum.java b/src/main/java/ru/lionzxy/fastlogblock/io/filesplitter/FileSplitterEnum.java deleted file mode 100644 index b06e1bd..0000000 --- a/src/main/java/ru/lionzxy/fastlogblock/io/filesplitter/FileSplitterEnum.java +++ /dev/null @@ -1,7 +0,0 @@ -package ru.lionzxy.fastlogblock.io.filesplitter; - -public enum FileSplitterEnum { - SINGLE, - BLOCKHASH; - -} diff --git a/src/main/java/ru/lionzxy/fastlogblock/io/filesplitter/FileSplitterManager.java b/src/main/java/ru/lionzxy/fastlogblock/io/filesplitter/FileSplitterManager.java deleted file mode 100644 index 6d2c998..0000000 --- a/src/main/java/ru/lionzxy/fastlogblock/io/filesplitter/FileSplitterManager.java +++ /dev/null @@ -1,4 +0,0 @@ -package ru.lionzxy.fastlogblock.io.filesplitter; - -public class FileSplitterManager { -} diff --git a/src/main/java/ru/lionzxy/fastlogblock/io/filesplitter/IFileSplitter.java b/src/main/java/ru/lionzxy/fastlogblock/io/filesplitter/IFileSplitter.java deleted file mode 100644 index cc29ac4..0000000 --- a/src/main/java/ru/lionzxy/fastlogblock/io/filesplitter/IFileSplitter.java +++ /dev/null @@ -1,18 +0,0 @@ -package ru.lionzxy.fastlogblock.io.filesplitter; - -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -import java.io.File; - -public abstract class IFileSplitter { - protected final File modFolder; - - public IFileSplitter(final File modFolder) { - this.modFolder = modFolder; - } - - public abstract File[] getAllLogFile(); - - public abstract File getFileByPosAndWorld(BlockPos blockPos, World world); -} diff --git a/src/main/java/ru/lionzxy/fastlogblock/models/BlockChangeEventModelWithWorld.java b/src/main/java/ru/lionzxy/fastlogblock/models/BlockChangeEventModelWithWorld.java deleted file mode 100644 index 78d54f0..0000000 --- a/src/main/java/ru/lionzxy/fastlogblock/models/BlockChangeEventModelWithWorld.java +++ /dev/null @@ -1,19 +0,0 @@ -package ru.lionzxy.fastlogblock.models; - -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -import java.sql.Timestamp; - -public class BlockChangeEventModelWithWorld extends BlockChangeEventModel { - private final World world; - - public BlockChangeEventModelWithWorld(BlockPos blockPos, String nameblock, String playernick, Timestamp timestamp, BlockChangeType blockChangeType, World world) { - super(blockPos, nameblock, playernick, timestamp, blockChangeType); - this.world = world; - } - - public World getWorld() { - return world; - } -} diff --git a/src/main/java/ru/lionzxy/fastlogblock/models/BlockChangeType.java b/src/main/java/ru/lionzxy/fastlogblock/models/BlockChangeType.java deleted file mode 100644 index a6c3747..0000000 --- a/src/main/java/ru/lionzxy/fastlogblock/models/BlockChangeType.java +++ /dev/null @@ -1,26 +0,0 @@ -package ru.lionzxy.fastlogblock.models; - -public enum BlockChangeType { - INSERT(0), - REMOVE(1), - UPDATE(2), - UNKNOWN(100); - private final byte typeId; - - BlockChangeType(final int typeid) { - this.typeId = (byte) typeid; - } - - public static BlockChangeType valueOf(final byte typeId) { - for (final BlockChangeType blockChangeType : BlockChangeType.values()) { - if (blockChangeType.getTypeId() == typeId) { - return blockChangeType; - } - } - return null; - } - - public byte getTypeId() { - return typeId; - } -} diff --git a/src/main/java/ru/lionzxy/fastlogblock/models/FindTaskResult.java b/src/main/java/ru/lionzxy/fastlogblock/models/FindTaskResult.java deleted file mode 100644 index 8a3044c..0000000 --- a/src/main/java/ru/lionzxy/fastlogblock/models/FindTaskResult.java +++ /dev/null @@ -1,24 +0,0 @@ -package ru.lionzxy.fastlogblock.models; - -import net.minecraft.entity.player.EntityPlayer; - -import java.util.List; - -public class FindTaskResult { - private final List blockChangeEventModels; - private final EntityPlayer entityPlayer; - - public FindTaskResult(List blockChangeEventModels, EntityPlayer entityPlayer) { - this.blockChangeEventModels = blockChangeEventModels; - this.entityPlayer = entityPlayer; - } - - public EntityPlayer getEntityPlayer() { - return entityPlayer; - } - - public List getBlockChangeEventModels() { - - return blockChangeEventModels; - } -} diff --git a/src/main/java/ru/lionzxy/fastlogblock/models/IFindResultListener.java b/src/main/java/ru/lionzxy/fastlogblock/models/IFindResultListener.java deleted file mode 100644 index 1455c08..0000000 --- a/src/main/java/ru/lionzxy/fastlogblock/models/IFindResultListener.java +++ /dev/null @@ -1,10 +0,0 @@ -package ru.lionzxy.fastlogblock.models; - -import jline.internal.Nullable; -import net.minecraft.entity.player.EntityPlayer; - -import java.util.List; - -public interface IFindResultListener { - void onResultAsync(List blockChangeEventModels, @Nullable EntityPlayer entityPlayer); -} diff --git a/src/main/java/ru/lionzxy/fastlogblock/ui/InfoItem.java b/src/main/java/ru/lionzxy/fastlogblock/ui/InfoItem.java deleted file mode 100644 index 281a468..0000000 --- a/src/main/java/ru/lionzxy/fastlogblock/ui/InfoItem.java +++ /dev/null @@ -1,45 +0,0 @@ -package ru.lionzxy.fastlogblock.ui; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.util.EnumActionResult; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumHand; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.text.TextComponentTranslation; -import net.minecraft.world.World; -import ru.lionzxy.fastlogblock.FastLogBlock; -import ru.lionzxy.fastlogblock.handlers.EventHandlingManager; -import ru.lionzxy.fastlogblock.utils.MinecraftUtils; - -import java.util.Objects; - -public class InfoItem extends Item { - private static final String ITEMNAME = "infoitem"; - private final EventHandlingManager eventHandlingManager; - - public InfoItem(EventHandlingManager eventHandlingManager) { - this.eventHandlingManager = eventHandlingManager; - setRegistryName(FastLogBlock.MODID, ITEMNAME); - final ResourceLocation registryName = Objects.requireNonNull(getRegistryName()); - setUnlocalizedName(registryName.toString()); - setCreativeTab(CreativeTabs.MISC); - } - - - @Override - public EnumActionResult onItemUse(EntityPlayer player, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { - if (worldIn.isRemote) { - return EnumActionResult.FAIL; - } - if (!MinecraftUtils.canShowLog(player)) { - player.sendMessage(new TextComponentTranslation("message.fastlogblock:blockinfo.event.permissionerror")); - return EnumActionResult.FAIL; - } - player.sendMessage(new TextComponentTranslation("message.fastlogblock:blockinfo.start", pos.getX(), pos.getY(), pos.getZ())); - eventHandlingManager.handleLogByPos(player, pos, worldIn); - return EnumActionResult.SUCCESS; - } -} diff --git a/src/main/java/ru/lionzxy/fastlogblock/utils/CollectionUtils.java b/src/main/java/ru/lionzxy/fastlogblock/utils/CollectionUtils.java deleted file mode 100644 index 6e96cb7..0000000 --- a/src/main/java/ru/lionzxy/fastlogblock/utils/CollectionUtils.java +++ /dev/null @@ -1,21 +0,0 @@ -package ru.lionzxy.fastlogblock.utils; - -import gnu.trove.map.TIntObjectMap; -import gnu.trove.map.hash.TIntObjectHashMap; -import gnu.trove.set.TIntSet; - -import java.util.function.Function; - -public class CollectionUtils { - - public static TIntObjectMap toHashMap(final TIntSet set, final Function mapper) { - final TIntObjectMap toReturn = new TIntObjectHashMap<>(); - - set.forEach((i) -> { - toReturn.put(i, mapper.apply(i)); - return true; - }); - - return toReturn; - } -} diff --git a/src/main/java/ru/lionzxy/fastlogblock/utils/Constants.java b/src/main/java/ru/lionzxy/fastlogblock/utils/Constants.java deleted file mode 100644 index 7f70713..0000000 --- a/src/main/java/ru/lionzxy/fastlogblock/utils/Constants.java +++ /dev/null @@ -1,6 +0,0 @@ -package ru.lionzxy.fastlogblock.utils; - -public class Constants { - public static final int SIZE_LOGLINE = Integer.BYTES * 4 + Long.BYTES * 2 + Byte.BYTES * 2; - public static final byte DEVIDER_SYMBOL = 28; -} diff --git a/src/main/java/ru/lionzxy/fastlogblock/utils/FileUtils.java b/src/main/java/ru/lionzxy/fastlogblock/utils/FileUtils.java deleted file mode 100644 index 990080f..0000000 --- a/src/main/java/ru/lionzxy/fastlogblock/utils/FileUtils.java +++ /dev/null @@ -1,19 +0,0 @@ -package ru.lionzxy.fastlogblock.utils; - -import java.io.File; -import java.io.IOException; - -public class FileUtils { - public static final int BYTEBUFFERSIZE = 2048; - - public static void createFileIfNotExist(final File file) throws IOException { - if (!file.exists()) { - if (file.getParentFile() != null && !file.getParentFile().exists() && !file.getParentFile().mkdirs()) { - throw new IOException("Can't create dir to file " + file.getParentFile().getAbsolutePath()); - } - if (!file.createNewFile()) { - throw new IOException("Can't create file " + file.getAbsolutePath()); - } - } - } -} diff --git a/src/main/java/ru/lionzxy/fastlogblock/utils/MinecraftUtils.java b/src/main/java/ru/lionzxy/fastlogblock/utils/MinecraftUtils.java deleted file mode 100644 index 9f78b6f..0000000 --- a/src/main/java/ru/lionzxy/fastlogblock/utils/MinecraftUtils.java +++ /dev/null @@ -1,10 +0,0 @@ -package ru.lionzxy.fastlogblock.utils; - -import net.minecraft.entity.player.EntityPlayer; -import ru.lionzxy.fastlogblock.config.LogConfig; - -public class MinecraftUtils { - public static boolean canShowLog(EntityPlayer player) { - return !LogConfig.onlyForOP || player.getEntityWorld().getMinecraftServer().isSinglePlayer() || player.canUseCommand(player.getEntityWorld().getMinecraftServer().getOpPermissionLevel(), ""); - } -} diff --git a/src/main/resources/assets/fastlogblock/lang/en_us.lang b/src/main/resources/assets/fastlogblock/lang/en_us.lang index fdbad01..e5202af 100644 --- a/src/main/resources/assets/fastlogblock/lang/en_us.lang +++ b/src/main/resources/assets/fastlogblock/lang/en_us.lang @@ -1,9 +1,6 @@ -message.fastlogblock:blockinfo.start=§3[FastLogBlock]§f Start computing log for Position[x=%d, y=%d, z=%d] +message.fastlogblock:blockinfo.start=§3[FastLogBlock]§f Computing log for position %d %d %d... message.fastlogblock:blockinfo.event.insert=§2[+]§6[%s§6]§f %s: %s message.fastlogblock:blockinfo.event.remove=§4[-]§6[%s§6]§f %s: %s message.fastlogblock:blockinfo.event.done=§3[FastLogBlock]§f Done! -message.fastlogblock:blockinfo.event.empty=§3[FastLogBlock]§f Not found changes with block -message.fastlogblock:blockinfo.event.permissionerror=§3[FastLogBlock]§4 Permission error. You can't use this mod (with current settings this mod can use only Server Admin) -message.fastlogblock:blockinfo.event.dateformat=dd/MM/yyyy HH:mm:ss - -item.fastlogblock:infoitem.name=FastBlockLog Info Item \ No newline at end of file +message.fastlogblock:blockinfo.event.empty=§3[FastLogBlock]§f No changes found for block +message.fastlogblock:blockinfo.event.dateformat='§9'yyyy-MM-dd' §c'HH:mm z'§6' diff --git a/src/main/resources/assets/fastlogblock/models/item/infoitem.json b/src/main/resources/assets/fastlogblock/models/item/infoitem.json deleted file mode 100644 index f0acec5..0000000 --- a/src/main/resources/assets/fastlogblock/models/item/infoitem.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "item/generated", - "textures": { - "layer0": "fastlogblock:items/infoitem" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/fastlogblock/textures/items/infoitem.png b/src/main/resources/assets/fastlogblock/textures/items/infoitem.png deleted file mode 100644 index b728a9b..0000000 Binary files a/src/main/resources/assets/fastlogblock/textures/items/infoitem.png and /dev/null differ diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta index 4018267..d807354 100644 --- a/src/main/resources/pack.mcmeta +++ b/src/main/resources/pack.mcmeta @@ -1,7 +1,7 @@ { "pack": { - "description": "examplemod resources", + "description": "FastLogBlockServer", "pack_format": 3, - "_comment": "A pack_format of 3 should be used starting with Minecraft 1.11. All resources, including language files, should be lowercase (eg: en_us.lang). A pack_format of 2 will load your mod resources with LegacyV2Adapter, which requires language files to have uppercase letters (eg: en_US.lang)." + "_comment": "Resources for FastLogBlockServer by 132ikl, forked from FastLogBlock by LionZXY" } } diff --git a/src/test/java/ru/lionzxy/fastlogblock/io/BlockMapperAsyncTest.java b/src/test/java/club/moddedminecraft/fastlogblockserver/io/BlockMapperAsyncTest.java similarity index 96% rename from src/test/java/ru/lionzxy/fastlogblock/io/BlockMapperAsyncTest.java rename to src/test/java/club/moddedminecraft/fastlogblockserver/io/BlockMapperAsyncTest.java index f49aa4b..62f2203 100644 --- a/src/test/java/ru/lionzxy/fastlogblock/io/BlockMapperAsyncTest.java +++ b/src/test/java/club/moddedminecraft/fastlogblockserver/io/BlockMapperAsyncTest.java @@ -1,9 +1,9 @@ -package ru.lionzxy.fastlogblock.io; +package club.moddedminecraft.fastlogblockserver.io; +import club.moddedminecraft.fastlogblockserver.models.ASCIString; import com.google.testing.threadtester.*; import junit.framework.TestCase; -import ru.lionzxy.fastlogblock.io.mappers.BlockMapper; -import ru.lionzxy.fastlogblock.models.ASCIString; +import club.moddedminecraft.fastlogblockserver.io.mappers.BlockMapper; import java.io.IOException; import java.util.Arrays; diff --git a/src/test/java/ru/lionzxy/fastlogblock/io/BlockMapperSaveTest.java b/src/test/java/club/moddedminecraft/fastlogblockserver/io/BlockMapperSaveTest.java similarity index 94% rename from src/test/java/ru/lionzxy/fastlogblock/io/BlockMapperSaveTest.java rename to src/test/java/club/moddedminecraft/fastlogblockserver/io/BlockMapperSaveTest.java index 66de10d..382753a 100644 --- a/src/test/java/ru/lionzxy/fastlogblock/io/BlockMapperSaveTest.java +++ b/src/test/java/club/moddedminecraft/fastlogblockserver/io/BlockMapperSaveTest.java @@ -1,8 +1,8 @@ -package ru.lionzxy.fastlogblock.io; +package club.moddedminecraft.fastlogblockserver.io; +import club.moddedminecraft.fastlogblockserver.models.ASCIString; import junit.framework.TestCase; -import ru.lionzxy.fastlogblock.io.mappers.BlockMapper; -import ru.lionzxy.fastlogblock.models.ASCIString; +import club.moddedminecraft.fastlogblockserver.io.mappers.BlockMapper; import java.io.File; import java.io.IOException; diff --git a/src/test/java/ru/lionzxy/fastlogblock/io/LogTest.java b/src/test/java/club/moddedminecraft/fastlogblockserver/io/LogTest.java similarity index 85% rename from src/test/java/ru/lionzxy/fastlogblock/io/LogTest.java rename to src/test/java/club/moddedminecraft/fastlogblockserver/io/LogTest.java index dac875c..8ed5760 100644 --- a/src/test/java/ru/lionzxy/fastlogblock/io/LogTest.java +++ b/src/test/java/club/moddedminecraft/fastlogblockserver/io/LogTest.java @@ -1,14 +1,14 @@ -package ru.lionzxy.fastlogblock.io; +package club.moddedminecraft.fastlogblockserver.io; +import club.moddedminecraft.fastlogblockserver.models.BlockChangeEventModel; +import club.moddedminecraft.fastlogblockserver.models.BlockChangeType; import junit.framework.TestCase; import net.minecraft.util.math.BlockPos; -import ru.lionzxy.fastlogblock.models.BlockChangeType; -import ru.lionzxy.fastlogblock.io.log.LogReader; -import ru.lionzxy.fastlogblock.io.log.LogWritter; -import ru.lionzxy.fastlogblock.io.mappers.BlockMapper; -import ru.lionzxy.fastlogblock.io.mappers.NickMapper; -import ru.lionzxy.fastlogblock.models.BlockChangeEventModel; -import ru.lionzxy.fastlogblock.utils.TestUtils; +import club.moddedminecraft.fastlogblockserver.io.log.LogReader; +import club.moddedminecraft.fastlogblockserver.io.log.LogWritter; +import club.moddedminecraft.fastlogblockserver.io.mappers.BlockMapper; +import club.moddedminecraft.fastlogblockserver.io.mappers.NickMapper; +import club.moddedminecraft.fastlogblockserver.utils.TestUtils; import java.io.File; import java.io.IOException; diff --git a/src/test/java/ru/lionzxy/fastlogblock/io/NickMapperAsyncTest.java b/src/test/java/club/moddedminecraft/fastlogblockserver/io/NickMapperAsyncTest.java similarity index 92% rename from src/test/java/ru/lionzxy/fastlogblock/io/NickMapperAsyncTest.java rename to src/test/java/club/moddedminecraft/fastlogblockserver/io/NickMapperAsyncTest.java index 0c20db5..ade4529 100644 --- a/src/test/java/ru/lionzxy/fastlogblock/io/NickMapperAsyncTest.java +++ b/src/test/java/club/moddedminecraft/fastlogblockserver/io/NickMapperAsyncTest.java @@ -1,9 +1,9 @@ -package ru.lionzxy.fastlogblock.io; +package club.moddedminecraft.fastlogblockserver.io; +import club.moddedminecraft.fastlogblockserver.models.ASCIString; import com.google.testing.threadtester.*; import junit.framework.TestCase; -import ru.lionzxy.fastlogblock.io.mappers.NickMapper; -import ru.lionzxy.fastlogblock.models.ASCIString; +import club.moddedminecraft.fastlogblockserver.io.mappers.NickMapper; import java.io.IOException; import java.util.Arrays; diff --git a/src/test/java/ru/lionzxy/fastlogblock/io/NickMapperSaveTest.java b/src/test/java/club/moddedminecraft/fastlogblockserver/io/NickMapperSaveTest.java similarity index 91% rename from src/test/java/ru/lionzxy/fastlogblock/io/NickMapperSaveTest.java rename to src/test/java/club/moddedminecraft/fastlogblockserver/io/NickMapperSaveTest.java index 3d0cdfa..55a57f4 100644 --- a/src/test/java/ru/lionzxy/fastlogblock/io/NickMapperSaveTest.java +++ b/src/test/java/club/moddedminecraft/fastlogblockserver/io/NickMapperSaveTest.java @@ -1,8 +1,8 @@ -package ru.lionzxy.fastlogblock.io; +package club.moddedminecraft.fastlogblockserver.io; +import club.moddedminecraft.fastlogblockserver.models.ASCIString; import junit.framework.TestCase; -import ru.lionzxy.fastlogblock.io.mappers.NickMapper; -import ru.lionzxy.fastlogblock.models.ASCIString; +import club.moddedminecraft.fastlogblockserver.io.mappers.NickMapper; import java.io.File; import java.io.IOException; diff --git a/src/test/java/ru/lionzxy/fastlogblock/io/WriteReadRunnableTest.java b/src/test/java/club/moddedminecraft/fastlogblockserver/io/WriteReadRunnableTest.java similarity index 86% rename from src/test/java/ru/lionzxy/fastlogblock/io/WriteReadRunnableTest.java rename to src/test/java/club/moddedminecraft/fastlogblockserver/io/WriteReadRunnableTest.java index e1c3cbd..c1e9fdf 100644 --- a/src/test/java/ru/lionzxy/fastlogblock/io/WriteReadRunnableTest.java +++ b/src/test/java/club/moddedminecraft/fastlogblockserver/io/WriteReadRunnableTest.java @@ -1,14 +1,14 @@ -package ru.lionzxy.fastlogblock.io; +package club.moddedminecraft.fastlogblockserver.io; +import club.moddedminecraft.fastlogblockserver.models.BlockChangeEventModelWithWorld; +import club.moddedminecraft.fastlogblockserver.models.BlockChangeType; +import club.moddedminecraft.fastlogblockserver.models.FindTask; import junit.framework.TestCase; import net.minecraft.util.math.BlockPos; -import ru.lionzxy.fastlogblock.io.filesplitter.impl.BlockHashFileSplitter; -import ru.lionzxy.fastlogblock.io.mappers.BlockMapper; -import ru.lionzxy.fastlogblock.io.mappers.NickMapper; -import ru.lionzxy.fastlogblock.models.BlockChangeEventModelWithWorld; -import ru.lionzxy.fastlogblock.models.BlockChangeType; -import ru.lionzxy.fastlogblock.models.FindTask; -import ru.lionzxy.fastlogblock.utils.TestUtils; +import club.moddedminecraft.fastlogblockserver.io.filesplitter.impl.BlockHashFileSplitter; +import club.moddedminecraft.fastlogblockserver.io.mappers.BlockMapper; +import club.moddedminecraft.fastlogblockserver.io.mappers.NickMapper; +import club.moddedminecraft.fastlogblockserver.utils.TestUtils; import java.io.File; import java.io.IOException; diff --git a/src/test/java/ru/lionzxy/fastlogblock/utils/ASCITest.java b/src/test/java/club/moddedminecraft/fastlogblockserver/utils/ASCITest.java similarity index 75% rename from src/test/java/ru/lionzxy/fastlogblock/utils/ASCITest.java rename to src/test/java/club/moddedminecraft/fastlogblockserver/utils/ASCITest.java index eccfbc7..0c08491 100644 --- a/src/test/java/ru/lionzxy/fastlogblock/utils/ASCITest.java +++ b/src/test/java/club/moddedminecraft/fastlogblockserver/utils/ASCITest.java @@ -1,7 +1,7 @@ -package ru.lionzxy.fastlogblock.utils; +package club.moddedminecraft.fastlogblockserver.utils; +import club.moddedminecraft.fastlogblockserver.models.ASCIString; import junit.framework.TestCase; -import ru.lionzxy.fastlogblock.models.ASCIString; public class ASCITest extends TestCase { public void testEquals() { diff --git a/src/test/java/ru/lionzxy/fastlogblock/utils/TestUtils.java b/src/test/java/club/moddedminecraft/fastlogblockserver/utils/TestUtils.java similarity index 84% rename from src/test/java/ru/lionzxy/fastlogblock/utils/TestUtils.java rename to src/test/java/club/moddedminecraft/fastlogblockserver/utils/TestUtils.java index e9827e6..b6e3227 100644 --- a/src/test/java/ru/lionzxy/fastlogblock/utils/TestUtils.java +++ b/src/test/java/club/moddedminecraft/fastlogblockserver/utils/TestUtils.java @@ -1,4 +1,4 @@ -package ru.lionzxy.fastlogblock.utils; +package club.moddedminecraft.fastlogblockserver.utils; import java.io.File;