fix CI not building

This commit is contained in:
yrsegal@gmail.com 2022-06-07 19:21:57 -04:00
parent 811adff148
commit e246d31926
6 changed files with 25 additions and 18 deletions

View file

@ -1,5 +1,6 @@
package at.petrak.hexcasting.common.blocks;
import at.petrak.hexcasting.annotations.SoftImplement;
import at.petrak.hexcasting.api.misc.FrozenColorizer;
import at.petrak.hexcasting.common.blocks.entity.BlockEntityConjured;
import at.petrak.hexcasting.xplat.IForgeLikeBlock;
@ -110,9 +111,16 @@ public class BlockConjured extends Block implements EntityBlock, IForgeLikeBlock
// NO-OP
}
@Override
@SoftImplement("forge")
public boolean addLandingEffects(BlockState state1, ServerLevel worldserver, BlockPos pos, BlockState state2,
LivingEntity entity, int numberOfParticles) {
LivingEntity entity, int numberOfParticles) {
return addLandingEffects(state1, worldserver, pos, entity, numberOfParticles);
}
@Override
public boolean addLandingEffects(BlockState state, ServerLevel worldserver, BlockPos pos,
LivingEntity entity, int numberOfParticles) {
BlockEntity tile = worldserver.getBlockEntity(pos);
if (tile instanceof BlockEntityConjured bec) {
bec.landParticle(entity, numberOfParticles);

View file

@ -87,7 +87,7 @@ public class BlockConjuredLight extends BlockConjured implements SimpleWaterlogg
}
@Override
public boolean addLandingEffects(BlockState state1, ServerLevel worldserver, BlockPos pos, BlockState state2,
public boolean addLandingEffects(BlockState state, ServerLevel worldserver, BlockPos pos,
LivingEntity entity, int numberOfParticles) {
return true;
}

View file

@ -1,5 +1,6 @@
package at.petrak.hexcasting.common.blocks.akashic;
import at.petrak.hexcasting.annotations.SoftImplement;
import at.petrak.hexcasting.api.spell.DatumType;
import at.petrak.hexcasting.api.spell.SpellDatum;
import at.petrak.hexcasting.common.items.ItemScroll;
@ -115,9 +116,14 @@ public class BlockAkashicBookshelf extends BlockAkashicFloodfiller implements En
return this.defaultBlockState().setValue(FACING, ctx.getHorizontalDirection().getOpposite());
}
@Override
@SoftImplement("forge")
public float getEnchantPowerBonus(BlockState state, LevelReader level, BlockPos pos) {
return 1;
return hasEnchantPowerBonus(state, level, pos) ? 1 : 0;
}
@Override
public boolean hasEnchantPowerBonus(BlockState state, LevelReader level, BlockPos pos) {
return true;
}
@Override

View file

@ -1,6 +1,5 @@
package at.petrak.hexcasting.xplat;
import at.petrak.hexcasting.annotations.SoftImplement;
import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.LivingEntity;
@ -9,20 +8,14 @@ import net.minecraft.world.level.block.state.BlockState;
/**
* An interface that mimics some methods of IForgeBlock.
* Fabric implementation will use mixins to achieve the same effect.
* Fabric implementation will use mixins to achieve the same effects.
*/
public interface IForgeLikeBlock {
@SoftImplement("forge")
default boolean addLandingEffects(BlockState state1, ServerLevel level, BlockPos pos, BlockState state2, LivingEntity entity, int numberOfParticles) {
default boolean addLandingEffects(BlockState state, ServerLevel level, BlockPos pos, LivingEntity entity, int numberOfParticles) {
return false;
}
/**
* On Fabric, this method's return value doesn't matter - it's only checked for whether it's greater than 0.
* Implementing boosts the way Forge does would... not be worth the effort.
*/
@SoftImplement("forge")
default float getEnchantPowerBonus(BlockState state, LevelReader level, BlockPos pos) {
return 0;
default boolean hasEnchantPowerBonus(BlockState state, LevelReader level, BlockPos pos) {
return false;
}
}

View file

@ -17,7 +17,7 @@ public class FabricEnchantmentTableBlockMixin {
BlockState state = level.getBlockState(blockPos.offset(blockPos2));
if (state.getBlock() instanceof IForgeLikeBlock forgeLike) {
boolean emptyBetween = level.isEmptyBlock(blockPos.offset(blockPos2.getX() / 2, blockPos2.getY(), blockPos2.getZ() / 2));
cir.setReturnValue(emptyBetween && forgeLike.getEnchantPowerBonus(state, level, blockPos) > 0);
cir.setReturnValue(emptyBetween && forgeLike.hasEnchantPowerBonus(state, level, blockPos));
}
}
}

View file

@ -26,7 +26,7 @@ public class FabricLivingEntityMixin {
float dist = (float) Mth.ceil(entity.fallDistance - 3.0F);
double e = Math.min(0.2F + dist / 15.0F, 2.5D);
int i = (int)(150.0D * e);
if (forgeLike.addLandingEffects(state, (ServerLevel) entity.level, pos, state, entity, i)) {
if (forgeLike.addLandingEffects(state, (ServerLevel) entity.level, pos, entity, i)) {
hex$cachedParticleState = state;
return Blocks.AIR.defaultBlockState();
}