[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
I'm fine with removing the functional purpose of the cooldown, but I
liked the "smoking" particles as a nice effect. Can we keep that?
---
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)
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
Artemis System <theartemissystem@gmail.com> writes: