Lots of changes including adding support for biome-specific bonemeal flowers and starting on the Biome Finder Compass

This commit is contained in:
Adubbz 2014-01-24 21:48:58 +11:00
parent 8181fed3c7
commit bc8b5fc074
79 changed files with 1235 additions and 237 deletions

View file

@ -12,11 +12,13 @@ import biomesoplenty.common.core.BOPBlocks;
import biomesoplenty.common.core.BOPCrafting;
import biomesoplenty.common.core.BOPEntities;
import biomesoplenty.common.core.BOPItems;
import biomesoplenty.common.core.BOPPackets;
import biomesoplenty.common.core.BOPPotions;
import biomesoplenty.common.core.BOPVanillaCompat;
import biomesoplenty.common.eventhandler.BOPEventHandlers;
import biomesoplenty.common.helpers.CreativeTabsBOP;
import biomesoplenty.common.integration.TreecapitatorIntegration;
import biomesoplenty.common.network.PacketPipeline;
import biomesoplenty.common.utils.BOPModInfo;
import biomesoplenty.common.world.WorldTypeBOP;
import biomesoplenty.common.world.decoration.ForcedDecorators;
@ -37,10 +39,12 @@ public class BiomesOPlenty
public static BiomesOPlenty instance;
@SidedProxy(clientSide = "biomesoplenty.ClientProxy", serverSide = "biomesoplenty.CommonProxy")
public static CommonProxy proxy;
public static CommonProxy proxy;
public static CreativeTabs tabBiomesOPlenty;
public static String configPath;
public static final PacketPipeline packetPipeline = new PacketPipeline();
public static CreativeTabs tabBiomesOPlenty;
public static String configPath;
@EventHandler
public void preInit(FMLPreInitializationEvent event)
@ -52,6 +56,7 @@ public class BiomesOPlenty
tabBiomesOPlenty = new CreativeTabsBOP(CreativeTabs.getNextID(), "tabBiomesOPlenty");
BOPPackets.init();
BOPPotions.init();
BOPBlocks.init();
BOPItems.init();
@ -76,12 +81,16 @@ public class BiomesOPlenty
@EventHandler
public void load(FMLInitializationEvent event)
{
packetPipeline.initalize();
TreecapitatorIntegration.init();
}
@EventHandler
public void postInit(FMLPostInitializationEvent event)
{
packetPipeline.postInitialize();
BOPBiomes.worldTypeBOP = new WorldTypeBOP();
}
}

View file

@ -0,0 +1,281 @@
/*package biomesoplenty.client.gui;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreenBook;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.nbt.NBTTagString;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
import org.apache.commons.lang3.StringUtils;
import org.lwjgl.opengl.GL11;
import biomesoplenty.common.helpers.BOPReflectionHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class GuiScreenBiomeBook extends GuiScreenBook
{
private static ResourceLocation biomeBookTexture = new ResourceLocation("biomesoplenty:textures/gui/screen/biomebookgui.png");
private GuiScreenBiomeBook.NextPageButton buttonNextPage;
private GuiScreenBiomeBook.NextPageButton buttonPreviousPage;
private List<PageLink> pageLinks = new ArrayList();
private boolean isDrawing;
public GuiScreenBiomeBook(EntityPlayer player, ItemStack itemStack)
{
super(player, itemStack, false);
}
@Override
public void initGui()
{
super.initGui();
//TODO: buttonList
this.field_146292_n.remove(2);
this.field_146292_n.remove(1);
int i = (this.field_146294_l - 192) / 2;
byte b0 = 2;
this.field_146292_n.add(this.buttonNextPage = new GuiScreenBiomeBook.NextPageButton(1, i + 120, b0 + 154, true));
this.field_146292_n.add(this.buttonPreviousPage = new GuiScreenBiomeBook.NextPageButton(2, i + 38, b0 + 154, false));
pageLinks.clear();
//TODO: fontRendererObj
this.pageLinks.add(new PageLink(3, i + 41 + (field_146289_q.getStringWidth("Contents") / 2) + 7, b0 + 154, 0x6189CE, "Contents", 1, 2, 0));
addLinks();
for (PageLink link : pageLinks)
{
this.field_146292_n.add(link);
}
updatePageButtons();
}
@Override
//TODO: actionPerformed()
protected void func_146284_a(GuiButton button)
{
super.func_146284_a(button);
//TODO: enabled
if (button.field_146124_l)
{
if (button instanceof PageLink)
{
PageLink link = (PageLink)button;
setCurrentPage(link.pageNumber);
}
updatePageButtons();
}
}
@Override
public void drawScreen(int x, int y, float renderPartialTicks)
{
isDrawing = true;
super.drawScreen(x, y, renderPartialTicks);
}
@Override
public void drawTexturedModalRect(int x, int y, int u, int v, int width, int height)
{
//TODO: minecraft
if (isDrawing) this.field_146297_k.getTextureManager().bindTexture(biomeBookTexture);
isDrawing = false;
super.drawTexturedModalRect(x, y, u, v, width, height);
}
private void updatePageButtons()
{
int currentPage = getCurrentPage();
int bookTotalPages = BOPReflectionHelper.getPrivateValue(GuiScreenBook.class, this, "field_146476_w", "field_146476_w");
this.buttonNextPage.field_146125_m = currentPage < bookTotalPages - 1;
this.buttonPreviousPage.field_146125_m = currentPage > 0;
for (PageLink link : pageLinks)
{
link.updateLink();
}
}
public void addLinks()
{
NBTTagList pages = BOPReflectionHelper.getPrivateValue(GuiScreenBook.class, this, "field_146483_y", "field_146483_y");
Pattern pattern = Pattern.compile("<link>(.+?)</link>");
for (int pageNo = 0; pageNo < pages.tagCount(); pageNo++)
{
String pageText = pages.func_150307_f(pageNo);
String[] lineSplitText = pageText.split("(?<=[\\n])");
for (int line = 0; line < lineSplitText.length; line++)
{
String lineText = lineSplitText[line];
Matcher matcher = pattern.matcher(lineText);
while (matcher.find())
{
String originalLinkText = matcher.group(1);
String[] splitLinkText = originalLinkText.split("<");
String linkText = splitLinkText[0];
int linkedPage = Integer.parseInt(splitLinkText[1].split(">")[0]);
String originalLinkString = "<link>" + originalLinkText + "</link>";
int i = (this.field_146294_l - 192) / 2;
byte b0 = 2;
//TODO: fontRendererObj
this.pageLinks.add(new PageLink(3 + pageLinks.size(), i + 34 + field_146289_q.getStringWidth(lineText.split(originalLinkString)[0]), b0 + 31 + (line * 9), 0x6189CE, linkText, pageNo, 0, linkedPage));
lineText = lineText.replace(originalLinkString , StringUtils.repeat(" ", linkText.length()));
}
lineSplitText[line] = lineText;
}
//TODO: setTagAt()?
pages.func_150304_a(pageNo, new NBTTagString(StringUtils.join(lineSplitText)));
}
BOPReflectionHelper.setPrivateValue(GuiScreenBook.class, this, pages, "field_146483_y", "field_146483_y");
}
public int getCurrentPage()
{
return BOPReflectionHelper.getPrivateValue(GuiScreenBook.class, this, "field_146484_x", "field_146484_x");
}
public void setCurrentPage(int pageNo)
{
BOPReflectionHelper.setPrivateValue(GuiScreenBook.class, this, pageNo, "field_146484_x", "field_146484_x");
}
@SideOnly(Side.CLIENT)
static class NextPageButton extends GuiButton
{
private final boolean nextPage;
public NextPageButton(int id, int xPosition, int yPosition, boolean nextPage)
{
super(id, xPosition, yPosition, 23, 13, "");
this.nextPage = nextPage;
}
@Override
//TODO: drawButton()
public void func_146112_a(Minecraft minecraft, int mouseX, int mouseY)
{
//TODO: drawButton
if (this.field_146125_m)
{
//TODO: xPosition yPosition xPosition width yPosition height
boolean isHovering = mouseX >= this.field_146128_h && mouseY >= this.field_146129_i && mouseX < this.field_146128_h + this.field_146120_f && mouseY < this.field_146129_i + this.field_146121_g;
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
minecraft.getTextureManager().bindTexture(GuiScreenBiomeBook.biomeBookTexture);
int k = 0;
int l = 192;
if (isHovering)
{
k += 23;
}
if (!this.nextPage)
{
l += 13;
}
//TODO: xPosition yPosition
this.drawTexturedModalRect(this.field_146128_h, this.field_146129_i, k, l, 23, 13);
}
}
}
@SideOnly(Side.CLIENT)
class PageLink extends GuiButton
{
private int colour;
private String text;
private int displayPage;
private int displayType;
public int pageNumber;
public PageLink(int id, int xPosition, int yPosition, int colour, String text, int displayPage, int displayType, int pageNumber)
{
//TODO: fontRendererObj
super(id, xPosition, yPosition, field_146289_q.getStringWidth(text.replaceAll("\\P{InBasic_Latin}", "")), 12, "");
this.colour = colour;
this.text = text;
this.displayPage = displayPage;
this.displayType = displayType;
this.pageNumber = pageNumber;
}
public void updateLink()
{
boolean display =
(displayType == 0 && getCurrentPage() == displayPage) ||
(displayType == 1) ||
(displayType == 2 && getCurrentPage() >= displayPage);
//TODO: enabled
this.field_146124_l = display;
//TODO: drawButton
this.field_146125_m = display;
}
@Override
//TODO: drawButton()
public void func_146112_a(Minecraft minecraft, int mouseX, int mouseY)
{
//TODO: drawButton
if (this.field_146125_m)
{
//TODO: xPosition yPosition xPosition width yPosition height
boolean isHovering = mouseX >= this.field_146128_h && mouseY >= this.field_146129_i && mouseX < this.field_146128_h + this.field_146120_f && mouseY < this.field_146129_i + this.field_146121_g;
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
String moddedText = isHovering ? "" + EnumChatFormatting.UNDERLINE + text : text;
//TODO: fontRendererObj xPosition yPosition
this.drawCenteredString(field_146289_q, moddedText, field_146128_h, field_146129_i, colour);
}
}
@Override
public void drawCenteredString(FontRenderer fontRenderer, String string, int x, int y, int colour)
{
fontRenderer.drawStringWithShadow(string, x, y, colour);
}
}
}*/

