Skip to content

Commit

Permalink
Merge branch 'main' into experimental/foundation
Browse files Browse the repository at this point in the history
  • Loading branch information
kappa-maintainer committed Aug 19, 2024
2 parents 12fce85 + b958531 commit b1f8e2f
Show file tree
Hide file tree
Showing 8 changed files with 533 additions and 18 deletions.
22 changes: 15 additions & 7 deletions src/main/java/net/minecraftforge/common/BiomeDictionary.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;

/**
* BiomeDictionary provides tags for Biomes to use
* If tags are not specified, you imply an "average" biome
* (Think Oak forest, moderate temperature, temperate trees, and moderate humidity)
*/
public class BiomeDictionary
{
private static final boolean DEBUG = false;
Expand All @@ -49,18 +54,21 @@ public static final class Type
public static final Type HOT = new Type("HOT");
public static final Type COLD = new Type("COLD");

/*Tags specifying the amount of vegetation a biome has. Specifying neither implies a biome to have moderate amounts*/
/**Tag specifying a sparse amount of vegetation*/
public static final Type SPARSE = new Type("SPARSE");
/**Tag specifying a dense amount of vegetation*/
public static final Type DENSE = new Type("DENSE");

/*Tags specifying how moist a biome is. Specifying neither implies the biome as having moderate humidity*/
/**Tag specifying how moist a biome is*/
public static final Type WET = new Type("WET");
/**Tag specifying how moist a biome is*/
public static final Type DRY = new Type("DRY");

/*Tree-based tags, SAVANNA refers to dry, desert-like trees (Such as Acacia), CONIFEROUS refers to snowy trees (Such as Spruce) and JUNGLE refers to jungle trees.
* Specifying no tag implies a biome has temperate trees (Such as Oak)*/
/**Tree-based tag: refers to dry, desert-like trees (Such as Acacia)*/
public static final Type SAVANNA = new Type("SAVANNA");
/**Tree-based tag: refers to snowy trees (Such as Spruce)*/
public static final Type CONIFEROUS = new Type("CONIFEROUS");
/**Tree-based tag: refers to jungle trees*/
public static final Type JUNGLE = new Type("JUNGLE");

/*Tags specifying the nature of a biome*/
Expand Down Expand Up @@ -125,14 +133,14 @@ public String toString()
}

