diff --git a/resources/changelog/1.19.2-1.2.31.txt b/resources/changelog/1.19.2-1.2.31.txt new file mode 100644 index 0000000000..e4a8a6d719 --- /dev/null +++ b/resources/changelog/1.19.2-1.2.31.txt @@ -0,0 +1,7 @@ +As always, don't forget to backup your world before updating! +Requires CyclopsCore version 1.17.0 or higher. + +Fixes: +* Fix item IO side mapping of Colossal Blood Chest, Closes #1025 +* Catch exceptions when getting vengeance spirit sounds, Closes #1023 + diff --git a/resources/changelog/1.19.2-1.2.32.txt b/resources/changelog/1.19.2-1.2.32.txt new file mode 100644 index 0000000000..94d32af7e4 --- /dev/null +++ b/resources/changelog/1.19.2-1.2.32.txt @@ -0,0 +1,6 @@ +As always, don't forget to backup your world before updating! +Requires CyclopsCore version 1.17.0 or higher. + +Fixes: +* Fix Effortless Ring step assist conflicting with other mods, Closes #1026 + diff --git a/resources/changelog/1.20.1-1.2.38.txt b/resources/changelog/1.20.1-1.2.38.txt new file mode 100644 index 0000000000..551b03a1a6 --- /dev/null +++ b/resources/changelog/1.20.1-1.2.38.txt @@ -0,0 +1,7 @@ +As always, don't forget to backup your world before updating! +Requires CyclopsCore version 1.18.4 or higher. + +Fixes: +* Fix item IO side mapping of Colossal Blood Chest, Closes #1025 +* Catch exceptions when getting vengeance spirit sounds, Closes #1023 + diff --git a/resources/changelog/1.20.1-1.2.39.txt b/resources/changelog/1.20.1-1.2.39.txt new file mode 100644 index 0000000000..78fbbf675b --- /dev/null +++ b/resources/changelog/1.20.1-1.2.39.txt @@ -0,0 +1,6 @@ +As always, don't forget to backup your world before updating! +Requires CyclopsCore version 1.18.4 or higher. + +Fixes: +* Fix Effortless Ring step assist conflicting with other mods, Closes #1026 + diff --git a/src/main/java/org/cyclops/evilcraft/blockentity/BlockEntityColossalBloodChest.java b/src/main/java/org/cyclops/evilcraft/blockentity/BlockEntityColossalBloodChest.java index ddd08ce60e..fc1624d1fa 100644 --- a/src/main/java/org/cyclops/evilcraft/blockentity/BlockEntityColossalBloodChest.java +++ b/src/main/java/org/cyclops/evilcraft/blockentity/BlockEntityColossalBloodChest.java @@ -227,7 +227,7 @@ public void registerTankInventoryCapabilitiesItem() { net.neoforged.neoforge.capabilities.Capabilities.ItemHandler.BLOCK, (blockEntity, direction) -> new ItemHandlerSlotMasked( blockEntity.getInventory(), - (direction == Direction.UP || direction == Direction.DOWN) ? IntStream.range(0, SLOTS_CHEST).toArray() : new int[]{SLOT_CONTAINER} + direction == Direction.DOWN ? new int[]{SLOTS_CHEST} : IntStream.range(0, SLOTS_CHEST + 1).toArray() ) ); } diff --git a/src/main/java/org/cyclops/evilcraft/entity/monster/EntityVengeanceSpirit.java b/src/main/java/org/cyclops/evilcraft/entity/monster/EntityVengeanceSpirit.java index 5b58f54dc5..b98bcaf018 100644 --- a/src/main/java/org/cyclops/evilcraft/entity/monster/EntityVengeanceSpirit.java +++ b/src/main/java/org/cyclops/evilcraft/entity/monster/EntityVengeanceSpirit.java @@ -668,7 +668,11 @@ public static EntityVengeanceSpirit spawnRandom(Level level, BlockPos blockPos, @Override public SoundEvent getDeathSound() { if(getInnerEntity() != null) { - return getInnerEntity().getDeathSound(); + try { + return getInnerEntity().getDeathSound(); + } catch (RuntimeException e) { + // Catch crashes + } } return RegistryEntries.SOUNDEVENT_MOB_VENGEANCESPIRIT_DEATH.get(); } @@ -677,7 +681,11 @@ public SoundEvent getDeathSound() { public SoundEvent getAmbientSound() { LivingEntity entity = getInnerEntity(); if(entity != null) { - return getInnerEntity().getAmbientSound(); + try { + return getInnerEntity().getAmbientSound(); + } catch (RuntimeException e) { + // Catch crashes + } } return RegistryEntries.SOUNDEVENT_MOB_VENGEANCESPIRIT_AMBIENT.get(); } diff --git a/src/main/java/org/cyclops/evilcraft/item/ItemEffortlessRing.java b/src/main/java/org/cyclops/evilcraft/item/ItemEffortlessRing.java index ddf4af3413..508f6e4c2c 100644 --- a/src/main/java/org/cyclops/evilcraft/item/ItemEffortlessRing.java +++ b/src/main/java/org/cyclops/evilcraft/item/ItemEffortlessRing.java @@ -1,12 +1,15 @@ package org.cyclops.evilcraft.item; import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.ai.attributes.AttributeInstance; +import net.minecraft.world.entity.ai.attributes.AttributeModifier; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.phys.Vec3; import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.neoforge.common.NeoForgeMod; import net.neoforged.neoforge.event.entity.living.LivingEvent; import net.neoforged.neoforge.event.entity.living.LivingFallEvent; import org.cyclops.cyclopscore.helper.ItemStackHelpers; @@ -20,10 +23,9 @@ public class ItemEffortlessRing extends Item { private static final int TICK_MODULUS = 1; - private static final String PLAYER_NBT_KEY = Reference.MOD_ID + ":" + "lastStepSize"; private static final float SPEED_BONUS = 0.05F; - private static final float STEP_SIZE = 1F; + private static final AttributeModifier STEP_SIZE_MODIFIER = new AttributeModifier(Reference.MOD_ID + ":stepHeightModifier", 1, AttributeModifier.Operation.ADDITION); private static final float JUMP_DISTANCE_FACTOR = 0.05F; private static final float JUMP_HEIGHT_FACTOR = 0.3F; private static final float FALLDISTANCE_REDUCTION = 2F; @@ -47,10 +49,10 @@ public void adjustParameters(ItemStack itemStack, Player player) { } // Step height - if(!player.getPersistentData().contains(PLAYER_NBT_KEY)) { - player.getPersistentData().putFloat(PLAYER_NBT_KEY, player.maxUpStep()); + AttributeInstance attribute = player.getAttribute(NeoForgeMod.STEP_HEIGHT.value()); + if (attribute != null && !attribute.hasModifier(STEP_SIZE_MODIFIER)) { + attribute.addTransientModifier(STEP_SIZE_MODIFIER); } - player.setMaxUpStep(player.isCrouching() ? 0.5F : STEP_SIZE); // Jump distance // Not possible anymore due to hardcoded value in LivingEntity#getFrictionInfluencedSpeed @@ -72,10 +74,10 @@ public void onPlayerUpdate(LivingEvent.LivingTickEvent event) { // Reset the step height. if(event.getEntity() instanceof Player) { Player player = (Player) event.getEntity(); - if(player.getPersistentData().contains(PLAYER_NBT_KEY)) { + AttributeInstance attribute = player.getAttribute(NeoForgeMod.STEP_HEIGHT.value()); + if (attribute != null && attribute.hasModifier(STEP_SIZE_MODIFIER)) { if (!ItemStackHelpers.hasPlayerItem(player, this)) { - player.setMaxUpStep(player.getPersistentData().getFloat(PLAYER_NBT_KEY)); - player.getPersistentData().remove(PLAYER_NBT_KEY); + attribute.removeModifier(STEP_SIZE_MODIFIER.getId()); } } }