View file

@ -0,0 +1,105 @@
package biomesoplenty.client.textures;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureUtil;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
public class TextureBiomeFinder extends TextureAtlasSprite
{
public double currentAngle;
public double angleDelta;
public TextureBiomeFinder(String path)
{
super(path);
}
@Override
public void updateAnimation()
{
Minecraft minecraft = Minecraft.getMinecraft();
NBTTagCompound playerData = minecraft.thePlayer != null ? minecraft.thePlayer.getEntityData() : null;
NBTTagCompound biomePositionsCompound = null;
NBTTagCompound biomeCompound = null;
if (playerData != null) biomePositionsCompound = playerData.getCompoundTag("biomePositions");
if (biomePositionsCompound != null) biomeCompound = biomePositionsCompound.getCompoundTag("Lavender Fields");
if (minecraft.theWorld != null && minecraft.thePlayer != null && biomeCompound != null)
{
this.updateFinder(minecraft.theWorld, biomeCompound.getInteger("x"), biomeCompound.getInteger("z"), minecraft.thePlayer.posX, minecraft.thePlayer.posZ, (double)minecraft.thePlayer.rotationYaw, false, false);
}
else
{
this.updateFinder((World)null, 0, 0, 0.0D, 0.0D, 0.0D, true, false);
}
}
public void updateFinder(World par1World, int biomePosX, int biomePosZ, double playerPosX, double playerPosZ, double par6, boolean par8, boolean par9)
{
if (!this.framesTextureData.isEmpty())
{
double d3 = 0.0D;
if (par1World != null && !par8)
{
System.out.println(biomePosX + " " + biomePosZ);
double d4 = (double)biomePosX - playerPosX;
double d5 = (double)biomePosZ - playerPosZ;
par6 %= 360.0D;
d3 = -((par6 - 90.0D) * Math.PI / 180.0D - Math.atan2(d5, d4));
}
if (par9)
{
this.currentAngle = d3;
}
else
{
double d6;
for (d6 = d3 - this.currentAngle; d6 < -Math.PI; d6 += (Math.PI * 2D))
{
;
}
while (d6 >= Math.PI)
{
d6 -= (Math.PI * 2D);
}
if (d6 < -1.0D)
{
d6 = -1.0D;
}
if (d6 > 1.0D)
{
d6 = 1.0D;
}
this.angleDelta += d6 * 0.1D;
this.angleDelta *= 0.8D;
this.currentAngle += this.angleDelta;
}
int i;
for (i = (int)((this.currentAngle / (Math.PI * 2D) + 1.0D) * (double)this.framesTextureData.size()) % this.framesTextureData.size(); i < 0; i = (i + this.framesTextureData.size()) % this.framesTextureData.size())
{
;
}
if (i != this.frameCounter)
{
this.frameCounter = i;
TextureUtil.func_147955_a((int[][])this.framesTextureData.get(this.frameCounter), this.width, this.height, this.originX, this.originY, false, false);
}
}
}
}

View file

@ -7,7 +7,6 @@ import java.util.Random;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.common.eventhandler.world.DecorateBiomeEventHandler;
import biomesoplenty.common.world.decoration.BOPWorldFeatures;
import biomesoplenty.common.world.decoration.IBOPDecoration;
import biomesoplenty.common.world.features.WorldGenBOPFlora;
@ -49,7 +48,7 @@ public abstract class BOPBiome extends BiomeGenBase implements IBOPDecoration
{
if (getWeightedWorldGenForBOPFlowers() != null && !getWeightedWorldGenForBOPFlowers().isEmpty())
{
return (WorldGenBOPFlora)getRandomWeightedWorldGenerator(getWeightedWorldGenForBOPFlowers());
return getRandomWeightedWorldGenerator(getWeightedWorldGenForBOPFlowers());
}
else
{
@ -70,31 +69,33 @@ public abstract class BOPBiome extends BiomeGenBase implements IBOPDecoration
}
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForGrass()
{
return null;
}
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
@Override
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
return null;
}
public static WorldGenerator getRandomWeightedWorldGenerator(HashMap<WorldGenerator, Double> worldGeneratorMap)
public static <T extends WorldGenerator> T getRandomWeightedWorldGenerator(HashMap<T, ? extends Number> worldGeneratorMap)
{
double completeWeight = 0D;
for (Double weight : worldGeneratorMap.values())
for (Number weight : worldGeneratorMap.values())
{
completeWeight += weight;
completeWeight += Double.parseDouble(weight.toString());
}
double random = Math.random() * completeWeight;
double countWeight = 0D;
for (Entry<WorldGenerator, Double> entry : worldGeneratorMap.entrySet())
for (Entry<T, ? extends Number> entry : worldGeneratorMap.entrySet())
{
countWeight += entry.getValue();
countWeight += Double.parseDouble(entry.getValue().toString());
if (countWeight >= random) return entry.getKey();
}

View file

@ -79,7 +79,7 @@ public class BiomeGenBambooForest extends BOPBiome
@Override
public WorldGenerator getRandomWorldGenForGrass(Random random)
{
return random.nextInt(4) == 0 ? new WorldGenTallGrass(Blocks.tallgrass, 2) : (random.nextInt(2) == 0 ? new WorldGenTallGrass(BOPBlockHelper.get("foliage"), 10) : (random.nextInt(2) == 0 ? new WorldGenTallGrass(BOPBlockHelper.get("foliage"), 11) : (random.nextInt(8) == 0 ? new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 3, 9, 64) : new WorldGenTallGrass(BOPBlockHelper.get("foliage"), 1))));
return random.nextInt(4) == 0 ? new WorldGenTallGrass(Blocks.tallgrass, 2) : (random.nextInt(2) == 0 ? new WorldGenTallGrass(BOPBlockHelper.get("foliage"), 10) : (random.nextInt(2) == 0 ? new WorldGenTallGrass(BOPBlockHelper.get("foliage"), 11) : (random.nextInt(8) == 0 ? new WorldGenBOPDoubleFlora(3) : new WorldGenTallGrass(BOPBlockHelper.get("foliage"), 1))));
}
@Override

View file

@ -12,6 +12,7 @@ import net.minecraft.world.gen.feature.WorldGenShrub;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.features.WorldGenBOPDoubleFlora;
import biomesoplenty.common.world.features.WorldGenBOPFlora;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
import biomesoplenty.common.world.features.trees.WorldGenBOPTaiga2;
import biomesoplenty.common.world.features.trees.WorldGenOriginalTree;
@ -35,6 +36,7 @@ public class BiomeGenBorealForest extends BOPBiome
this.theBiomeDecorator.treesPerChunk = 20;
this.theBiomeDecorator.grassPerChunk = 50;
this.bopWorldFeatures.bopFlowersPerChunk = 5;
this.bopWorldFeatures.shrubsPerChunk = 10;
this.bopWorldFeatures.waterReedsPerChunk = 4;
}
@ -48,11 +50,11 @@ public class BiomeGenBorealForest extends BOPBiome
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
HashMap<WorldGenBOPFlora, Integer> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 4, 10, 5), 10D);
flowerMap.put(new WorldGenBOPDoubleFlora(4, 5), 10);
return flowerMap;
}

View file

@ -31,6 +31,7 @@ public class BiomeGenBrushland extends BOPBiome
this.theBiomeDecorator.grassPerChunk = 6;
this.theBiomeDecorator.flowersPerChunk = -999;
this.bopWorldFeatures.bopFlowersPerChunk = 5;
this.bopWorldFeatures.thornsPerChunk = 4;
this.bopWorldFeatures.shrubsPerChunk = 30;
this.bopWorldFeatures.waterReedsPerChunk = 2;
@ -45,11 +46,11 @@ public class BiomeGenBrushland extends BOPBiome
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
HashMap<WorldGenBOPFlora, Integer> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(Blocks.red_flower, 2), 5D);
flowerMap.put(new WorldGenBOPFlora(Blocks.red_flower, 2), 5);
return flowerMap;
}

