mirror of
https://github.com/GTNewHorizons/MagicBees.git
synced 2026-11-20 04:09:48 +00:00
Update Forestry version, fix flower providers' growFlowers
This commit is contained in:
1 parent
167b1f5257
commit
a76d0d1c29
8 files changed
+112
-44
No files matched your search
@@ -6,11 +6,13 @@ import net.minecraft.block.Block;
|
||||
|
||||
import forestry.api.apiculture.FlowerManager;
|
||||
import forestry.api.genetics.IFlower;
|
||||
import forestry.api.genetics.IFlowerGrowthRule;
|
||||
import forestry.api.genetics.IFlowerProvider;
|
||||
|
||||
public abstract class FlowerProvider implements IFlowerProvider {
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public Set<IFlower> getFlowers() {
|
||||
return FlowerManager.flowerRegistry.getAcceptableFlowers(getFlowerType());
|
||||
}
|
||||
@@ -22,4 +24,8 @@ public abstract class FlowerProvider implements IFlowerProvider {
|
||||
protected void registerAcceptableFlower(Block block, int meta) {
|
||||
FlowerManager.flowerRegistry.registerAcceptableFlower(block, meta, getFlowerType());
|
||||
}
|
||||
}
|
||||
|
||||
protected void registerGrowthRule(IFlowerGrowthRule growthRule) {
|
||||
FlowerManager.flowerRegistry.registerGrowthRule(growthRule, getFlowerType());
|
||||
}
|
||||
}
|
||||
+42
-23
@@ -7,21 +7,61 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.genetics.IFlowerGrowthHelper;
|
||||
import forestry.api.genetics.IFlowerGrowthRule;
|
||||
import forestry.api.genetics.IFlowerRegistry;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.IPollinatable;
|
||||
|
||||
public class FlowerProviderArsMagicaFlower extends FlowerProvider {
|
||||
|
||||
public class FlowerProviderArsMagicaFlower extends FlowerProvider implements IFlowerGrowthRule {
|
||||
|
||||
public FlowerProviderArsMagicaFlower() {
|
||||
registerPlantableFlower(ArsMagicaHelper.blackOrchid, 0, 1);
|
||||
registerPlantableFlower(ArsMagicaHelper.desertNova, 0, 1);
|
||||
registerPlantableFlower(ArsMagicaHelper.aum, 0, 1);
|
||||
registerPlantableFlower(ArsMagicaHelper.wakebloom, 0, 1);
|
||||
registerPlantableFlower(ArsMagicaHelper.tarmaRoot, 0, 1);
|
||||
registerGrowthRule(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFlowerType() {
|
||||
return "flowersArsMagica";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return LocalizationManager.getLocalizedString("flowerProvider.arsmagica");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products) {
|
||||
return products;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
|
||||
return pollinatable.getPlantType().size() > 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean growFlower(World world, IIndividual genome, int x, int y, int z) {
|
||||
return growFlower(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, int x, int y, int z) {
|
||||
return growFlower(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean growFlower(IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y, int z) {
|
||||
return growFlower(world, x, y, z);
|
||||
}
|
||||
|
||||
private boolean growFlower(World world, int x, int y, int z) {
|
||||
boolean flag = false;
|
||||
Block blockDown = world.getBlock(x, y - 1, z);
|
||||
if (world.getBlock(x, y, z).isAir(world, x, y, z)) {
|
||||
@@ -50,25 +90,4 @@ public class FlowerProviderArsMagicaFlower extends FlowerProvider {
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFlowerType() {
|
||||
return "flowersArsMagica";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return LocalizationManager.getLocalizedString("flowerProvider.arsmagica");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products) {
|
||||
return products;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
|
||||
return pollinatable.getPlantType().size() > 1;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,6 +21,7 @@ public class FlowerProviderAuraNode extends FlowerProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean growFlower(World world, IIndividual genome, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ public class FlowerProviderBookshelf extends FlowerProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean growFlower(World world, IIndividual genome, int x, int i, int j) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -5,17 +5,38 @@ import magicbees.main.utils.compat.BotaniaHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import forestry.api.genetics.IFlowerGrowthHelper;
|
||||
import forestry.api.genetics.IFlowerGrowthRule;
|
||||
import forestry.api.genetics.IFlowerRegistry;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.IPollinatable;
|
||||
|
||||
public class FlowerProviderBotania extends FlowerProvider {
|
||||
public class FlowerProviderBotania extends FlowerProvider implements IFlowerGrowthRule {
|
||||
|
||||
public FlowerProviderBotania() {
|
||||
registerPlantableFlower(BotaniaHelper.blockMysticalFlower, OreDictionary.WILDCARD_VALUE, 1);
|
||||
registerGrowthRule(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean growFlower(World world, IIndividual individual, int x, int y, int z) {
|
||||
return growFlower(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, int x, int y, int z) {
|
||||
return growFlower(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean growFlower(IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y, int z) {
|
||||
return growFlower(world, x, y, z);
|
||||
}
|
||||
|
||||
private boolean growFlower(World world, int x, int y, int z) {
|
||||
if (world.isAirBlock(x, y, z) && BotaniaHelper.blockMysticalFlower.canPlaceBlockAt(world, x, y, z)) {
|
||||
world.setBlock(x, y, z, BotaniaHelper.blockMysticalFlower);
|
||||
world.setBlockMetadataWithNotify(x, y, z, world.rand.nextInt(16), 2);
|
||||
|
||||
+37
-17
@@ -6,30 +6,19 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.genetics.IFlowerGrowthHelper;
|
||||
import forestry.api.genetics.IFlowerGrowthRule;
|
||||
import forestry.api.genetics.IFlowerRegistry;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.IPollinatable;
|
||||
|
||||
public class FlowerProviderThaumcraftFlower extends FlowerProvider {
|
||||
public class FlowerProviderThaumcraftFlower extends FlowerProvider implements IFlowerGrowthRule {
|
||||
|
||||
public FlowerProviderThaumcraftFlower() {
|
||||
registerPlantableFlower(ThaumcraftHelper.plant, ThaumcraftHelper.BlockPlant.SHIMMERLEAF.ordinal(), 1);
|
||||
registerPlantableFlower(ThaumcraftHelper.plant, ThaumcraftHelper.BlockPlant.CINDERPEARL.ordinal(), 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean growFlower(World world, IIndividual genome, int x, int y, int z) {
|
||||
boolean flag = false;
|
||||
Block blockDown = world.getBlock(x, y - 1, z);
|
||||
if (world.getBlock(x, y, z).isAir(world, x, y, z)) {
|
||||
if (blockDown == Blocks.dirt || blockDown == Blocks.grass) {
|
||||
world.setBlock(x, y, z, ThaumcraftHelper.plant, ThaumcraftHelper.BlockPlant.SHIMMERLEAF.ordinal(), 2);
|
||||
flag = true;
|
||||
} else if (blockDown == Blocks.sand) {
|
||||
world.setBlock(x, y, z, ThaumcraftHelper.plant, ThaumcraftHelper.BlockPlant.CINDERPEARL.ordinal(), 2);
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
registerGrowthRule(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -52,4 +41,35 @@ public class FlowerProviderThaumcraftFlower extends FlowerProvider {
|
||||
return 0 < pollinatable.getPlantType().size();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean growFlower(World world, IIndividual genome, int x, int y, int z) {
|
||||
return growFlower(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, int x, int y, int z) {
|
||||
return growFlower(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean growFlower(IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y, int z) {
|
||||
return growFlower(world, x, y, z);
|
||||
}
|
||||
|
||||
private boolean growFlower(World world, int x, int y, int z) {
|
||||
boolean flag = false;
|
||||
Block blockDown = world.getBlock(x, y - 1, z);
|
||||
if (world.getBlock(x, y, z).isAir(world, x, y, z)) {
|
||||
if (blockDown == Blocks.dirt || blockDown == Blocks.grass) {
|
||||
world.setBlock(x, y, z, ThaumcraftHelper.plant, ThaumcraftHelper.BlockPlant.SHIMMERLEAF.ordinal(), 2);
|
||||
flag = true;
|
||||
} else if (blockDown == Blocks.sand) {
|
||||
world.setBlock(x, y, z, ThaumcraftHelper.plant, ThaumcraftHelper.BlockPlant.CINDERPEARL.ordinal(), 2);
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,7 @@ public class VersionInfo
|
||||
|
||||
public static final String Logo = "/gfx/magicbees/logo.png";
|
||||
|
||||
public static final String Depends = "required-after:Forestry@[4.0.4,);after:Thaumcraft;after:ExtraBees;after:EE3;after:ArsMagica;after:TConstruct;after:Railcraft;after:ThermalFoundation;after:ThermalExpansion;after:RedstoneArsenal;after:AWWayofTime;after:Botania;after:appliedenergistics2";
|
||||
public static final String Depends = "required-after:Forestry@[4.0.8,);after:Thaumcraft;after:ExtraBees;after:EE3;after:ArsMagica;after:TConstruct;after:Railcraft;after:ThermalFoundation;after:ThermalExpansion;after:RedstoneArsenal;after:AWWayofTime;after:Botania;after:appliedenergistics2";
|
||||
|
||||
boolean criticalUpdate;
|
||||
boolean newVersion;
|
||||
|
||||
Reference in new issue
Block a user