diff --git a/build.gradle b/build.gradle index 62fa202..0392916 100644 --- a/build.gradle +++ b/build.gradle @@ -118,7 +118,7 @@ dependencies { // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied. // The userdev artifact is a special name and will get all sorts of transformations applied to it. - minecraft 'net.minecraftforge:forge:1.16.5-36.2.2' + minecraft 'net.minecraftforge:forge:1.16.5-36.2.0' // You may put jars on which you depend on in ./libs or you may define them like so.. // compile "some.group:artifact:version:classifier" diff --git a/src/main/java/sonnenlicht/somethinggood/common/block/AbstractFanBlock.java b/src/main/java/sonnenlicht/somethinggood/common/block/AbstractFanBlock.java index 930b99d..46f1cf0 100644 --- a/src/main/java/sonnenlicht/somethinggood/common/block/AbstractFanBlock.java +++ b/src/main/java/sonnenlicht/somethinggood/common/block/AbstractFanBlock.java @@ -9,9 +9,6 @@ import net.minecraft.state.StateContainer; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.SoundCategory; -import net.minecraft.util.SoundEvent; -import net.minecraft.util.SoundEvents; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.shapes.IBooleanFunction; import net.minecraft.util.math.shapes.ISelectionContext; diff --git a/src/main/java/sonnenlicht/somethinggood/common/item/FireCore.java b/src/main/java/sonnenlicht/somethinggood/common/item/FireCore.java index 4d4f4cf..648ebb0 100644 --- a/src/main/java/sonnenlicht/somethinggood/common/item/FireCore.java +++ b/src/main/java/sonnenlicht/somethinggood/common/item/FireCore.java @@ -1,6 +1,5 @@ package sonnenlicht.somethinggood.common.item; -import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -23,8 +22,6 @@ public FireCore() { } @Override public void addInformation(ItemStack stack, @Nullable World worldIn, List tooltip, ITooltipFlag flagIn) { - if (Screen.hasShiftDown()) { - tooltip.add(new TranslationTextComponent("bizarre_fans.fire_core.desc_0")); - } + tooltip.add(new TranslationTextComponent("bizarre_fans.fire_core.desc_0")); } } diff --git a/src/main/java/sonnenlicht/somethinggood/common/item/FrozenCore.java b/src/main/java/sonnenlicht/somethinggood/common/item/FrozenCore.java index 6f1fe88..90515af 100644 --- a/src/main/java/sonnenlicht/somethinggood/common/item/FrozenCore.java +++ b/src/main/java/sonnenlicht/somethinggood/common/item/FrozenCore.java @@ -1,6 +1,5 @@ package sonnenlicht.somethinggood.common.item; -import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -23,8 +22,6 @@ public FrozenCore() { } @Override public void addInformation(ItemStack stack, @Nullable World worldIn, List tooltip, ITooltipFlag flagIn) { - if (Screen.hasShiftDown()) { - tooltip.add(new TranslationTextComponent("bizarre_fans.frozen_core.desc_0")); - } + tooltip.add(new TranslationTextComponent("bizarre_fans.frozen_core.desc_0")); } } diff --git a/src/main/java/sonnenlicht/somethinggood/common/item/FunctionCore.java b/src/main/java/sonnenlicht/somethinggood/common/item/FunctionCore.java index 617e162..5705459 100644 --- a/src/main/java/sonnenlicht/somethinggood/common/item/FunctionCore.java +++ b/src/main/java/sonnenlicht/somethinggood/common/item/FunctionCore.java @@ -1,6 +1,5 @@ package sonnenlicht.somethinggood.common.item; -import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -23,8 +22,6 @@ public FunctionCore() { } @Override public void addInformation(ItemStack stack, @Nullable World worldIn, List tooltip, ITooltipFlag flagIn) { - if (Screen.hasShiftDown()) { - tooltip.add(new TranslationTextComponent("bizarre_fans.function_core.desc_0")); - } + tooltip.add(new TranslationTextComponent("bizarre_fans.function_core.desc_0")); } } diff --git a/src/main/java/sonnenlicht/somethinggood/common/item/ReversalCore.java b/src/main/java/sonnenlicht/somethinggood/common/item/ReversalCore.java index dab719d..156f723 100644 --- a/src/main/java/sonnenlicht/somethinggood/common/item/ReversalCore.java +++ b/src/main/java/sonnenlicht/somethinggood/common/item/ReversalCore.java @@ -1,6 +1,5 @@ package sonnenlicht.somethinggood.common.item; -import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -23,8 +22,6 @@ public ReversalCore() { } @Override public void addInformation(ItemStack stack, @Nullable World worldIn, List tooltip, ITooltipFlag flagIn) { - if (Screen.hasShiftDown()) { - tooltip.add(new TranslationTextComponent("bizarre_fans.reversal_core.desc_0")); - } + tooltip.add(new TranslationTextComponent("bizarre_fans.reversal_core.desc_0")); } } diff --git a/src/main/java/sonnenlicht/somethinggood/common/tile/AbstractFanBlockTileEntity.java b/src/main/java/sonnenlicht/somethinggood/common/tile/AbstractFanBlockTileEntity.java index 692c33b..de891fc 100644 --- a/src/main/java/sonnenlicht/somethinggood/common/tile/AbstractFanBlockTileEntity.java +++ b/src/main/java/sonnenlicht/somethinggood/common/tile/AbstractFanBlockTileEntity.java @@ -181,7 +181,7 @@ public AxisAlignedBB getAABB() { } /**

风扇基础功能

*/ - private void setPushing() { + public void setPushing() { if(getWorld() != null){ BlockState state = getWorld().getBlockState(getPos()); Direction facing = state.get(AbstractFanBlock.FACING).getOpposite(); diff --git a/src/main/java/sonnenlicht/somethinggood/common/tile/FrozenFanBlockTileEntity.java b/src/main/java/sonnenlicht/somethinggood/common/tile/FrozenFanBlockTileEntity.java index 7674e76..d7027c3 100644 --- a/src/main/java/sonnenlicht/somethinggood/common/tile/FrozenFanBlockTileEntity.java +++ b/src/main/java/sonnenlicht/somethinggood/common/tile/FrozenFanBlockTileEntity.java @@ -1,13 +1,11 @@ package sonnenlicht.somethinggood.common.tile; -import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.material.Material; import net.minecraft.entity.LivingEntity; import net.minecraft.potion.EffectInstance; import net.minecraft.potion.Effects; -import net.minecraft.util.DamageSource; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; diff --git a/src/main/java/sonnenlicht/somethinggood/common/tile/PullFanBlockTileEntity.java b/src/main/java/sonnenlicht/somethinggood/common/tile/PullFanBlockTileEntity.java index 837013d..b34918f 100644 --- a/src/main/java/sonnenlicht/somethinggood/common/tile/PullFanBlockTileEntity.java +++ b/src/main/java/sonnenlicht/somethinggood/common/tile/PullFanBlockTileEntity.java @@ -27,14 +27,13 @@ public PullFanBlockTileEntity() { /**

保留父类方法内容,增加新功能

*/ @Override public void tick() { - if (getWorld() !=null && getWorld().getBlockState(getPos()).getBlock() instanceof AbstractFanBlock && getWorld().getGameTime() % 2 == 0) - if (getWorld().getBlockState(getPos()).get(AbstractFanBlock.POWERED)) - setPushing(); + super.tick(); if (getWorld() !=null && getWorld().getBlockState(getPos()).getBlock() instanceof AbstractFanBlock && getWorld().getGameTime() % 100 == 0) if (getWorld().getBlockState(getPos()).get(AbstractFanBlock.POWERED) && ConfigRegistry.PLAY_SOUND.get()) getWorld().playSound(null, pos, SoundEvents.ITEM_ELYTRA_FLYING, SoundCategory.BLOCKS,0.5F,1); - if (getWorld() !=null && getWorld().getBlockState(getPos()).getBlock() instanceof AbstractFanBlock && getWorld().getGameTime() % 2 == 0) + if (getWorld() !=null && getWorld().getBlockState(getPos()).getBlock() instanceof AbstractFanBlock && getWorld().getGameTime() % 2 == 0){ if (getWorld().getBlockState(getPos()).get(AbstractFanBlock.POWERED) && ConfigRegistry.SUMMON_PARTICLE.get()){ + setPushing(); Random rand = new Random(); for(int i = 0; i < 4; ++i) { double px = (float)pos.getZ() + rand.nextFloat(); @@ -47,13 +46,15 @@ public void tick() { getWorld().addParticle(ParticleTypes.ENCHANTED_HIT, pz, py + 1, px, vz, vy, vx); } } + } } /** *

聚集风扇起作用时的逻辑

* 将范围内活实体聚集于风扇处 */ - private void setPushing() { + @Override + public void setPushing() { if (getWorld() != null) { for (LivingEntity living : getWorld().getEntitiesWithinAABB(LivingEntity.class, new AxisAlignedBB(this.getPos()).grow(zone, zone, zone))) { if (living.isAlive() && !(living instanceof PlayerEntity)) {