View file

@ -57,12 +57,12 @@ public class BiomeGenChaparral extends BOPBiome
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
HashMap<WorldGenBOPFlora, Integer> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 4, 10, 5), 8D);
flowerMap.put(new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 1, 7, 5), 4D);
flowerMap.put(new WorldGenBOPDoubleFlora(4, 5), 8);
flowerMap.put(new WorldGenBOPDoubleFlora(1, 5), 4);
return flowerMap;
}

View file

@ -47,14 +47,14 @@ public class BiomeGenCherryBlossomGrove extends BOPBiome
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
HashMap<WorldGenBOPFlora, Integer> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 6), 12D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 9), 8D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 0), 6D);
flowerMap.put(new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 1, 7, 5), 4D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 6), 12);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 9), 8);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 0), 6);
flowerMap.put(new WorldGenBOPDoubleFlora(1, 5), 4);
return flowerMap;
}

View file

@ -66,7 +66,7 @@ public class BiomeGenConiferousForest extends BOPBiome
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 10), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 11), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(Blocks.tallgrass, 2), 0.5D);
grassMap.put(new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 3, 9, 64), 0.5D);
grassMap.put(new WorldGenBOPDoubleFlora(3, 64), 0.5D);
return grassMap;
}

View file

@ -54,11 +54,11 @@ public class BiomeGenConiferousForestSnow extends BOPBiome
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
HashMap<WorldGenBOPFlora, Integer> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 8), 8D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 8), 8);
return flowerMap;
}
@ -73,7 +73,7 @@ public class BiomeGenConiferousForestSnow extends BOPBiome
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 10), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 11), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(Blocks.tallgrass, 2), 0.25D);
grassMap.put(new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 3, 9, 64), 0.25D);
grassMap.put(new WorldGenBOPDoubleFlora(3, 64), 0.25D);
return grassMap;
}

View file

@ -11,6 +11,7 @@ import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.configuration.BOPConfigurationMisc;
import biomesoplenty.common.world.features.WorldGenBOPDoubleFlora;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
import biomesoplenty.common.world.features.trees.WorldGenDeadTree1;
@ -41,7 +42,6 @@ public class BiomeGenDeadSwamp extends BOPBiome
this.theBiomeDecorator.sandPerChunk2 = -999;
this.bopWorldFeatures.mudPerChunk = 3;
this.bopWorldFeatures.doubleTallGrassPerChunk = 1;
this.bopWorldFeatures.riverCanePerChunk = 2;
this.bopWorldFeatures.waterReedsPerChunk = 4;
this.bopWorldFeatures.koruPerChunk = 1;
@ -56,6 +56,7 @@ public class BiomeGenDeadSwamp extends BOPBiome
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 2), 1D);
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 10), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 11), 0.5D);
grassMap.put(new WorldGenBOPDoubleFlora(3), 0.25D);
return grassMap;
}

View file

@ -10,6 +10,7 @@ import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.features.WorldGenBOPDoubleFlora;
import biomesoplenty.common.world.features.WorldGenBOPFlora;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
import biomesoplenty.common.world.features.WorldGenMoss;
@ -39,7 +40,7 @@ public class BiomeGenFen extends BOPBiome
this.theBiomeDecorator.sandPerChunk = -999;
this.theBiomeDecorator.sandPerChunk2 = -999;
this.bopWorldFeatures.doubleTallGrassPerChunk = 1;
this.bopWorldFeatures.bopFlowersPerChunk = 5;
this.bopWorldFeatures.cattailsPerChunk = 1;
this.bopWorldFeatures.highCattailsPerChunk = 1;
this.bopWorldFeatures.waterPoolsPerChunk = 99;
@ -63,11 +64,11 @@ public class BiomeGenFen extends BOPBiome
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
HashMap<WorldGenBOPFlora, Integer> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(Blocks.red_flower, 2), 6D);
flowerMap.put(new WorldGenBOPFlora(Blocks.red_flower, 2), 6);
return flowerMap;
}
@ -82,6 +83,7 @@ public class BiomeGenFen extends BOPBiome
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 2), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 10), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 11), 0.5D);
grassMap.put(new WorldGenBOPDoubleFlora(3), 0.25D);
return grassMap;
}

View file

@ -11,7 +11,6 @@ import net.minecraft.entity.passive.EntityPig;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenTallGrass;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;

View file

@ -6,7 +6,6 @@ import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
@ -51,13 +50,13 @@ public class BiomeGenGrove extends BOPBiome
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
HashMap<WorldGenBOPFlora, Integer> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 0), 16D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 9), 6D);
flowerMap.put(new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 5, 11, 3), 4D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 0), 16);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 9), 6);
flowerMap.put(new WorldGenBOPDoubleFlora(5, 3), 4);
return flowerMap;
}

View file

@ -52,13 +52,13 @@ public class BiomeGenHeathland extends BOPBiome
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
HashMap<WorldGenBOPFlora, Integer> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 7), 8D);
flowerMap.put(new WorldGenBOPFlora(Blocks.red_flower, 2), 6D);
flowerMap.put(new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 1, 7, 5), 4D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 7), 8);
flowerMap.put(new WorldGenBOPFlora(Blocks.red_flower, 2), 6);
flowerMap.put(new WorldGenBOPDoubleFlora(1, 5), 4);
return flowerMap;
}

View file

@ -28,7 +28,6 @@ public class BiomeGenHighland extends BOPBiome
this.theBiomeDecorator.treesPerChunk = -999;
this.theBiomeDecorator.grassPerChunk = 99;
this.bopWorldFeatures.doubleTallGrassPerChunk = 99;
this.bopWorldFeatures.wildCarrotsPerChunk = 1;
}
@ -40,7 +39,7 @@ public class BiomeGenHighland extends BOPBiome
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 10), 0.25D);
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 11), 0.25D);
grassMap.put(new WorldGenBOPTallGrass(Blocks.tallgrass, 1), 0.5D);
grassMap.put(new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 2, 8, 64), 1D);
grassMap.put(new WorldGenBOPDoubleFlora(2), 1D);
return grassMap;
}

View file

@ -6,7 +6,6 @@ import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenShrub;
import net.minecraft.world.gen.feature.WorldGenTallGrass;
@ -46,11 +45,11 @@ public class BiomeGenJadeCliffs extends BOPBiome
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
HashMap<WorldGenBOPFlora, Integer> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 1, 7, 5), 6D);
flowerMap.put(new WorldGenBOPDoubleFlora(1, 5), 6);
return flowerMap;
}

View file

@ -5,7 +5,6 @@ import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenTallGrass;
import net.minecraft.world.gen.feature.WorldGenerator;

View file

@ -3,21 +3,19 @@ package biomesoplenty.common.biomes;
import java.util.HashMap;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenShrub;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.features.WorldGenBOPDoubleFlora;
import biomesoplenty.common.world.features.WorldGenBOPFlora;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
import biomesoplenty.common.world.features.trees.WorldGenCypress;
import biomesoplenty.common.world.features.trees.WorldGenDeadTree1;
import net.minecraft.block.Block;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenSavannaTree;
import net.minecraft.world.gen.feature.WorldGenShrub;
import net.minecraft.world.gen.feature.WorldGenerator;
public class BiomeGenLushDesert extends BOPBiome
{
@ -64,12 +62,12 @@ public class BiomeGenLushDesert extends BOPBiome
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
HashMap<WorldGenBOPFlora, Integer> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 4, 10, 5), 4D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 7), 8D);
flowerMap.put(new WorldGenBOPDoubleFlora(4, 5), 4);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 7), 8);
return flowerMap;
}

View file

@ -7,7 +7,6 @@ import net.minecraft.block.Block;
import net.minecraft.entity.monster.EntitySlime;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
@ -56,13 +55,13 @@ public class BiomeGenLushSwamp extends BOPBiome
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
HashMap<WorldGenBOPFlora, Integer> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 4), 8D);
flowerMap.put(new WorldGenBOPFlora(Blocks.red_flower, 2), 4D);
flowerMap.put(new WorldGenBOPFlora(Blocks.red_flower, 1), 6D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 4), 8);
flowerMap.put(new WorldGenBOPFlora(Blocks.red_flower, 2), 4);
flowerMap.put(new WorldGenBOPFlora(Blocks.red_flower, 1), 6);
return flowerMap;
}

View file

@ -6,7 +6,6 @@ import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
@ -58,11 +57,11 @@ public class BiomeGenMapleWoods extends BOPBiome
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
HashMap<WorldGenBOPFlora, Integer> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 8), 1D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 8), 1);
return flowerMap;
}

View file

