Catch up with renames

This commit is contained in:
simibubi 2023-02-24 22:34:52 +01:00
parent 51e3aadd34
commit a9f041a136
4 changed files with 27 additions and 24 deletions

View File

@ -2,10 +2,10 @@ package com.simibubi.create.content.contraptions.components.waterwheel;
import java.util.Random; import java.util.Random;
import com.simibubi.create.AllBlockEntityTypes;
import com.simibubi.create.AllBlocks; import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.content.contraptions.base.RotatedPillarKineticBlock; import com.simibubi.create.content.contraptions.base.RotatedPillarKineticBlock;
import com.simibubi.create.foundation.block.ITE; import com.simibubi.create.foundation.block.IBE;
import com.simibubi.create.foundation.utility.Couple; import com.simibubi.create.foundation.utility.Couple;
import com.simibubi.create.foundation.utility.Iterate; import com.simibubi.create.foundation.utility.Iterate;
@ -30,7 +30,7 @@ import net.minecraft.world.level.block.state.StateDefinition.Builder;
import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.BlockHitResult;
public class LargeWaterWheelBlock extends RotatedPillarKineticBlock implements ITE<LargeWaterWheelTileEntity> { public class LargeWaterWheelBlock extends RotatedPillarKineticBlock implements IBE<LargeWaterWheelBlockEntity> {
public static final BooleanProperty EXTENSION = BooleanProperty.create("extension"); public static final BooleanProperty EXTENSION = BooleanProperty.create("extension");
@ -82,7 +82,7 @@ public class LargeWaterWheelBlock extends RotatedPillarKineticBlock implements I
@Override @Override
public InteractionResult use(BlockState pState, Level pLevel, BlockPos pPos, Player pPlayer, InteractionHand pHand, public InteractionResult use(BlockState pState, Level pLevel, BlockPos pPos, Player pPlayer, InteractionHand pHand,
BlockHitResult pHit) { BlockHitResult pHit) {
return onTileEntityUse(pLevel, pPos, wwt -> wwt.applyMaterialIfValid(pPlayer.getItemInHand(pHand))); return onBlockEntityUse(pLevel, pPos, wwt -> wwt.applyMaterialIfValid(pPlayer.getItemInHand(pHand)));
} }
@Override @Override
@ -128,7 +128,7 @@ public class LargeWaterWheelBlock extends RotatedPillarKineticBlock implements I
pLevel.setBlockAndUpdate(structurePos, requiredStructure); pLevel.setBlockAndUpdate(structurePos, requiredStructure);
} }
} }
withTileEntityDo(pLevel, pPos, WaterWheelTileEntity::determineAndApplyFlowScore); withBlockEntityDo(pLevel, pPos, WaterWheelBlockEntity::determineAndApplyFlowScore);
} }
@Override @Override
@ -137,13 +137,13 @@ public class LargeWaterWheelBlock extends RotatedPillarKineticBlock implements I
} }
@Override @Override
public BlockEntityType<? extends LargeWaterWheelTileEntity> getTileEntityType() { public BlockEntityType<? extends LargeWaterWheelBlockEntity> getBlockEntityType() {
return AllTileEntities.LARGE_WATER_WHEEL.get(); return AllBlockEntityTypes.LARGE_WATER_WHEEL.get();
} }
@Override @Override
public Class<LargeWaterWheelTileEntity> getTileEntityClass() { public Class<LargeWaterWheelBlockEntity> getBlockEntityClass() {
return LargeWaterWheelTileEntity.class; return LargeWaterWheelBlockEntity.class;
} }
@Override @Override

View File

