mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 10:55:17 +00:00
The decay time in passive flowers will now be saved to the droped stacks if the decay option is enabled.
This commit is contained in:
1 parent
df53b9fafa
commit
fba7495c0b
4 files changed
+53
-16
No files matched your search
@@ -21,7 +21,7 @@ import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
public class SubTileDaybloom extends SubTileGenerating {
|
||||
public class SubTileDaybloom extends SubTilePassiveGenerating {
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
@@ -39,11 +39,6 @@ public class SubTileDaybloom extends SubTileGenerating {
|
||||
return 25 + (int) (getSurroundingFlowers() * 7.5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPassiveFlower() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getSurroundingFlowers() {
|
||||
int flowers = 0;
|
||||
for(ForgeDirection dir : LibMisc.CARDINAL_DIRECTIONS) {
|
||||
|
||||
+3
-9
@@ -27,7 +27,7 @@ import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
public class SubTileHydroangeas extends SubTileGenerating {
|
||||
public class SubTileHydroangeas extends SubTilePassiveGenerating {
|
||||
|
||||
private static final String TAG_BURN_TIME = "burnTime";
|
||||
private static final String TAG_COOLDOWN = "cooldown";
|
||||
@@ -83,11 +83,6 @@ public class SubTileHydroangeas extends SubTileGenerating {
|
||||
sync();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPassiveFlower() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void doBurnParticles() {
|
||||
Botania.proxy.wispFX(supertile.getWorldObj(), supertile.xCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5, 0.05F, 0.05F, 0.7F, (float) Math.random() / 6, (float) -Math.random() / 60);
|
||||
}
|
||||
@@ -140,15 +135,14 @@ public class SubTileHydroangeas extends SubTileGenerating {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(ArrayList<ItemStack> list) {
|
||||
ArrayList<ItemStack> drops = super.getDrops(list);
|
||||
public void populateDropStackNBTs(List<ItemStack> drops) {
|
||||
super.populateDropStackNBTs(drops);
|
||||
int cooldown = this.cooldown;
|
||||
if(burnTime > 0)
|
||||
cooldown = getCooldown();
|
||||
|
||||
if(cooldown > 0)
|
||||
ItemNBTHelper.setInt(drops.get(0), TAG_COOLDOWN, getCooldown());
|
||||
return drops;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Mar 16, 2015, 6:03:16 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.block.subtile.generating;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.subtile.SubTileGenerating;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
|
||||
public class SubTilePassiveGenerating extends SubTileGenerating {
|
||||
|
||||
@Override
|
||||
public boolean isPassiveFlower() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(ArrayList<ItemStack> list) {
|
||||
ArrayList<ItemStack> drops = super.getDrops(list);
|
||||
populateDropStackNBTs(drops);
|
||||
return drops;
|
||||
}
|
||||
|
||||
public void populateDropStackNBTs(List<ItemStack> drops) {
|
||||
if(isPassiveFlower() && ticksExisted > 0 && ConfigHandler.hardcorePassiveGeneration > 0)
|
||||
ItemNBTHelper.setInt(drops.get(0), TAG_TICKS_EXISTED, ticksExisted);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) {
|
||||
super.onBlockPlacedBy(world, x, y, z, entity, stack);
|
||||
ticksExisted = ItemNBTHelper.getInt(stack, TAG_TICKS_EXISTED, 0);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -197,7 +197,7 @@ public class EntitySpark extends Entity implements ISparkEntity {
|
||||
removeTransferants--;
|
||||
getTransfers();
|
||||
}
|
||||
|
||||
|
||||
void particlesTowards(Entity e) {
|
||||
Vector3 thisVec = Vector3.fromEntityCenter(this).add(0, 0, 0);
|
||||
Vector3 receiverVec = Vector3.fromEntityCenter(e).add(0, 0, 0);
|
||||
|
||||
Reference in new issue
Block a user