mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-14 14:34:16 +01:00
Catch up with renames
This commit is contained in:
parent
51e3aadd34
commit
a9f041a136
@ -2,10 +2,10 @@ package com.simibubi.create.content.contraptions.components.waterwheel;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.simibubi.create.AllBlockEntityTypes;
|
||||
import com.simibubi.create.AllBlocks;
|
||||
import com.simibubi.create.AllTileEntities;
|
||||
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.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.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");
|
||||
|
||||
@ -82,7 +82,7 @@ public class LargeWaterWheelBlock extends RotatedPillarKineticBlock implements I
|
||||
@Override
|
||||
public InteractionResult use(BlockState pState, Level pLevel, BlockPos pPos, Player pPlayer, InteractionHand pHand,
|
||||
BlockHitResult pHit) {
|
||||
return onTileEntityUse(pLevel, pPos, wwt -> wwt.applyMaterialIfValid(pPlayer.getItemInHand(pHand)));
|
||||
return onBlockEntityUse(pLevel, pPos, wwt -> wwt.applyMaterialIfValid(pPlayer.getItemInHand(pHand)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -128,7 +128,7 @@ public class LargeWaterWheelBlock extends RotatedPillarKineticBlock implements I
|
||||
pLevel.setBlockAndUpdate(structurePos, requiredStructure);
|
||||
}
|
||||
}
|
||||
withTileEntityDo(pLevel, pPos, WaterWheelTileEntity::determineAndApplyFlowScore);
|
||||
withBlockEntityDo(pLevel, pPos, WaterWheelBlockEntity::determineAndApplyFlowScore);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -137,13 +137,13 @@ public class LargeWaterWheelBlock extends RotatedPillarKineticBlock implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockEntityType<? extends LargeWaterWheelTileEntity> getTileEntityType() {
|
||||
return AllTileEntities.LARGE_WATER_WHEEL.get();
|
||||
public BlockEntityType<? extends LargeWaterWheelBlockEntity> getBlockEntityType() {
|
||||
return AllBlockEntityTypes.LARGE_WATER_WHEEL.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<LargeWaterWheelTileEntity> getTileEntityClass() {
|
||||
return LargeWaterWheelTileEntity.class;
|
||||
public Class<LargeWaterWheelBlockEntity> getBlockEntityClass() {
|
||||
return LargeWaterWheelBlockEntity.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -4,9 +4,9 @@ import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -2,11 +2,11 @@ package com.simibubi.create.content.contraptions.components.waterwheel;
|
||||
|
||||
import com.jozufozu.flywheel.api.MaterialManager;
|
||||
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 WaterWheelInstance(MaterialManager modelManager, KineticTileEntity tile) {
|
||||
public WaterWheelInstance(MaterialManager modelManager, KineticBlockEntity tile) {
|
||||
super(modelManager, tile);
|
||||
}
|
||||
|
||||
|
@ -1,16 +1,19 @@
|
||||
package com.simibubi.create.content.contraptions.components.waterwheel;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import com.simibubi.create.AllBlocks;
|
||||
import com.simibubi.create.content.contraptions.goggles.IProxyHoveringInformation;
|
||||
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.particle.ParticleEngine;
|
||||
import net.minecraft.client.renderer.LevelRenderer;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
@ -156,7 +159,7 @@ public class WaterWheelStructuralBlock extends DirectionalBlock implements IWren
|
||||
return true;
|
||||
}
|
||||
|
||||
public static class RenderProperties implements IBlockRenderProperties, DestroyProgressRenderingHandler {
|
||||
public static class RenderProperties implements IBlockRenderProperties, MultiPosDestructionHandler {
|
||||
|
||||
@Override
|
||||
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());
|
||||
return true;
|
||||
}
|
||||
return DestroyProgressRenderingHandler.super.addHitEffects(state, level, target, manager);
|
||||
return IBlockRenderProperties.super.addHitEffects(state, level, target, manager);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderDestroyProgress(ClientLevel level, LevelRenderer renderer, int breakerId,
|
||||
BlockPos targetPos, int progress, BlockState blockState) {
|
||||
@Nullable
|
||||
public Set<BlockPos> getExtraPositions(ClientLevel level, BlockPos pos, BlockState blockState, int progress) {
|
||||
WaterWheelStructuralBlock waterWheelStructuralBlock = AllBlocks.WATER_WHEEL_STRUCTURAL.get();
|
||||
if (!waterWheelStructuralBlock.stillValid(level, targetPos, blockState, false))
|
||||
return true;
|
||||
BlockPos masterPos = WaterWheelStructuralBlock.getMaster(level, targetPos, blockState);
|
||||
renderer.destroyBlockProgress(masterPos.hashCode(), masterPos, progress);
|
||||
return true;
|
||||
if (!waterWheelStructuralBlock.stillValid(level, pos, blockState, false))
|
||||
return null;
|
||||
HashSet<BlockPos> set = new HashSet<>();
|
||||
set.add(WaterWheelStructuralBlock.getMaster(level, pos, blockState));
|
||||
return set;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user