-
-
Notifications
You must be signed in to change notification settings - Fork 89
1.21.1 neoforge initial clusterfuck #814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.21.1 neoforge initial clusterfuck #814
Conversation
…uck' into 1.21.1-neoforge-initial-clusterfuck
| //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) { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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"
]
}There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Jeopardent -> Jeopardant
| // 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vro
| // 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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
|
👀 |
e7f38f2
into
DaFuqs:1.21.1-neoforge-initial-clusterfuck
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