Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRandomLabs committed Sep 28, 2018
1 parent 068a509 commit 12ab1c6
Show file tree
Hide file tree
Showing 16 changed files with 868 additions and 960 deletions.
36 changes: 7 additions & 29 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -711,12 +711,12 @@ Updated:
- Added the ability to use Pick Block to take a connector's wire by sneaking (BluSunrize)
- Added Magma blocks to the list of heatsources for the Thermoelectric generator (BluSunrize)
- Added Efficiency, Unbreaking and Mending enchantments to the Engineer's Hammer and Wirecutter (BluSunrize)
- Made those tools take damage when used to break blocks
- Made those tools take damage when used to break blocks
- Added compatibility for Forge's update checker (Malte)
- Added support for Forge's memory Maven repo, this makes deleting old coremod versions unnecessary in Forge 2656+ (latest) (Malte)
- Changed fences to allow torches on top and prevent mobspawns (Malte)
- Changed animated item models to use Item-TESRs rather than rebaking (Malte)
- Made the Fluorescent tube to be really fancy again! (Malte)
- Made the Fluorescent tube to be really fancy again! (Malte)
- Changed renderdistance config to work as described (Malte)
- Changed the images of wiring in the manual to use up-to-date pictures and feature connectors and relays (BluSunrize)
- Shift-clicking is no longer needed to connect wires to breaker switches etc (Malte)
Expand Down Expand Up @@ -771,7 +771,10 @@ Updated:
* Horses and llamas can be tamed again but they need to be tamed first as MC rules
* Fixed Villager Trade Exchanger doing stuff when it doesn't need to do stuff and fixed missing button translations
* Added recipe integrations for EnderIO (if present) all the recipes integrations can be disabled in the config
* Added Fluid Dictionary Converter that will transform fluids into another similar fluids with Crafttweaker integration import mods.industrialforegoing.FluidDictionary; FluidDictionary.add("essence","xpjuice",1); FluidDictionary.remove("essence","xpjuice");
* Added Fluid Dictionary Converter that will transform fluids into another similar fluids with Crafttweaker integration import mods.industrialforegoing.FluidDictionary;

FluidDictionary.add("essence","xpjuice",1);
FluidDictionary.remove("essence","xpjuice");

