Skip to content

Commit

Permalink
Change feature and credit comments to all use JavaDocs and be moved t…
Browse files Browse the repository at this point in the history
…o package-info files
  • Loading branch information
TrigamDev committed Jan 17, 2025
1 parent 667fd8d commit 5eb33cc
Show file tree
Hide file tree
Showing 41 changed files with 319 additions and 223 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@
import java.util.Arrays;
import java.util.HashMap;

// FEATURE: Configurable Data-Driven Resources
// AUTHORS: Flatkat, WheatFlour
/**
* FEATURE: Configurable data-driven resources.
* @author Flatkat
* @author WheatFlour
*/

public record HarmonyConfigCondition(String config_name) implements ResourceCondition {

@Retention(RetentionPolicy.RUNTIME)
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/dev/symphony/harmony/item/ModifyItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@
public class ModifyItems {

public static void init() {
// FEATURE: Change stew/soup stack sizes
// AUTHORS: Flatkat, Trigam
/**
* FEATURE: Change stew/soup stack sizes.
* @author Flatkat
* @author Trigam
*/

if (HarmonyConfig.stewStackSize != 1) {
DefaultItemComponentEvents.MODIFY.register(context -> {
// Ok so, can't use an item tag since tags only exist
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
package dev.symphony.harmony.mixin.building;

package dev.symphony.harmony.mixin.building.armor_stand_arms;

import dev.symphony.harmony.config.HarmonyConfig;
import net.minecraft.block.Block;
Expand All @@ -25,12 +24,10 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

// FEATURE: Allow Armor stands to be given arms using a Stick, and removed using Shears
// AUTHORS: WheatFlour, Trigam
@Mixin(ArmorStandEntity.class)
public abstract class ArmorStandStickArms extends Entity {
public abstract class ToggleableArmorStandArms extends Entity {

public ArmorStandStickArms(EntityType<?> type, World world) {
public ToggleableArmorStandArms(EntityType<?> type, World world) {
super(type, world);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* FEATURE: Allow Armor stands to be given arms using a Stick, and removed using Shears.
* @author WheatFlour
* @author Trigam
*/

package dev.symphony.harmony.mixin.building.armor_stand_arms;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dev.symphony.harmony.mixin.combat;
package dev.symphony.harmony.mixin.combat.slower_item_despawn;

import dev.symphony.harmony.config.HarmonyConfig;
import net.minecraft.entity.Entity;
Expand All @@ -11,14 +11,12 @@
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

// FEATURE: Make items despawn slower on lower difficulties
// AUTHOR: axialeaa
@Mixin(ItemEntity.class)
public abstract class ItemEntityMixin extends Entity {
public abstract class ModifyItemDespawnTimes extends Entity {

@Shadow @Final private static int NEVER_DESPAWN_AGE;

public ItemEntityMixin(EntityType<?> type, World world) {
public ModifyItemDespawnTimes(EntityType<?> type, World world) {
super(type, world);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* FEATURE: Make items despawn slower on lower difficulties.
* @author axialeaa
*/

package dev.symphony.harmony.mixin.combat.slower_item_despawn;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* FEATURE: Makes Tridents with Loyalty come back from the void.
* Brought from TridentFix from Powercyphe (licensed under MIT) under their consent
* Brought from TridentFix from Powercyphe (licensed under MIT) under their consent.
* @author Powercyphe
*/
package dev.symphony.harmony.mixin.combat.tridents_return_from_void;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dev.symphony.harmony.mixin.food;
package dev.symphony.harmony.mixin.food.glow_berries_apply_glowing;

import dev.symphony.harmony.config.HarmonyConfig;
import net.minecraft.entity.LivingEntity;
Expand All @@ -13,23 +13,17 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

// FEATURE: When Glowberries are eaten, they give the glowing effect for a configurable amount of time
// AUTHORS: Michiel1106
@Mixin(Item.class)
public class GlowBerryMixin {
public class GlowBerriesApplyGlowing {

// Injects into the finishusing class, affecting every item.
@Inject(method = "finishUsing", at = @At("HEAD"))

private void glowBerryGlowEffect(ItemStack stack, World world, LivingEntity user, CallbackInfoReturnable<ItemStack> cir) {
// Checks if its not done on the client and if the glowberry effect isnt 0, if its zero it wont do anything

if(!world.isClient && HarmonyConfig.glowBerryEffect != 0) {
// Checks if the item the person is holding is a glowberry
// If eating Glow Berry, apply glowing
if (stack.getItem() == Items.GLOW_BERRIES) {
// Convert the input from ticks to seconds as 20 ticks is 1 second
int glowduration = HarmonyConfig.glowBerryEffect * 20;
// Apply the effect using the glowduration above
user.addStatusEffect(new StatusEffectInstance(StatusEffects.GLOWING, glowduration, 0, true, true));
int glowDuration = HarmonyConfig.glowBerryEffect * 20;
user.addStatusEffect(new StatusEffectInstance(StatusEffects.GLOWING, glowDuration, 0, true, true));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* FEATURE: When Glow Berries are eaten, they give the glowing effect for a configurable amount of time.
* @author Michiel1106
*/

package dev.symphony.harmony.mixin.food.glow_berries_apply_glowing;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dev.symphony.harmony.mixin.mobs;
package dev.symphony.harmony.mixin.mobs.husks_drop_sand;

import dev.symphony.harmony.config.HarmonyConfig;
import dev.symphony.harmony.loot.HarmonyLootContextTypes;
Expand All @@ -20,16 +20,10 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

/**
* Husks drop sand when they convert into zombies in water.
* @author axialeaa
* @see HarmonyLootTables
* @see HarmonyLootContextTypes
*/
@Mixin(HuskEntity.class)
public class HuskEntityMixin extends ZombieEntity {
public class HusksDropSandOnConversion extends ZombieEntity {

public HuskEntityMixin(World world) {
public HusksDropSandOnConversion(World world) {
super(world);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* FEATURE: Husks drop Sand when they convert into Zombies in water.
* @author axialeaa
* @see dev.symphony.harmony.loot.HarmonyLootTables
* @see dev.symphony.harmony.loot.HarmonyLootContextTypes
*/

package dev.symphony.harmony.mixin.mobs.husks_drop_sand;
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* Mobs can spawn wearing armor each with independently-calculated armor materials, instead of necessarily matching throughout the entire worn set.
* FEATURE: Mobs can spawn wearing armor each with independently-calculated armor materials,
* instead of necessarily matching throughout the entire worn set.
* @author axialeaa
*/
package dev.symphony.harmony.mixin.mobs.mismatched_mob_armor;
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
/**
* Parrots are able to perch on players' shoulders more reliably, only flying off when the player touches water without being in a boat, takes damage, touches powder snow, flies with elytra or quickly sneaks and unsneaks.
* FEATURE: Parrots are able to perch on players' shoulders more reliably.
* Parrots will only dismount when the player:
* <ul>
* <li>Touches water while not in a boat</li>
* <li>Takes damage</li>
* <li>Touches Powder Snow</li>
* <li>Flies with an Elytra</li>
* <li>Quickly sneaks and unsneaks</li>
* </ul>
* @author axialeaa
*/
package dev.symphony.harmony.mixin.mobs.permissive_parrot_perching;
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* Tamed wolves growl when there is a hostile mob nearby, regardless of whether that mob has made them "angry".
* FEATURE: Tamed wolves growl when there is a hostile mob nearby,
* regardless of whether that mob has made them "angry".
* @author axialeaa
*/
package dev.symphony.harmony.mixin.mobs.wolves_growl_at_monsters;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dev.symphony.harmony.mixin.potions;
package dev.symphony.harmony.mixin.potions.apply_beacon_buff_to_tamed_mobs;

import com.llamalad7.mixinextras.sugar.Local;
import dev.symphony.harmony.config.HarmonyConfig;
Expand All @@ -19,10 +19,8 @@
import java.util.List;
import java.util.Objects;

// FEATURE: Gives the beacon's effect to tamed entities as well as players.
// AUTHOR: axialeaa
@Mixin(BeaconBlockEntity.class)
public class BeaconBlockEntityMixin {
public class ApplyBeaconBuffToTamedMobs {

@Inject(method = "applyPlayerEffects", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;getNonSpectatingEntities(Ljava/lang/Class;Lnet/minecraft/util/math/Box;)Ljava/util/List;"))
private static void applyTamedEntityEffects(World world, BlockPos pos, int beaconLevel, @Nullable RegistryEntry<StatusEffect> primaryEffect, @Nullable RegistryEntry<StatusEffect> secondaryEffect, CallbackInfo ci,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* FEATURE: Gives the beacon's effect to tamed entities as well as players.
* @author axialeaa
*/

package dev.symphony.harmony.mixin.potions.apply_beacon_buff_to_tamed_mobs;
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package dev.symphony.harmony.mixin.redstone;
package dev.symphony.harmony.mixin.redstone.copper_bulb_delay;

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import dev.symphony.harmony.config.HarmonyConfig;
import dev.symphony.harmony.mixin.redstone.AbstractBlockImplMixin;
import net.minecraft.block.BlockState;
import net.minecraft.block.BulbBlock;
import net.minecraft.server.world.ServerWorld;
Expand All @@ -12,8 +13,6 @@
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;

// FEATURE: Added back 1 tick Copper Bulb delay
// AUTHORS: Randomvideos, axialeaa
@Mixin(BulbBlock.class)
public class OneTickCopperBulbDelay extends AbstractBlockImplMixin {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* FEATURE: Add back the 1-tick Copper Bulb delay.
* @author Randomvideos
* @author axialeaa
*/

package dev.symphony.harmony.mixin.redstone.copper_bulb_delay;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dev.symphony.harmony.mixin.redstone;
package dev.symphony.harmony.mixin.redstone.restone_lamp_delay;

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
Expand All @@ -11,9 +11,6 @@
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;


// FEATURE: Removed Redstone Lamp delay
// AUTHORS: Randomvideos
@Mixin(RedstoneLampBlock.class)
public class RemoveRedstoneLampDelay extends Block {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* FEATURE: Remove the Redstone Lamp delay.
* @author Randomvideos
*/

package dev.symphony.harmony.mixin.redstone.restone_lamp_delay;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dev.symphony.harmony.mixin.transportation.elytra;
package dev.symphony.harmony.mixin.transportation.elytra.liquids_deactivate_elytra;

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import dev.symphony.harmony.config.HarmonyConfig;
Expand All @@ -10,16 +10,12 @@
import org.spongepowered.asm.mixin.injection.At;

@Mixin(LivingEntity.class)
public abstract class LivingEntityMixin extends Entity {
public LivingEntityMixin(EntityType<?> type, World world) {
public abstract class LiquidsDeactivateElytra extends Entity {

public LiquidsDeactivateElytra(EntityType<?> type, World world) {
super(type, world);
}

/**
* FEATURE: Flying through liquids deactivates the Elytra
* @author Kiku
* @author Flatkat
*/
@ModifyExpressionValue(method = "canGlide", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/LivingEntity;hasStatusEffect(Lnet/minecraft/registry/entry/RegistryEntry;)Z"))
private boolean cancelElytraInLiquid(boolean original) {
if(HarmonyConfig.liquidsDeactivateElytra){
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* FEATURE: Flying through liquids deactivates the Elytra.
* @author Kiku
* @author Flatkat
*/

package dev.symphony.harmony.mixin.transportation.elytra.liquids_deactivate_elytra;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dev.symphony.harmony.mixin.transportation;
package dev.symphony.harmony.mixin.transportation.horse.amor_prevents_bucking;

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import dev.symphony.harmony.config.HarmonyConfig;
Expand All @@ -19,8 +19,6 @@
@Mixin (AbstractHorseEntity.class)
public class HorseArmorPreventsBucking {

// FEATURE:
// AUTHORS: KikuGie, Flatkat
@Unique
private static final Map<Item, Float> preventBuckingChance = new Object2FloatArrayMap<>();
@Shadow @Final private Inventory armorInventory;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* FEATURE: Horse Armor has a chance to prevent the Horse bucking when taking damage.
* @author KikuGie
* @author Flatkat
*/

package dev.symphony.harmony.mixin.transportation.horse.amor_prevents_bucking;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dev.symphony.harmony.mixin.transportation.minecarts;
package dev.symphony.harmony.mixin.transportation.minecart.customizable_furnace_minecart_speed;

import dev.symphony.harmony.config.HarmonyConfig;
import net.minecraft.entity.EntityType;
Expand All @@ -20,10 +20,6 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

/**
* FEATURE: Made Furnace Minecart speeds customizable.
* @author RandomVideos
*/
@Mixin(FurnaceMinecartEntity.class)
public class FurnaceMinecartEntityMixin extends AbstractMinecartEntity {
@Shadow private int fuel;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* FEATURE: Make Furnace Minecart speeds customizable.
* @author RandomVideos
*/

package dev.symphony.harmony.mixin.transportation.minecart.customizable_furnace_minecart_speed;
Loading

0 comments on commit 5eb33cc

Please sign in to comment.