Skip to content

Commit

Permalink
#style: 清理代码
Browse files Browse the repository at this point in the history
  • Loading branch information
HeChuQIU committed Jun 26, 2023
1 parent 130fc84 commit b48c3ea
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 30 deletions.
3 changes: 0 additions & 3 deletions src/main/java/com/hechu/mindustry/block/MechanicalDrill.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package com.hechu.mindustry.block;

import net.minecraft.core.BlockPos;
import net.minecraft.tags.BlockTags;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.block.BaseEntityBlock;
import net.minecraft.world.level.block.RenderShape;
import net.minecraft.world.level.block.entity.BlockEntity;
Expand All @@ -30,7 +28,6 @@ public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState sta
@Override
public @NotNull RenderShape getRenderShape(@NotNull BlockState state) {
return RenderShape.ENTITYBLOCK_ANIMATED;
// return RenderShape.MODEL;
}

@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,12 @@
public class MechanicalDrillBlockEntity extends BlockEntity implements GeoBlockEntity {
public static final String NAME = "mechanical_drill";
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);

// We statically instantiate our RawAnimations for efficiency, consistency, and error-proofing
private static final RawAnimation ROTATION_ANIMS = RawAnimation.begin().thenLoop("mechanical_drill.rotation");

public MechanicalDrillBlockEntity(BlockPos pos, BlockState state) {
super(MECHANICAL_DRILL_BLOCK_ENTITY.get(), pos, state);
}

// Let's set our animations up
// For this one, we want it to play the "Fertilizer" animation set if it's raining,
// or switch to a botarium if it's not.
@Override
public void registerControllers(AnimatableManager.ControllerRegistrar controllerRegistrar) {
controllerRegistrar.add(new AnimationController<>(this, state -> state.setAndContinue(ROTATION_ANIMS)));
Expand Down Expand Up @@ -75,12 +70,6 @@ public void tick() {
}
if (isMining) {
progress += 0.4 / 20;
/*PlayerList playerList = level.getServer() == null ? null : level.getServer().getPlayerList();
if (playerList != null && playerList.getPlayerCount() > 0) {
for (ServerPlayer player : playerList.getPlayers()) {
level.destroyBlockProgress(player.getId(), miningBlockPos, (int) Math.ceil(counter * 10));
}
}*/
if (progress >= 1) {
for (ItemStack drop : Block.getDrops(miningBlockState, (ServerLevel) level, miningBlockPos, null)) {
Block.popResource(level, getBlockPos().above(), drop);
Expand All @@ -91,15 +80,6 @@ public void tick() {
} else {
progress = 0;
}
/*if (counter++ % 100 == 0) {
BlockState belowBlockState = level.getBlockState(getBlockPos().below());
if (belowBlockState.getTags().anyMatch(tag -> tag.equals(BlockTags.COPPER_ORES))) {
level.removeBlock(getBlockPos().below(), true);
for (ItemStack drop : Block.getDrops(belowBlockState, (ServerLevel) level, getBlockPos().below(), null)) {
Block.popResource(level, getBlockPos().below(), drop);
}
}
}*/
}

public float getProgress() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.hechu.mindustry.block;

import com.hechu.mindustry.model.MechanicalDrillModel;
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
import software.bernie.geckolib.renderer.GeoBlockRenderer;

public class MechanicalDrillBlockEntityRenderer extends GeoBlockRenderer<MechanicalDrillBlockEntity> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import java.util.function.Consumer;

public class MechanicalDrill extends BlockItem implements GeoItem {
private AnimatableInstanceCache cache = new SingletonAnimatableInstanceCache(this);
private final AnimatableInstanceCache cache = new SingletonAnimatableInstanceCache(this);

private static final RawAnimation ROTATION_ANIMS = RawAnimation.begin().thenLoop("mechanical_drill.rotation");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.hechu.mindustry.item;

import com.hechu.mindustry.Mindustry;
import com.hechu.mindustry.block.MechanicalDrillBlockEntity;
import net.minecraft.resources.ResourceLocation;
import software.bernie.geckolib.model.GeoModel;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity;
import net.minecraft.world.level.block.entity.BlockEntity;
import snownee.jade.api.*;
import snownee.jade.api.config.IPluginConfig;
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/com/hechu/mindustry/jade/ExamplePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
import com.hechu.mindustry.block.MechanicalDrill;
import com.hechu.mindustry.block.MechanicalDrillBlockEntity;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.AbstractFurnaceBlock;
import net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity;
import net.minecraft.world.level.block.entity.BlockEntity;
import snownee.jade.api.*;

@WailaPlugin
Expand Down

0 comments on commit b48c3ea

Please sign in to comment.