JAOPCA (went from JAOPCA-1.12.2-2.2.6.78.jar to JAOPCA-1.12.2-2.2.6.82.jar):
JAOPCA-1.12.2-2.2.6.82.jar:
Expand Down Expand Up @@ -975,31 +978,6 @@ Updated:
Judge40: Create event for overriding mob griefing flag based on entity. (#4710)

NuclearCraft (went from [Archived file] to NuclearCraft-2.10j--1.12.2):
NuclearCraft-2.10j--1.12.2:
+ Added extra control buttons to Fusion Reactor

* Fixed default active water cooling rate
+ Added config option to use Ctrl rather than Shift for tooltip info
NuclearCraft-2.10i--1.12.2:
* Fixed comparator reading of the heat and efficiency of fission and fusion reactors
NuclearCraft-2.10h--1.12.2:
+ Added support for Mekanism's condensentrated gases in machine recipes
NuclearCraft-2.10g--1.12.2:
+ Added Lithium Ion Cell
* Battery blocks now have configurable sides and retain their energy when broken

+ Added Centrifuge - used to separate and reprocess molten salt fuels
* Fixed missing molten thorium fuel recipes

* Fuel rods are no longer required for nuclear fuels

* CTM is now used for connected textures!
NuclearCraft-2.10f--1.12.2:
* Fixed lighting of transparent blocks

* Decay Generator recipes can now be viewed in JEI and modified with CraftTweaker

* Wasteland dimension can now be disabled

Ore Excavation (went from OreExcavation-1.4.113.jar to OreExcavation-1.4.118.jar):
OreExcavation-1.4.118.jar:
Expand Down Expand Up @@ -1100,4 +1078,4 @@ Removed:
- Game Stages
- Reborn Core

* Generated using https://github.com/TheRandomLabs/ChangelogGenerator (1.9.5)
* Generated using https://github.com/TheRandomLabs/ChangelogGenerator (1.11)
471 changes: 109 additions & 362 deletions changeloghistory.txt

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions jei_changelog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
JEI Old to JEI New

Updated:
Just Enough Items (JEI) (went from jei_1.12.2-4.12.0.215.jar to jei_1.12.2-4.12.1.217.jar):
4.12.1:
* Small optimizations to startup time
* v4.12.1
* Fix #1355 Stopwatch is not reset when measuring plugin method execution time
* Update uk_ua.lang (#1348)
* Fix broken info recipes

* Generated using https://github.com/TheRandomLabs/ChangelogGenerator (1.11)
8 changes: 8 additions & 0 deletions jei_shortchangelog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
JEI Old to JEI New

Updated:
Just Enough Items (JEI) (went from jei_1.12.2-4.12.0.215.jar to jei_1.12.2-4.12.1.217.jar):
View changelog at:
https://minecraft.curseforge.com/projects/jei/files/2621449

* Generated using https://github.com/TheRandomLabs/ChangelogGenerator (1.11)
14 changes: 2 additions & 12 deletions shortchangelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,19 +164,9 @@ Updated:

Minecraft Forge (went from 1.12.2-14.23.2.2645 to 1.12.2-14.23.3.2673):
View changelog at:
https://files.minecraftforge.net/maven/net/minecraftforge/forge/1.12.2-14.23.3.2673/forge-1.12.2-14.23.3.2673-changelog.txt
https://files.minecraftforge.net/maven/net/minecraftforge/forge/1.12.2-14.23.4.2758/forge-1.12.2-14.23.4.2758-changelog.txt

NuclearCraft (went from [Archived file] to NuclearCraft-2.10j--1.12.2):
NuclearCraft-2.10j--1.12.2:
https://minecraft.curseforge.com/projects/nuclearcraft-mod/files/2553193
NuclearCraft-2.10i--1.12.2:
https://minecraft.curseforge.com/projects/nuclearcraft-mod/files/2552679
NuclearCraft-2.10h--1.12.2:
https://minecraft.curseforge.com/projects/nuclearcraft-mod/files/2552538
NuclearCraft-2.10g--1.12.2:
https://minecraft.curseforge.com/projects/nuclearcraft-mod/files/2552426
NuclearCraft-2.10f--1.12.2:
https://minecraft.curseforge.com/projects/nuclearcraft-mod/files/2550819

Ore Excavation (went from OreExcavation-1.4.113.jar to OreExcavation-1.4.118.jar):
OreExcavation-1.4.118.jar:
Expand Down Expand Up @@ -236,4 +226,4 @@ Removed:
- Game Stages
- Reborn Core

* Generated using https://github.com/TheRandomLabs/ChangelogGenerator (1.9.4)
* Generated using https://github.com/TheRandomLabs/ChangelogGenerator (1.11)
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
package com.therandomlabs.changeloggenerator;

import java.io.IOException;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import com.therandomlabs.curseapi.CurseException;
import com.therandomlabs.curseapi.file.CurseFile;
import com.therandomlabs.curseapi.minecraft.comparison.ModListComparer;
import com.therandomlabs.curseapi.minecraft.comparison.ModSpecificChangelogHandler;
import com.therandomlabs.curseapi.project.CurseProject;
import com.therandomlabs.curseapi.util.Documents;
import com.therandomlabs.utils.collection.ImmutableList;
import com.therandomlabs.utils.io.IOUtils;
import com.therandomlabs.utils.misc.StringUtils;

public final class ActuallyAdditionsHandler implements ModSpecificChangelogHandler {
public static final ActuallyAdditionsHandler INSTANCE = new ActuallyAdditionsHandler();
public static final String CHANGELOG_URL = "https://raw.githubusercontent.com/Ellpeck/" +
"ActuallyAdditions/master/update/changelog.md";

private ActuallyAdditionsHandler() {}

@Override
public boolean handlesMod(CurseProject project) {
return project.id() == 228404;
}

@Override
public List<String> getURLsToPreload(CurseFile oldFile, CurseFile newFile)
throws CurseException {
return new ImmutableList<>(CHANGELOG_URL);
}

@Override
public Map<String, String> getChangelogs(CurseFile oldFile, CurseFile newFile, boolean urls)
throws CurseException, IOException {
final Map<String, String> changelog = new LinkedHashMap<>();

if(urls) {
changelog.put(ModListComparer.VIEW_CHANGELOG_AT, CHANGELOG_URL);
return changelog;
}

String[] split = oldFile.name().split("-");
String oldVersion = split[1] + '-' + split[2];
oldVersion = StringUtils.removeLastChars(oldVersion, 4);

split = newFile.name().split("-");
String newVersion = split[1] + '-' + split[2];
newVersion = StringUtils.removeLastChars(newVersion, 4);

final String[] lines =
StringUtils.splitNewline(Documents.read(CHANGELOG_URL));
final StringBuilder entry = new StringBuilder();
String version = null;

boolean changelogStarted = false;

for(String line : lines) {
if(line.startsWith("# ")) {
if(changelogStarted) {
changelog.put(version, entry.toString());
entry.setLength(0);
}

version = line.substring(2);

if(!changelogStarted && version.equals(newVersion)) {
changelogStarted = true;
}

if(version.equals(oldVersion)) {
break;
}

continue;
}

if(line.isEmpty()) {
continue;
}

if(changelogStarted) {
entry.append(line).append(IOUtils.LINE_SEPARATOR);
}
}

return changelog;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package com.therandomlabs.changeloggenerator;

import java.io.IOException;
import java.util.LinkedHashMap;
import java.util.Map;
import com.therandomlabs.curseapi.CurseException;
import com.therandomlabs.curseapi.file.CurseFile;
import com.therandomlabs.curseapi.minecraft.comparison.ModListComparer;
import com.therandomlabs.curseapi.minecraft.comparison.ModSpecificChangelogHandler;
import com.therandomlabs.curseapi.project.CurseProject;
import com.therandomlabs.utils.io.IOUtils;
import com.therandomlabs.utils.misc.StringUtils;

public final class BiomesOPlentyHandler implements ModSpecificChangelogHandler {
public static final BiomesOPlentyHandler INSTANCE = new BiomesOPlentyHandler();

private BiomesOPlentyHandler() {}

@Override
public boolean handlesMod(CurseProject project) {
return project.id() == 220318;
}

@Override
public Map<String, String> getChangelogs(CurseFile oldFile, CurseFile newFile, boolean urls)
throws CurseException, IOException {
final Map<String, String> changelog = new LinkedHashMap<>();

if(urls) {
changelog.put(
ModListComparer.VIEW_CHANGELOG_AT,
ModListComparer.getChangelogURLString(newFile, true)
);
return changelog;
}

final String[] split = oldFile.name().split("-");
final String oldVersion = split[1] + '-' + split[2];

final String[] lines = StringUtils.splitNewline(newFile.changelog(true));

final StringBuilder entry = new StringBuilder();

String version = null;

for(int i = 1; i < lines.length; i++) {
final String line = lines[i];

if(line.startsWith("Build ")) {
version = StringUtils.removeLastChar(line.split(" ")[1]);
continue;
}

if(version == null) {
continue;
}

if(version.equals(oldVersion)) {
break;
}

if(line.isEmpty()) {
changelog.put(version, entry.toString());
entry.setLength(0);
version = null;
}

if(version != null) {
entry.append(line.substring(1)).append(IOUtils.LINE_SEPARATOR);
}
}

return changelog;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
package com.therandomlabs.changeloggenerator;

import java.io.IOException;
import java.util.LinkedHashMap;
import java.util.Map;
import com.therandomlabs.curseapi.CurseException;
import com.therandomlabs.curseapi.file.CurseFile;
import com.therandomlabs.curseapi.minecraft.comparison.ModListComparer;
import com.therandomlabs.curseapi.minecraft.comparison.ModSpecificChangelogHandler;
import com.therandomlabs.curseapi.project.CurseProject;
import com.therandomlabs.utils.io.IOUtils;
import com.therandomlabs.utils.misc.StringUtils;

public final class Bre2elHandler implements ModSpecificChangelogHandler {
public static final Bre2elHandler INSTANCE = new Bre2elHandler();

private Bre2elHandler() {}

@Override
public boolean handlesMod(CurseProject project) {
return "bre2el".equals(project.ownerUsername());
}

@Override
public boolean isFullChangelogInNewFile(CurseProject project) {
return true;
}

@Override
public Map<String, String> getChangelogs(CurseFile oldFile, CurseFile newFile, boolean urls)
throws CurseException, IOException {
final Map<String, String> changelog = new LinkedHashMap<>();

if(urls) {
changelog.put(
ModListComparer.VIEW_CHANGELOG_AT,
ModListComparer.getChangelogURLString(newFile, true)
);
return changelog;
}

final String oldVersion = oldFile.name().split("-")[2].replaceAll("\\.jar", "");

final String[] lines = StringUtils.splitNewline(newFile.changelog(true));
final StringBuilder entry = new StringBuilder();
String version = null;

for(String line : lines) {
if(line.startsWith("v")) {
if(version != null) {
changelog.put(version, entry.toString());
entry.setLength(0);
}

version = line.substring(1);

if(version.equals(oldVersion)) {
break;
}

continue;
}

if(line.isEmpty()) {
continue;
}

entry.append(line).append(IOUtils.LINE_SEPARATOR);
}

return changelog;
}
}
Loading

0 comments on commit 12ab1c6

Please sign in to comment.