@ -4,9 +4,9 @@ import net.minecraft.core.BlockPos;
import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
public class LargeWaterWheelTileEntity extends WaterWheelTileEntity { public class LargeWaterWheelBlockEntity extends WaterWheelBlockEntity {
public LargeWaterWheelTileEntity(BlockEntityType<?> type, BlockPos pos, BlockState state) { public LargeWaterWheelBlockEntity(BlockEntityType<?> type, BlockPos pos, BlockState state) {
super(type, pos, state); super(type, pos, state);
} }

View File

@ -2,11 +2,11 @@ package com.simibubi.create.content.contraptions.components.waterwheel;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.simibubi.create.content.contraptions.base.CutoutRotatingInstance; import com.simibubi.create.content.contraptions.base.CutoutRotatingInstance;
import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.content.contraptions.base.KineticBlockEntity;
public class WaterWheelInstance extends CutoutRotatingInstance { public class WaterWheelInstance extends CutoutRotatingInstance {
public WaterWheelInstance(MaterialManager modelManager, KineticTileEntity tile) { public WaterWheelInstance(MaterialManager modelManager, KineticBlockEntity tile) {
super(modelManager, tile); super(modelManager, tile);
} }

View File

@ -1,16 +1,19 @@
package com.simibubi.create.content.contraptions.components.waterwheel; package com.simibubi.create.content.contraptions.components.waterwheel;
import java.util.HashSet;
import java.util.Random; import java.util.Random;
import java.util.Set;
import java.util.function.Consumer; import java.util.function.Consumer;
import org.jetbrains.annotations.Nullable;
import com.simibubi.create.AllBlocks; import com.simibubi.create.AllBlocks;
import com.simibubi.create.content.contraptions.goggles.IProxyHoveringInformation; import com.simibubi.create.content.contraptions.goggles.IProxyHoveringInformation;
import com.simibubi.create.content.contraptions.wrench.IWrenchable; import com.simibubi.create.content.contraptions.wrench.IWrenchable;
import com.simibubi.create.foundation.block.render.DestroyProgressRenderingHandler; import com.simibubi.create.foundation.block.render.MultiPosDestructionHandler;
import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.particle.ParticleEngine; import net.minecraft.client.particle.ParticleEngine;
import net.minecraft.client.renderer.LevelRenderer;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
@ -156,7 +159,7 @@ public class WaterWheelStructuralBlock extends DirectionalBlock implements IWren
return true; return true;
} }
public static class RenderProperties implements IBlockRenderProperties, DestroyProgressRenderingHandler { public static class RenderProperties implements IBlockRenderProperties, MultiPosDestructionHandler {
@Override @Override
public boolean addDestroyEffects(BlockState state, Level Level, BlockPos pos, ParticleEngine manager) { public boolean addDestroyEffects(BlockState state, Level Level, BlockPos pos, ParticleEngine manager) {
@ -172,18 +175,18 @@ public class WaterWheelStructuralBlock extends DirectionalBlock implements IWren
manager.crack(WaterWheelStructuralBlock.getMaster(level, targetPos, state), bhr.getDirection()); manager.crack(WaterWheelStructuralBlock.getMaster(level, targetPos, state), bhr.getDirection());
return true; return true;
} }
return DestroyProgressRenderingHandler.super.addHitEffects(state, level, target, manager); return IBlockRenderProperties.super.addHitEffects(state, level, target, manager);
} }
@Override @Override
public boolean renderDestroyProgress(ClientLevel level, LevelRenderer renderer, int breakerId, @Nullable
BlockPos targetPos, int progress, BlockState blockState) { public Set<BlockPos> getExtraPositions(ClientLevel level, BlockPos pos, BlockState blockState, int progress) {
WaterWheelStructuralBlock waterWheelStructuralBlock = AllBlocks.WATER_WHEEL_STRUCTURAL.get(); WaterWheelStructuralBlock waterWheelStructuralBlock = AllBlocks.WATER_WHEEL_STRUCTURAL.get();
if (!waterWheelStructuralBlock.stillValid(level, targetPos, blockState, false)) if (!waterWheelStructuralBlock.stillValid(level, pos, blockState, false))
return true; return null;
BlockPos masterPos = WaterWheelStructuralBlock.getMaster(level, targetPos, blockState); HashSet<BlockPos> set = new HashSet<>();
renderer.destroyBlockProgress(masterPos.hashCode(), masterPos, progress); set.add(WaterWheelStructuralBlock.getMaster(level, pos, blockState));
return true; return set;
} }
} }