Skip to content

Commit

Permalink
Merge pull request #118 from AnonymousHacker1279/1.21.1-dev
Browse files Browse the repository at this point in the history
Update master branch with 1.21.1-dev changes
  • Loading branch information
AnonymousHacker1279 authored Oct 15, 2024
2 parents e8117f1 + 85431d2 commit 94605ee
Show file tree
Hide file tree
Showing 26 changed files with 221 additions and 260 deletions.
13 changes: 7 additions & 6 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
This major update ports to MC 1.21.1. Not much in the way of new features, but a few bugfixes and improvements.
This minor update fixes a few bugs and tweaks some features.

### Feature Changes / Additions

- Starmites now have a rare chance to drop Starstorm Shards when killed
- Improve spawn checks for Evil Eyes
- Must have 25 blocks of open space above the spawn point
- Soldier-type XP drops are now based on factors including local difficulty, worn armor, and armor/weapon enchantments
- Increase XP drops for berserk Wandering Warriors
- Add Skygazer enchantment caps for Density (5), Wind Burst (10), and Breach (4).

### Bugfixes

- Prevent clamping of certain accessory effect types where it doesn't make sense (such as looting bonuses)
- Fix the mob category for Star Wolves being monster instead of creature
- Fix soldier-type entities not dropping XP at all
- Fix various parity issues between custom arrow entities and vanilla arrows (for example, fixing the Flame enchantment
on Aurora and Dragon's Breath bows)
4 changes: 1 addition & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,11 @@ if (file("RELEASE_NOTES.md").exists()) {
addAdditionalFile(javadocJar, sourcesJar)

curseDepends {
required 'cobalt-config'
optional "immersive-weapons-compatibility-bridge", "attributefix"
embedded 'custom-portal-api-reforged' // BiomeSquisher is not on CF
embedded 'biomesquisher', 'custom-portal-api-reforged'
}

modrinthDepends {
required 'cobaltconfig'
optional "immersive-weapons-compatibility-bridge", "attributefix"
embedded 'biomesquisher', 'custom-portal-api-reforged'
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.daemon=true
org.gradle.caching=true
org.gradle.parallel=true
mod_id=immersiveweapons
mod_version=1.21.1-1.30.0
mod_version=1.21.1-1.30.1
mod_group_id=tech.anonymoushacker1279.immersiveweapons
neogradle.subsystems.parchment.minecraftVersion=1.21
neogradle.subsystems.parchment.mappingsVersion=2024.07.28
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,9 @@ private static Map<String, Integer> getEnchantCapsMap() {
enchantCaps.put("minecraft:swift_sneak", 5);
enchantCaps.put("minecraft:lure", 5);
enchantCaps.put("minecraft:aqua_affinity", 1);
enchantCaps.put("minecraft:density", 5);
enchantCaps.put("minecraft:wind_burst", 10);
enchantCaps.put("minecraft:breach", 4);
enchantCaps.put("immersiveweapons:extended_reach", 1);
enchantCaps.put("immersiveweapons:endless_musket_pouch", 1);
enchantCaps.put("immersiveweapons:scorch_shot", 3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.minecraft.nbt.CompoundTag;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.util.Mth;
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.*;
Expand Down Expand Up @@ -56,6 +57,8 @@ public SpawnGroupData finalizeSpawn(ServerLevelAccessor level, DifficultyInstanc
// Increase movement speed and damage
getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(getAttribute(Attributes.MOVEMENT_SPEED).getBaseValue() * 1.15);
getAttribute(Attributes.ATTACK_DAMAGE).setBaseValue(getAttribute(Attributes.ATTACK_DAMAGE).getBaseValue() * 1.5);

xpReward += Mth.ceil(berserkChance * 100);
}

return super.finalizeSpawn(level, difficulty, reason, spawnData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.minecraft.nbt.CompoundTag;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.util.Mth;
import net.minecraft.util.TimeUtil;
import net.minecraft.util.valueproviders.UniformInt;
import net.minecraft.world.DifficultyInstance;
Expand Down Expand Up @@ -46,11 +47,10 @@ protected void registerGoals() {
}

@Override
public SpawnGroupData finalizeSpawn(ServerLevelAccessor levelAccessor, DifficultyInstance difficultyInstance,
MobSpawnType mobSpawnType, @Nullable SpawnGroupData groupData) {
public SpawnGroupData finalizeSpawn(ServerLevelAccessor level, DifficultyInstance difficulty, MobSpawnType reason, @Nullable SpawnGroupData spawnData) {

populateDefaultEquipmentSlots(random, difficultyInstance);
populateDefaultEquipmentEnchantments(levelAccessor, random, difficultyInstance);
populateDefaultEquipmentSlots(random, difficulty);
populateDefaultEquipmentEnchantments(level, random, difficulty);
prepareForCombat();
setCanPickUpLoot(true);

Expand All @@ -66,7 +66,35 @@ public SpawnGroupData finalizeSpawn(ServerLevelAccessor levelAccessor, Difficult
}
}

return super.finalizeSpawn(levelAccessor, difficultyInstance, mobSpawnType, groupData);
xpReward = calculateXPDropAmount(difficulty.getSpecialMultiplier());

return super.finalizeSpawn(level, difficulty, reason, spawnData);
}

private int calculateXPDropAmount(float difficultyMultiplier) {
int baseXP = Mth.ceil(100 * difficultyMultiplier);

int armorXP = 0;
for (ItemStack stack : getArmorSlots()) {
if (!stack.isEmpty()) {
armorXP += 2 + random.nextInt(3);

if (stack.isEnchanted()) {
armorXP += 2 + random.nextInt(3);
}
}
}

int weaponXP = 0;
if (!getMainHandItem().isEmpty()) {
weaponXP += 2 + random.nextInt(3);

if (getMainHandItem().isEnchanted()) {
weaponXP += 2 + random.nextInt(3);
}
}

return baseXP + armorXP + weaponXP;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import tech.anonymoushacker1279.immersiveweapons.config.IWConfigs;
import tech.anonymoushacker1279.immersiveweapons.init.*;
import tech.anonymoushacker1279.immersiveweapons.item.AccessoryItem;
import tech.anonymoushacker1279.immersiveweapons.item.gun.MusketItem;
import tech.anonymoushacker1279.immersiveweapons.item.tool.HitEffectUtils;
import tech.anonymoushacker1279.immersiveweapons.network.payload.BulletEntityDebugPayload;
import tech.anonymoushacker1279.immersiveweapons.network.payload.GunShotBloodParticlePayload;
Expand Down Expand Up @@ -79,11 +78,6 @@ public void setFiringItem(Item stack) {
firingItem = stack;
}

@Override
public double getGravityModifier() {
return firingItem instanceof MusketItem ? gravityModifier / 4 : gravityModifier;
}

public float calculateDamage() {
float velocityModifier = (float) getDeltaMovement().length();
// Determine the damage to be dealt, which is calculated by multiplying the velocity modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public class CannonballEntity extends BulletEntity implements ItemSupplier {

public CannonballEntity(EntityType<? extends Arrow> entityType, Level level) {
super(entityType, level);
gravityModifier = 0.055d;
}

public CannonballEntity(LivingEntity shooter, Level level, @Nullable ItemStack firedFromWeapon) {
Expand Down
Loading

0 comments on commit 94605ee

Please sign in to comment.