Skip to content

Commit

Permalink
Removed server-side restrictions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jallot committed Apr 27, 2020
1 parent 7a16a36 commit 547969f
Show file tree
Hide file tree
Showing 49 changed files with 445 additions and 4,286 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/.gradle/
libs
libs
begradle-0.2.3-SNAPSHOT-fg3.jar
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@
--- net/minecraft/client/ClientBrandRetriever.java
+++ net/minecraft/client/ClientBrandRetriever.java
@@ -2,6 +2,6 @@

public class ClientBrandRetriever {
public static String getClientModName() {
- return "vanilla";
+ return "WorldDownloader-" + wdl.VersionConstants.getModVersion();
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@
--- net/minecraft/client/ClientBrandRetriever.java
+++ net/minecraft/client/ClientBrandRetriever.java
@@ -2,6 +2,6 @@

public class ClientBrandRetriever {
public static String getClientModName() {
- return "vanilla";
+ return "WorldDownloader-" + wdl.VersionConstants.getModVersion();
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@
--- net/minecraft/client/ClientBrandRetriever.java
+++ net/minecraft/client/ClientBrandRetriever.java
@@ -2,6 +2,6 @@

public class ClientBrandRetriever {
public static String getClientModName() {
- return "vanilla";
+ return "WorldDownloader-" + wdl.VersionConstants.getModVersion();
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@
--- net/minecraft/client/ClientBrandRetriever.java
+++ net/minecraft/client/ClientBrandRetriever.java
@@ -2,6 +2,6 @@

public class ClientBrandRetriever {
public static String getClientModName() {
- return "vanilla";
+ return "WorldDownloader-" + wdl.VersionConstants.getModVersion();
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@
--- net/minecraft/client/ClientBrandRetriever.java
+++ net/minecraft/client/ClientBrandRetriever.java
@@ -2,6 +2,6 @@

public class ClientBrandRetriever {
public static String getClientModName() {
- return "vanilla";
+ return "WorldDownloader-" + wdl.VersionConstants.getModVersion();
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@
--- net/minecraft/client/ClientBrandRetriever.java
+++ net/minecraft/client/ClientBrandRetriever.java
@@ -2,6 +2,6 @@

public class ClientBrandRetriever {
public static String getClientModName() {
- return "vanilla";
+ return "WorldDownloader-" + wdl.VersionConstants.getModVersion();
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@
--- net/minecraft/client/ClientBrandRetriever.java
+++ net/minecraft/client/ClientBrandRetriever.java
@@ -2,6 +2,6 @@

public class ClientBrandRetriever {
public static String getClientModName() {
- return "vanilla";
+ return "WorldDownloader-" + wdl.VersionConstants.getModVersion();
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@
--- net/minecraft/client/ClientBrandRetriever.java
+++ net/minecraft/client/ClientBrandRetriever.java
@@ -2,6 +2,6 @@

public class ClientBrandRetriever {
public static String getClientModName() {
- return "vanilla";
+ return "WorldDownloader-" + wdl.VersionConstants.getModVersion();
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@
--- net/minecraft/client/ClientBrandRetriever.java
+++ net/minecraft/client/ClientBrandRetriever.java
@@ -2,6 +2,6 @@

public class ClientBrandRetriever {
public static String getClientModName() {
- return "vanilla";
+ return "WorldDownloader-" + wdl.VersionConstants.getModVersion();
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@
--- net/minecraft/client/ClientBrandRetriever.java
+++ net/minecraft/client/ClientBrandRetriever.java
@@ -2,6 +2,6 @@

public class ClientBrandRetriever {
public static String getClientModName() {
- return "vanilla";
+ return "WorldDownloader-" + wdl.VersionConstants.getModVersion();
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@
--- net/minecraft/client/ClientBrandRetriever.java
+++ net/minecraft/client/ClientBrandRetriever.java
@@ -2,6 +2,6 @@

public class ClientBrandRetriever {
public static String getClientModName() {
- return "vanilla";
+ return "WorldDownloader-" + wdl.VersionConstants.getModVersion();
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@
--- net/minecraft/client/ClientBrandRetriever.java
+++ net/minecraft/client/ClientBrandRetriever.java
@@ -2,6 +2,6 @@

public class ClientBrandRetriever {
public static String getClientModName() {
- return "vanilla";
+ return "WorldDownloader-" + wdl.VersionConstants.getModVersion();
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@
--- net/minecraft/client/ClientBrandRetriever.java
+++ net/minecraft/client/ClientBrandRetriever.java
@@ -2,6 +2,6 @@

public class ClientBrandRetriever {
public static String getClientModName() {
- return "vanilla";
+ return "WorldDownloader-" + wdl.VersionConstants.getModVersion();
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@
--- net/minecraft/client/ClientBrandRetriever.java
+++ net/minecraft/client/ClientBrandRetriever.java
@@ -2,6 +2,6 @@

public class ClientBrandRetriever {
public static String getClientModName() {
- return "vanilla";
+ return "WorldDownloader-" + wdl.VersionConstants.getModVersion();
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@
--- net/minecraft/client/ClientBrandRetriever.java
+++ net/minecraft/client/ClientBrandRetriever.java
@@ -2,6 +2,6 @@

public class ClientBrandRetriever {
public static String getClientModName() {
- return "vanilla";
+ return "WorldDownloader-" + wdl.VersionConstants.getModVersion();
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@
--- net/minecraft/client/ClientBrandRetriever.java
+++ net/minecraft/client/ClientBrandRetriever.java
@@ -2,6 +2,6 @@

public class ClientBrandRetriever {
public static String getClientModName() {
- return "vanilla";
+ return "WorldDownloader-" + wdl.VersionConstants.getModVersion();
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@
--- net/minecraft/client/ClientBrandRetriever.java
+++ net/minecraft/client/ClientBrandRetriever.java
@@ -2,6 +2,6 @@

public class ClientBrandRetriever {
public static String getClientModName() {
- return "vanilla";
+ return "WorldDownloader-" + wdl.VersionConstants.getModVersion();
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@
--- net/minecraft/client/ClientBrandRetriever.java
+++ net/minecraft/client/ClientBrandRetriever.java
@@ -2,6 +2,6 @@

public class ClientBrandRetriever {
public static String getClientModName() {
- return "vanilla";
+ return "WorldDownloader-" + wdl.VersionConstants.getModVersion();
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@
--- net/minecraft/client/ClientBrandRetriever.java
+++ net/minecraft/client/ClientBrandRetriever.java
@@ -2,6 +2,6 @@

public class ClientBrandRetriever {
public static String getClientModName() {
- return "vanilla";
+ return "WorldDownloader-" + wdl.VersionConstants.getModVersion();
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@
--- net/minecraft/client/ClientBrandRetriever.java
+++ net/minecraft/client/ClientBrandRetriever.java
@@ -2,6 +2,6 @@

public class ClientBrandRetriever {
public static String getClientModName() {
- return "vanilla";
+ return "WorldDownloader-" + wdl.VersionConstants.getModVersion();
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@
--- net/minecraft/client/ClientBrandRetriever.java
+++ net/minecraft/client/ClientBrandRetriever.java
@@ -2,6 +2,6 @@

public class ClientBrandRetriever {
public static String getClientModName() {
- return "vanilla";
+ return "WorldDownloader-" + wdl.VersionConstants.getModVersion();
}
}
17 changes: 9 additions & 8 deletions share/src/main/java/wdl/EntityUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,16 @@ public static int getEntityTrackDistance(TrackDistanceMode mode, @Nonnull String
return -1;
}
case SERVER: {
int serverDistance = WDLPluginChannels
.getEntityRange(type);

if (serverDistance < 0) {
return getEntityTrackDistance(TrackDistanceMode.DEFAULT, type, entity);
}

return serverDistance;
}
// int serverDistance = WDLPluginChannels
// .getEntityRange(type);
//
// if (serverDistance < 0) {
// return getEntityTrackDistance(TrackDistanceMode.DEFAULT, type, entity);
// }
//
// return serverDistance;
}
case USER: {
int value = WDL.getInstance().worldProps.getUserEntityTrackDistance(type);

Expand Down
38 changes: 19 additions & 19 deletions share/src/main/java/wdl/WDL.java
Original file line number Diff line number Diff line change
Expand Up @@ -422,9 +422,9 @@ public void startDownload() {
minecraft.displayGuiScreen(null);
worldClient = minecraft.world;

if (!WDLPluginChannels.canDownloadAtAll()) {
return;
}
// if (!WDLPluginChannels.canDownloadAtAll()) {
// return;
// }

if (promptForInfoForSettings("startDownload", true, this::startDownload, () -> minecraft.displayGuiScreen(null))) {
return;
Expand Down Expand Up @@ -536,7 +536,7 @@ public boolean loadWorld() {
loadServerProps();
}

WDLPluginChannels.onWorldLoad();
// WDLPluginChannels.onWorldLoad();

// Is this a different server?
if (networkManager != newNM) {
Expand Down Expand Up @@ -611,11 +611,11 @@ public void onSaveComplete() {
* when stopping.
*/
public void saveEverything() throws Exception {
if (!WDLPluginChannels.canDownloadAtAll()) {
WDLMessages.chatMessageTranslated(WDL.serverProps,
WDLMessageTypes.ERROR, "wdl.messages.generalError.forbidden");
return;
}
// if (!WDLPluginChannels.canDownloadAtAll()) {
// WDLMessages.chatMessageTranslated(WDL.serverProps,
// WDLMessageTypes.ERROR, "wdl.messages.generalError.forbidden");
// return;
// }

WorldBackupType backupType = serverProps.getValue(MiscSettings.BACKUP_TYPE);

Expand Down Expand Up @@ -727,7 +727,7 @@ public boolean shouldCancel() {
* @return The player NBT tag. Needed for later use in the world info.
*/
private NBTTagCompound savePlayer(GuiWDLSaveProgress progressScreen) {
if (!WDLPluginChannels.canDownloadAtAll()) { return new NBTTagCompound(); }
// if (!WDLPluginChannels.canDownloadAtAll()) { return new NBTTagCompound(); }

progressScreen.startMajorTask(
I18n.format("wdl.saveProgress.playerData.title"),
Expand Down Expand Up @@ -799,7 +799,7 @@ private NBTTagCompound savePlayer(GuiWDLSaveProgress progressScreen) {
*/
private void saveWorldInfo(GuiWDLSaveProgress progressScreen,
NBTTagCompound playerInfoNBT) {
if (!WDLPluginChannels.canDownloadAtAll()) { return; }
// if (!WDLPluginChannels.canDownloadAtAll()) { return; }

progressScreen.startMajorTask(
I18n.format("wdl.saveProgress.worldMetadata.title"),
Expand Down Expand Up @@ -881,7 +881,7 @@ private void saveWorldInfo(GuiWDLSaveProgress progressScreen,
*/
private void saveChunks(GuiWDLSaveProgress progressScreen)
throws IllegalArgumentException, IllegalAccessException {
if (!WDLPluginChannels.canDownloadAtAll()) { return; }
// if (!WDLPluginChannels.canDownloadAtAll()) { return; }

WDLMessages.chatMessageTranslated(WDL.serverProps,
WDLMessageTypes.SAVING, "wdl.messages.saving.savingChunks");
Expand Down Expand Up @@ -911,9 +911,9 @@ private void saveChunks(GuiWDLSaveProgress progressScreen)
Chunk c = chunks.get(currentChunk);
if (c != null) {
//Serverside restrictions check
if (!WDLPluginChannels.canSaveChunk(c)) {
continue;
}
// if (!WDLPluginChannels.canSaveChunk(c)) {
// continue;
// }

progressScreen.setMinorTaskProgress(I18n.format(
"wdl.saveProgress.chunk.saving", c.getPos().x,
Expand All @@ -930,9 +930,9 @@ private void saveChunks(GuiWDLSaveProgress progressScreen)
* Import all non-overwritten TileEntities, then save the chunk
*/
public void saveChunk(Chunk c) {
if (!WDLPluginChannels.canDownloadAtAll()) { return; }

if (!WDLPluginChannels.canSaveChunk(c)) { return; }
// if (!WDLPluginChannels.canDownloadAtAll()) { return; }
//
// if (!WDLPluginChannels.canSaveChunk(c)) { return; }

try {
savedChunks.add(c.getPos());
Expand Down Expand Up @@ -1327,7 +1327,7 @@ private void addForgeDataToWorldInfo(NBTTagCompound rootWorldInfoNBT, NBTTagComp
* that contain pictures.
*/
private void saveMapData(GuiWDLSaveProgress progressScreen) {
if (!WDLPluginChannels.canSaveMaps()) { return; }
// if (!WDLPluginChannels.canSaveMaps()) { return; }

File dataDirectory = new File(saveHandler.getWorldDirectory(),
"data");
Expand Down
12 changes: 6 additions & 6 deletions share/src/main/java/wdl/WDLChunkLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ public WDLChunkLoader(WDL wdl, File file) {
protected NBTTagList getEntityList(Chunk chunk) {
NBTTagList entityList = new NBTTagList();

if (!WDLPluginChannels.canSaveEntities(chunk)) {
return entityList;
}
// if (!WDLPluginChannels.canSaveEntities(chunk)) {
// return entityList;
// }

// Build a list of all entities in the chunk.
List<Entity> entities = new ArrayList<>();
Expand Down Expand Up @@ -204,9 +204,9 @@ protected static boolean shouldSaveEntity(Entity e) {
protected NBTTagList getTileEntityList(Chunk chunk) {
NBTTagList tileEntityList = new NBTTagList();

if (!WDLPluginChannels.canSaveTileEntities(chunk)) {
return tileEntityList;
}
// if (!WDLPluginChannels.canSaveTileEntities(chunk)) {
// return tileEntityList;
// }

Map<BlockPos, TileEntity> chunkTEMap = chunk.getTileEntityMap();
Map<BlockPos, NBTTagCompound> oldTEMap = getOldTileEntities(chunk);
Expand Down
Loading

0 comments on commit 547969f

Please sign in to comment.