Skip to content

Commit

Permalink
1.1.1-1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
BuildTools committed Jun 25, 2022
1 parent 0225e65 commit 121c711
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 13 deletions.
11 changes: 3 additions & 8 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
1.1.0-1.19
New:
- Horse Armor can now be enchanted with Protection enchantments
- Fidelity Enchantment
1.1.1-1.19

Changes:
- Optimizations
- Fixed possible exploit with Blessing of Regeneration
- Reflection Enchantment is now more consistent in how it reflects
Fixes:
- Strip Miner is now in the lootpools


4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ org.gradle.jvmargs=-Xmx1G
loader_version=0.14.8

# Mod Properties
mod_version = 1.1.0-1.19
mod_version = 1.1.1-1.19
maven_group = qu
archives_base_name = qu-enchantments

# Dependencies
fabric_version=0.56.1+1.19
fabric_version=0.56.3+1.19
fabric_asm_version = v2.3
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class ModEnchantments {
public static final Enchantment SKYWALKER = register("skywalker", new SkywalkerEnchantment(CorruptedEnchantment.EnchantmentType.WALKER, Enchantment.Rarity.VERY_RARE, EquipmentSlot.FEET));
public static final Enchantment ESSENCE_OF_ENDER = register("essence_of_ender", new EssenceOfEnderEnchantment(CorruptedEnchantment.EnchantmentType.THORNS, Enchantment.Rarity.VERY_RARE, EnchantmentTarget.ARMOR_CHEST, ALL_ARMOR));
public static final Enchantment OMEN_OF_IMMUNITY = register("omen_of_immunity", new OmenOfImmunityEnchantment(CorruptedEnchantment.EnchantmentType.RUNE, Enchantment.Rarity.VERY_RARE, RUNE, EquipmentSlot.MAINHAND, EquipmentSlot.OFFHAND));
public static final Enchantment STRIP_MINER_ENCHANTMENT = register("strip_miner", new StripMinerEnchantment(CorruptedEnchantment.EnchantmentType.PICKAXE_DROP, Enchantment.Rarity.VERY_RARE, EnchantmentTarget.DIGGER, EquipmentSlot.MAINHAND));
public static final Enchantment STRIP_MINER = register("strip_miner", new StripMinerEnchantment(CorruptedEnchantment.EnchantmentType.PICKAXE_DROP, Enchantment.Rarity.VERY_RARE, EnchantmentTarget.DIGGER, EquipmentSlot.MAINHAND));

private static Enchantment register(String name, Enchantment enchantment) {
return Registry.register(Registry.ENCHANTMENT, new Identifier(QuEnchantments.MOD_ID, name), enchantment);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/qu/quEnchantments/mixin/BlockMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class BlockMixin {
target = "Lnet/minecraft/block/Block;dropStacks(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/entity/BlockEntity;Lnet/minecraft/entity/Entity;Lnet/minecraft/item/ItemStack;)V"),
method = "afterBreak", cancellable = true)
private void stopDrop(World world, PlayerEntity player, BlockPos pos, BlockState state, BlockEntity blockEntity, ItemStack stack, CallbackInfo ci) {
if (EnchantmentHelper.getLevel(ModEnchantments.STRIP_MINER_ENCHANTMENT, stack) > 0) {
if (EnchantmentHelper.getLevel(ModEnchantments.STRIP_MINER, stack) > 0) {
ci.cancel();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class ServerPlayerInteractionManagerMixin {
private void mineRing(BlockPos pos, CallbackInfoReturnable<Boolean> cir) {
ItemStack itemStack = this.player.getMainHandStack();
int lvl;
if ((lvl = EnchantmentHelper.getLevel(ModEnchantments.STRIP_MINER_ENCHANTMENT, itemStack)) > 0) {
if ((lvl = EnchantmentHelper.getLevel(ModEnchantments.STRIP_MINER, itemStack)) > 0) {
Iterable<BlockPos> iterable;
if (lvl == 1) {
List<BlockPos> temp = new ArrayList<>(2);
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/qu/quEnchantments/util/ModLootTableModifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ public static void ModifyLootTables() {
.conditionally(RandomChanceLootCondition.builder(chance))
.apply(new SetEnchantmentsLootFunction.Builder(false)
.enchantment(ModEnchantments.OMEN_OF_IMMUNITY, ConstantLootNumberProvider.create(1))))
.with(ItemEntry.builder(Items.BOOK)
.conditionally(RandomChanceLootCondition.builder(chance))
.apply(new SetEnchantmentsLootFunction.Builder(false)
.enchantment(ModEnchantments.STRIP_MINER, ConstantLootNumberProvider.create(1))))
.build();
builder.pool(pool);

Expand Down Expand Up @@ -95,6 +99,10 @@ public static void ModifyLootTables() {
.conditionally(RandomChanceLootCondition.builder(chance))
.apply(new SetEnchantmentsLootFunction.Builder(false)
.enchantment(ModEnchantments.OMEN_OF_IMMUNITY, ConstantLootNumberProvider.create(1))))
.with(ItemEntry.builder(Items.BOOK)
.conditionally(RandomChanceLootCondition.builder(chance))
.apply(new SetEnchantmentsLootFunction.Builder(false)
.enchantment(ModEnchantments.STRIP_MINER, ConstantLootNumberProvider.create(1))))
.build();
builder.pool(pool);

Expand Down Expand Up @@ -135,6 +143,10 @@ public static void ModifyLootTables() {
.conditionally(RandomChanceLootCondition.builder(chance))
.apply(new SetEnchantmentsLootFunction.Builder(false)
.enchantment(ModEnchantments.OMEN_OF_IMMUNITY, ConstantLootNumberProvider.create(1))))
.with(ItemEntry.builder(Items.BOOK)
.conditionally(RandomChanceLootCondition.builder(chance))
.apply(new SetEnchantmentsLootFunction.Builder(false)
.enchantment(ModEnchantments.STRIP_MINER, ConstantLootNumberProvider.create(1))))
.build();
builder.pool(pool);

Expand Down Expand Up @@ -175,6 +187,10 @@ public static void ModifyLootTables() {
.conditionally(RandomChanceLootCondition.builder(chance))
.apply(new SetEnchantmentsLootFunction.Builder(false)
.enchantment(ModEnchantments.OMEN_OF_IMMUNITY, ConstantLootNumberProvider.create(1))))
.with(ItemEntry.builder(Items.BOOK)
.conditionally(RandomChanceLootCondition.builder(chance))
.apply(new SetEnchantmentsLootFunction.Builder(false)
.enchantment(ModEnchantments.STRIP_MINER, ConstantLootNumberProvider.create(1))))
.with(ItemEntry.builder(ModItems.RUNE_0)
.conditionally(RandomChanceLootCondition.builder(0.05f)))
.with(ItemEntry.builder(ModItems.RUNE_1)
Expand Down

0 comments on commit 121c711

Please sign in to comment.