Skip to content

Conversation

@sudo-CuriousLad
Copy link
Contributor

I fucked up the other PR 😭 So rusty

Anyways I would like to say that the placement of these is very temporary most likely and they will be moved into more relevant classes.

I think I did okay? pls no kill

Comment on lines 111 to 114
//Curious: Gang idfk what to name this I'ma be so fr
//Curious TODO: Find a proper name for this event
@SubscribeEvent
public void triggerInertia(BlockEvent.BreakEvent event) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could probably be just handleInertia, no need to overthink this

}

//Curious: I'm like 90% sure this isn't needed anymore since Enchantments are stored as components now so I'm just commenting both instances of this
//Curious TODO: Look into whether enchantments still need this event check for the Indestructible enchant
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd say yes simply because the current enchantable tag is just a generic one and not a negative tag for #spectrum:indestructible_blacklisted

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it could just be made to exclude #spectrum:indestructible_blacklisted though, we have exclusionslib specifically for that

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do note, however, that it's optional currently

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I should be fine to delete that handler, yes?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as long as you replace it with equivalent functionality
since exclusionslib is optional, i strongly advise you to write an equivalent handler

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do that later then, need to look into spectrum's code more

Copy link
Owner

@DaFuqs DaFuqs Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neoforge has it's own tag exclusion mechanism: https://docs.neoforged.net/docs/resources/server/tags/, so we are good without a dedicated blacklist tag.

{
    "values": [
       ...
    ],
    "remove": [
        "minecraft:iron_ingot"
    ]
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's really useful

}

@SubscribeEvent
public void triggerJeopardentKillCriterion(LivingDeathEvent event) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Jeopardent -> Jeopardant

Comment on lines 195 to 259
// AttackBlockCallback.EVENT.register((player, world, hand, pos, direction) -> {
// if (!world.isClientSide && !player.isSpectator()) {
//
// ItemStack mainHandStack = player.getMainHandItem();
// if (mainHandStack.getItem() instanceof ExchangeStaffItem exchangeStaffItem) {
// BlockState targetBlockState = world.getBlockState(pos);
// if (exchangeStaffItem.canInteractWith(targetBlockState, world, pos, player)) {
// Optional<Block> storedBlock = ExchangeStaffItem.getStoredBlock(player.getMainHandItem());
//
// if (storedBlock.isPresent()
// && storedBlock.get() != targetBlockState.getBlock()
// && storedBlock.get().asItem() != Items.AIR
// && ExchangeStaffItem.exchange(world, pos, player, storedBlock.get(), player.getMainHandItem(), true, direction)) {
//
// return InteractionResult.SUCCESS;
// }
// }
// world.playSound(null, player.blockPosition(), SoundEvents.DISPENSER_FAIL, SoundSource.PLAYERS, 1.0F, 1.0F);
// return InteractionResult.FAIL;
// }
// }
// return InteractionResult.PASS;
// });

// CommonLifecycleEvents.TAGS_LOADED.register((registries, client) -> {
// if (client) {
// SpectrumColorProviders.resetToggleableProviders();
// }
// });

// PlayerBlockBreakEvents.AFTER.register((level, player, pos, state, blockEntity) -> {
// if (player instanceof ServerPlayer serverPlayerEntity) {
// ItemStack handStack = player.getItemInHand(serverPlayerEntity.getUsedItemHand());
// if (SpectrumEnchantmentHelper.hasEnchantment(player.level().registryAccess(), SpectrumEnchantments.INERTIA, handStack)) {
// InertiaComponent.onInertiaBlockBreak(level, pos, state, serverPlayerEntity, handStack);
// }
//
// SpectrumAdvancementCriteria.BLOCK_BROKEN.trigger(serverPlayerEntity, state);
// }
// });

// EnchantmentEvents.ALLOW_ENCHANTING.register((registryEntry, itemStack, enchantingContext) -> {
// if (registryEntry.is(SpectrumEnchantments.INDESTRUCTIBLE) && itemStack.is(SpectrumItemTags.INDESTRUCTIBLE_BLACKLISTED)) {
// return TriState.FALSE;
// }
// return TriState.DEFAULT;
// });

// UseEntityCallback.EVENT.register((player, world, hand, entity, hitResult) -> {
// ItemStack handStack = player.getItemInHand(hand);
// if (handStack.getItem() instanceof PrioritizedEntityInteraction && entity instanceof LivingEntity livingEntity) {
// return handStack.interactLivingEntity(player, livingEntity, hand);
// }
// return InteractionResult.PASS;
// });

// UseBlockCallback.EVENT.register((player, world, hand, hitResult) -> {
// ItemStack handStack = player.getItemInHand(hand);
// if (handStack.getItem() instanceof PrioritizedBlockInteraction) {
// return handStack.useOn(new UseOnContext(player, hand, hitResult));
// }
// return InteractionResult.PASS;
// });
//I don't wanna mess with server stuff rn I'm not sure how this works
//TODO: Look into server code stuff so these can be handled
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vro

Comment on lines 321 to 339
// EntitySleepEvents.STOP_SLEEPING.register((entity, sleepingPos) -> {
// // If the player wears a Whispy Cirlcet and sleeps
// // they get fully healed and all negative status effects removed
// // When the sleep timer reached 100 the player is fully asleep
// if (entity instanceof ServerPlayer serverPlayerEntity
// && serverPlayerEntity.getSleepTimer() == 100
// && SpectrumTrinketItem.hasEquipped(entity, SpectrumItems.WHISPY_CIRCLET)) {
//
// entity.setHealth(entity.getMaxHealth());
// WhispyCircletItem.removeNegativeStatusEffects(entity);
// }
// });

// ServerEntityCombatEvents.AFTER_KILLED_OTHER_ENTITY.register((world, entity, killedEntity) -> {
// if (entity instanceof ServerPlayer serverPlayerEntity && SpectrumTrinketItem.hasEquipped(serverPlayerEntity, SpectrumItems.JEOPARDANT)) {
// SpectrumAdvancementCriteria.JEOPARDANT_KILL.trigger(serverPlayerEntity, killedEntity);
// }
// });
//Curious: This is too scary for me Daf
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you literally did that above, remove this commented out code

Copy link
Contributor Author

@sudo-CuriousLad sudo-CuriousLad Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot version control is a thing and I can just delete that I'm sorry

import java.util.*;
import java.util.concurrent.atomic.*;

public class SpectrumEventListeners {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one more thing: @SubscribeEvent must be used in conjunction with @EventBusSubscriber, the only other way is manually registering event listeners to the bus

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I just forgot to do that, change has been made

@DaFuqs
Copy link
Owner

DaFuqs commented Jan 31, 2026

👀

@DaFuqs DaFuqs merged commit e7f38f2 into DaFuqs:1.21.1-neoforge-initial-clusterfuck Jan 31, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants