Java Code Examples for net.minecraft.block.state.IBlockState#withRotation()

The following examples show how to use net.minecraft.block.state.IBlockState#withRotation() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SchematicUtils.java    From litematica with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static IBlockState getUntransformedBlockState(IBlockState state, SchematicPlacement schematicPlacement, String subRegionName)
{
    SubRegionPlacement placement = schematicPlacement.getRelativeSubRegionPlacement(subRegionName);

    if (placement != null)
    {
        final Rotation rotationCombined = PositionUtils.getReverseRotation(schematicPlacement.getRotation().add(placement.getRotation()));
        final Mirror mirrorMain = schematicPlacement.getMirror();
        Mirror mirrorSub = placement.getMirror();

        if (mirrorSub != Mirror.NONE &&
            (schematicPlacement.getRotation() == Rotation.CLOCKWISE_90 ||
             schematicPlacement.getRotation() == Rotation.COUNTERCLOCKWISE_90))
        {
            mirrorSub = mirrorSub == Mirror.FRONT_BACK ? Mirror.LEFT_RIGHT : Mirror.FRONT_BACK;
        }

        if (rotationCombined != Rotation.NONE)
        {
            state = state.withRotation(rotationCombined);
        }

        if (mirrorSub != Mirror.NONE)
        {
            state = state.withMirror(mirrorSub);
        }

        if (mirrorMain != Mirror.NONE)
        {
            state = state.withMirror(mirrorMain);
        }
    }

    return state;
}
 
Example 2
Source File: Ladder.java    From EmergingTechnology with MIT License 4 votes vote down vote up
public IBlockState withMirror(IBlockState state, Mirror mirrorIn)
{
    return state.withRotation(mirrorIn.toRotation((EnumFacing)state.getValue(FACING)));
}
 
Example 3
Source File: BiomassGenerator.java    From EmergingTechnology with MIT License 4 votes vote down vote up
@Override
public IBlockState withMirror(IBlockState state, Mirror mirrorIn) {
    return state.withRotation(mirrorIn.toRotation((EnumFacing) state.getValue(FACING)));
}
 
Example 4
Source File: AlgaeBioreactor.java    From EmergingTechnology with MIT License 4 votes vote down vote up
@Override
public IBlockState withMirror(IBlockState state, Mirror mirrorIn) {
    return state.withRotation(mirrorIn.toRotation((EnumFacing) state.getValue(FACING)));
}
 
Example 5
Source File: Harvester.java    From EmergingTechnology with MIT License 4 votes vote down vote up
@Override
public IBlockState withMirror(IBlockState state, Mirror mirrorIn) {
    return state.withRotation(mirrorIn.toRotation((EnumFacing) state.getValue(FACING)));
}
 
Example 6
Source File: Shredder.java    From EmergingTechnology with MIT License 4 votes vote down vote up
@Override
public IBlockState withMirror(IBlockState state, Mirror mirrorIn) {
    return state.withRotation(mirrorIn.toRotation((EnumFacing) state.getValue(FACING)));
}
 
Example 7
Source File: Processor.java    From EmergingTechnology with MIT License 4 votes vote down vote up
@Override
public IBlockState withMirror(IBlockState state, Mirror mirrorIn) {
    return state.withRotation(mirrorIn.toRotation((EnumFacing) state.getValue(FACING)));
}
 
Example 8
Source File: Scaffolder.java    From EmergingTechnology with MIT License 4 votes vote down vote up
@Override
public IBlockState withMirror(IBlockState state, Mirror mirrorIn) {
    return state.withRotation(mirrorIn.toRotation((EnumFacing) state.getValue(FACING)));
}
 
Example 9
Source File: Scrubber.java    From EmergingTechnology with MIT License 4 votes vote down vote up
@Override
public IBlockState withMirror(IBlockState state, Mirror mirrorIn) {
    return state.withRotation(mirrorIn.toRotation((EnumFacing) state.getValue(FACING)));
}
 
Example 10
Source File: BlockBeacon.java    From Cyberware with MIT License 4 votes vote down vote up
@Override
public IBlockState withMirror(IBlockState state, Mirror mirrorIn)
{
	return state.withRotation(mirrorIn.toRotation((EnumFacing)state.getValue(FACING)));
}
 
Example 11
Source File: BlockFenceGate.java    From customstuff4 with GNU General Public License v3.0 4 votes vote down vote up
@Override
public IBlockState withMirror(IBlockState state, Mirror mirrorIn)
{
    return state.withRotation(mirrorIn.toRotation(state.getValue(FACING)));
}
 
Example 12
Source File: BlockBarrel.java    From Sakura_mod with MIT License 4 votes vote down vote up
/**
 * Returns the blockstate with the given mirror of the passed blockstate. If inapplicable, returns the passed
 * blockstate.
 */
public IBlockState withMirror(IBlockState state, Mirror mirrorIn)
{
    return state.withRotation(mirrorIn.toRotation(state.getValue(FACING)));
}
 
Example 13
Source File: Injector.java    From EmergingTechnology with MIT License 4 votes vote down vote up
@Override
public IBlockState withMirror(IBlockState state, Mirror mirrorIn) {
    return state.withRotation(mirrorIn.toRotation((EnumFacing) state.getValue(FACING)));
}
 
Example 14
Source File: BlockComponentBox.java    From Cyberware with MIT License 4 votes vote down vote up
@Override
public IBlockState withMirror(IBlockState state, Mirror mirrorIn)
{
	return state.withRotation(mirrorIn.toRotation((EnumFacing)state.getValue(FACING)));
}
 
Example 15
Source File: Wind.java    From EmergingTechnology with MIT License 4 votes vote down vote up
@Override
public IBlockState withMirror(IBlockState state, Mirror mirrorIn) {
    return state.withRotation(mirrorIn.toRotation((EnumFacing) state.getValue(FACING)));
}
 
Example 16
Source File: Hydroponic.java    From EmergingTechnology with MIT License 4 votes vote down vote up
@Override
public IBlockState withMirror(IBlockState state, Mirror mirrorIn) {
    return state.withRotation(mirrorIn.toRotation((EnumFacing) state.getValue(FACING)));
}
 
Example 17
Source File: BlockTFStorage.java    From TofuCraftReload with MIT License 4 votes vote down vote up
public IBlockState withMirror(IBlockState state, Mirror mirrorIn) {
    return state.withRotation(mirrorIn.toRotation((EnumFacing) state.getValue(FACING)));
}
 
Example 18
Source File: BlockAdvancedAggregator.java    From TofuCraftReload with MIT License 4 votes vote down vote up
/**
 * Returns the blockstate with the given mirror of the passed blockstate. If inapplicable, returns the passed
 * blockstate.
 */
public IBlockState withMirror(IBlockState state, Mirror mirrorIn)
{
    return state.withRotation(mirrorIn.toRotation((EnumFacing)state.getValue(FACING)));
}
 
Example 19
Source File: BlockTFOven.java    From TofuCraftReload with MIT License 4 votes vote down vote up
/**
 * Returns the blockstate with the given mirror of the passed blockstate. If inapplicable, returns the passed
 * blockstate.
 */
public IBlockState withMirror(IBlockState state, Mirror mirrorIn)
{
    return state.withRotation(mirrorIn.toRotation((EnumFacing)state.getValue(FACING)));
}
 
Example 20
Source File: Piezoelectric.java    From EmergingTechnology with MIT License 4 votes vote down vote up
@Override
public IBlockState withMirror(IBlockState state, Mirror mirrorIn) {
    return state.withRotation(mirrorIn.toRotation((EnumFacing) state.getValue(FACING)));
}