/**
* Retrieves a Type instance by name,
* if one does not exist already it creates one.
* Retrieves a Type instance by name.
* If one does not exist already, it creates one.
* This can be used as intermediate measure for modders to
* add their own Biome types.
* <p>
* There are <i>no</i> naming conventions besides:
* <ul><li><b>Must</b> be all upper case (enforced by name.toUpper())</li>
* <li><b>No</b> Special characters. {Unenforced, just don't be a pain, if it becomes a issue I WILL
* <li><b>No</b> Special characters. {Unenforced, just don't be a pain, if it becomes an issue I WILL
* make this RTE with no worry about backwards compatibility}</li></ul>
* <p>
* Note: For performance sake, the return value of this function SHOULD be cached.
Expand Down
14 changes: 11 additions & 3 deletions src/main/java/net/minecraftforge/common/DungeonHooks.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.WeightedRandom;


/**
* DungeonHooks allows you to add or remove mobs
* to the spawners that generate in dungeons
*
* @author LexManos, cpw
*/
public class DungeonHooks
{
private static ArrayList<DungeonMob> dungeonMobs = new ArrayList<DungeonMob>();
Expand All @@ -34,7 +41,7 @@ public class DungeonHooks
* If the mob is already in the spawn list, the rarity will be added to the existing one,
* causing the mob to be more common.
*
* @param name The name of the monster, use the same name used when registering the entity.
* @param name The name of the monster. This is the same name used when registering the entity.
* @param rarity The rarity of selecting this mob over others. Must be greater then 0.
* Vanilla Minecraft has the following mobs:
* Spider 100
Expand Down Expand Up @@ -83,8 +90,9 @@ public static int removeDungeonMob(ResourceLocation name)

/**
* Gets a random mob name from the list.
* @param rand World generation random number generator
* @return The mob name
*
* @param rand The World generation random number
* @return The mobs name
*/
public static ResourceLocation getRandomDungeonMob(Random rand)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package net.minecraftforge.fml.client;

import net.minecraft.client.resources.I18n;
import net.minecraftforge.fml.common.DuplicateModsFoundException;
import net.minecraftforge.fml.common.ModContainer;

Expand All @@ -40,9 +41,9 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
this.drawDefaultBackground();
int offset = Math.max(85 - dupes.dupes.size() * 10, 10);
this.drawCenteredString(this.fontRenderer, "Forge Mod Loader has found a problem with your minecraft installation", this.width / 2, offset, 0xFFFFFF);
this.drawCenteredString(this.fontRenderer, I18n.format("fml.messages.load.problem.found"), this.width / 2, offset, 0xFFFFFF);
offset+=10;
this.drawCenteredString(this.fontRenderer, "You have mod sources that are duplicate within your system", this.width / 2, offset, 0xFFFFFF);
this.drawCenteredString(this.fontRenderer, "You have duplicate mods installed. Please remove duplicates to avoid conflicts.", this.width / 2, offset, 0xFFFFFF);
offset+=10;
this.drawCenteredString(this.fontRenderer, "Mod Id : File name", this.width / 2, offset, 0xFFFFFF);
offset+=5;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package net.minecraftforge.fml.client;

import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.resources.I18n;
import net.minecraftforge.fml.common.ModContainer;
import net.minecraftforge.fml.common.toposort.ModSortingException;
import net.minecraftforge.fml.common.toposort.ModSortingException.SortingExceptionData;
Expand All @@ -43,7 +44,7 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
this.drawDefaultBackground();
int offset = Math.max(85 - (failedList.getVisitedNodes().size() + 3) * 10, 10);
this.drawCenteredString(this.fontRenderer, "Forge Mod Loader has found a problem with your minecraft installation", this.width / 2, offset, 0xFFFFFF);
this.drawCenteredString(this.fontRenderer, I18n.format("fml.messages.load.problem.found"), this.width / 2, offset, 0xFFFFFF);
offset+=10;
this.drawCenteredString(this.fontRenderer, "A mod sorting cycle was detected and loading cannot continue", this.width / 2, offset, 0xFFFFFF);
offset+=10;
Expand Down
19 changes: 14 additions & 5 deletions src/main/java/net/minecraftforge/fml/common/ProgressManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,24 @@
import com.google.common.base.Joiner;

/**
* Not a fully fleshed out API, may change in future MC versions.
* However feel free to use and suggest additions.
* ProgressManager allows you to create loading bars
* that appear durning Mod Loading
*/
public class ProgressManager
{
private static final List<ProgressBar> bars = new CopyOnWriteArrayList<ProgressBar>();

/**
* Not a fully fleshed out API, may change in future MC versions.
* However feel free to use and suggest additions.
* Create a progress bar with a title and number of steps
*
* @param title The title of the bar
* @param steps The ammout of steps
*/
public static ProgressBar push(String title, int steps)
{
return push(title, steps, false);
}

/**
* Not a fully fleshed out API, may change in future MC versions.
* However feel free to use and suggest additions.
Expand Down Expand Up @@ -118,6 +122,11 @@ public void step(Class<?> classToName, String... extra)
step(ClassNameUtils.shortName(classToName)+Joiner.on(' ').join(extra));
}

/**
* Move to the next step in a bar.
*
* @param message The message to display inside a the bar
*/
public void step(String message)
{
if(step >= steps) throw new IllegalStateException("too much steps for ProgressBar " + title);
Expand Down Expand Up @@ -157,4 +166,4 @@ public void timeEachStep()
this.timeEachStep = true;
}
}
}
}
2 changes: 2 additions & 0 deletions src/main/resources/assets/forge/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ fml.menu.modoptions=Mod Options...

item.forge.bucketFilled.name=%s Bucket


fml.messages.load.problem.found=Forge Mod Loader has found a problem with your minecraft installation
fml.messages.mod.missing.dependencies=%s is missing mods it depends on.
fml.messages.mod.missing.dependencies.fix=Include the following mods or remove %s.
fml.messages.mod.missing.dependencies.compatibility=You must include the right dependencies for %s:
Expand Down
Loading

0 comments on commit b1f8e2f

Please sign in to comment.