forked from DiamondCookie/MagicBees
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moving to Forestry 3.6; updating deprecated methods to new versions.
- Loading branch information
1 parent
a1a4506
commit 03068d7
Showing
16 changed files
with
631 additions
and
479 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
src/main/java/magicbees/bees/allele/flowerProvider/FlowerImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package magicbees.bees.allele.flowerProvider; | ||
|
||
import net.minecraft.block.Block; | ||
import forestry.api.genetics.IFlower; | ||
|
||
public class FlowerImpl implements IFlower { | ||
|
||
private Block flowerBlock; | ||
private int meta; | ||
private double weight; | ||
private boolean plantable; | ||
|
||
public FlowerImpl(Block flower, int blockMeta, double flowerWeight, boolean isPlantable) { | ||
flowerBlock = flower; | ||
meta = blockMeta; | ||
weight = flowerWeight; | ||
plantable = isPlantable; | ||
} | ||
|
||
@Override | ||
public Block getBlock() { | ||
return flowerBlock; | ||
} | ||
|
||
@Override | ||
public int getMeta() { | ||
return meta; | ||
} | ||
|
||
@Override | ||
public double getWeight() { | ||
return weight; | ||
} | ||
|
||
@Override | ||
public void setWeight(double value) { | ||
weight = value; | ||
} | ||
|
||
@Override | ||
public boolean isPlantable() { | ||
return plantable; | ||
} | ||
|
||
@Override | ||
public int compareTo(IFlower other) { | ||
return (int)(weight - other.getWeight()); | ||
} | ||
|
||
} |
50 changes: 50 additions & 0 deletions
50
src/main/java/magicbees/bees/allele/flowerProvider/FlowerProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package magicbees.bees.allele.flowerProvider; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import net.minecraft.block.Block; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.world.World; | ||
import forestry.api.genetics.IFlower; | ||
import forestry.api.genetics.IFlowerProvider; | ||
import forestry.api.genetics.IIndividual; | ||
import forestry.api.genetics.IPollinatable; | ||
|
||
public abstract class FlowerProvider implements IFlowerProvider { | ||
|
||
protected List<IFlower> flowers; | ||
|
||
public FlowerProvider(int size) { | ||
flowers = new ArrayList<IFlower>(size); | ||
} | ||
|
||
@Override | ||
public boolean isAcceptedFlower(World world, IIndividual genome, int x, int y, int z) { | ||
Block block = world.getBlock(x, y, z); | ||
for (IFlower flower : flowers) { | ||
if (flower.getBlock() == block) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
|
||
@Override | ||
public List<IFlower> getFlowers() { | ||
return flowers; | ||
} | ||
|
||
@Override | ||
public abstract boolean isAcceptedPollinatable(World world, IPollinatable pollinatable); | ||
|
||
@Override | ||
public abstract boolean growFlower(World world, IIndividual individual, int x, int y, int z); | ||
|
||
@Override | ||
public abstract String getDescription(); | ||
|
||
@Override | ||
public abstract ItemStack[] affectProducts(World world, IIndividual individual, int x, int y, int z, ItemStack[] products); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.