Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions gradle/gradle-daemon-jvm.properties
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#This file is generated by updateDaemonJvm
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/46949723aaa20c7b64d7ecfed7207034/redirect
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/d6690dfd71c4c91e08577437b5b2beb0/redirect
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/3cd7045fca9a72cd9bc7d14a385e594c/redirect
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/552c7bffe0370c66410a51c55985b511/redirect
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/5ee463876563a46fff651cce1bc53a4c/redirect
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/5ee463876563a46fff651cce1bc53a4c/redirect
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/d4fd992c9557644e637ebe98263e0ae7/redirect
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/59a9771cad43219260d9aac9a8ec4d6a/redirect
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/5ee463876563a46fff651cce1bc53a4c/redirect
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/3689d0bcdd77ac01674ba3c9dbbe94d0/redirect
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/8e1d9ee5d0f13e442218f6884a306da1/redirect
toolchainVersion=25
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pluginManagement {
}

plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.23'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.24'
}


115 changes: 79 additions & 36 deletions src/main/java/vazkii/botania/api/subtile/SubTileGenerating.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,58 +69,96 @@ public void onUpdate() {

linkCollector();

if(canGeneratePassively()) {
if (canGeneratePassively()) {
int delay = getDelayBetweenPassiveGeneration();
if(delay > 0 && ticksExisted % delay == 0 && !supertile.getWorldObj().isRemote) {
if(shouldSyncPassiveGeneration())
if (delay > 0 && ticksExisted % delay == 0 && !supertile.getWorldObj().isRemote) {
if (shouldSyncPassiveGeneration())
sync();
addMana(getValueForPassiveGeneration());
}
}
emptyManaIntoCollector();

if(acceptsRedstone()) {
if (acceptsRedstone()) {
redstoneSignal = 0;
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
int redstoneSide = supertile.getWorldObj().getIndirectPowerLevelTo(supertile.xCoord + dir.offsetX, supertile.yCoord + dir.offsetY, supertile.zCoord + dir.offsetZ, dir.ordinal());
int redstoneSide = supertile.getWorldObj().getIndirectPowerLevelTo(
supertile.xCoord + dir.offsetX,
supertile.yCoord + dir.offsetY,
supertile.zCoord + dir.offsetZ,
dir.ordinal());
redstoneSignal = Math.max(redstoneSignal, redstoneSide);
}
}

if(supertile.getWorldObj().isRemote) {
if (supertile.getWorldObj().isRemote) {
double particleChance = 1F - (double) mana / (double) getMaxMana() / 3.5F;
Color color = new Color(getColor());
if(Math.random() > particleChance)
BotaniaAPI.internalHandler.sparkleFX(supertile.getWorldObj(), supertile.xCoord + 0.3 + Math.random() * 0.5, supertile.yCoord + 0.5 + Math.random() * 0.5, supertile.zCoord + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5);
if (Math.random() > particleChance){
Color color = new Color(getColor());
BotaniaAPI.internalHandler.sparkleFX(
supertile.getWorldObj(),
supertile.xCoord + 0.3 + Math.random() * 0.5,
supertile.yCoord + 0.5 + Math.random() * 0.5,
supertile.zCoord + 0.3 + Math.random() * 0.5,
color.getRed() / 255F,
color.getGreen() / 255F,
color.getBlue() / 255F,
(float) Math.random(), 5);
}
}

boolean passive = isPassiveFlower();
if(!supertile.getWorldObj().isRemote) {
if (!supertile.getWorldObj().isRemote) {
int muhBalance = BotaniaAPI.internalHandler.getPassiveFlowerDecay();

if(passive && muhBalance > 0 && passiveDecayTicks > muhBalance) {
supertile.getWorldObj().playAuxSFX(2001, supertile.xCoord, supertile.yCoord, supertile.zCoord, Block.getIdFromBlock(supertile.getBlockType()));
if(supertile.getWorldObj().getBlock(supertile.xCoord, supertile.yCoord - 1, supertile.zCoord).isSideSolid(supertile.getWorldObj(), supertile.xCoord, supertile.yCoord - 1, supertile.zCoord, ForgeDirection.UP))
supertile.getWorldObj().setBlock(supertile.xCoord, supertile.yCoord, supertile.zCoord, Blocks.deadbush);
if (passive && muhBalance > 0 && passiveDecayTicks > muhBalance) {
supertile.getWorldObj().playAuxSFX(
2001,
supertile.xCoord,
supertile.yCoord,
supertile.zCoord,
Block.getIdFromBlock(supertile.getBlockType()));
if (
supertile.getWorldObj().getBlock(
supertile.xCoord,
supertile.yCoord - 1,
supertile.zCoord).isSideSolid(supertile.getWorldObj(),
supertile.xCoord,
supertile.yCoord - 1,
supertile.zCoord,
ForgeDirection.UP)
)
supertile.getWorldObj().setBlock(
supertile.xCoord,
supertile.yCoord,
supertile.zCoord,
Blocks.deadbush);
else supertile.getWorldObj().setBlockToAir(supertile.xCoord, supertile.yCoord, supertile.zCoord);
}
}

if(!overgrowth && passive)
if (!overgrowth && passive)
passiveDecayTicks++;
}

public void linkCollector() {
boolean needsNew = false;
if(linkedCollector == null) {
if (linkedCollector == null) {
needsNew = true;

if(cachedCollectorCoordinates != null) {
if (cachedCollectorCoordinates != null) {
needsNew = false;
if(supertile.getWorldObj().blockExists(cachedCollectorCoordinates.posX, cachedCollectorCoordinates.posY, cachedCollectorCoordinates.posZ)) {
if (supertile.getWorldObj().blockExists(
cachedCollectorCoordinates.posX,
cachedCollectorCoordinates.posY,
cachedCollectorCoordinates.posZ)
) {
needsNew = true;
TileEntity tileAt = supertile.getWorldObj().getTileEntity(cachedCollectorCoordinates.posX, cachedCollectorCoordinates.posY, cachedCollectorCoordinates.posZ);
if(tileAt != null && tileAt instanceof IManaCollector && !tileAt.isInvalid()) {
TileEntity tileAt = supertile.getWorldObj().getTileEntity(
cachedCollectorCoordinates.posX,
cachedCollectorCoordinates.posY,
cachedCollectorCoordinates.posZ);
if (tileAt != null && tileAt instanceof IManaCollector && !tileAt.isInvalid()) {
linkedCollector = tileAt;
needsNew = false;
}
Expand All @@ -129,14 +167,14 @@ public void linkCollector() {
}
} else {
TileEntity tileAt = supertile.getWorldObj().getTileEntity(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord);
if(tileAt != null && tileAt instanceof IManaCollector)
if (tileAt != null && tileAt instanceof IManaCollector)
linkedCollector = tileAt;
}

if(needsNew && ticksExisted == 1) { // New flowers only
if (needsNew && ticksExisted == 1) { // New flowers only
IManaNetwork network = BotaniaAPI.internalHandler.getManaNetworkInstance();
int size = network.getAllCollectorsInWorld(supertile.getWorldObj()).size();
if(BotaniaAPI.internalHandler.shouldForceCheck() || size != sizeLastCheck) {
if (BotaniaAPI.internalHandler.shouldForceCheck() || size != sizeLastCheck) {
ChunkCoordinates coords = new ChunkCoordinates(supertile.xCoord, supertile.yCoord, supertile.zCoord);
linkedCollector = network.getClosestCollector(coords, supertile.getWorldObj(), RANGE);
sizeLastCheck = size;
Expand All @@ -153,9 +191,9 @@ public void addMana(int mana) {
}

public void emptyManaIntoCollector() {
if(linkedCollector != null && isValidBinding()) {
if (linkedCollector != null && isValidBinding()) {
IManaCollector collector = (IManaCollector) linkedCollector;
if(!collector.isFull() && mana > 0) {
if (!collector.isFull() && mana > 0) {
int manaval = Math.min(mana, collector.getMaxMana() - collector.getCurrentMana());
mana -= manaval;
collector.recieveMana(manaval);
Expand Down Expand Up @@ -191,10 +229,10 @@ public ArrayList<ItemStack> getDrops(ArrayList<ItemStack> list) {
}

public void populateDropStackNBTs(List<ItemStack> drops) {
if(isPassiveFlower() && ticksExisted > 0 && BotaniaAPI.internalHandler.getPassiveFlowerDecay() > 0) {
if (isPassiveFlower() && ticksExisted > 0 && BotaniaAPI.internalHandler.getPassiveFlowerDecay() > 0) {
ItemStack drop = drops.get(0);
if(drop != null) {
if(!drop.hasTagCompound())
if (drop != null) {
if (!drop.hasTagCompound())
drop.setTagCompound(new NBTTagCompound());
NBTTagCompound cmp = drop.getTagCompound();
cmp.setInteger(TAG_PASSIVE_DECAY_TICKS, passiveDecayTicks);
Expand All @@ -205,18 +243,18 @@ public void populateDropStackNBTs(List<ItemStack> drops) {
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) {
super.onBlockPlacedBy(world, x, y, z, entity, stack);
if(isPassiveFlower()) {
if (isPassiveFlower()) {
NBTTagCompound cmp = stack.getTagCompound();
passiveDecayTicks = cmp.getInteger(TAG_PASSIVE_DECAY_TICKS);
}
}

@Override
public boolean onWanded(EntityPlayer player, ItemStack wand) {
if(player == null)
if (player == null)
return false;

if(!player.worldObj.isRemote)
if (!player.worldObj.isRemote)
sync();

knownMana = mana;
Expand Down Expand Up @@ -251,7 +289,7 @@ public void writeToPacketNBT(NBTTagCompound cmp) {
cmp.setInteger(TAG_TICKS_EXISTED, ticksExisted);
cmp.setInteger(TAG_PASSIVE_DECAY_TICKS, passiveDecayTicks);

if(cachedCollectorCoordinates != null) {
if (cachedCollectorCoordinates != null) {
cmp.setInteger(TAG_COLLECTOR_X, cachedCollectorCoordinates.posX);
cmp.setInteger(TAG_COLLECTOR_Y, cachedCollectorCoordinates.posY);
cmp.setInteger(TAG_COLLECTOR_Z, cachedCollectorCoordinates.posZ);
Expand All @@ -268,7 +306,7 @@ public void writeToPacketNBT(NBTTagCompound cmp) {

@Override
public ChunkCoordinates getBinding() {
if(linkedCollector == null)
if (linkedCollector == null)
return null;
return new ChunkCoordinates(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord);
}
Expand All @@ -284,9 +322,9 @@ public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z,
range *= range;

double dist = (x - supertile.xCoord) * (x - supertile.xCoord) + (y - supertile.yCoord) * (y - supertile.yCoord) + (z - supertile.zCoord) * (z - supertile.zCoord);
if(range >= dist) {
if (range >= dist) {
TileEntity tile = player.worldObj.getTileEntity(x, y, z);
if(tile instanceof IManaCollector) {
if (tile instanceof IManaCollector) {
linkedCollector = tile;
return true;
}
Expand All @@ -297,7 +335,12 @@ public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z,


public boolean isValidBinding() {
return linkedCollector != null && !linkedCollector.isInvalid() && supertile.getWorldObj().getTileEntity(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord) == linkedCollector;
return linkedCollector != null &&
!linkedCollector.isInvalid() &&
supertile.getWorldObj().getTileEntity(
linkedCollector.xCoord,
linkedCollector.yCoord,
linkedCollector.zCoord) == linkedCollector;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid
LibBlockNames.SUBTILE_SPECTROLUS,
LibBlockNames.SUBTILE_RAFFLOWSIA,
LibBlockNames.SUBTILE_DANDELIFEON,
LibBlockNames.SUBTILE_REIUJIA,

// Functional
LibBlockNames.SUBTILE_JADED_AMARANTHUS,
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/vazkii/botania/common/block/ModBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
import vazkii.botania.common.block.subtile.generating.SubTileNarslimmus;
import vazkii.botania.common.block.subtile.generating.SubTileNightshade;
import vazkii.botania.common.block.subtile.generating.SubTileRafflowsia;
import vazkii.botania.common.block.subtile.generating.SubTileReiujia;
import vazkii.botania.common.block.subtile.generating.SubTileSpectrolus;
import vazkii.botania.common.block.subtile.generating.SubTileThermalily;
import vazkii.botania.common.block.tile.TileAlfPortal;
Expand Down Expand Up @@ -485,6 +486,7 @@ private static void initTileEntities() {
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_SPECTROLUS, SubTileSpectrolus.class);
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_DANDELIFEON, SubTileDandelifeon.class);
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_RAFFLOWSIA, SubTileRafflowsia.class);
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_REIUJIA, SubTileReiujia.class);

registerSubTileWithMini(LibBlockNames.SUBTILE_BELLETHORN, SubTileBellethorn.class);
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_DREADTHORN, SubTileDreadthorn.class);
Expand Down
Loading