diff --git a/CHANGELOG.md b/CHANGELOG.md index de03afd..d9abb38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ### Changelog +**1.1.10** +* Update to 20w11a +* Enhance Flame Spell + **1.1.9** * Fix Scrolling Bug diff --git a/gradle.properties b/gradle.properties index 0413160..b0fecfe 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,17 +3,17 @@ org.gradle.jvmargs = -Xmx1G # Fabric Properties # check these on https://fabricmc.net/use - minecraft_version = 20w10a + minecraft_version = 20w11a curseforge_id = 365308 simple_minecraft_version = 1.16-Snapshot - yarn_mappings = 20w10a+build.20 + yarn_mappings = 20w11a+build.1 loader_version = 0.7.8+build.187 # Mod Properties - mod_version = 1.1.9 + mod_version = 1.1.10 maven_group = com.thebrokenrail archives_base_name = sorcerycraft # Dependencies # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api - fabric_version = 0.5.1+build.305-1.16 + fabric_version = 0.5.3+build.308-1.16 diff --git a/src/main/java/com/thebrokenrail/sorcerycraft/block/CastingTableScreenHandler.java b/src/main/java/com/thebrokenrail/sorcerycraft/block/CastingTableScreenHandler.java index e1d2dda..85fb401 100644 --- a/src/main/java/com/thebrokenrail/sorcerycraft/block/CastingTableScreenHandler.java +++ b/src/main/java/com/thebrokenrail/sorcerycraft/block/CastingTableScreenHandler.java @@ -229,7 +229,7 @@ public class CastingTableScreenHandler extends ScreenHandler { @Override public boolean canUse(PlayerEntity player) { - return true; + return context.run((world, blockPos) -> world.getBlockState(blockPos).getBlock().equals(SorceryCraft.CASTING_TABLE_BLOCK) && player.squaredDistanceTo((double) blockPos.getX() + 0.5D, (double) blockPos.getY() + 0.5D, (double) blockPos.getZ() + 0.5D) <= 64.0D, true); } public Spell[] getRecipes() { diff --git a/src/main/java/com/thebrokenrail/sorcerycraft/client/block/CastingTableScreen.java b/src/main/java/com/thebrokenrail/sorcerycraft/client/block/CastingTableScreen.java index 8634b7a..f5131b4 100644 --- a/src/main/java/com/thebrokenrail/sorcerycraft/client/block/CastingTableScreen.java +++ b/src/main/java/com/thebrokenrail/sorcerycraft/client/block/CastingTableScreen.java @@ -132,7 +132,7 @@ public class CastingTableScreen extends ScreenWithHandler use(World world, PlayerEntity playerEntity, Hand hand) { ItemStack itemStack = playerEntity.getStackInHand(hand); - SorceryCraft.playSpellSound(playerEntity); - if (!world.isClient()) { + SorceryCraft.playSpellSound(playerEntity); + playerEntity.incrementStat(SorceryCraft.STAT_CAST_SPELL); SpellEntity entity = new SpellEntity(world, playerEntity); diff --git a/src/main/java/com/thebrokenrail/sorcerycraft/spell/FlameSpell.java b/src/main/java/com/thebrokenrail/sorcerycraft/spell/FlameSpell.java index 534c711..cb6398d 100644 --- a/src/main/java/com/thebrokenrail/sorcerycraft/spell/FlameSpell.java +++ b/src/main/java/com/thebrokenrail/sorcerycraft/spell/FlameSpell.java @@ -2,9 +2,13 @@ package com.thebrokenrail.sorcerycraft.spell; import com.thebrokenrail.sorcerycraft.spell.api.Spell; import net.minecraft.block.AbstractFireBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.TntBlock; import net.minecraft.entity.Entity; +import net.minecraft.item.FlintAndSteelItem; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; +import net.minecraft.state.property.Properties; import net.minecraft.util.Identifier; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; @@ -22,9 +26,19 @@ public class FlameSpell extends Spell { @Override public void execute(World world, Entity source, Entity attacker, BlockHitResult hitResult) { - BlockPos blockPos = hitResult.getBlockPos().offset(hitResult.getSide()); - if (world.isAir(blockPos)) { - world.setBlockState(blockPos, AbstractFireBlock.getState(world, blockPos)); + BlockPos blockPos = hitResult.getBlockPos(); + BlockState blockState = world.getBlockState(blockPos); + + BlockPos sideBlockPos = hitResult.getBlockPos().offset(hitResult.getSide()); + BlockState sideBlockState = world.getBlockState(sideBlockPos); + + if (blockState.getBlock() instanceof TntBlock) { + TntBlock.primeTnt(world, blockPos); + world.removeBlock(blockPos, false); + } else if (FlintAndSteelItem.canIgnite(sideBlockState, world, sideBlockPos)) { + world.setBlockState(sideBlockPos, AbstractFireBlock.getState(world, sideBlockPos)); + } else if (FlintAndSteelItem.isIgnitable(blockState)) { + world.setBlockState(blockPos, blockState.with(Properties.LIT, true)); } }