Skip to content

Commit

Permalink
Fixed Area Effect and Summoner Blocks crashing the game (#639)
Browse files Browse the repository at this point in the history
- Summoner Blocks and Area Effect Blocks no longer crash the game when
right-clicked with a Spawn Egg and Potion respectively.
- Localized the set Entity Type and Potion Name for both blocks' status
message.
- Added to changelog fix implemented by the packet cleanup, where in
previous versions of the mod right-clicking a Summoner or Area Effect
Block with their corresponding items wouldn't actually update their
settings.

---------

Co-authored-by: kirderf1 <[email protected]>
  • Loading branch information
Cibernet83 and kirderf1 authored Oct 2, 2024
1 parent 833d773 commit 4dda5a0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- Many organic blocks are now compostable
- Many wood-based blocks can now be used as fuel
- Cruxite ore textures tweaked
- Localized potion name for the status message that appears when right-clicking an Area Effect Block with a potion
- Localized entity type for the status message that appears when right-clicking a Summoner Block with a Spawn Egg

### Fixed
- The Umbral Infiltrator no longer jitters when thrown by a void player
- Manually-spawned Lotus Flowers can no longer be hurt or killed by any damage source
- Lotus Flowers no longer push entities inside of them away
- Ogres and Basilisks no longer slide around when idling
- Cruxite button now uses raw cruxite instead of cruxite block, which resolves a conflict with storage block breakdown

- Fixed right-clicking on an Area Effect Block with a Potion not properly updating its settings
- Fixed right-clicking on a Summoner Block with a Spawn Egg not properly updating its settings

### Contributors for this release

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"block.minestuck.apple_cake": "Apple Cake",
"block.minestuck.area_effect_block": "Area Effect Block",
"block.minestuck.area_effect_block.additional_info": "- Can be toggled to apply the effect only to players\n- Can be permanently disabled\n- Area of effect changes when rotated\n- UI only accessible in creative mode\n- Right clicking with a potion bottle in creative mode sets it to that potion effect",
"block.minestuck.area_effect_block.effect_change_message": "Effect type changed to %s with the amplification strength %s.",
"block.minestuck.area_effect_block.effect_change_message": "Effect type changed to %s",
"block.minestuck.area_effect_block.tooltip": "Applies a potion effect to entities within a specified area when powered.",
"block.minestuck.attached_strawberry_stem": "Strawberry Stem",
"block.minestuck.black_chess_brick_slab": "Black Chess Brick Slab",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ private void clickWithPotion(Level level, BlockPos pos, Player player, AreaEffec
{
be.setEffect(firstEffect.getEffect(), firstEffect.getAmplifier());

player.displayClientMessage(Component.translatable(getDescriptionId() + "." + EFFECT_CHANGE_MESSAGE,
BuiltInRegistries.MOB_EFFECT.getKey(firstEffect.getEffect()), firstEffect.getAmplifier()), true);
player.displayClientMessage(Component.translatable(getDescriptionId() + "." + EFFECT_CHANGE_MESSAGE, Component.translatable(
"potion.withAmplifier", firstEffect.getEffect().getDisplayName(),
Component.translatable("potion.potency." + firstEffect.getAmplifier()))), true);
level.playSound(null, pos, SoundEvents.UI_BUTTON_CLICK.value(), SoundSource.BLOCKS, 0.5F, 1F);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public InteractionResult use(BlockState state, Level level, BlockPos pos, Player
if(!level.isClientSide)
{
summoner.setSummonedEntity(eggItem.getType(stackIn.getTag()));
player.displayClientMessage(Component.translatable(SUMMON_TYPE_CHANGE, BuiltInRegistries.ENTITY_TYPE.getKey(eggItem.getType(stackIn.getTag()))), true);
player.displayClientMessage(Component.translatable(SUMMON_TYPE_CHANGE, eggItem.getType(stackIn.getTag()).getDescription()), true);
}

level.playSound(player, pos, SoundEvents.UI_BUTTON_CLICK.value(), SoundSource.BLOCKS, 0.5F, 1F);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ protected void addTranslations()
addBlock(MSBlocks.AREA_EFFECT_BLOCK, "Area Effect Block");
addBlockTooltip(MSBlocks.AREA_EFFECT_BLOCK, "Applies a potion effect to entities within a specified area when powered.");
addBlockExtra(MSBlocks.AREA_EFFECT_BLOCK, "additional_info", "- Can be toggled to apply the effect only to players\n- Can be permanently disabled\n- Area of effect changes when rotated\n- UI only accessible in creative mode\n- Right clicking with a potion bottle in creative mode sets it to that potion effect");
addBlockExtra(MSBlocks.AREA_EFFECT_BLOCK, AreaEffectBlock.EFFECT_CHANGE_MESSAGE, "Effect type changed to %s with the amplification strength %s.");
addBlockExtra(MSBlocks.AREA_EFFECT_BLOCK, AreaEffectBlock.EFFECT_CHANGE_MESSAGE, "Effect type changed to %s");
addBlock(MSBlocks.PLATFORM_GENERATOR, "Platform Generator");
addBlockTooltip(MSBlocks.PLATFORM_GENERATOR, "Creates a temporary platform when powered.");
addBlockExtra(MSBlocks.PLATFORM_GENERATOR, "additional_info", "- Length of area where platforms generate is proportional to power\n- Can be toggled to alternate visibility\n- Platform can be blocked by platform receptacles as well as hard or impossible to break blocks");
Expand Down

0 comments on commit 4dda5a0

Please sign in to comment.