2013-03-08 00:25:48 +00:00
|
|
|
/*
|
2016-06-23 03:49:47 +00:00
|
|
|
* Minecraft Forge
|
2019-02-10 22:57:03 +00:00
|
|
|
* Copyright (c) 2016-2019.
|
2016-06-23 03:49:47 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation version 2.1
|
|
|
|
* of the License.
|
|
|
|
*
|
|
|
|
* This library 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
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2013-03-08 00:25:48 +00:00
|
|
|
*/
|
|
|
|
|
2018-03-25 15:59:43 +00:00
|
|
|
package net.minecraftforge.fml.loading.moddiscovery;
|
2012-07-22 14:26:38 +00:00
|
|
|
|
2019-01-14 03:51:36 +00:00
|
|
|
import net.minecraftforge.forgespi.coremod.ICoreModFile;
|
2018-04-07 03:58:48 +00:00
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.Reader;
|
|
|
|
import java.nio.file.Files;
|
|
|
|
import java.nio.file.Path;
|
|
|
|
|
|
|
|
public class CoreModFile implements ICoreModFile {
|
|
|
|
private final Path internalPath;
|
2018-03-25 15:59:43 +00:00
|
|
|
private final ModFile file;
|
|
|
|
private final String name;
|
2012-07-22 14:26:38 +00:00
|
|
|
|
2018-04-07 03:58:48 +00:00
|
|
|
CoreModFile(final String name, final Path path, final ModFile file) {
|
2018-03-25 15:59:43 +00:00
|
|
|
this.name = name;
|
|
|
|
this.internalPath = path;
|
|
|
|
this.file = file;
|
|
|
|
}
|
2012-07-22 14:26:38 +00:00
|
|
|
|
2018-03-25 15:59:43 +00:00
|
|
|
@Override
|
2018-04-07 03:58:48 +00:00
|
|
|
public Reader readCoreMod() throws IOException {
|
|
|
|
return Files.newBufferedReader(this.internalPath);
|
2012-07-22 14:26:38 +00:00
|
|
|
}
|
2018-03-25 15:59:43 +00:00
|
|
|
|
2012-07-22 14:26:38 +00:00
|
|
|
@Override
|
2018-04-07 03:58:48 +00:00
|
|
|
public Path getPath() {
|
2018-03-25 15:59:43 +00:00
|
|
|
return this.internalPath;
|
2012-07-22 14:26:38 +00:00
|
|
|
}
|
|
|
|
}
|