Skip to content

Commit

Permalink
34ty
Browse files Browse the repository at this point in the history
  • Loading branch information
seymourimadeit committed Jun 24, 2024
1 parent c42a1b5 commit 7b02d3f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.neoforged.gradle.userdev' version '7.0.143'
id 'net.neoforged.gradle.userdev' version '7.0.145'
}

version = minecraft_version + "-" + mod_version
Expand Down
4 changes: 1 addition & 3 deletions changelog-1.21.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
- Fix crash when an alchemist fires an arrow
- Fix alchemist armband being offset when throwing potion
- Fix version checker being borked
- Update to latest forge changes
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ minecraft_version=1.21
# as they do not follow standard versioning conventions.
minecraft_version_range=[1.21, 1.22)
# The Neo version must agree with the Minecraft version to get a valid artifact
neo_version=21.0.20-beta
neo_version=21.0.31-beta
# The Neo version range can use any version of Neo as bounds or match the loader version range
neo_version_range=[20.5.14,)
# The loader version range can only use the major version of Neo/FML as bounds
Expand All @@ -31,7 +31,7 @@ mod_name=Piglin Proliferation
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=MIT for code, CC BY-NC-SA 4.0 for assets
# The mod version. See https://semver.org/
mod_version=2.0.1
mod_version=2.0.2
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/tallestred/piglinproliferation/PPEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,13 @@ public static void onEffectRemoved(MobEffectEvent.Remove event) {
}

@SubscribeEvent
public static void hurtEntity(LivingHurtEvent event) {
if (event.getSource().getDirectEntity() instanceof Arrow arrow && PPConfig.COMMON.healingArrowDamage.get()) {
public static void hurtEntity(LivingDamageEvent.Pre event) {
if (event.getContainer().getSource().getDirectEntity() instanceof Arrow arrow && PPConfig.COMMON.healingArrowDamage.get()) {
for (MobEffectInstance mobeffectinstance : arrow.getPotionContents().getAllEffects()) {
if ((mobeffectinstance.getEffect() == MobEffects.REGENERATION || mobeffectinstance.getEffect() == MobEffects.HEAL)) {
if ((event.getEntity() instanceof Mob && event.getEntity().isInvertedHealAndHarm()))
return;
event.setAmount(0.0F);
event.getContainer().setNewDamage(0.0F);
arrow.level().playSound(null, arrow.blockPosition(), PPSounds.REGEN_HEALING_ARROW_HIT.get(), SoundSource.NEUTRAL, 1.0F, 1.0F);
event.getEntity().setDeltaMovement(event.getEntity().getDeltaMovement().multiply(-1.0D, -1.0D, -1.0D));
event.getEntity().invulnerableTime = 0;
Expand All @@ -230,7 +230,7 @@ public static void hurtEntity(LivingHurtEvent event) {
}

@SubscribeEvent
public static void attackEntity(LivingAttackEvent event) {
public static void attackEntity(LivingIncomingDamageEvent event) {
// Testing bygone nether compatibility led me to discover that alchemists healing piglin hunters leads to them attacking each other since the
// horses they're riding on are considered undead, this should work as a quick fix for that, but further discussions with the mod creator is needed.
if (event.getEntity() instanceof Mob mob) {
Expand Down Expand Up @@ -273,7 +273,7 @@ public static void onCriticalHit(CriticalHitEvent event) {
}

@SubscribeEvent
public static void onShieldBlock(ShieldBlockEvent event) {
public static void onShieldBlock(LivingShieldBlockEvent event) {
if (event.getEntity().getUseItem().getItem() instanceof BucklerItem)
event.setCanceled(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ public CommonConfig(ModConfigSpec.Builder builder) {
builder.push("Vanilla Changes");
healingArrowDamage = builder.define("Allow healing and Regeneration arrows to not do damage?", true);
alchemistWeightInBastions = builder.comment("""
Weight is calculated by dividing the current value by the sum of all weights combined.
Weig
ht is calculated by dividing the current value by the sum of all weights combined.
Use https://minecraft.fandom.com/wiki/Bastion_Remnant?so=search#cite_ref-piglin_group_1-39 as a guide.
The default weight for alchemists spawning is 4, giving them a 28% chance of spawning in bastions.
(Due to this, regular piglins have a spawn rate of 28% aswell, and brutes have a spawn rate of 7% spawn rate, changed values will have to account for this).
Expand Down

0 comments on commit 7b02d3f

Please sign in to comment.