@ -9,6 +9,7 @@ import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.features.WorldGenBOPDoubleFlora;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
public class BiomeGenMarsh extends BOPBiome
@ -39,7 +40,6 @@ public class BiomeGenMarsh extends BOPBiome
this.theBiomeDecorator.sandPerChunk2 = -999;
this.bopWorldFeatures.koruPerChunk = 1;
this.bopWorldFeatures.doubleTallGrassPerChunk = 50;
this.bopWorldFeatures.mudPerChunk = 1;
this.bopWorldFeatures.waterLakesPerChunk = 100;
this.bopWorldFeatures.waterReedsPerChunk = 10;
@ -54,6 +54,7 @@ public class BiomeGenMarsh extends BOPBiome
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 10), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 11), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(Blocks.tallgrass, 1), 1D);
grassMap.put(new WorldGenBOPDoubleFlora(3), 0.25D);
return grassMap;
}

View file

@ -7,9 +7,7 @@ import net.minecraft.block.Block;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenDoublePlant;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.features.WorldGenBOPDoubleFlora;
@ -39,7 +37,6 @@ public class BiomeGenMeadow extends BOPBiome
this.bopWorldFeatures.bopFlowersPerChunk = 14;
this.bopWorldFeatures.wildCarrotsPerChunk = 1;
this.bopWorldFeatures.sunflowersPerChunk = 1;
this.bopWorldFeatures.shrubsPerChunk = 5;
this.bopWorldFeatures.cloverPatchesPerChunk = 15;
this.bopWorldFeatures.generatePumpkins = false;
@ -53,14 +50,15 @@ public class BiomeGenMeadow extends BOPBiome
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
HashMap<WorldGenBOPFlora, Integer> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 0), 10D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 4), 8D);
flowerMap.put(new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 5, 11, 3), 5D);
flowerMap.put(new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 1, 7, 5), 4D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 0), 10);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 4), 8);
flowerMap.put(new WorldGenBOPDoubleFlora(5, 3), 5);
flowerMap.put(new WorldGenBOPDoubleFlora(1, 5), 4);
flowerMap.put(new WorldGenBOPDoubleFlora(0, 3), 2);
return flowerMap;
}

View file

@ -6,7 +6,6 @@ import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.configuration.BOPConfigurationMisc;
@ -47,11 +46,11 @@ public class BiomeGenMoor extends BOPBiome
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
HashMap<WorldGenBOPFlora, Integer> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 1), 14D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 1), 14);
return flowerMap;
}

View file

@ -5,7 +5,6 @@ import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenTallGrass;
import net.minecraft.world.gen.feature.WorldGenerator;

View file

@ -5,7 +5,6 @@ import java.util.Random;
import net.minecraft.entity.monster.EntityWitch;
import net.minecraft.init.Blocks;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
@ -64,16 +63,16 @@ public class BiomeGenMysticGrove extends BOPBiome
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
HashMap<WorldGenBOPFlora, Integer> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 6), 12D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 3), 10D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 4), 8D);
flowerMap.put(new WorldGenBOPFlora(Blocks.red_flower, 3), 6D);
flowerMap.put(new WorldGenBOPFlora(Blocks.red_flower, 2), 6D);
flowerMap.put(new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 1, 7, 5), 4D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 6), 12);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 3), 10);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 4), 8);
flowerMap.put(new WorldGenBOPFlora(Blocks.red_flower, 3), 6);
flowerMap.put(new WorldGenBOPFlora(Blocks.red_flower, 2), 6);
flowerMap.put(new WorldGenBOPDoubleFlora(1, 5), 4);
return flowerMap;
}

View file

@ -6,7 +6,6 @@ import net.minecraft.entity.monster.EntityCaveSpider;
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.entity.passive.EntityBat;
import net.minecraft.init.Blocks;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenTallGrass;
import net.minecraft.world.gen.feature.WorldGenerator;
@ -14,8 +13,8 @@ import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.configuration.BOPConfigurationMisc;
import biomesoplenty.common.world.features.WorldGenBOPFlora;
import biomesoplenty.common.world.features.trees.WorldGenBOPSwampTree;
import biomesoplenty.common.world.features.trees.WorldGenDeadTree1;
import biomesoplenty.common.world.features.trees.WorldGenBOPTaiga2;
import biomesoplenty.common.world.features.trees.WorldGenDeadTree1;
public class BiomeGenOminousWoods extends BOPBiome
{

View file

@ -3,9 +3,7 @@ package biomesoplenty.common.biomes;
import java.util.Random;
import net.minecraft.init.Blocks;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.configuration.BOPConfigurationMisc;
import biomesoplenty.common.world.features.trees.WorldGenOriginalTree;

View file

@ -48,12 +48,12 @@ public class BiomeGenPrairie extends BOPBiome
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
HashMap<WorldGenBOPFlora, Integer> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers2"), 4), 12D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 9), 6D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers2"), 4), 12);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 9), 6);
return flowerMap;
}

View file

@ -6,7 +6,6 @@ import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;

View file

@ -7,7 +7,6 @@ import net.minecraft.block.Block;
import net.minecraft.entity.passive.EntityOcelot;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenTallGrass;
import net.minecraft.world.gen.feature.WorldGenerator;
@ -50,14 +49,14 @@ public class BiomeGenRainforest extends BOPBiome
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
HashMap<WorldGenBOPFlora, Integer> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 6), 12D);
flowerMap.put(new WorldGenBOPFlora(Blocks.red_flower, 1), 6D);
flowerMap.put(new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 4, 10, 5), 4D);
flowerMap.put(new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 1, 7, 5), 6D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 6), 12);
flowerMap.put(new WorldGenBOPFlora(Blocks.red_flower, 1), 6);
flowerMap.put(new WorldGenBOPDoubleFlora(4, 5), 4);
flowerMap.put(new WorldGenBOPDoubleFlora(1, 5), 6);
return flowerMap;
}

View file

@ -6,7 +6,6 @@ import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenShrub;
import net.minecraft.world.gen.feature.WorldGenerator;
@ -34,6 +33,7 @@ public class BiomeGenRedwoodForest extends BOPBiome
this.theBiomeDecorator.treesPerChunk = 75;
this.theBiomeDecorator.grassPerChunk = 16;
this.bopWorldFeatures.bopFlowersPerChunk = 5;
this.bopWorldFeatures.bushesPerChunk = 4;
this.bopWorldFeatures.berryBushesPerChunk = 1;
this.bopWorldFeatures.shrubsPerChunk = 10;
@ -49,12 +49,12 @@ public class BiomeGenRedwoodForest extends BOPBiome
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
HashMap<WorldGenBOPFlora, Integer> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 4, 10, 5), 10D);
flowerMap.put(new WorldGenBOPFlora(Blocks.red_flower, 1), 8D);
flowerMap.put(new WorldGenBOPDoubleFlora(4, 5), 10);
flowerMap.put(new WorldGenBOPFlora(Blocks.red_flower, 1), 8);
return flowerMap;
}

View file

@ -51,13 +51,13 @@ public class BiomeGenSacredSprings extends BOPBiome
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
HashMap<WorldGenBOPFlora, Integer> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 6), 10D);
flowerMap.put(new WorldGenBOPFlora(Blocks.red_flower, 1), 6D);
flowerMap.put(new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 5, 11, 5), 5D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 6), 10);
flowerMap.put(new WorldGenBOPFlora(Blocks.red_flower, 1), 6);
flowerMap.put(new WorldGenBOPDoubleFlora(5, 5), 5);
return flowerMap;
}

View file

@ -7,7 +7,6 @@ import net.minecraft.block.Block;
import net.minecraft.entity.passive.EntityWolf;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;

View file

@ -5,7 +5,6 @@ import java.util.Random;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenShrub;
import net.minecraft.world.gen.feature.WorldGenerator;

View file

@ -7,7 +7,6 @@ import net.minecraft.block.Block;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenShrub;
import net.minecraft.world.gen.feature.WorldGenTallGrass;
@ -35,6 +34,7 @@ public class BiomeGenShrubland extends BOPBiome
this.theBiomeDecorator.flowersPerChunk = 0;
this.theBiomeDecorator.grassPerChunk = 5;
this.bopWorldFeatures.bopFlowersPerChunk = 5;
this.bopWorldFeatures.bushesPerChunk = 7;
this.bopWorldFeatures.shrubsPerChunk = 5;
this.bopWorldFeatures.waterReedsPerChunk = 3;
@ -45,16 +45,15 @@ public class BiomeGenShrubland extends BOPBiome
//TODO: getRandomWorldGenForTrees()
public WorldGenAbstractTree func_150567_a(Random random)
{
return new WorldGenShrub(0, 0);
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
HashMap<WorldGenBOPFlora, Integer> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(Blocks.red_flower, 2), 4D);
flowerMap.put(new WorldGenBOPFlora(Blocks.red_flower, 2), 4);
return flowerMap;
}

View file

