Fix (some) compile issues#1602
Closed
Onako2 wants to merge 2 commits into
Closed
Conversation
granny
requested changes
Oct 27, 2024
| int i = EnchantmentHelper.getEnchantmentLevel(this.enchantment, livingEntity); | ||
| + // Purpur start - Add an option to fix MC-3304 projectile looting | ||
| + if (org.purpurmc.purpur.PurpurConfig.fixProjectileLootingTransfer && context.getParamOrNull(LootContextParams.DIRECT_ATTACKING_ENTITY) instanceof net.minecraft.world.entity.projectile.AbstractArrow arrow) { | ||
| + if (org.purpurmc.purpur.PurpurConfig.fixProjectileLootingTransfer && context.getParameter(LootContextParams.DIRECT_ATTACKING_ENTITY) instanceof net.minecraft.world.entity.projectile.AbstractArrow arrow) { |
Member
There was a problem hiding this comment.
getOptionalParameter is the replacement for getParamOrNull
| + return InteractionResult.CONSUME; | ||
| + } | ||
| + return net.minecraft.world.ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION; | ||
| + return InteractionResult.PASS; |
Member
There was a problem hiding this comment.
The replacement for ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION is InteractionResult.TRY_WITH_EMPTY_HAND
| if (entity.isOnFire() && entity.mayInteract(worldserver, pos)) { | ||
| - if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entity, pos, Blocks.AIR.defaultBlockState(), !(worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) || entity instanceof Player))) { | ||
| + if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entity, pos, Blocks.AIR.defaultBlockState(), !((worldserver.purpurConfig.powderSnowBypassMobGriefing || world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) || entity instanceof Player))) { // Purpur | ||
| + if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entity, pos, Blocks.AIR.defaultBlockState(), !((worldserver.purpurConfig.powderSnowBypassMobGriefing || ((ServerLevel) world).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) || entity instanceof Player))) { // Purpur |
Member
There was a problem hiding this comment.
This line exists under an if statement that calls world instanceof ServerLevel worldserver, which means world should be worldserver.
Comment on lines
-6491
to
+6492
| + boolean hurt = target.hurt(target.damageSources().mobProjectile(this, (LivingEntity) shooter), level().purpurConfig.phantomFlameDamage); | ||
| + if (hurt && level().purpurConfig.phantomFlameFireTime > 0) { | ||
| + target.hurt(target.damageSources().mobProjectile(this, (LivingEntity) shooter), level().purpurConfig.phantomFlameDamage); | ||
| + if (level().purpurConfig.phantomFlameFireTime > 0) { |
Member
There was a problem hiding this comment.
Entity#hurt() is replaced by Entity#hurtServer(). The boolean should not be removed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request issue fixes some compile issues.
This can be merged now or later depending on when the person merging this wants to work on compile issues :) .