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
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
plugins {
id 'idea'
id 'maven-publish'
id 'me.modmuss50.mod-publish-plugin' version '0.7.4' apply false
id 'net.neoforged.moddev' version '2.0.34-beta' apply false
id 'fabric-loom' version '1.11-SNAPSHOT' apply false
id 'me.modmuss50.mod-publish-plugin' version '1.0.0' apply false
id 'net.neoforged.moddev' version '2.0.112' apply false
}

version = "${project.mod_version}+mc${project.minecraft_version}"
Expand Down
10 changes: 8 additions & 2 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ plugins {
id 'net.neoforged.moddev'
}

neoForge.neoFormVersion = project.neoform_version

configurations.configureEach {
resolutionStrategy {
force 'org.ow2.asm:asm:9.8'
}
}

dependencies {
compileOnly("org.jetbrains:annotations:${project.jetbrains_annotations_version}")
compileOnly("net.fabricmc:sponge-mixin:${project.mixin_version}")
Expand All @@ -12,8 +20,6 @@ dependencies {
}

neoForge {
neoFormVersion = project.neoform_version

parchment {
minecraftVersion = project.parchment_minecraft_version
mappingsVersion = project.parchment_mappings_version
Expand Down
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'
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
26 changes: 13 additions & 13 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx2G
org.gradle.jvmargs=-Xmx3G

# common
minecraft_version=1.21.4
minecraft_version=1.21.9
# https://parchmentmc.org/docs/getting-started
parchment_minecraft_version=1.21.4
parchment_mappings_version=2025.03.23
parchment_minecraft_version=1.21.8
parchment_mappings_version=2025.09.14
# https://projects.neoforged.net/neoforged/neoform
neoform_version=1.21.4-20241203.161809
mixin_version=0.15.2+mixin.0.8.7
mixin_extras_version=0.4.1
jetbrains_annotations_version=25.0.0
neoform_version=1.21.9-20250930.151910
mixin_version=0.16.3+mixin.0.8.7
mixin_extras_version=0.5.0
jetbrains_annotations_version=26.0.2-1

# 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.17.2
fabric_version=0.134.0+1.21.9
modmenu_version=16.0.0-rc.1

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

# other
kaleido_config_version=0.3.3+1.3.2
Expand All @@ -35,7 +35,7 @@ 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.curseforge_id=877074
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-9.1.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
12 changes: 4 additions & 8 deletions gradlew

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

3 changes: 1 addition & 2 deletions gradlew.bat

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

5 changes: 2 additions & 3 deletions neoforge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ plugins {

def platformName = "NeoForge"

neoForge.version = project.neoforge_version

dependencies {
compileOnly(project(':common'))
implementation("folk.sisby:kaleido-config:${project.kaleido_config_version}")
additionalRuntimeClasspath("folk.sisby:kaleido-config:${project.kaleido_config_version}") // needed because kaleido does not have a neoforge.mods.toml file
jarJar("folk.sisby:kaleido-config:${project.kaleido_config_version}") {
version {
strictly "[${project.kaleido_config_version},)"
Expand Down Expand Up @@ -51,8 +52,6 @@ publishMods {
}

neoForge {
version = project.neoforge_version

parchment {
minecraftVersion = project.parchment_minecraft_version
mappingsVersion = project.parchment_mappings_version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
public class RamelNeoForge {

public RamelNeoForge(ModContainer modContainer, IEventBus modEventBus) {
if(FMLEnvironment.dist.isClient()) {
if(FMLEnvironment.getDist().isClient()) {
RamelNeoForgeClient.init(modContainer);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package dev.rosebud.ramel.neoforge.client;

import dev.rosebud.ramel.client.RamelConfigScreen;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.api.distmarker.OnlyIn;
import net.neoforged.fml.ModContainer;
import net.neoforged.neoforge.client.gui.IConfigScreenFactory;

@OnlyIn(Dist.CLIENT)
public class RamelNeoForgeClient {

public static void init(ModContainer modContainer) {
Expand Down
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
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pluginManagement {
}

plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0'
}

rootProject.name = 'ramel'
Expand Down