@ -3,18 +3,17 @@ package biomesoplenty.common.biomes;
import java.util.HashMap;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.entity.monster.EntitySpider;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.configuration.BOPConfigurationMisc;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
import biomesoplenty.common.world.features.trees.WorldGenBOPSwampTree;
import biomesoplenty.common.world.features.trees.WorldGenDeadTree1;
import net.minecraft.block.Block;
import net.minecraft.entity.monster.EntitySpider;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenerator;
public class BiomeGenSilkglades extends BOPBiome
{

View file

@ -7,7 +7,6 @@ import net.minecraft.block.Block;
import net.minecraft.entity.monster.EntitySlime;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;

View file

@ -7,7 +7,6 @@ import net.minecraft.block.Block;
import net.minecraft.entity.passive.EntityWolf;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenTaiga2;
import net.minecraft.world.gen.feature.WorldGenerator;
@ -50,11 +49,11 @@ public class BiomeGenSpruceWoods extends BOPBiome
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
HashMap<WorldGenBOPFlora, Integer> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers2"), 5), 15D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers2"), 5), 15);
return flowerMap;
}

View file

@ -6,7 +6,6 @@ import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenShrub;
import net.minecraft.world.gen.feature.WorldGenerator;
@ -68,7 +67,7 @@ public class BiomeGenTemperateRainforest extends BOPBiome
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 11), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(Blocks.tallgrass, 1), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(Blocks.tallgrass, 2), 0.5D);
grassMap.put(new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 3, 9, 64), 0.25D);
grassMap.put(new WorldGenBOPDoubleFlora(3), 0.25D);
return grassMap;
}

View file

@ -4,7 +4,6 @@ import java.util.HashMap;
import java.util.Random;
import net.minecraft.init.Blocks;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenShrub;
import net.minecraft.world.gen.feature.WorldGenTallGrass;
@ -29,6 +28,7 @@ public class BiomeGenThicket extends BOPBiome
this.theBiomeDecorator.treesPerChunk = 17;
this.theBiomeDecorator.grassPerChunk = 1;
this.bopWorldFeatures.bopFlowersPerChunk = 5;
this.bopWorldFeatures.thornsPerChunk = 25;
this.bopWorldFeatures.shrubsPerChunk = 15;
}
@ -41,11 +41,11 @@ public class BiomeGenThicket extends BOPBiome
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
HashMap<WorldGenBOPFlora, Integer> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(Blocks.red_flower, 2), 0.5D);
flowerMap.put(new WorldGenBOPFlora(Blocks.red_flower, 2), 4);
return flowerMap;
}

View file

@ -6,7 +6,6 @@ import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;

View file

@ -7,7 +7,6 @@ import net.minecraft.block.Block;
import net.minecraft.entity.passive.EntityOcelot;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenTrees;
import net.minecraft.world.gen.feature.WorldGenerator;
@ -44,7 +43,6 @@ public class BiomeGenTropicalRainforest extends BOPBiome
this.theBiomeDecorator.waterlilyPerChunk = 2;
this.bopWorldFeatures.bopFlowersPerChunk = 10;
this.bopWorldFeatures.doubleTallGrassPerChunk = 8;
this.bopWorldFeatures.generatePumpkins = false;
this.bopWorldFeatures.generateMelons = true;
this.bopWorldFeatures.sproutsPerChunk = 2;
@ -62,11 +60,11 @@ public class BiomeGenTropicalRainforest extends BOPBiome
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
HashMap<WorldGenBOPFlora, Integer> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 5), 12D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 5), 12);
return flowerMap;
}
@ -80,7 +78,7 @@ public class BiomeGenTropicalRainforest extends BOPBiome
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 11), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(Blocks.tallgrass, 1), 1D);
grassMap.put(new WorldGenBOPTallGrass(Blocks.tallgrass, 2), 0.75D);
grassMap.put(new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 3, 9, 64), 1D);
grassMap.put(new WorldGenBOPDoubleFlora(3), 1D);
return grassMap;
}

View file

@ -43,7 +43,6 @@ public class BiomeGenTropics extends BOPBiome
this.theBiomeDecorator.sandPerChunk2 = 50;
this.bopWorldFeatures.bopFlowersPerChunk = 30;
this.bopWorldFeatures.sunflowersPerChunk = 2;
this.bopWorldFeatures.shrubsPerChunk = 4;
this.bopWorldFeatures.generatePumpkins = false;
}
@ -58,15 +57,16 @@ public class BiomeGenTropics extends BOPBiome
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
HashMap<WorldGenBOPFlora, Integer> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 9), 8D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 5), 10D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers2"), 0), 15D);
flowerMap.put(new WorldGenBOPFlora(Blocks.red_flower, 1), 7D);
flowerMap.put(new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 4, 10, 5), 6D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 9), 8);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 5), 10);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers2"), 0), 15);
flowerMap.put(new WorldGenBOPFlora(Blocks.red_flower, 1), 7);
flowerMap.put(new WorldGenBOPDoubleFlora(4, 5), 6);
flowerMap.put(new WorldGenBOPDoubleFlora(0, 3), 2);
return flowerMap;
}
@ -79,7 +79,7 @@ public class BiomeGenTropics extends BOPBiome
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 10), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 11), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(Blocks.tallgrass, 1), 1D);
grassMap.put(new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 3, 9, 64), 0.25D);
grassMap.put(new WorldGenBOPDoubleFlora(3), 0.25D);
return grassMap;
}

View file

@ -3,17 +3,15 @@ package biomesoplenty.common.biomes;
import java.util.HashMap;
import java.util.Random;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.features.WorldGenBOPFlora;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenShrub;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.features.WorldGenBOPFlora;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
public class BiomeGenTundra extends BOPBiome
{
@ -51,11 +49,11 @@ public class BiomeGenTundra extends BOPBiome
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
HashMap<WorldGenBOPFlora, Integer> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 8), 4D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 8), 4);
return flowerMap;
}

View file

@ -1,6 +1,5 @@
package biomesoplenty.common.biomes;
import net.minecraft.world.biome.BiomeGenBase.Height;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.configuration.BOPConfigurationMisc;

View file

@ -4,7 +4,6 @@ import java.util.HashMap;
import java.util.Random;
import net.minecraft.init.Blocks;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;

View file

@ -3,6 +3,12 @@ package biomesoplenty.common.biomes;
import java.util.HashMap;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.entity.monster.EntitySlime;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.features.WorldGenBOPDoubleFlora;
import biomesoplenty.common.world.features.WorldGenBOPFlora;
@ -10,14 +16,6 @@ import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
import biomesoplenty.common.world.features.WorldGenMoss;
import biomesoplenty.common.world.features.trees.WorldGenBOPSwampTree;
import biomesoplenty.common.world.features.trees.WorldGenBOPTaiga2;
import net.minecraft.block.Block;
import net.minecraft.entity.monster.EntitySlime;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenerator;
public class BiomeGenWetland extends BOPBiome
{
@ -74,12 +72,12 @@ public class BiomeGenWetland extends BOPBiome
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
HashMap<WorldGenBOPFlora, Integer> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 1), 10D);
flowerMap.put(new WorldGenBOPFlora(Blocks.red_flower, 1), 6D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 1), 10);
flowerMap.put(new WorldGenBOPFlora(Blocks.red_flower, 1), 6);
return flowerMap;
}
@ -93,7 +91,7 @@ public class BiomeGenWetland extends BOPBiome
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 11), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(Blocks.tallgrass, 2), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(Blocks.tallgrass, 1), 1D);
grassMap.put(new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 3, 9, 64), 0.75D);
grassMap.put(new WorldGenBOPDoubleFlora(3), 0.75D);
return grassMap;
}

View file

@ -3,17 +3,15 @@ package biomesoplenty.common.biomes;
import java.util.HashMap;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.features.WorldGenBOPDoubleFlora;
import biomesoplenty.common.world.features.WorldGenBOPFlora;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenerator;
public class BiomeGenWoodland extends BOPBiome
{
@ -50,11 +48,11 @@ public class BiomeGenWoodland extends BOPBiome
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
HashMap<WorldGenBOPFlora, Integer> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 4, 10, 5), 6D);
flowerMap.put(new WorldGenBOPDoubleFlora(4, 5), 6);
return flowerMap;
}

View file

