Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- updated to 1.21.5
- fixed incorrect knockback calculations
19 changes: 13 additions & 6 deletions common/src/main/java/dev/rosebud/ramel/mixin/CamelEntityMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.google.common.base.MoreObjects;
import dev.rosebud.ramel.Config;
import net.minecraft.network.protocol.game.ClientboundSetEntityMotionPacket;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.util.Mth;
Expand All @@ -12,6 +13,7 @@
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.animal.camel.Camel;
import net.minecraft.world.item.enchantment.EnchantmentHelper;
import net.minecraft.world.level.Level;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
Expand All @@ -36,8 +38,10 @@ private CamelEntityMixin(EntityType<? extends Camel> entityType, Level level) {
return;
}

int speedEffectModifier = this.hasEffect(MobEffects.MOVEMENT_SPEED) ? Objects.requireNonNull(this.getEffect(MobEffects.MOVEMENT_SPEED)).getAmplifier() + 1 : 0;
int slowEffectModifier = this.hasEffect(MobEffects.MOVEMENT_SLOWDOWN) ? Objects.requireNonNull(this.getEffect(MobEffects.MOVEMENT_SLOWDOWN)).getAmplifier() + 1 : 0;
ServerLevel level = (ServerLevel) this.level();

int speedEffectModifier = this.hasEffect(MobEffects.SPEED) ? Objects.requireNonNull(this.getEffect(MobEffects.SPEED)).getAmplifier() + 1 : 0;
int slowEffectModifier = this.hasEffect(MobEffects.SLOWNESS) ? Objects.requireNonNull(this.getEffect(MobEffects.SLOWNESS)).getAmplifier() + 1 : 0;
double speedAdjustedImpact = Mth.clamp(this.getSpeed() * 1.65, .2, 3.0) + .25 * (speedEffectModifier - slowEffectModifier);

float rammingRange = Config.INSTANCE.additionalRammingRange.value() * (isBaby() ? 0.5F : 1.0F);
Expand All @@ -46,17 +50,20 @@ private CamelEntityMixin(EntityType<? extends Camel> entityType, Level level) {

DamageSource source = this.damageSources().mobAttack(MoreObjects.firstNonNull(this.getControllingPassenger(), this));

this.level().getEntities(this, this.getBoundingBox().inflate(rammingRange), Entity::isAlive).stream()
level.getEntities(this, this.getBoundingBox().inflate(rammingRange), Entity::isAlive).stream()
.filter(e -> e instanceof LivingEntity && !this.getPassengers().contains(e))
.forEach(e -> {
LivingEntity entity = (LivingEntity) e;

if (entity.hurtServer(level, source, rammingDamage)) {
EnchantmentHelper.doPostAttackEffects(level, entity, source);
}

entity.playSound(SoundEvents.PLAYER_ATTACK_KNOCKBACK);
entity.hurt(source, rammingDamage);
final double blockedImpact = entity.isDamageSourceBlocked(source) ? .5 : 1.0;
final double blockedImpact = entity.applyItemBlocking(level, source, rammingDamage) > 0.0 ? .5 : 1.0;

entity.knockback(blockedImpact * speedAdjustedImpact * knockBackMultiplier,
Mth.sin(this.getXRot() * (Mth.PI / 180.0F)), -Mth.cos(this.getXRot() * (Mth.PI / 180.0F)));
Mth.sin(this.getYRot() * Mth.PI / 180.0F), -Mth.cos(this.getYRot() * Mth.PI / 180.0F));
if (entity instanceof ServerPlayer player) {
// The player won't feel any effects if we don't update the velocity
player.connection.send(new ClientboundSetEntityMotionPacket(player));
Expand Down
2 changes: 1 addition & 1 deletion fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.7-SNAPSHOT'
id 'fabric-loom' version '1.10-SNAPSHOT'
id 'me.modmuss50.mod-publish-plugin'
}
def platformName = "Fabric"
Expand Down
2 changes: 1 addition & 1 deletion fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

"depends": {
"fabricloader": ">=0.15.11",
"minecraft": ">=1.21"
"minecraft": ">=1.21.5"
},

"custom": {
Expand Down
20 changes: 10 additions & 10 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
org.gradle.jvmargs=-Xmx2G

# common
minecraft_version=1.21.4
minecraft_version=1.21.5
# https://parchmentmc.org/docs/getting-started
parchment_minecraft_version=1.21.4
parchment_mappings_version=2025.03.23
parchment_minecraft_version=1.21.5
parchment_mappings_version=2025.06.15
# https://projects.neoforged.net/neoforged/neoform
neoform_version=1.21.4-20241203.161809
neoform_version=1.21.5-20250325.162830
mixin_version=0.15.2+mixin.0.8.7
mixin_extras_version=0.4.1
jetbrains_annotations_version=25.0.0

# fabric
# https://fabricmc.net/develop
fabric_loader_version=0.16.9
fabric_version=0.119.2+1.21.4
modmenu_version=13.0.3
fabric_loader_version=0.16.14
fabric_version=0.127.1+1.21.5
modmenu_version=14.0.0-rc.2

# neoforge
# https://projects.neoforged.net/neoforged/neoforge
neoforge_version=21.4.118-beta
neoforge_version=21.5.78

# other
kaleido_config_version=0.3.3+1.3.2
Expand All @@ -35,9 +35,9 @@ issue_tracker_url=https://github.com/rosebudmods/ramel/issues
discord_url=https://discord.gg/TN9gaXJ6E8

# publishing
mod_version=1.2.2
mod_version=1.2.3
pub.should_publish=true
pub.additional_versions=
pub.additional_versions=1.21.6
pub.curseforge_id=877074
pub.modrinth_id=4Uw92C2y
github_repository=rosebudmods/ramel
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
9 changes: 4 additions & 5 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion neoforge/src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ config = "${mod_id}.mixins.json"
[dependencies]
"${mod_id}" = [
{ modId = "neoforge", type = "required", versionRange = "*", ordering = "NONE", side = "BOTH" },
{ modId = "minecraft", type = "required", versionRange = "[1.21,)", ordering = "NONE", side = "BOTH" },
{ modId = "minecraft", type = "required", versionRange = "[1.21.5,)", ordering = "NONE", side = "BOTH" },
]

# Features are specific properties of the game environment, that you may want to declare you require. This example declares
Expand Down