mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-27 23:45:44 +00:00
Inital update to 1.4.6, Version bumped to 6.5
This commit is contained in:
1 parent
420e04f1b9
commit
a2f4a0d2dd
70 files changed
+761
-744
No files matched your search
@@ -2,6 +2,7 @@ package net.minecraftforge.common;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.WeightedRandomChestContent;
|
||||
import net.minecraft.world.WorldServer;
|
||||
@@ -42,6 +43,15 @@ public class ChestGenHooks
|
||||
addInfo(STRONGHOLD_CROSSING, ComponentStrongholdRoomCrossing.strongholdRoomCrossingChestContents, 1, 5);
|
||||
addInfo(VILLAGE_BLACKSMITH, ComponentVillageHouse2.villageBlacksmithChestContents, 3, 9);
|
||||
addInfo(BONUS_CHEST, WorldServer.bonusChestContent, 10, 10);
|
||||
|
||||
ItemStack book = new ItemStack(Item.field_92053_bW, 1, 0);
|
||||
WeightedRandomChestContent tmp = new WeightedRandomChestContent(book, 1, 1, 1);
|
||||
getInfo(MINESHAFT_CORRIDOR ).addItem(tmp);
|
||||
getInfo(PYRAMID_DESERT_CHEST).addItem(tmp);
|
||||
getInfo(PYRAMID_JUNGLE_CHEST).addItem(tmp);
|
||||
getInfo(STRONGHOLD_CORRIDOR ).addItem(tmp);
|
||||
getInfo(STRONGHOLD_LIBRARY ).addItem(new WeightedRandomChestContent(book, 1, 5, 2));
|
||||
getInfo(STRONGHOLD_CROSSING ).addItem(tmp);
|
||||
}
|
||||
|
||||
private static void addInfo(String category, WeightedRandomChestContent[] items, int min, int max)
|
||||
@@ -103,7 +113,7 @@ public class ChestGenHooks
|
||||
}
|
||||
|
||||
//shortcut functions, See the non-static versions below
|
||||
public static WeightedRandomChestContent[] getItems(String category){ return getInfo(category).getItems(); }
|
||||
public static WeightedRandomChestContent[] getItems(String category, Random rnd){ return getInfo(category).getItems(rnd); }
|
||||
public static int getCount(String category, Random rand){ return getInfo(category).getCount(rand); }
|
||||
public static void addItem(String category, WeightedRandomChestContent item){ getInfo(category).addItem(item); }
|
||||
public static void removeItem(String category, ItemStack item){ getInfo(category).removeItem(item); }
|
||||
@@ -151,7 +161,7 @@ public class ChestGenHooks
|
||||
while(itr.hasNext())
|
||||
{
|
||||
WeightedRandomChestContent cont = itr.next();
|
||||
if (item.isItemEqual(cont.itemStack) || (item.getItemDamage() == -1 && item.itemID == cont.itemStack.itemID))
|
||||
if (item.isItemEqual(cont.theItemId) || (item.getItemDamage() == -1 && item.itemID == cont.theItemId.itemID))
|
||||
{
|
||||
itr.remove();
|
||||
}
|
||||
@@ -163,9 +173,25 @@ public class ChestGenHooks
|
||||
*
|
||||
* @return The random objects
|
||||
*/
|
||||
public WeightedRandomChestContent[] getItems()
|
||||
public WeightedRandomChestContent[] getItems(Random rnd)
|
||||
{
|
||||
return contents.toArray(new WeightedRandomChestContent[contents.size()]);
|
||||
ArrayList<WeightedRandomChestContent> ret = new ArrayList<WeightedRandomChestContent>();
|
||||
|
||||
for (WeightedRandomChestContent orig : contents)
|
||||
{
|
||||
Item item = orig.theItemId.getItem();
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
WeightedRandomChestContent n = item.getChestGenBase(this, rnd, orig);
|
||||
if (n != null)
|
||||
{
|
||||
ret.add(n);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret.toArray(new WeightedRandomChestContent[ret.size()]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,7 +32,7 @@ public class ForgeInternalHandler
|
||||
Entity entity = event.entity;
|
||||
if (entity.getClass().equals(EntityItem.class))
|
||||
{
|
||||
ItemStack stack = ((EntityItem)entity).item;
|
||||
ItemStack stack = ((EntityItem)entity).getDataWatcher().getWatchableObjectItemStack(10);
|
||||
|
||||
if (stack == null)
|
||||
{
|
||||
|
||||
@@ -10,9 +10,9 @@ public class ForgeVersion
|
||||
//This number is incremented every time we remove deprecated code/major API changes, never reset
|
||||
public static final int majorVersion = 6;
|
||||
//This number is incremented every minecraft release, never reset
|
||||
public static final int minorVersion = 4;
|
||||
public static final int minorVersion = 5;
|
||||
//This number is incremented every time a interface changes or new major feature is added, and reset every Minecraft version
|
||||
public static final int revisionVersion = 2;
|
||||
public static final int revisionVersion = 0;
|
||||
//This number is incremented every time Jenkins builds Forge, and never reset. Should always be 0 in the repo code.
|
||||
public static final int buildVersion = 0;
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package net.minecraftforge.event.terraingen;
|
||||
|
||||
import cpw.mods.fml.common.Side;
|
||||
import cpw.mods.fml.common.asm.SideOnly;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.world.biome.BiomeDecorator;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.event.*;
|
||||
@@ -44,7 +43,7 @@ public class BiomeEvent extends Event
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static class BiomeColor extends BiomeEvent
|
||||
public static class BiomeColor extends BiomeEvent
|
||||
{
|
||||
public final int originalColor;
|
||||
public int newColor;
|
||||
|
||||
Reference in new issue
Block a user