@ -80,8 +80,6 @@ public class BOPConfigurationBiomeGen
jungleGen = config.get("Special Biomes To Generate", "Jungle", true).getBoolean(true);
megaTaigaGen = config.get("Special Biomes To Generate", "Mega Taiga", true).getBoolean(true);
}
FMLCommonHandler.instance().getFMLLogger().log(Level.INFO, "[BiomesOPlenty] Generated Biome Gen Config!");
}
catch (Exception e)
{

View file

@ -169,8 +169,6 @@ public class BOPConfigurationIDs
entityDartID = config.get("Entity IDs", "Dart ID", 104, null).getInt();;
entityPoisonDartID = config.get("Entity IDs", "Poison Dart ID", 105, null).getInt();;
FMLCommonHandler.instance().getFMLLogger().log(Level.INFO, "[BiomesOPlenty] Generating Biome ID's");
//23-79 ExtraBiomesXL
promisedLandShrubID = config.get("Biome IDs", "Sublime Shrubland (Promised Land) ID", 53).getInt();
@ -297,8 +295,6 @@ public class BOPConfigurationIDs
wastelandID = config.get("Biome IDs", "Wasteland ID", 252).getInt();
wetlandID = config.get("Biome IDs", "Wetland ID", 253).getInt();
woodlandID = config.get("Biome IDs", "Woodland ID", 254).getInt();
FMLCommonHandler.instance().getFMLLogger().log(Level.INFO, "[BiomesOPlenty] Generated IDs Config!");
}
catch (Exception e)
{

View file

@ -25,8 +25,6 @@ public class BOPConfigurationMain
config.load();
seenVersion = config.get("Vars", "Seen Version", "null");
FMLCommonHandler.instance().getFMLLogger().log(Level.INFO, "[BiomesOPlenty] Generated Main Config!");
}
catch (Exception e)
{

View file

@ -59,8 +59,6 @@ public class BOPConfigurationMisc
onlySpawnOnBeaches = config.get("Spawn Settings", "Only Spawn On Beaches", true).getBoolean(true);
//promisedLandSkyColor = config.get("Hard-Coded Colors", "Promised Land Sky Color", 5883101, null).getInt();
FMLCommonHandler.instance().getFMLLogger().log(Level.INFO, "[BiomesOPlenty] Generated Misc Config!");
}
catch (Exception e)
{

View file

@ -34,8 +34,6 @@ public class BOPConfigurationTerrainGen
//netherOverride = config.get("Dimension Settings", "Enable Nether Override", true).getBoolean(true);
//landmassPercentage = config.get("Biomes O\' Plenty World Type Settings", "Landmass Percentage", 10, "In Vanilla it is set to 10. Takes values from 0 to 100.").getInt();
FMLCommonHandler.instance().getFMLLogger().log(Level.INFO, "[BiomesOPlenty] Generated Terrain Gen Config!");
}
catch (Exception e)
{

View file

@ -38,8 +38,6 @@ public class BOPConfigurationWorldFeatures
WorldGenFieldAssociation.worldGeneratorMap.remove(key);
}
}
FMLCommonHandler.instance().getFMLLogger().log(Level.INFO, "[BiomesOPlenty] Generated World Features Config!");
}
catch (Exception e)
{

View file

@ -123,8 +123,6 @@ public class BOPConfigurationStrongholds
BiomeManager.addStrongholdBiome(biome);
}
}
FMLCommonHandler.instance().getFMLLogger().log(Level.INFO, "[BiomesOPlenty] Generated Villages Config!");
}
catch (Exception e)
{

View file

@ -118,8 +118,6 @@ public class BOPConfigurationVillages
BiomeManager.addVillageBiome(biome, true);
}
}
FMLCommonHandler.instance().getFMLLogger().log(Level.INFO, "[BiomesOPlenty] Generated Villages Config!");
}
catch (Exception e)
{

View file

@ -18,6 +18,7 @@ import biomesoplenty.common.items.ItemBOPScythe;
import biomesoplenty.common.items.ItemBOPSeeds;
import biomesoplenty.common.items.ItemBOPSpade;
import biomesoplenty.common.items.ItemBOPSword;
import biomesoplenty.common.items.ItemBiomeFinder;
import biomesoplenty.common.items.ItemDart;
import biomesoplenty.common.items.ItemDartBlower;
import biomesoplenty.common.items.ItemEnderporter;
@ -65,6 +66,9 @@ public class BOPItems
registerItem(new ItemBOPRecord("bopdisc").setUnlocalizedName("bopDisc"));
registerItem(new ItemBOPRecord("bopdiscmud").setUnlocalizedName("bopDiscMud"));
//registerItem(new ItemBiomeBook().setUnlocalizedName("biomeBook"));
registerItem(new ItemBiomeFinder().setUnlocalizedName("biomeFinder"));
registerItem(new ItemBOPSword(BOPItemHelper.toolMaterialMud, 0).setUnlocalizedName("swordMud"));
registerItem(new ItemBOPSpade(BOPItemHelper.toolMaterialMud, 0).setUnlocalizedName("shovelMud"));
registerItem(new ItemBOPPickaxe(BOPItemHelper.toolMaterialMud, 0).setUnlocalizedName("pickaxeMud"));

View file

@ -0,0 +1,18 @@
package biomesoplenty.common.core;
import static biomesoplenty.BiomesOPlenty.packetPipeline;
import biomesoplenty.common.network.packet.PacketBiomePosition;
public class BOPPackets
{
public static void init()
{
registerPackets();
}
private static void registerPackets()
{
packetPipeline.registerPacket(PacketBiomePosition.class);
}
}

View file

@ -1,14 +1,22 @@
package biomesoplenty.common.core;
import java.util.HashMap;
import java.util.Map.Entry;
import net.minecraft.block.BlockDispenser;
import net.minecraft.item.ItemStack;
import net.minecraft.util.WeightedRandomChestContent;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.ChestGenHooks;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.api.BOPItemHelper;
import biomesoplenty.common.configuration.BOPConfigurationMisc;
import biomesoplenty.common.entities.projectiles.dispenser.DispenserBehaviourDart;
import biomesoplenty.common.entities.projectiles.dispenser.DispenserBehaviourMudball;
import biomesoplenty.common.world.decoration.ForcedDecorators;
import biomesoplenty.common.world.decoration.IBOPDecoration;
import biomesoplenty.common.world.features.WorldGenBOPDoubleFlora;
import biomesoplenty.common.world.features.WorldGenBOPFlora;
public class BOPVanillaCompat
{
@ -16,6 +24,7 @@ public class BOPVanillaCompat
{
registerDispenserBehaviours();
addDungeonLoot();
addBonemealFlowers();
}
private static void registerDispenserBehaviours()
@ -54,4 +63,44 @@ public class BOPVanillaCompat
village.addItem(new WeightedRandomChestContent(new ItemStack(BOPItemHelper.get("flippers"), 1, 0), 1, 1, 5));
}
}
private static void addBonemealFlowers()
{
//TODO: getBiomeGenArray()
for (BiomeGenBase biome : BiomeGenBase.func_150565_n())
{
if (biome != null)
{
IBOPDecoration bopDecoration = null;
if (biome instanceof IBOPDecoration)
{
bopDecoration = (IBOPDecoration)biome;
}
else if (ForcedDecorators.biomeHasForcedDecorator(biome.biomeID))
{
bopDecoration = ForcedDecorators.getForcedDecorator(biome.biomeID);
}
if (bopDecoration != null)
{
if (bopDecoration.getWeightedWorldGenForBOPFlowers() != null && !bopDecoration.getWeightedWorldGenForBOPFlowers().isEmpty())
{
HashMap<WorldGenBOPFlora, Integer> flowerMap = bopDecoration.getWeightedWorldGenForBOPFlowers();
for (Entry<WorldGenBOPFlora, Integer> entry : flowerMap.entrySet())
{
if (!(entry.getKey() instanceof WorldGenBOPDoubleFlora))
{
WorldGenBOPFlora flowerGenerator = entry.getKey();
int weight = entry.getValue();
biome.addFlower(flowerGenerator.flora, flowerGenerator.floraMeta, weight);
}
}
}
}
}
}
}
}

View file

