org.bukkit.Axis Java Examples

The following examples show how to use org.bukkit.Axis. 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: NMS_1_16_R1.java    From 1.13-Command-API with Apache License 2.0 6 votes vote down vote up
@Override
public EnumSet<Axis> getAxis(CommandContext cmdCtx, String key) {
	EnumSet<Axis> set = EnumSet.noneOf(Axis.class);
	EnumSet<EnumAxis> parsedEnumSet = ArgumentRotationAxis.a(cmdCtx, key);
	for (EnumAxis element : parsedEnumSet) {
		switch (element) {
		case X:
			set.add(Axis.X);
			break;
		case Y:
			set.add(Axis.Y);
			break;
		case Z:
			set.add(Axis.Z);
			break;
		}
	}
	return set;
}
 
Example #2
Source File: NMS_1_14.java    From 1.13-Command-API with Apache License 2.0 6 votes vote down vote up
@Override
public EnumSet<Axis> getAxis(CommandContext cmdCtx, String key) {
	EnumSet<Axis> set = EnumSet.noneOf(Axis.class);
	EnumSet<EnumAxis> parsedEnumSet = ArgumentRotationAxis.a(cmdCtx, key);
	for (EnumAxis element : parsedEnumSet) {
		switch (element) {
		case X:
			set.add(Axis.X);
			break;
		case Y:
			set.add(Axis.Y);
			break;
		case Z:
			set.add(Axis.Z);
			break;
		}
	}
	return set;
}
 
Example #3
Source File: NMS_1_13.java    From 1.13-Command-API with Apache License 2.0 6 votes vote down vote up
@Override
public EnumSet<Axis> getAxis(CommandContext cmdCtx, String key) {
    EnumSet<Axis> set = EnumSet.noneOf(Axis.class);
    EnumSet<EnumAxis> parsedEnumSet = ArgumentRotationAxis.a(cmdCtx, key);
    for (EnumAxis element : parsedEnumSet) {
        switch (element) {
            case X:
                set.add(Axis.X);
                break;
            case Y:
                set.add(Axis.Y);
                break;
            case Z:
                set.add(Axis.Z);
                break;
        }
    }
    return set;
}
 
Example #4
Source File: NMS_1_15.java    From 1.13-Command-API with Apache License 2.0 6 votes vote down vote up
@Override
public EnumSet<Axis> getAxis(CommandContext cmdCtx, String key) {
	EnumSet<Axis> set = EnumSet.noneOf(Axis.class);
	EnumSet<EnumAxis> parsedEnumSet = ArgumentRotationAxis.a(cmdCtx, key);
	for (EnumAxis element : parsedEnumSet) {
		switch (element) {
		case X:
			set.add(Axis.X);
			break;
		case Y:
			set.add(Axis.Y);
			break;
		case Z:
			set.add(Axis.Z);
			break;
		}
	}
	return set;
}
 
Example #5
Source File: NMS_1_13_2.java    From 1.13-Command-API with Apache License 2.0 6 votes vote down vote up
@Override
public EnumSet<Axis> getAxis(CommandContext cmdCtx, String key) {
    EnumSet<Axis> set = EnumSet.noneOf(Axis.class);
    EnumSet<EnumAxis> parsedEnumSet = ArgumentRotationAxis.a(cmdCtx, key);
    for (EnumAxis element : parsedEnumSet) {
        switch (element) {
            case X:
                set.add(Axis.X);
                break;
            case Y:
                set.add(Axis.Y);
                break;
            case Z:
                set.add(Axis.Z);
                break;
        }
    }
    return set;
}
 
Example #6
Source File: NMS_1_14_4.java    From 1.13-Command-API with Apache License 2.0 6 votes vote down vote up
@Override
public EnumSet<Axis> getAxis(CommandContext cmdCtx, String key) {
    EnumSet<Axis> set = EnumSet.noneOf(Axis.class);
    EnumSet<EnumAxis> parsedEnumSet = ArgumentRotationAxis.a(cmdCtx, key);
    for (EnumAxis element : parsedEnumSet) {
        switch (element) {
            case X:
                set.add(Axis.X);
                break;
            case Y:
                set.add(Axis.Y);
                break;
            case Z:
                set.add(Axis.Z);
                break;
        }
    }
    return set;
}
 
Example #7
Source File: NMS_1_14_3.java    From 1.13-Command-API with Apache License 2.0 6 votes vote down vote up
@Override
public EnumSet<Axis> getAxis(CommandContext cmdCtx, String key) {
    EnumSet<Axis> set = EnumSet.noneOf(Axis.class);
    EnumSet<EnumAxis> parsedEnumSet = ArgumentRotationAxis.a(cmdCtx, key);
    for (EnumAxis element : parsedEnumSet) {
        switch (element) {
            case X:
                set.add(Axis.X);
                break;
            case Y:
                set.add(Axis.Y);
                break;
            case Z:
                set.add(Axis.Z);
                break;
        }
    }
    return set;
}
 
Example #8
Source File: NMS_1_13_1.java    From 1.13-Command-API with Apache License 2.0 6 votes vote down vote up
@Override
public EnumSet<Axis> getAxis(CommandContext cmdCtx, String key) {
    EnumSet<Axis> set = EnumSet.noneOf(Axis.class);
    EnumSet<EnumAxis> parsedEnumSet = ArgumentRotationAxis.a(cmdCtx, key);
    for (EnumAxis element : parsedEnumSet) {
        switch (element) {
            case X:
                set.add(Axis.X);
                break;
            case Y:
                set.add(Axis.Y);
                break;
            case Z:
                set.add(Axis.Z);
                break;
        }
    }
    return set;
}
 
Example #9
Source File: BlockAdapterBlockData.java    From DungeonsXL with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void setAxis(Block block, boolean z) {
    if (!(block.getBlockData() instanceof Orientable)) {
        throw new IllegalArgumentException("Block is not Orientable");
    }
    Orientable data = (Orientable) block.getBlockData();
    data.setAxis(z ? Axis.Z : Axis.X);
    block.setBlockData(data, false);
}
 
Example #10
Source File: LumberAxe.java    From Slimefun4 with GNU General Public License v3.0 5 votes vote down vote up
private void stripLog(Block b) {
    b.getWorld().playSound(b.getLocation(), Sound.ITEM_AXE_STRIP, 1, 1);
    Axis axis = ((Orientable) b.getBlockData()).getAxis();
    b.setType(Material.valueOf("STRIPPED_" + b.getType().name()));

    Orientable orientable = (Orientable) b.getBlockData();
    orientable.setAxis(axis);
    b.setBlockData(orientable);
}
 
Example #11
Source File: Draw3d.java    From GiantTrees with GNU General Public License v3.0 5 votes vote down vote up
private UnaryOperator<BlockData> orient(Orientation orientation) {
  return blockData -> {
    if (blockData instanceof Orientable) {
      Orientable orientable = (Orientable) blockData;
      switch (orientation) {
        case xMajor: orientable.setAxis(Axis.X);
        case yMajor: orientable.setAxis(Axis.Z);
        case zMajor: orientable.setAxis(Axis.Y);
      }
    }
    return blockData;
  };
}
 
Example #12
Source File: NMS.java    From 1.13-Command-API with Apache License 2.0 4 votes vote down vote up
/** Argument implementations without CommandSyntaxExceptions */
EnumSet<Axis>      getAxis(CommandContext<?> cmdCtx, String key);