Skip to content

Commit

Permalink
chorus flight stackable #2309
Browse files Browse the repository at this point in the history
  • Loading branch information
Lothrazar committed Aug 26, 2023
1 parent d099393 commit 42d60e8
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ org.gradle.daemon=false

mod_id=cyclic
curse_id=239286
mod_version=1.12.4-SNAPSHOT
mod_version=1.12.4

# NEO FORGED
forge_version=47.1.65
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/com/lothrazar/cyclic/CyclicLogger.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.lothrazar.cyclic;

import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.Logger;
import net.minecraftforge.common.ForgeConfigSpec.BooleanValue;

Expand All @@ -21,9 +20,6 @@ public void error(String string, Object e) {
logger.error(string, e);
}

private void debug(String... strings) {
logger.log(Level.DEBUG, strings);
}
public void info(String string) {
//default for all releases is false to prevent spam-logs slipping out
if (LOGINFO.get()) {
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/com/lothrazar/cyclic/item/food/AppleBuffs.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import net.minecraft.network.chat.MutableComponent;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.level.Level;
Expand Down Expand Up @@ -40,10 +39,6 @@ public void appendHoverText(ItemStack stack, Level worldIn, List<Component> tool

@Override
public ItemStack finishUsingItem(ItemStack stack, Level worldIn, LivingEntity entityLiving) {
if (entityLiving instanceof Player) {
// TOOD
((Player) entityLiving).getCooldowns().addCooldown(this, 30);
}
return super.finishUsingItem(stack, worldIn, entityLiving);
}
}
15 changes: 11 additions & 4 deletions src/main/java/com/lothrazar/cyclic/item/food/EdibleFlightItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class EdibleFlightItem extends AppleBuffs {
public static IntValue TICKS;

public EdibleFlightItem(Properties properties) {
super(properties.rarity(Rarity.RARE).food(new FoodProperties.Builder().nutrition(3).saturationMod(0).alwaysEat().build()));
super(properties.rarity(Rarity.RARE).food(new FoodProperties.Builder().nutrition(1).saturationMod(0).alwaysEat().build()));
}

@Override
Expand All @@ -30,8 +30,15 @@ public void appendHoverText(ItemStack stack, Level worldIn, List<Component> tool
}

@Override
public ItemStack finishUsingItem(ItemStack stack, Level worldIn, LivingEntity entityLiving) {
entityLiving.addEffect(new MobEffectInstance(PotionEffectRegistry.FLIGHT.get(), TICKS.get()));
return super.finishUsingItem(stack, worldIn, entityLiving);
public ItemStack finishUsingItem(ItemStack stack, Level worldIn, LivingEntity entity) {
final var flight = PotionEffectRegistry.FLIGHT.get();
if (entity.hasEffect(flight)) {
MobEffectInstance currentEff = entity.getEffect(flight);
currentEff.update(new MobEffectInstance(PotionEffectRegistry.FLIGHT.get(), currentEff.getDuration() + TICKS.get())); // update to merge together new and existing timers
}
else {
entity.addEffect(new MobEffectInstance(flight, TICKS.get()));
}
return super.finishUsingItem(stack, worldIn, entity);
}
}
4 changes: 2 additions & 2 deletions update.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"1.19.2-latest":"1.8.2",
"1.19.3-latest":"1.9.0",
"1.19.4-latest":"1.10.2",
"1.20.1-latest":"1.12.3"
"1.20.1-latest":"1.12.4"

},
"1.16.5": {
Expand Down Expand Up @@ -158,6 +158,6 @@
,"1.12.1":"Fix transparency of several blocks (Terra Glass and both Clouds). Fix blockrendering/transparency along edges of cyclic:lamp (waxed lamp). Fix rendering of cyclic:laser_cannon beams #2295 and block highlights for Building Scepters and Location GPS. Fix 'Apple of lofty stature' not syncing when you rejoin the world, meaning the Step Height Disabled wasnt turning it off #2296 #2258. Exp boost no longer gives XP if the original harvest had a zero drop (stone/dirt etc) fix #2283. Fix render_type of Melter and Solidifier. Melter and Solidifier now drain the 'rf per tick' from recipe constrantly, instead of one batch drain at the end (and fix bug #2284) "
,"1.20.2":"For ease of use and better visuals, and to better match modern rendering pipelines, the Shape Data card, Building Scepters and the Block Randomizer now uses a block-outline wireframe method to hilight blocks instead of rendering cube-faces (for example, the GPS data card still uses the cube-faces render and not wireframe). (This update ports some features that had previously been exlusive to the mc 1.16.5-1.15.12 thru 1.16.5-1.15.21; all are listed below). New configs: [cyclic.enchantment.disarm] now has 'ignoredMobs' and 'percentPerLevel', [cyclic.items.tile_transporter] now has 'overrideChestSingle', read on or see cyclic.yml for more details. PR #1976 by metalshark :Item, Energy, and Fluid Cables now have Increased performance (compile time optimisations, reduction in cyclomatic complexity and removal of redundant checks). PR #1994 by 'metalshark' Fixes issue #1992. Merge pull request #2013 from metalshark : Add caching of packager recipes and move static methods out of main class for scaling. Merge pull request #2011 from metalshark : Invalidate capabilities when declaring them. #1933 Sack of Holding chest placement override added, with new config to revert back to legacy behavior if desired (overrideChestSingle). #2168 fix bug where ender shelf sometimes would not save contents when mined after exiting reloading world when client data desyncs. Added a percentage config and ignorelist config for cyclic:disarm enchantment (disarmPercentPerLevel, disarmIngoredMobs), resolves it dropping your copied weapon from alexsmobs:mimicube #2249. Fix #1878 layered and/or logic for multiple wireless transmitters on the same node. Now all git branches can be merged from mc-1.16.5 downstream to mc-1.20.1 and future updates as well."
,"1.20.3":"Requires flib-0.0.10. Fix preview rendering #2317. Machines now have an alternate render preview option. Recipe balance changes applied (only mc 1.20.1+). Fix #2297 shield textures. "
,"1.20.4": ""
,"1.20.4": "Remove eating cooldown on some foods. Glistering Chorus Fruit is now stackable again like before (potion time +stacks up #2309). CraftTweaker zenscript support added to the 5 cyclic recipe types, see scripts folder in this link for examples https://github.com/Lothrazar/Cyclic/tree/trunk/1.20/examples "
}
}

0 comments on commit 42d60e8

Please sign in to comment.