Update to 20w11a Enhance Flame Spell
This commit is contained in:
parent
df7826d584
commit
5a4cd89d68
@ -1,5 +1,9 @@
|
||||
### Changelog
|
||||
|
||||
**1.1.10**
|
||||
* Update to 20w11a
|
||||
* Enhance Flame Spell
|
||||
|
||||
**1.1.9**
|
||||
* Fix Scrolling Bug
|
||||
|
||||
|
@ -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
|
||||
|
@ -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() {
|
||||
|
@ -132,7 +132,7 @@ public class CastingTableScreen extends ScreenWithHandler<CastingTableScreenHand
|
||||
@Override
|
||||
public boolean mouseScrolled(double d, double e, double amount) {
|
||||
int i = handler.getRecipes().length;
|
||||
if (this.canScroll(i)) {
|
||||
if (canScroll(i)) {
|
||||
int j = i - 7;
|
||||
indexStartOffset = (int) ((double) indexStartOffset - amount);
|
||||
indexStartOffset = MathHelper.clamp(indexStartOffset, 0, j);
|
||||
|
@ -33,9 +33,9 @@ public class SpellItem extends Item {
|
||||
public TypedActionResult<ItemStack> 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);
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user