Skip to content

Commit

Permalink
Add passive_creaking enchantment, update dependencies, fix broken cod…
Browse files Browse the repository at this point in the history
…e from update
  • Loading branch information
JRTerry-Modding committed Oct 28, 2024
1 parent f0e10e1 commit aee3908
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 10 deletions.
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.21.1
yarn_mappings=1.21.1+build.3
loader_version=0.16.2
minecraft_version=1.21.3
yarn_mappings=1.21.3+build.2
loader_version=0.16.7
# Mod Properties
mod_version=1.20.1+SNAPSHOT-1.0
mod_version=v1.2+1.21.3
maven_group=net.dev-gio
archives_base_name=PassiveEnchantments
# Dependencies
# check this on https://modmuss50.me/fabric.html
fabric_version=0.102.1+1.21.1
fabric_version=0.107.0+1.21.3
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class Enchantments {
//For List
public static final RegistryKey<Enchantment> PASSIVE_BLAZE_ENCHANTMENT = Enchantments.of("passive_blaze");
public static final RegistryKey<Enchantment> PASSIVE_BREEZE_ENCHANTMENT = Enchantments.of("passive_breeze");
public static final RegistryKey<Enchantment> PASSIVE_CREAKING_ENCHANTMENT = Enchantments.of("passive_creaking");
public static final RegistryKey<Enchantment> PASSIVE_CREEPER_ENCHANTMENT = Enchantments.of("passive_creeper");
public static final RegistryKey<Enchantment> PASSIVE_ENDERMAN_ENCHANTMENT = Enchantments.of("passive_enderman");
public static final RegistryKey<Enchantment> PASSIVE_ENDERMITE_ENCHANTMENT = Enchantments.of("passive_endermite");
Expand All @@ -41,6 +42,7 @@ public class Enchantments {
//Enchantment Tags, used instead of getting level
public static final TagKey<Enchantment> PASSIVE_BLAZE = enchantmentTagKeyOf("passive_blaze");
public static final TagKey<Enchantment> PASSIVE_BREEZE = enchantmentTagKeyOf("passive_breeze");
public static final TagKey<Enchantment> PASSIVE_CREAKING = enchantmentTagKeyOf("passive_creaking");
public static final TagKey<Enchantment> PASSIVE_CREEPER = enchantmentTagKeyOf("passive_creeper");
public static final TagKey<Enchantment> PASSIVE_ENDERMAN = enchantmentTagKeyOf("passive_enderman");
public static final TagKey<Enchantment> PASSIVE_ENDERMITE = enchantmentTagKeyOf("passive_endermite");
Expand All @@ -65,6 +67,7 @@ public class Enchantments {
public static final List<RegistryKey<Enchantment>> PASSIVE_ENCHANTMENTS = List.of(
PASSIVE_BLAZE_ENCHANTMENT,
PASSIVE_BREEZE_ENCHANTMENT,
PASSIVE_CREAKING_ENCHANTMENT,
PASSIVE_CREEPER_ENCHANTMENT,
PASSIVE_ENDERMAN_ENCHANTMENT,
PASSIVE_ENDERMITE_ENCHANTMENT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public TagKey<Enchantment> mobEnchantment(LivingEntity mob) {
Map<Class<?>, TagKey<Enchantment>> enchantmentMap = new HashMap<>() {{
put(BlazeEntity.class, Enchantments.PASSIVE_BLAZE);
put(BreezeEntity.class, Enchantments.PASSIVE_BREEZE);
put(TransientCreakingEntity.class, Enchantments.PASSIVE_CREAKING);
put(CreakingEntity.class, Enchantments.PASSIVE_CREAKING);
put(CreeperEntity.class, Enchantments.PASSIVE_CREEPER);
put(EndermanEntity.class, Enchantments.PASSIVE_ENDERMAN);
put(EndermiteEntity.class, Enchantments.PASSIVE_ENDERMITE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected ChickenMixin(EntityType<? extends AnimalEntity> entityType, World worl
}
@Inject(method = "createChickenAttributes", at = @At("RETURN"), cancellable = true)
private static void createAttributes(CallbackInfoReturnable<DefaultAttributeContainer.Builder> cir) {
cir.setReturnValue(cir.getReturnValue().add(EntityAttributes.GENERIC_FOLLOW_RANGE, 35.0).add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.25).add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 3.0).add(EntityAttributes.GENERIC_ARMOR, 2.0).add(EntityAttributes.GENERIC_MAX_HEALTH, 4.0));
cir.setReturnValue(cir.getReturnValue().add(EntityAttributes.FOLLOW_RANGE, 35.0).add(EntityAttributes.MOVEMENT_SPEED, 0.25).add(EntityAttributes.ATTACK_DAMAGE, 3.0).add(EntityAttributes.ARMOR, 2.0).add(EntityAttributes.MAX_HEALTH, 4.0));
}
@Inject(method = "initGoals", at = @At("RETURN"))
private void initGoals(CallbackInfo ci) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected CowMixin(EntityType<? extends AnimalEntity> entityType, World world) {
}
@Inject(method = "createCowAttributes", at = @At("RETURN"), cancellable = true)
private static void createAttributes(CallbackInfoReturnable<DefaultAttributeContainer.Builder> cir) {
cir.setReturnValue(cir.getReturnValue().add(EntityAttributes.GENERIC_FOLLOW_RANGE, 35.0).add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.25).add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 3.0).add(EntityAttributes.GENERIC_ARMOR, 2.0).add(EntityAttributes.GENERIC_MAX_HEALTH, 10.0));
cir.setReturnValue(cir.getReturnValue().add(EntityAttributes.FOLLOW_RANGE, 35.0).add(EntityAttributes.MOVEMENT_SPEED, 0.25).add(EntityAttributes.ATTACK_DAMAGE, 3.0).add(EntityAttributes.ARMOR, 2.0).add(EntityAttributes.MAX_HEALTH, 10.0));
}
@Inject(method = "initGoals", at = @At("RETURN"))
private void initGoals(CallbackInfo ci) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected PigMixin(EntityType<? extends AnimalEntity> entityType, World world) {
}
@Inject(method = "createPigAttributes", at = @At("RETURN"), cancellable = true)
private static void createAttributes(CallbackInfoReturnable<DefaultAttributeContainer.Builder> cir) {
cir.setReturnValue(cir.getReturnValue().add(EntityAttributes.GENERIC_FOLLOW_RANGE, 35.0).add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.25).add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 3.0).add(EntityAttributes.GENERIC_ARMOR, 2.0).add(EntityAttributes.GENERIC_MAX_HEALTH, 10.0));
cir.setReturnValue(cir.getReturnValue().add(EntityAttributes.FOLLOW_RANGE, 35.0).add(EntityAttributes.MOVEMENT_SPEED, 0.25).add(EntityAttributes.ATTACK_DAMAGE, 3.0).add(EntityAttributes.ARMOR, 2.0).add(EntityAttributes.MAX_HEALTH, 10.0));
}
@Inject(method = "initGoals", at = @At("RETURN"))
private void initGoals(CallbackInfo ci) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected SheepMixin(EntityType<? extends AnimalEntity> entityType, World world)
}
@Inject(method = "createSheepAttributes", at = @At("RETURN"), cancellable = true)
private static void createAttributes(CallbackInfoReturnable<DefaultAttributeContainer.Builder> cir) {
cir.setReturnValue(cir.getReturnValue().add(EntityAttributes.GENERIC_FOLLOW_RANGE, 35.0).add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.23).add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 3.0).add(EntityAttributes.GENERIC_ARMOR, 2.0).add(EntityAttributes.GENERIC_MAX_HEALTH, 8.0));
cir.setReturnValue(cir.getReturnValue().add(EntityAttributes.FOLLOW_RANGE, 35.0).add(EntityAttributes.MOVEMENT_SPEED, 0.23).add(EntityAttributes.ATTACK_DAMAGE, 3.0).add(EntityAttributes.ARMOR, 2.0).add(EntityAttributes.MAX_HEALTH, 8.0));
}
@Inject(method = "initGoals", at = @At("RETURN"))
private void initGoals(CallbackInfo ci) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.registry.tag.TagKey;
import net.minecraft.server.world.ServerWorld;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
Expand All @@ -22,7 +23,7 @@
class MobMixin {

@Inject(method = "test",at = @At("HEAD"), cancellable = true)
private void onTargetTest(LivingEntity mob, LivingEntity target, CallbackInfoReturnable<Boolean> cir)
private void onTargetTest(ServerWorld world, LivingEntity mob, LivingEntity target, CallbackInfoReturnable<Boolean> cir)
{
if (target == null){
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"enchantment.passive_enchantments.passive_blaze": "Passive Blaze",
"enchantment.passive_enchantments.passive_breeze": "Passive Breeze",
"enchantment.passive_enchantments.passive_creeper": "Passive Creeper",
"enchantment.passive_enchantments.passive_creaking": "Passive Creaking",
"enchantment.passive_enchantments.passive_enderman": "Passive Enderman",
"enchantment.passive_enchantments.passive_endermite": "Passive Endermite",
"enchantment.passive_enchantments.passive_guardian": "Passive Guardian",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"values": [
"passive_enchantments:passive_blaze",
"passive_enchantments:passive_breeze",
"passive_enchantments:passive_creaking",
"passive_enchantments:passive_creeper",
"passive_enchantments:passive_enderman",
"passive_enchantments:passive_endermite",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"values": [
"passive_enchantments:passive_blaze",
"passive_enchantments:passive_breeze",
"passive_enchantments:passive_creaking",
"passive_enchantments:passive_creeper",
"passive_enchantments:passive_enderman",
"passive_enchantments:passive_endermite",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"values": [
"passive_enchantments:passive_blaze",
"passive_enchantments:passive_breeze",
"passive_enchantments:passive_creaking",
"passive_enchantments:passive_creeper",
"passive_enchantments:passive_enderman",
"passive_enchantments:passive_endermite",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"values": [
"passive_enchantments:passive_blaze",
"passive_enchantments:passive_breeze",
"passive_enchantments:passive_creaking",
"passive_enchantments:passive_creeper",
"passive_enchantments:passive_enderman",
"passive_enchantments:passive_endermite",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"description": {
"translate": "enchantment.passive_enchantments.passive_creaking"
},
"supported_items": "#minecraft:enchantable/armor",
"exclusive_set": "#minecraft:exclusive_set/armor",
"slots": ["armor"],
"weight": 3,
"anvil_cost": 1,
"min_cost": {
"base": 25,
"per_level_above_first": 25
},
"max_cost": {
"base": 75,
"per_level_above_first": 25
},
"max_level": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"passive_enchantments:passive_creaking"
]
}

0 comments on commit aee3908

Please sign in to comment.