Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit e24c67b

Browse files
committed
:irritatered:
1 parent 3b527fa commit e24c67b

4 files changed

Lines changed: 64 additions & 7 deletions

File tree

patchwork-fml/src/main/java/net/minecraftforge/fml/ModList.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ public static ModList get() {
3131

3232
public boolean isLoaded(String modId) {
3333
// Patchwork: use Fabric Loader lookup instead of an internal one
34-
return FabricLoader.getInstance().isDevelopmentEnvironment() || FabricLoader.getInstance().isModLoaded(modId);
34+
return FabricLoader.getInstance().isModLoaded(modId);
3535
}
3636
}

patchwork-networking/src/main/java/com/patchworkmc/api/networking/Channel.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*
2+
* Minecraft Forge, Patchwork Project
3+
* Copyright (c) 2016-2019, 2019
4+
*
5+
* This library is free software; you can redistribute it and/or
6+
* modify it under the terms of the GNU Lesser General Public
7+
* License as published by the Free Software Foundation version 2.1
8+
* of the License.
9+
*
10+
* This library 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 GNU
13+
* Lesser General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Lesser General Public
16+
* License along with this library; if not, write to the Free Software
17+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18+
*/
19+
120
package com.patchworkmc.api.networking;
221

322
import net.minecraft.util.Identifier;

patchwork-networking/src/main/java/com/patchworkmc/impl/networking/NetworkVersionManager.java

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*
2+
* Minecraft Forge, Patchwork Project
3+
* Copyright (c) 2016-2019, 2019
4+
*
5+
* This library is free software; you can redistribute it and/or
6+
* modify it under the terms of the GNU Lesser General Public
7+
* License as published by the Free Software Foundation version 2.1
8+
* of the License.
9+
*
10+
* This library 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 GNU
13+
* Lesser General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Lesser General Public
16+
* License along with this library; if not, write to the Free Software
17+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18+
*/
19+
120
package com.patchworkmc.impl.networking;
221

322
import java.util.ArrayList;
@@ -63,7 +82,7 @@ public Map<Identifier, Pair<String, Boolean>> buildChannelVersionsForListPing()
6382
for (VersionedChannel channel: channels) {
6483
Identifier name = channel.getChannelName();
6584

66-
if(name.getNamespace().equals("fml")) {
85+
if (name.getNamespace().equals("fml")) {
6786
continue;
6887
}
6988

@@ -119,19 +138,19 @@ private List<String> validateChannels(final Function<Identifier, String> incomin
119138
final String incomingVersion = incoming.apply(channel.getChannelName());
120139
final boolean accepted = predicate.test(channel, incomingVersion != null ? incomingVersion : NetworkRegistry.ABSENT);
121140

122-
if(origin == Origin.VANILLA) {
141+
if (origin == Origin.VANILLA) {
123142
LOGGER.debug(NETREGISTRY, "Channel '{}' : Vanilla acceptance test: {}", channel.getChannelName(), accepted ? "ACCEPTED" : "REJECTED");
124143
} else {
125144
LOGGER.debug(NETREGISTRY, "Channel '{}' : Version test of '{}' from {} : {}", channel.getChannelName(), incomingVersion, origin, accepted ? "ACCEPTED" : "REJECTED");
126145
}
127146

128-
if(!accepted) {
147+
if (!accepted) {
129148
rejected.add(channel.getChannelName().toString());
130149
}
131150
}
132151

133152
if (!rejected.isEmpty()) {
134-
if(origin == Origin.VANILLA) {
153+
if (origin == Origin.VANILLA) {
135154
LOGGER.error(NETREGISTRY, "Channels {} rejected vanilla connections", rejected);
136155
} else {
137156
LOGGER.error(NETREGISTRY, "Channels {} rejected their {} version number", rejected, origin);
Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,28 @@
1+
/*
2+
* Minecraft Forge, Patchwork Project
3+
* Copyright (c) 2016-2019, 2019
4+
*
5+
* This library is free software; you can redistribute it and/or
6+
* modify it under the terms of the GNU Lesser General Public
7+
* License as published by the Free Software Foundation version 2.1
8+
* of the License.
9+
*
10+
* This library 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 GNU
13+
* Lesser General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Lesser General Public
16+
* License along with this library; if not, write to the Free Software
17+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18+
*/
19+
120
package com.patchworkmc.impl.networking;
221

322
import com.patchworkmc.api.networking.Channel;
423

524
public interface VersionedChannel extends Channel {
625
String getNetworkProtocolVersion();
7-
boolean tryServerVersionOnClient(final String serverVersion);
8-
boolean tryClientVersionOnServer(final String clientVersion);
26+
boolean tryServerVersionOnClient(String serverVersion);
27+
boolean tryClientVersionOnServer(String clientVersion);
928
}

0 commit comments

Comments
 (0)