Skip to content
This repository was archived by the owner on Apr 7, 2021. It is now read-only.

Commit 46c1a3e

Browse files
committed
Fix loading language from packaged jar, update license headers
1 parent f31f5a4 commit 46c1a3e

File tree

135 files changed

+329
-131
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+329
-131
lines changed

bootstrap/src/main/java/org/dragonet/proxy/Bootstrap.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

licenseheader.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
DragonProxy
2-
Copyright (C) 2016-2019 Dragonet Foundation
2+
Copyright (C) 2016-2020 Dragonet Foundation
33

44
This program is free software: you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/DragonProxy.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/PingPassthroughThread.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/command/CommandManager.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/command/ProxyCommand.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/command/defaults/StatsCommand.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/configuration/DragonConfiguration.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/configuration/lang/MinecraftLanguage.java

+25-7
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,46 @@
1+
/*
2+
* DragonProxy
3+
* Copyright (C) 2016-2020 Dragonet Foundation
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You can view the LICENSE file for more details.
16+
*
17+
* https://github.com/DragonetMC/DragonProxy
18+
*/
119
package org.dragonet.proxy.configuration.lang;
220

3-
import com.google.gson.JsonElement;
4-
import com.google.gson.JsonParser;
521
import com.google.gson.stream.JsonReader;
622
import lombok.extern.log4j.Log4j2;
723
import org.dragonet.proxy.DragonProxy;
824

9-
import java.io.FileNotFoundException;
10-
import java.io.FileReader;
11-
import java.io.IOException;
25+
import java.io.*;
1226
import java.util.HashMap;
1327
import java.util.Map;
1428

1529
/**
1630
* Load the Minecraft language translations.
1731
*/
32+
@Log4j2
1833
public class MinecraftLanguage {
1934
private static final Map<String, String> language = new HashMap<>();
2035

2136
static {
2237
// TODO: support for more languages
23-
String path = DragonProxy.class.getClassLoader().getResource("en_us.json").getPath();
38+
InputStream stream = DragonProxy.class.getClassLoader().getResourceAsStream("en_us.json");
39+
if(stream == null) {
40+
throw new RuntimeException("Cannot find Minecraft language file: en_us.json");
41+
}
2442

25-
try(JsonReader reader = new JsonReader(new FileReader(path))) {
43+
try(JsonReader reader = new JsonReader(new InputStreamReader(stream))) {
2644
reader.beginObject();
2745

2846
while(reader.hasNext()) {

proxy/src/main/java/org/dragonet/proxy/console/DragonConsole.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/data/entity/BedrockAttributeType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/data/entity/BedrockEntityType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/data/entity/BedrockPaintingType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/data/stats/StatInfo.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/data/stats/StatMeasurement.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/data/stats/Statistics.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/data/window/BedrockWindowType.java

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* DragonProxy
3+
* Copyright (C) 2016-2020 Dragonet Foundation
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You can view the LICENSE file for more details.
16+
*
17+
* https://github.com/DragonetMC/DragonProxy
18+
*/
119
package org.dragonet.proxy.data.window;
220

321
import lombok.Getter;

proxy/src/main/java/org/dragonet/proxy/form/CustomForm.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/form/Form.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/form/components/FormComponent.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/form/components/InputComponent.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/form/components/LabelComponent.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/metrics/Metrics.java

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* DragonProxy
3+
* Copyright (C) 2016-2020 Dragonet Foundation
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You can view the LICENSE file for more details.
16+
*
17+
* https://github.com/DragonetMC/DragonProxy
18+
*/
119
package org.dragonet.proxy.metrics;
220

321
import lombok.extern.log4j.Log4j2;

proxy/src/main/java/org/dragonet/proxy/metrics/MetricsManager.java

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* DragonProxy
3+
* Copyright (C) 2016-2020 Dragonet Foundation
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You can view the LICENSE file for more details.
16+
*
17+
* https://github.com/DragonetMC/DragonProxy
18+
*/
119
package org.dragonet.proxy.metrics;
220

321
import lombok.extern.log4j.Log4j2;

proxy/src/main/java/org/dragonet/proxy/network/ProxyServerEventListener.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/network/UpstreamPacketHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/network/session/ProxySession.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/network/session/cache/Cache.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/network/session/cache/ChunkCache.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/network/session/cache/EntityCache.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/network/session/cache/PlayerListCache.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/network/session/cache/WindowCache.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/network/session/cache/WorldCache.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/network/session/cache/object/CachedEntity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/network/session/cache/object/CachedItemEntity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/network/session/cache/object/CachedPainting.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/network/session/cache/object/CachedPlayer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/network/session/cache/object/CachedWindow.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

proxy/src/main/java/org/dragonet/proxy/network/session/data/AuthData.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DragonProxy
3-
* Copyright (C) 2016-2019 Dragonet Foundation
3+
* Copyright (C) 2016-2020 Dragonet Foundation
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

0 commit comments

Comments
 (0)