Waterloggable fixes with the cell and cables
This commit is contained in:
parent
86fdbae7b2
commit
727bd418fa
2 changed files with 2 additions and 3 deletions
|
@ -29,6 +29,7 @@ import net.minecraft.block.BlockRenderType;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.block.BlockWithEntity;
|
import net.minecraft.block.BlockWithEntity;
|
||||||
import net.minecraft.block.Material;
|
import net.minecraft.block.Material;
|
||||||
|
import net.minecraft.block.Waterloggable;
|
||||||
import net.minecraft.block.entity.BlockEntity;
|
import net.minecraft.block.entity.BlockEntity;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityContext;
|
import net.minecraft.entity.EntityContext;
|
||||||
|
@ -71,7 +72,7 @@ import java.util.Map;
|
||||||
/**
|
/**
|
||||||
* Created by modmuss50 on 19/05/2017.
|
* Created by modmuss50 on 19/05/2017.
|
||||||
*/
|
*/
|
||||||
public class CableBlock extends BlockWithEntity {
|
public class CableBlock extends BlockWithEntity implements Waterloggable {
|
||||||
|
|
||||||
public static final BooleanProperty EAST = BooleanProperty.of("east");
|
public static final BooleanProperty EAST = BooleanProperty.of("east");
|
||||||
public static final BooleanProperty WEST = BooleanProperty.of("west");
|
public static final BooleanProperty WEST = BooleanProperty.of("west");
|
||||||
|
|
|
@ -155,9 +155,7 @@ public class ItemDynamicCell extends Item implements ItemFluidInfo {
|
||||||
if(drainFluid != Fluids.EMPTY){
|
if(drainFluid != Fluids.EMPTY){
|
||||||
stack.decrement(1);
|
stack.decrement(1);
|
||||||
insertOrDropStack(player, getCellWithFluid(drainFluid, 1));
|
insertOrDropStack(player, getCellWithFluid(drainFluid, 1));
|
||||||
world.setBlockState(hitPos, Blocks.AIR.getDefaultState());
|
|
||||||
playEmptyingSound(player, world, hitPos, drainFluid);
|
playEmptyingSound(player, world, hitPos, drainFluid);
|
||||||
|
|
||||||
return TypedActionResult.pass(stack);
|
return TypedActionResult.pass(stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue