Skip to content
This repository has been archived by the owner on Jul 21, 2024. It is now read-only.

Commit

Permalink
Added biome dump
Browse files Browse the repository at this point in the history
  • Loading branch information
LeStegii authored and Hexeption committed Mar 2, 2021
1 parent c092220 commit 1bc8635
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 24 deletions.
49 changes: 28 additions & 21 deletions patches/net/minecraft/server/MinecraftServer.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListenableFutureTask;
@@ -15,93 +19,111 @@
@@ -15,93 +19,112 @@
import io.netty.handler.codec.base64.Base64;
import java.awt.GraphicsEnvironment;
import java.awt.image.BufferedImage;
Expand Down Expand Up @@ -94,6 +94,7 @@
-import net.minecraft.world.WorldType;
-import net.minecraft.world.chunk.storage.AnvilSaveConverter;
+import net.minecraft.world.*;
+import net.minecraft.world.biome.Biome;
+import net.minecraft.world.chunk.storage.AnvilSaveHandler;
import net.minecraft.world.storage.ISaveFormat;
import net.minecraft.world.storage.ISaveHandler;
Expand Down Expand Up @@ -159,15 +160,15 @@
@SideOnly(Side.SERVER)
private String hostname;
private int serverPort = -1;
@@ -128,7 +150,6 @@
@@ -128,7 +151,6 @@
private KeyPair serverKeyPair;
private String serverOwner;
private String folderName;
- @SideOnly(Side.CLIENT)
private String worldName;
private boolean isDemo;
private boolean enableBonusChest;
@@ -144,178 +165,295 @@
@@ -144,178 +166,301 @@
private final GameProfileRepository profileRepo;
private final PlayerProfileCache profileCache;
private long nanoTimeSinceStatusRefresh;
Expand Down Expand Up @@ -501,6 +502,17 @@
- }
- }
- } //Forge: End dead code
+ if(MagmaConfig.instance.debugPrintBiomes.getValues()){
+ for (Biome biome : ForgeRegistries.BIOMES.getValuesCollection()) {
+ MinecraftServer.LOGGER.info(biome.getRegistryName());
+ }
+ }

- WorldServer overWorld = (WorldServer)(isDemo() ? new WorldServerDemo(this, isavehandler, worldinfo, 0, profiler).init() : new WorldServer(this, isavehandler, worldinfo, 0, profiler).init());
- overWorld.initialize(worldsettings);
- for (int dim : net.minecraftforge.common.DimensionManager.getStaticDimensionIDs())
- {
- WorldServer world = (dim == 0 ? overWorld : (WorldServer)new WorldServerMulti(this, isavehandler, dim, overWorld, profiler).init());
+ server.loadPlugins();
+ server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.STARTUP);
+ // Magma end
Expand All @@ -513,12 +525,7 @@
+ } else {
+ world = (WorldServer) (new WorldServer(this, idatamanager, worlddata, dim, this.profiler, worldEnvironment, gen)).init();
+ }

- WorldServer overWorld = (WorldServer)(isDemo() ? new WorldServerDemo(this, isavehandler, worldinfo, 0, profiler).init() : new WorldServer(this, isavehandler, worldinfo, 0, profiler).init());
- overWorld.initialize(worldsettings);
- for (int dim : net.minecraftforge.common.DimensionManager.getStaticDimensionIDs())
- {
- WorldServer world = (dim == 0 ? overWorld : (WorldServer)new WorldServerMulti(this, isavehandler, dim, overWorld, profiler).init());
+
+ world.initialize(worldsettings);
+ this.server.scoreboardManager = new CraftScoreboardManager(this, world.getScoreboard());
+ } else {
Expand Down Expand Up @@ -560,7 +567,7 @@
int i = 16;
int j = 4;
int k = 192;
@@ -323,45 +461,43 @@
@@ -323,45 +468,43 @@
int i1 = 0;
this.setUserMessage("menu.generatingTerrain");
int j1 = 0;
Expand Down Expand Up @@ -630,7 +637,7 @@
}
}

@@ -379,73 +515,80 @@
@@ -379,73 +522,80 @@

public abstract boolean shouldBroadcastConsoleToOps();

Expand Down Expand Up @@ -743,7 +750,7 @@
{
if (worldserver1 != null)
{
@@ -453,159 +596,214 @@
@@ -453,159 +603,214 @@
worldserver1.flush();
}
}
Expand Down Expand Up @@ -1031,7 +1038,7 @@
BufferedImage bufferedimage = ImageIO.read(file1);
Validate.validState(bufferedimage.getWidth() == 64, "Must be 64 pixels wide");
Validate.validState(bufferedimage.getHeight() == 64, "Must be 64 pixels high");
@@ -613,52 +811,44 @@
@@ -613,52 +818,44 @@
ByteBuf bytebuf1 = Base64.encode(bytebuf);
response.setFavicon("data:image/png;base64," + bytebuf1.toString(StandardCharsets.UTF_8));
bytebuf1.release(); // Forge: fix MC-122085
Expand Down Expand Up @@ -1096,7 +1103,7 @@
this.startProfiling = false;
this.profiler.profilingEnabled = true;
this.profiler.clearProfiling();
@@ -667,16 +857,15 @@
@@ -667,16 +864,15 @@
this.profiler.startSection("root");
this.updateTimeLightAndEntities();

Expand All @@ -1118,7 +1125,7 @@
}

Collections.shuffle(Arrays.asList(agameprofile));
@@ -684,7 +873,7 @@
@@ -684,7 +880,7 @@
this.statusResponse.invalidateJson();
}

Expand All @@ -1127,7 +1134,7 @@
{
this.profiler.startSection("save");
this.playerList.saveAllPlayerData();
@@ -693,134 +882,165 @@
@@ -693,134 +889,165 @@
}

this.profiler.startSection("tallying");
Expand Down Expand Up @@ -1362,7 +1369,7 @@
LOGGER.warn(msg);
}

@@ -835,53 +1055,52 @@
@@ -835,53 +1062,52 @@
return ret;
}

Expand Down Expand Up @@ -1442,7 +1449,7 @@
}
});
}
@@ -889,145 +1108,115 @@
@@ -889,145 +1115,115 @@
return report;
}

Expand Down Expand Up @@ -1632,7 +1639,7 @@
worldserver1.getWorldInfo().setDifficulty(difficulty);
worldserver1.setAllowedSpawnTypes(this.allowSpawnMonsters(), this.canSpawnAnimals);
}
@@ -1035,80 +1224,75 @@
@@ -1035,80 +1231,75 @@
}
}

Expand Down Expand Up @@ -1742,7 +1749,7 @@
++l;
}
}
@@ -1117,228 +1301,193 @@
@@ -1117,228 +1308,193 @@
playerSnooper.addClientStat("worlds", Integer.valueOf(l));
}

Expand Down Expand Up @@ -2025,7 +2032,7 @@
return entity;
}
}
@@ -1347,316 +1496,254 @@
@@ -1347,316 +1503,254 @@
return null;
}

Expand Down
14 changes: 11 additions & 3 deletions src/main/java/org/magmafoundation/magma/commands/MagmaCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
import java.util.Collections;
import java.util.List;

import net.minecraft.world.biome.Biome;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
Expand Down Expand Up @@ -101,6 +103,7 @@ public boolean execute(CommandSender sender, String commandLabel, String[] args)
createMagmaDump("worlds.mdump");
createMagmaDump("permissions.mdump");
createMagmaDump("materials.mdump");
createMagmaDump("biomes.mdump");
sender.sendMessage(ChatColor.RED + "Dump saved!");
break;
default:
Expand Down Expand Up @@ -151,12 +154,17 @@ private void createMagmaDump(String fileName) {
}

writer.close();


case "materials":

for (Material material : Material.values()) {
writer.write( material.name() + "\n");
writer.write(material.name() + "\n");
}

writer.close();
case "biomes":

for (Biome biome : ForgeRegistries.BIOMES.getValuesCollection()) {
writer.write(biome.getRegistryName() + "\n");
}

writer.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class MagmaConfig extends ConfigBase {
public final BooleanValue debugPrintBukkitMatterials = new BooleanValue(this, "debug.debugPrintBukkitMatterials", false, "Prints the Forge Bukkit Materials");
public final BooleanValue debugPrintBukkitBannerPatterns = new BooleanValue(this, "debug.debugPrintBukkitBannerPatterns", false, "Prints the Forge Bukkit Banner Patterns");
public final BooleanValue debugPrintCommandNode = new BooleanValue(this, "debug.debugPrintCommandNode", false, "Prints out all Command Nodes for permissions");
public final BooleanValue debugPrintBiomes = new BooleanValue(this, "debug.debugPrintBiomes", false, "Prints out all registered biomes");

//============================Black List Mods=============================
public final BooleanValue blacklistedModsEnable = new BooleanValue(this, "forge.blacklistedmods.enabled", false, "Enable blacklisting of mods");
Expand Down

0 comments on commit 1bc8635

Please sign in to comment.