~williewillus/violet-moon

botania: Remove general runic altar cooldown v1 PROPOSED

Artemis System: 1
 Remove general runic altar cooldown

 1 files changed, 4 insertions(+), 20 deletions(-)
#1086237 linux.yml success
On 12/29/23 04:50, Artemis System wrote:

 > What do you think, alwinfy? I think it's unnecessary to keep the
 > cooldown clutter in the already cluttered runic altar block entity file
 > for a barely noticeable effect that no longer communicates anything
 > meaningful. Though maybe it could come back in another manner later.
Honestly? I do kind of want to keep the smoke around, myself. I always 
liked the effect even if I didn't realize it was an indicator - I just 
thought it signified that something high-energy had just happened. My 
vote's for keeping it.
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~williewillus/violet-moon/patches/46302/mbox | git am -3
Learn more about email & git

[PATCH botania] Remove general runic altar cooldown Export this patch

Probably predates the cooldown item flag which applies to specific items, and has no real reason to exist anymore, from what i can tell. Also removes the particle effect that plays in the cooldown, it was so subtle that i didn't even know it existed
---
New patch upcoming to address that the specific item cooldown is shorter than the now
removed cooldown
.../block_entity/RunicAltarBlockEntity.java   | 24 ++++---------------
 1 file changed, 4 insertions(+), 20 deletions(-)

diff --git a/Xplat/src/main/java/vazkii/botania/common/block/block_entity/RunicAltarBlockEntity.java b/Xplat/src/main/java/vazkii/botania/common/block/block_entity/RunicAltarBlockEntity.java
index f2c0dd2e8..052a4b7b0 100644
--- a/Xplat/src/main/java/vazkii/botania/common/block/block_entity/RunicAltarBlockEntity.java
+++ b/Xplat/src/main/java/vazkii/botania/common/block/block_entity/RunicAltarBlockEntity.java
@@ -38,7 +38,6 @@
import vazkii.botania.api.recipe.RunicAltarRecipe;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.client.fx.SparkleParticleData;
import vazkii.botania.client.fx.WispParticleData;
import vazkii.botania.client.gui.HUDHandler;
import vazkii.botania.common.block.BotaniaBlocks;
import vazkii.botania.common.crafting.BotaniaRecipeTypes;
@@ -60,14 +59,12 @@ public class RunicAltarBlockEntity extends SimpleInventoryBlockEntity implements
	private static final String TAG_MANA = "mana";
	private static final String TAG_MANA_TO_GET = "manaToGet";
	private static final int SET_KEEP_TICKS_EVENT = 0;
	private static final int SET_COOLDOWN_EVENT = 1;
	private static final int CRAFT_EFFECT_EVENT = 2;

	private RunicAltarRecipe currentRecipe;

	public int manaToGet = 0;
	private int mana = 0;
	private int cooldown = 0;
	public int signal = 0;

	private List<ItemStack> lastRecipe = null;
@@ -78,7 +75,7 @@ public RunicAltarBlockEntity(BlockPos pos, BlockState state) {
	}

	public boolean addItem(@Nullable Player player, ItemStack stack, @Nullable InteractionHand hand) {
		if (cooldown > 0 || stack.getItem() instanceof WandOfTheForestItem || stack.is(BotaniaItems.lexicon)) {
		if (stack.getItem() instanceof WandOfTheForestItem || stack.is(BotaniaItems.lexicon)) {
			return false;
		}

@@ -127,9 +124,6 @@ public boolean triggerEvent(int id, int param) {
			case SET_KEEP_TICKS_EVENT:
				recipeKeepTicks = param;
				return true;
			case SET_COOLDOWN_EVENT:
				cooldown = param;
				return true;
			case CRAFT_EFFECT_EVENT: {
				if (level.isClientSide) {
					for (int i = 0; i < 25; i++) {
@@ -148,11 +142,7 @@ public boolean triggerEvent(int id, int param) {
		}
	}

	private void tickCooldown() {
		if (cooldown > 0) {
			cooldown--;
		}

	private void tickRecipeKeep() {
		if (recipeKeepTicks > 0) {
			--recipeKeepTicks;
		} else {
@@ -188,7 +178,7 @@ public static void serverTick(Level level, BlockPos worldPosition, BlockState st
		}

		self.updateRecipe();
		self.tickCooldown();
		self.tickRecipeKeep();
	}

	public static void clientTick(Level level, BlockPos worldPosition, BlockState state, RunicAltarBlockEntity self) {
@@ -197,12 +187,7 @@ public static void clientTick(Level level, BlockPos worldPosition, BlockState st
			Vec3 endVec = vec.add(0, 2.5, 0);
			Proxy.INSTANCE.lightningFX(level, vec, endVec, 2F, 0x00948B, 0x00E4D7);
		}

		if (self.cooldown > 0) {
			WispParticleData data = WispParticleData.wisp(0.2F, 0.2F, 0.2F, 0.2F, 1);
			level.addParticle(data, worldPosition.getX() + Math.random(), worldPosition.getY() + 0.8, worldPosition.getZ() + Math.random(), 0, - -0.025F, 0);
		}
		self.tickCooldown();
		self.tickRecipeKeep();
	}

	private void updateRecipe() {
@@ -283,7 +268,6 @@ public boolean onUsedByWand(@Nullable Player player, ItemStack wand, Direction s
				XplatAbstractions.INSTANCE.itemFlagsComponent(outputItem).markAltarOutput();
				level.addFreshEntity(outputItem);
				currentRecipe = null;
				level.blockEvent(getBlockPos(), BotaniaBlocks.runeAltar, SET_COOLDOWN_EVENT, 60);
				level.blockEvent(getBlockPos(), BotaniaBlocks.runeAltar, CRAFT_EFFECT_EVENT, 0);

				saveLastRecipe();
-- 
2.39.3 (Apple Git-145)
Artemis System <theartemissystem@gmail.com> writes:
botania/patches/linux.yml: SUCCESS in 22m6s

[Remove general runic altar cooldown][0] from [Artemis System][1]

[0]: https://lists.sr.ht/~williewillus/violet-moon/patches/46302
[1]: mailto:theartemissystem@gmail.com

✓ #1086237 SUCCESS botania/patches/linux.yml https://builds.sr.ht/~williewillus/job/1086237