@ -23,6 +23,18 @@ public class BOPReflectionHelper
}
}
public static <T, E> void setPrivateValue(Class <? super T > classToAccess, T instance, E value, String fieldName, String obfFieldName)
{
if (isDeobfuscated)
{
ReflectionHelper.setPrivateValue(classToAccess, instance, value, fieldName);
}
else
{
ObfuscationReflectionHelper.setPrivateValue(classToAccess, instance, value, obfFieldName);
}
}
public static <T, E> void setPrivateFinalValue(Class <? super T > classToAccess, T instance, E value, String fieldName, String obfFieldName)
{
Field field = null;

View file

@ -0,0 +1,88 @@
/*package biomesoplenty.common.items;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemEditableBook;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.nbt.NBTTagString;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import biomesoplenty.BiomesOPlenty;
import biomesoplenty.client.gui.GuiScreenBiomeBook;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemBiomeBook extends ItemEditableBook
{
public ItemBiomeBook()
{
super();
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
}
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
{
setBookInfo(itemStack);
if (world.isRemote)
{
Minecraft.getMinecraft().func_147108_a(new GuiScreenBiomeBook(player, itemStack));
}
return itemStack;
}
@Override
//TODO: public void getSubItems(Item item, CreativeTabs creativeTabs, List list)
public void func_150895_a(Item item, CreativeTabs creativeTabs, List list)
{
ItemStack biomeBook = new ItemStack(item);
setBookInfo(biomeBook);
list.add(biomeBook);
}
private void setBookInfo(ItemStack itemStack)
{
if (!itemStack.hasTagCompound()) itemStack.setTagCompound(new NBTTagCompound());
itemStack.getTagCompound().setString("title", this.getItemStackDisplayName(itemStack));
itemStack.getTagCompound().setString("author", "The BoP Team");
NBTTagList tagList = new NBTTagList();
tagList.appendTag(new NBTTagString("Bla \n<link>Hi<2></link>"));
tagList.appendTag(new NBTTagString("Test I"));
tagList.appendTag(new NBTTagString("Test II"));
itemStack.getTagCompound().setTag("pages", tagList);
}
@Override
public void registerIcons(IIconRegister iconRegister)
{
itemIcon = iconRegister.registerIcon("biomesoplenty:biomebook");
}
@Override
@SideOnly(Side.CLIENT)
public boolean hasEffect(ItemStack itemStack)
{
return false;
}
@Override
public String getItemStackDisplayName(ItemStack itemStack)
{
return EnumChatFormatting.AQUA + super.getItemStackDisplayName(itemStack);
}
}*/

View file

@ -0,0 +1,99 @@
package biomesoplenty.common.items;
import java.util.Arrays;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.ChunkPosition;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.WorldChunkManager;
import biomesoplenty.BiomesOPlenty;
import biomesoplenty.api.BOPBiomeHelper;
import biomesoplenty.client.textures.TextureBiomeFinder;
import biomesoplenty.common.network.packet.PacketBiomePosition;
public class ItemBiomeFinder extends Item
{
public ItemBiomeFinder()
{
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
}
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
{
if (!world.isRemote)
{
if (!itemStack.hasTagCompound()) itemStack.setTagCompound(new NBTTagCompound());
BiomeGenBase biomeToFind = BOPBiomeHelper.getBOPBiome("lavenderFields");
int radius = 256;
WorldChunkManager chunkManager = world.getWorldChunkManager();
//TODO: findBiome()?
ChunkPosition biomePosition = null;
for (int x = -10; x <= 10; x++)
{
for (int z = -10; z <= 10; z++)
{
ChunkPosition foundPosition = chunkManager.func_150795_a(x * 1024, z * 1024, radius, Arrays.asList(biomeToFind), world.rand);
if (foundPosition != null && world.getBiomeGenForCoords(foundPosition.field_151329_a, foundPosition.field_151328_c) == biomeToFind)
{
biomePosition = foundPosition;
break;
}
}
}
if (biomePosition != null)
{
System.out.println(biomePosition.field_151329_a + " " + biomePosition.field_151328_c);
NBTTagCompound biomeCompound = new NBTTagCompound();
biomeCompound.setInteger("x", biomePosition.field_151329_a);
biomeCompound.setInteger("z", biomePosition.field_151328_c);
if (!player.getEntityData().hasKey("biomePositions")) player.getEntityData().setTag("biomePositions", new NBTTagCompound());
NBTTagCompound biomePositions = player.getEntityData().getCompoundTag("biomePositions");
if (!biomePositions.hasKey(biomeToFind.biomeName)) biomePositions.setTag(biomeToFind.biomeName, biomeCompound);
BiomesOPlenty.packetPipeline.sendTo(new PacketBiomePosition(biomeToFind.biomeName, biomePosition.field_151329_a, biomePosition.field_151328_c), (EntityPlayerMP)player);
}
System.out.println("Done looking");
}
return itemStack;
}
@Override
public void registerIcons(IIconRegister iconRegister)
{
if (iconRegister instanceof TextureMap)
{
TextureAtlasSprite texture = new TextureBiomeFinder("biomesoplenty:biomefinder");
((TextureMap)iconRegister).setTextureEntry("biomesoplenty:biomefinder", texture);
this.itemIcon = texture;
}
}
/*@Override
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean advancedItemTooltips)
{
if (!itemStack.hasTagCompound()) itemStack.setTagCompound(new NBTTagCompound());
}*/
}

View file

@ -0,0 +1,43 @@
package biomesoplenty.common.network;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import net.minecraft.entity.player.EntityPlayer;
/**
* AbstractPacket class. Should be the parent of all packets wishing to use the PacketPipeline.
* @author sirgingalot
*/
public abstract class AbstractPacket
{
/**
* Encode the packet data into the ByteBuf stream. Complex data sets may need specific data handlers (See @link{cpw.mods.fml.common.network.ByteBuffUtils})
*
* @param ctx channel context
* @param buffer the buffer to encode into
*/
public abstract void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer);
/**
* Decode the packet data from the ByteBuf stream. Complex data sets may need specific data handlers (See @link{cpw.mods.fml.common.network.ByteBuffUtils})
*
* @param ctx channel context
* @param buffer the buffer to decode from
*/
public abstract void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer);
/**
* Handle a packet on the client side. Note this occurs after decoding has completed.
*
* @param player the player reference
*/
public abstract void handleClientSide(EntityPlayer player);
/**
* Handle a packet on the server side. Note this occurs after decoding has completed.
*
* @param player the player reference
*/
public abstract void handleServerSide(EntityPlayer player);
}

View file

@ -0,0 +1,221 @@
package biomesoplenty.common.network;
import java.util.*;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageCodec;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.network.INetHandler;
import net.minecraft.network.NetHandlerPlayServer;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.network.FMLEmbeddedChannel;
import cpw.mods.fml.common.network.FMLOutboundHandler;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.network.internal.FMLProxyPacket;
import cpw.mods.fml.relauncher.Side;
/**
* Packet pipeline class. Directs all registered packet data to be handled by the packets themselves.
* @author sirgingalot
* some code from: cpw
*/
@ChannelHandler.Sharable
public class PacketPipeline extends MessageToMessageCodec<FMLProxyPacket, AbstractPacket>
{
private EnumMap<Side, FMLEmbeddedChannel> channels;
private LinkedList<Class<? extends AbstractPacket>> packets = new LinkedList<Class<? extends AbstractPacket>>();
private boolean isPostInitialised = false;
/**
* Register your packet with the pipeline. Discriminators are automatically set.
*
* @param clazz the class to register
*
* @return whether registration was successful. Failure may occur if 256 packets have been registered or if the registry already contains this packet
*/
public boolean registerPacket(Class<? extends AbstractPacket> clazz)
{
if (this.packets.size() > 256)
{
// You should log here!!
return false;
}
if (this.packets.contains(clazz))
{
// You should log here!!
return false;
}
if (this.isPostInitialised)
{
// You should log here!!
return false;
}
this.packets.add(clazz);
return true;
}
// In line encoding of the packet, including discriminator setting
@Override
protected void encode(ChannelHandlerContext ctx, AbstractPacket msg, List<Object> out) throws Exception
{
ByteBuf buffer = Unpooled.buffer();
Class<? extends AbstractPacket> clazz = msg.getClass();
if (!this.packets.contains(msg.getClass()))
{
throw new NullPointerException("No Packet Registered for: " + msg.getClass().getCanonicalName());
}
byte discriminator = (byte) this.packets.indexOf(clazz);
buffer.writeByte(discriminator);
msg.encodeInto(ctx, buffer);
FMLProxyPacket proxyPacket = new FMLProxyPacket(buffer.copy(), ctx.channel().attr(NetworkRegistry.FML_CHANNEL).get());
out.add(proxyPacket);
}
// In line decoding and handling of the packet
@Override
protected void decode(ChannelHandlerContext ctx, FMLProxyPacket msg, List<Object> out) throws Exception
{
ByteBuf payload = msg.payload();
byte discriminator = payload.readByte();
Class<? extends AbstractPacket> clazz = this.packets.get(discriminator);
if (clazz == null)
{
throw new NullPointerException("No packet registered for discriminator: " + discriminator);
}
AbstractPacket pkt = clazz.newInstance();
pkt.decodeInto(ctx, payload.slice());
EntityPlayer player;
switch (FMLCommonHandler.instance().getEffectiveSide())
{
case CLIENT:
player = Minecraft.getMinecraft().thePlayer;
pkt.handleClientSide(player);
break;
case SERVER:
INetHandler netHandler = ctx.channel().attr(NetworkRegistry.NET_HANDLER).get();
player = ((NetHandlerPlayServer) netHandler).field_147369_b;
pkt.handleServerSide(player);
break;
default:
}
out.add(pkt);
}
// Method to call from FMLInitializationEvent
public void initalize()
{
this.channels = NetworkRegistry.INSTANCE.newChannel("BiomeOPlenty", this);
}
// Method to call from FMLPostInitializationEvent
// Ensures that packet discriminators are common between server and client by using logical sorting
public void postInitialize()
{
if (this.isPostInitialised)
{
return;
}
this.isPostInitialised = true;
Collections.sort(this.packets, new Comparator<Class<? extends AbstractPacket>>()
{
@Override
public int compare(Class<? extends AbstractPacket> clazz1, Class<? extends AbstractPacket> clazz2)
{
int com = String.CASE_INSENSITIVE_ORDER.compare(clazz1.getCanonicalName(), clazz2.getCanonicalName());
if (com == 0) {
com = clazz1.getCanonicalName().compareTo(clazz2.getCanonicalName());
}
return com;
}
});
}
/**
* Send this message to everyone.
* <p/>
* Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper
*
* @param message The message to send
*/
public void sendToAll(AbstractPacket message)
{
this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALL);
this.channels.get(Side.SERVER).writeAndFlush(message);
}
/**
* Send this message to the specified player.
* <p/>
* Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper
*
* @param message The message to send
* @param player The player to send it to
*/
public void sendTo(AbstractPacket message, EntityPlayerMP player)
{
this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER);
this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(player);
this.channels.get(Side.SERVER).writeAndFlush(message);
}
/**
* Send this message to everyone within a certain range of a point.
* <p/>
* Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper
*
* @param message The message to send
* @param point The {@link cpw.mods.fml.common.network.NetworkRegistry.TargetPoint} around which to send
*/
public void sendToAllAround(AbstractPacket message, NetworkRegistry.TargetPoint point)
{
this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT);
this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(point);
this.channels.get(Side.SERVER).writeAndFlush(message);
}
/**
* Send this message to everyone within the supplied dimension.
* <p/>
* Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper
*
* @param message The message to send
* @param dimensionId The dimension id to target
*/
public void sendToDimension(AbstractPacket message, int dimensionId)
{
this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.DIMENSION);
this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(dimensionId);
this.channels.get(Side.SERVER).writeAndFlush(message);
}
/**
* Send this message to the server.
* <p/>
* Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper
*
* @param message The message to send
*/
public void sendToServer(AbstractPacket message)
{
this.channels.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.TOSERVER);
this.channels.get(Side.CLIENT).writeAndFlush(message);
}
}

