Skip to content

Commit

Permalink
merge trunk/1.19 patches for doorbell sound not-nullable and charm co…
Browse files Browse the repository at this point in the history
…nfigs
  • Loading branch information
Lothrazar committed Dec 30, 2023
2 parents 4048d5f + eb0cac1 commit b176d63
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 17 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.5
mod_version=1.12.6

# NEO FORGED
forge_version=47.1.65
Expand Down
12 changes: 11 additions & 1 deletion src/main/java/com/lothrazar/cyclic/block/DoorbellButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.ButtonBlock;
import net.minecraft.world.level.block.SimpleWaterloggedBlock;
Expand Down Expand Up @@ -64,8 +67,15 @@ public boolean isSignalSource(BlockState state) {
return true;
}

@Override
protected void playSound(Player p, LevelAccessor level, BlockPos pos, boolean isOn) {
if (isOn) {
level.playSound(p, pos, this.getSound(isOn), SoundSource.BLOCKS);
}
}

@Override
protected SoundEvent getSound(boolean isOn) {
return isOn ? SoundRegistry.DOORBELL_MIKEKOENIG.get() : null;
return SoundRegistry.DOORBELL_MIKEKOENIG.get();
}
}
12 changes: 8 additions & 4 deletions src/main/java/com/lothrazar/cyclic/config/ConfigRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
import com.lothrazar.cyclic.item.WandHypnoItem;
import com.lothrazar.cyclic.item.bauble.AutoCaveTorchItem;
import com.lothrazar.cyclic.item.bauble.AutoTorchItem;
import com.lothrazar.cyclic.item.bauble.CharmBase;
import com.lothrazar.cyclic.item.elemental.IceWand;
import com.lothrazar.cyclic.item.elemental.WaterSpreaderItem;
import com.lothrazar.cyclic.item.ender.ItemProjectileDungeon;
Expand All @@ -97,6 +96,8 @@
import net.minecraftforge.common.ForgeConfigSpec;
import net.minecraftforge.common.ForgeConfigSpec.BooleanValue;
import net.minecraftforge.common.ForgeConfigSpec.ConfigValue;
import net.minecraftforge.common.ForgeConfigSpec.DoubleValue;
import net.minecraftforge.common.ForgeConfigSpec.IntValue;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.config.ModConfig;

