mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-25 14:34:33 +00:00
Compare commits
4
Commits
master
...
2.5.11-pre
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
60bfc0ea35 | ||
|
|
c4da0b3024 | ||
|
|
bad253cd4d | ||
|
|
d5dd9872b7 |
No files matched your search
+4
-4
@@ -1,12 +1,12 @@
|
|||||||
// Add your dependencies here
|
// Add your dependencies here
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api('com.github.GTNewHorizons:ForestryMC:4.10.7:dev')
|
api('com.github.GTNewHorizons:ForestryMC:4.10.13:dev')
|
||||||
implementation('com.github.GTNewHorizons:GTNHLib:0.6.21:dev')
|
implementation('com.github.GTNewHorizons:GTNHLib:0.6.36:dev')
|
||||||
|
|
||||||
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.7.40-GTNH:dev')
|
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.7.60-GTNH:dev')
|
||||||
|
|
||||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.42:api')
|
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.44:api')
|
||||||
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
|
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
|
||||||
compileOnly("curse.maven:extrabiomesxl-60041:2273301")
|
compileOnly("curse.maven:extrabiomesxl-60041:2273301")
|
||||||
}
|
}
|
||||||
@@ -389,34 +389,27 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onFoodEffect(IBeeGenome genome, IBeeHousing housing) {
|
private void onFoodEffect(IBeeGenome genome, IBeeHousing housing) {
|
||||||
for (EntityLivingBase entity : getEntities(EntityLivingBase.class, genome, housing)) {
|
for (EntityPlayer player : getEntities(EntityPlayer.class, genome, housing)) {
|
||||||
if (entity instanceof EntityPlayer player) {
|
player.getFoodStats().addStats(2, 0.2f);
|
||||||
player.getFoodStats().addStats(2, 0.2f);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onHungerEffect(IBeeGenome genome, IBeeHousing housing, World world) {
|
private void onHungerEffect(IBeeGenome genome, IBeeHousing housing, World world) {
|
||||||
for (EntityLivingBase entity : getEntities(EntityLivingBase.class, genome, housing)) {
|
for (EntityPlayer player : getEntities(EntityPlayer.class, genome, housing)) {
|
||||||
if (entity instanceof EntityPlayer player) {
|
if (world.rand.nextInt(4) < wearsItems(player)) {
|
||||||
if (world.rand.nextInt(4) < wearsItems(player)) {
|
continue;
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
player.getFoodStats().addExhaustion(4.0f);
|
|
||||||
player.addPotionEffect(new PotionEffect(Potion.hunger.id, 100));
|
|
||||||
}
|
}
|
||||||
|
player.addExhaustion(4.0f);
|
||||||
|
player.addPotionEffect(new PotionEffect(Potion.hunger.id, 100));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onPotionEffect(IBeeGenome genome, IBeeHousing housing, World world, PotionEffect potion) {
|
private void onPotionEffect(IBeeGenome genome, IBeeHousing housing, World world, PotionEffect potion) {
|
||||||
for (EntityLivingBase entity : getEntities(EntityLivingBase.class, genome, housing)) {
|
for (EntityPlayer player : getEntities(EntityPlayer.class, genome, housing)) {
|
||||||
if (entity instanceof EntityPlayer player) {
|
if (world.rand.nextInt(4) < wearsItems(player)) {
|
||||||
if (world.rand.nextInt(4) < wearsItems(player)) {
|
continue;
|
||||||
continue;
|
|
||||||
}
|
|
||||||
player.addPotionEffect(potion);
|
|
||||||
}
|
}
|
||||||
|
player.addPotionEffect(potion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -611,13 +604,16 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
|||||||
|
|
||||||
public <T extends Entity> List<T> getEntities(Class<T> eClass, IBeeGenome genome, IBeeHousing housing) {
|
public <T extends Entity> List<T> getEntities(Class<T> eClass, IBeeGenome genome, IBeeHousing housing) {
|
||||||
int[] area = genome.getTerritory();
|
int[] area = genome.getTerritory();
|
||||||
int[] offset = { -Math.round(area[0] / 2f), -Math.round(area[1] / 2f), -Math.round(area[2] / 2f) };
|
int offsetX = -Math.round(area[0] / 2f);
|
||||||
int[] min = { housing.getCoordinates().posX + offset[0], housing.getCoordinates().posY + offset[1],
|
int offsetY = -Math.round(area[1] / 2f);
|
||||||
housing.getCoordinates().posZ + offset[2] };
|
int offsetZ = -Math.round(area[2] / 2f);
|
||||||
int[] max = { housing.getCoordinates().posX + offset[0] + area[0],
|
int minX = housing.getCoordinates().posX + offsetX;
|
||||||
housing.getCoordinates().posY + offset[1] + area[1],
|
int minY = housing.getCoordinates().posY + offsetY;
|
||||||
housing.getCoordinates().posZ + offset[2] + area[2] };
|
int minZ = housing.getCoordinates().posZ + offsetZ;
|
||||||
AxisAlignedBB box = AxisAlignedBB.getBoundingBox(min[0], min[1], min[2], max[0], max[1], max[2]);
|
int maxX = housing.getCoordinates().posX + offsetX + area[0];
|
||||||
|
int maxY = housing.getCoordinates().posY + offsetY + area[1];
|
||||||
|
int maxZ = housing.getCoordinates().posZ + offsetZ + area[2];
|
||||||
|
AxisAlignedBB box = AxisAlignedBB.getBoundingBox(minX, minY, minZ, maxX, maxY, maxZ);
|
||||||
return housing.getWorld().getEntitiesWithinAABB(eClass, box);
|
return housing.getWorld().getEntitiesWithinAABB(eClass, box);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user