View file

@ -0,0 +1,60 @@
package biomesoplenty.common.network.packet;
import cpw.mods.fml.common.network.ByteBufUtils;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import biomesoplenty.common.network.AbstractPacket;
public class PacketBiomePosition extends AbstractPacket
{
private String biomeName;
private int x;
private int z;
public PacketBiomePosition() {}
public PacketBiomePosition(String biomeName, int x, int z)
{
this.biomeName = biomeName;
this.x = x;
this.z = z;
}
@Override
public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer)
{
ByteBufUtils.writeUTF8String(buffer, biomeName);
buffer.writeInt(x);
buffer.writeInt(z);
}
@Override
public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer)
{
biomeName = ByteBufUtils.readUTF8String(buffer);
x = buffer.readInt();
z = buffer.readInt();
}
@Override
public void handleClientSide(EntityPlayer player)
{
NBTTagCompound biomeCompound = new NBTTagCompound();
biomeCompound.setInteger("x", x);
biomeCompound.setInteger("z", z);
if (!player.getEntityData().hasKey("biomePositions")) player.getEntityData().setTag("biomePositions", new NBTTagCompound());
NBTTagCompound biomePositions = player.getEntityData().getCompoundTag("biomePositions");
if (!biomePositions.hasKey(biomeName)) biomePositions.setTag(biomeName, biomeCompound);
}
@Override
public void handleServerSide(EntityPlayer player)
{
}
}

View file

@ -32,7 +32,6 @@ public class BOPWorldFeatures
public int bromeliadsPerChunk = 0;
public int waterReedsPerChunk = 0;
public int wildCarrotsPerChunk = 0;
public int doubleTallGrassPerChunk = 0;
public int poisonIvyPerChunk = 0;
public int berryBushesPerChunk = 0;
public int portobellosPerChunk = 0;
@ -45,7 +44,6 @@ public class BOPWorldFeatures
public int sproutsPerChunk = 0;
public int tinyCactiPerChunk = 0;
public int oasesPerChunk = 0;
public int sunflowersPerChunk = 0;
public int minersDelightPerChunk = 2;
public int rootsPerChunk = 9;
public int grassSplatterPerChunk = 0;

View file

@ -1,7 +1,10 @@
package biomesoplenty.common.world.decoration;
import java.util.HashMap;
import java.util.Random;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.common.world.features.WorldGenBOPFlora;
public interface IBOPDecoration
@ -9,4 +12,8 @@ public interface IBOPDecoration
public WorldGenBOPFlora getRandomWorldGenForBOPFlowers(Random random);
public BOPWorldFeatures getWorldFeatures();
public HashMap<WorldGenerator, Double> getWeightedWorldGenForGrass();
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers();
}

View file

@ -4,20 +4,23 @@ import java.lang.reflect.Field;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.common.world.decoration.IBOPDecoration;
import biomesoplenty.common.world.generation.WorldGeneratorBOP;
public class WorldGenBOPDoubleFlora extends WorldGeneratorBOP
public class WorldGenBOPDoubleFlora extends WorldGenBOPFlora
{
private Block bottomFlora;
private Block topFlora;
private int bottomFloraMeta;
private int topFloraMeta;
private int groupCount;
private boolean isVanilla;
private int vanillaFloraMeta;
public WorldGenBOPDoubleFlora(Block bottomFlora, Block topFlora, int bottomFloraMeta, int topFloraMeta)
{
@ -33,6 +36,21 @@ public class WorldGenBOPDoubleFlora extends WorldGeneratorBOP
this.topFloraMeta = topFloraMeta;
this.groupCount = groupCount;
this.isVanilla = false;
}
public WorldGenBOPDoubleFlora(int vanillaFloraMeta)
{
this(vanillaFloraMeta, 64);
}
public WorldGenBOPDoubleFlora(int vanillaFloraMeta, int groupCount)
{
this.vanillaFloraMeta = vanillaFloraMeta;
this.groupCount = groupCount;
this.isVanilla = true;
}
@Override
@ -44,13 +62,26 @@ public class WorldGenBOPDoubleFlora extends WorldGeneratorBOP
int j1 = y + random.nextInt(4) - random.nextInt(4);
int k1 = z + random.nextInt(8) - random.nextInt(8);
//TODO: isAirBlock() canReplace()
if (world.func_147437_c(i1, j1, k1) && (!world.provider.hasNoSky || j1 < 255) && this.bottomFlora.func_149705_a(world, i1, j1, k1, 0, new ItemStack(bottomFlora, 1, bottomFloraMeta)))
//TODO: isAirBlock()
if (world.func_147437_c(i1, j1, k1) && (!world.provider.hasNoSky || j1 < 255))
{
//TODO: setBlock()
world.func_147465_d(i1, j1, k1, this.bottomFlora, this.bottomFloraMeta, 2);
//TODO: setBlock()
world.func_147465_d(i1, j1 + 1, k1, this.topFlora, this.topFloraMeta, 2);
if (isVanilla)
{
if (Blocks.double_plant.func_149742_c(world, i1, j1, k1))
{
Blocks.double_plant.func_149889_c(world, i1, j1, k1, this.vanillaFloraMeta, 2);
}
}
else
{
if (bottomFlora != null && this.bottomFlora.func_149705_a(world, i1, j1, k1, 0, new ItemStack(bottomFlora, 1, bottomFloraMeta)))
{
//TODO: setBlock()
world.func_147465_d(i1, j1, k1, this.bottomFlora, this.bottomFloraMeta, 2);
//TODO: setBlock()
world.func_147465_d(i1, j1 + 1, k1, this.topFlora, this.topFloraMeta, 2);
}
}
}
}

View file

@ -15,10 +15,12 @@ import biomesoplenty.common.world.generation.WorldGeneratorBOP;
public class WorldGenBOPFlora extends WorldGeneratorBOP
{
private Block flora;
private int floraMeta;
public Block flora;
public int floraMeta;
private int groupCount = 64;
public WorldGenBOPFlora() {}
public WorldGenBOPFlora(Block flora, int floraMeta)
{
this.flora = flora;

View file

@ -1,7 +1,10 @@
package biomesoplenty.common.world.forceddecorators;
import java.util.HashMap;
import java.util.Random;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.common.world.decoration.BOPWorldFeatures;
import biomesoplenty.common.world.decoration.IBOPDecoration;
import biomesoplenty.common.world.features.WorldGenBOPFlora;
@ -26,4 +29,16 @@ public class ForcedDecorator implements IBOPDecoration
{
return bopWorldFeatures;
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForGrass()
{
return null;
}
@Override
public HashMap<WorldGenBOPFlora, Integer> getWeightedWorldGenForBOPFlowers()
{
return null;
}
}

View file

@ -90,9 +90,6 @@ public class WorldGenFieldAssociation
associateField("wasteland2PerChunk", new WorldGenWasteland2());
associateField("wasteland3PerChunk", new WorldGenWasteland3());
associateField("wasteland4PerChunk", new WorldGenWasteland4());
associateField("doubleTallGrassPerChunk", new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 2, 8));
associateField("sunflowersPerChunk", new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 0, 8));
}
public static void associateField(String fieldName, WorldGenerator generator)

View file

@ -387,6 +387,9 @@ item.flowerBand.exoticflowerband.name=Exotic Flower Band
item.wadingBoots.name=Wading Boots
item.flippers.name=Flippers
item.biomeBook.name=Book O' Biomes
item.biomeFinder.name=Biome Finder
item.bopBucket.amethyst_empty.name=Amethyst Bucket
item.bopBucket.amethyst_spring_water.name=Spring Water Amethyst Bucket
item.bopBucket.liquid_poison.name=Liquid Poison Bucket

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -0,0 +1,3 @@
{
"animation": {}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B