Expand Down Expand Up @@ -126,6 +127,9 @@ public void setupClient() {
private static ConfigValue<List<? extends String>> MBALL_IGNORE_LIST;
private static ConfigValue<List<? extends String>> DISARM_IGNORE_LIST;
private static final String WALL = "####################################################################################";
public static IntValue CHARM_LUCK;
public static DoubleValue CHARM_SPEED;
public static DoubleValue CHARM_ATTACKSPEED;
public static BooleanValue OVERRIDE_TRANSPORTER_SINGLETON;
public static BooleanValue GENERATE_FLOWERS;
public static BooleanValue CYAN_PODZOL_LEGACY;
Expand Down Expand Up @@ -370,9 +374,9 @@ private static void initConfig() {
MaterialRegistry.OBS_LEG = CFG.comment("Damage Reduction").defineInRange("leg", 10, 1, 99);
CFG.pop();
ItemProjectileDungeon.RANGE = CFG.comment("Range in all directions to search for spawner").defineInRange("spawner_seeker.range", 64, 1, 256);
CharmBase.CHARM_LUCK = CFG.comment("Boost given by item charm_luck").defineInRange("charm_luck.boost", 10, 0, 100);
CharmBase.CHARM_SPEED = CFG.comment("Boost given by item charm_speed").defineInRange("charm_speed.boost", 0.5F, 0, 2F);
CharmBase.CHARM_ATTACKSPEED = CFG.comment("Boost given by item charm_attackspeed").defineInRange("charm_attack_speed.boost", 0.5F, 0, 2F);
CHARM_LUCK = CFG.comment("Boost given by item charm_luck").defineInRange("charm_luck.boost", 10, 0, 100);
CHARM_SPEED = CFG.comment("Boost given by item charm_speed").defineInRange("charm_speed.boost", 0.5F, 0, 2F);
CHARM_ATTACKSPEED = CFG.comment("Boost given by item charm_attackspeed").defineInRange("charm_attack_speed.boost", 0.5F, 0, 2F);
AutoTorchItem.LIGHT_LEVEL = CFG.comment("Light level limit for placing torches").defineInRange("charm_torch.light_level", 9, 0, 15);
CFG.comment(WALL, " Caving Torch Charm settings", WALL).push("caving_torch");
AutoCaveTorchItem.LIGHT_LIMIT = CFG.comment("Light level at which to start placing down a torch").defineInRange("light_limit", 7, 0, 14);
Expand Down
12 changes: 4 additions & 8 deletions src/main/java/com/lothrazar/cyclic/item/bauble/CharmBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.UUID;
import com.lothrazar.cyclic.ModCyclic;
import com.lothrazar.cyclic.config.ConfigRegistry;
import com.lothrazar.cyclic.registry.ItemRegistry;
import com.lothrazar.cyclic.util.CharmUtil;
import com.lothrazar.library.core.Const;
Expand All @@ -25,15 +26,10 @@
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraftforge.common.ForgeConfigSpec.DoubleValue;
import net.minecraftforge.common.ForgeConfigSpec.IntValue;
import net.minecraftforge.common.ForgeMod;

public abstract class CharmBase extends ItemBaseToggle {

public static IntValue CHARM_LUCK;
public static DoubleValue CHARM_SPEED;
public static DoubleValue CHARM_ATTACKSPEED;
private static final int FIREPROTSECONDS = 10;
private static final int FALLDISTANCESECONDS = 5;
private static final int FALLDISTANCELIMIT = 5; // was 6 in 1.12.2
Expand Down Expand Up @@ -150,15 +146,15 @@ private static void toggleAttribute(Player player, Item charm, Attribute attr, U
static final AttributeModifier.Operation MUL = AttributeModifier.Operation.MULTIPLY_BASE;

static void charmSpeed(Player player) {
toggleAttribute(player, ItemRegistry.CHARM_SPEED.get(), Attributes.MOVEMENT_SPEED, ID_SPEED, CHARM_SPEED.get().floatValue(), 0, ADD);
toggleAttribute(player, ItemRegistry.CHARM_SPEED.get(), Attributes.MOVEMENT_SPEED, ID_SPEED, ConfigRegistry.CHARM_SPEED.get().floatValue(), 0, ADD);
}

static void charmLuck(Player player) {
toggleAttribute(player, ItemRegistry.CHARM_LUCK.get(), Attributes.LUCK, ID_LUCK, 0, CHARM_LUCK.get(), ADD);
toggleAttribute(player, ItemRegistry.CHARM_LUCK.get(), Attributes.LUCK, ID_LUCK, 0, ConfigRegistry.CHARM_LUCK.get(), ADD);
}

static void charmAttackSpeed(Player player) {
toggleAttribute(player, ItemRegistry.CHARM_ATTACKSPEED.get(), Attributes.ATTACK_SPEED, ID_ATTACKSPEED, CHARM_ATTACKSPEED.get().floatValue(), 0, ADD);
toggleAttribute(player, ItemRegistry.CHARM_ATTACKSPEED.get(), Attributes.ATTACK_SPEED, ID_ATTACKSPEED, ConfigRegistry.CHARM_ATTACKSPEED.get().floatValue(), 0, ADD);
}

static void charmSwimming(Player player) {
Expand Down
8 changes: 5 additions & 3 deletions update.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
"1.18.2-latest": "1.7.17",
"1.19.2-latest":"1.8.2",
"1.19.3-latest":"1.9.0",
"1.19.4-latest":"1.10.2",
"1.19.4-latest":"1.10.3",
"1.20.1-latest":"1.12.4"

},
"1.16.5": {
"0.6.1": "Ported ",
Expand Down Expand Up @@ -150,7 +149,8 @@
"1.19.4": {
"1.10.0":"Ported to MC-1.19.4 (from 1.19.3-1.9.0)"
,"1.10.1" :"Fix #2221 visual gui fluid bars. backport #2282 tags for tool types. Fix multi-jump enchant #2256 and fix #2248 Cant open the Extended Inventory after eating the Ender Inventory Cake. 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.10.2":"Fix buttons rendering a second version when hovering for a tooltip. (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.10.3":"#2332 Patch doorbell crash. Patch InvocationTargetException: null errors coming from IHasClickToggle"
},
"1.20.1": {
"1.11.0":"Ported to MC-1.20 (from 1.19.4-1.10.0)",
Expand All @@ -159,5 +159,7 @@
,"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": "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 "
,"1.20.5":"Merge pull request #2334 from TelepathicGrunt/trunk/1.20 Optimize anti beacon to not deadlock worldgen or lag entities"
,"1.20.6":"#2332 Patch doorbell crash. Patch InvocationTargetException: null errors coming from IHasClickToggle"
}
}

0 comments on commit b176d63

Please sign in to comment.